summaryrefslogtreecommitdiff
path: root/devdocs/go
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/go
new repository
Diffstat (limited to 'devdocs/go')
-rw-r--r--devdocs/go/archive%2Ftar%2Findex.html299
-rw-r--r--devdocs/go/archive%2Fzip%2Findex.html290
-rw-r--r--devdocs/go/arena%2Findex.html8
-rw-r--r--devdocs/go/bufio%2Findex.html318
-rw-r--r--devdocs/go/builtin%2Findex.html147
-rw-r--r--devdocs/go/bytes%2Findex.html650
-rw-r--r--devdocs/go/cmp%2Findex.html73
-rw-r--r--devdocs/go/compress%2Fbzip2%2Findex.html17
-rw-r--r--devdocs/go/compress%2Fflate%2Findex.html307
-rw-r--r--devdocs/go/compress%2Fgzip%2Findex.html282
-rw-r--r--devdocs/go/compress%2Flzw%2Findex.html54
-rw-r--r--devdocs/go/compress%2Fzlib%2Findex.html95
-rw-r--r--devdocs/go/container%2Fheap%2Findex.html171
-rw-r--r--devdocs/go/container%2Flist%2Findex.html100
-rw-r--r--devdocs/go/container%2Fring%2Findex.html199
-rw-r--r--devdocs/go/context%2Findex.html381
-rw-r--r--devdocs/go/crypto%2Faes%2Findex.html19
-rw-r--r--devdocs/go/crypto%2Fboring%2Findex.html7
-rw-r--r--devdocs/go/crypto%2Fcipher%2Findex.html463
-rw-r--r--devdocs/go/crypto%2Fdes%2Findex.html38
-rw-r--r--devdocs/go/crypto%2Fdsa%2Findex.html50
-rw-r--r--devdocs/go/crypto%2Fecdh%2Findex.html98
-rw-r--r--devdocs/go/crypto%2Fecdsa%2Findex.html76
-rw-r--r--devdocs/go/crypto%2Fed25519%2Findex.html90
-rw-r--r--devdocs/go/crypto%2Felliptic%2Findex.html117
-rw-r--r--devdocs/go/crypto%2Fhmac%2Findex.html23
-rw-r--r--devdocs/go/crypto%2Findex.html106
-rw-r--r--devdocs/go/crypto%2Fmd5%2Findex.html42
-rw-r--r--devdocs/go/crypto%2Frand%2Findex.html32
-rw-r--r--devdocs/go/crypto%2Frc4%2Findex.html30
-rw-r--r--devdocs/go/crypto%2Frsa%2Findex.html295
-rw-r--r--devdocs/go/crypto%2Fsha1%2Findex.html42
-rw-r--r--devdocs/go/crypto%2Fsha256%2Findex.html45
-rw-r--r--devdocs/go/crypto%2Fsha512%2Findex.html44
-rw-r--r--devdocs/go/crypto%2Fsubtle%2Findex.html24
-rw-r--r--devdocs/go/crypto%2Ftls%2Ffipsonly%2Findex.html9
-rw-r--r--devdocs/go/crypto%2Ftls%2Findex.html1114
-rw-r--r--devdocs/go/crypto%2Fx509%2Findex.html785
-rw-r--r--devdocs/go/crypto%2Fx509%2Fpkix%2Findex.html108
-rw-r--r--devdocs/go/database%2Fsql%2Fdriver%2Findex.html403
-rw-r--r--devdocs/go/database%2Fsql%2Findex.html1151
-rw-r--r--devdocs/go/debug%2Fbuildinfo%2Findex.html19
-rw-r--r--devdocs/go/debug%2Fdwarf%2Findex.html754
-rw-r--r--devdocs/go/debug%2Felf%2Findex.html2116
-rw-r--r--devdocs/go/debug%2Fgosym%2Findex.html133
-rw-r--r--devdocs/go/debug%2Fmacho%2Findex.html542
-rw-r--r--devdocs/go/debug%2Fpe%2Findex.html350
-rw-r--r--devdocs/go/debug%2Fplan9obj%2Findex.html87
-rw-r--r--devdocs/go/embed%2Findex.html102
-rw-r--r--devdocs/go/encoding%2Fascii85%2Findex.html28
-rw-r--r--devdocs/go/encoding%2Fasn1%2Findex.html130
-rw-r--r--devdocs/go/encoding%2Fbase32%2Findex.html96
-rw-r--r--devdocs/go/encoding%2Fbase64%2Findex.html114
-rw-r--r--devdocs/go/encoding%2Fbinary%2Findex.html217
-rw-r--r--devdocs/go/encoding%2Fcsv%2Findex.html239
-rw-r--r--devdocs/go/encoding%2Fgob%2Findex.html374
-rw-r--r--devdocs/go/encoding%2Fhex%2Findex.html106
-rw-r--r--devdocs/go/encoding%2Findex.html33
-rw-r--r--devdocs/go/encoding%2Fjson%2Findex.html640
-rw-r--r--devdocs/go/encoding%2Fpem%2Findex.html78
-rw-r--r--devdocs/go/encoding%2Fxml%2Findex.html596
-rw-r--r--devdocs/go/errors%2Findex.html118
-rw-r--r--devdocs/go/expvar%2Findex.html120
-rw-r--r--devdocs/go/flag%2Findex.html452
-rw-r--r--devdocs/go/fmt%2Findex.html627
-rw-r--r--devdocs/go/go%2Fast%2Findex.html1031
-rw-r--r--devdocs/go/go%2Fbuild%2Fconstraint%2Findex.html88
-rw-r--r--devdocs/go/go%2Fbuild%2Findex.html293
-rw-r--r--devdocs/go/go%2Fconstant%2Findex.html290
-rw-r--r--devdocs/go/go%2Fdoc%2Fcomment%2Findex.html256
-rw-r--r--devdocs/go/go%2Fdoc%2Findex.html237
-rw-r--r--devdocs/go/go%2Fformat%2Findex.html42
-rw-r--r--devdocs/go/go%2Fimporter%2Findex.html22
-rw-r--r--devdocs/go/go%2Fparser%2Findex.html68
-rw-r--r--devdocs/go/go%2Fprinter%2Findex.html100
-rw-r--r--devdocs/go/go%2Fscanner%2Findex.html111
-rw-r--r--devdocs/go/go%2Ftoken%2Findex.html339
-rw-r--r--devdocs/go/go%2Ftypes%2Findex.html1630
-rw-r--r--devdocs/go/go%2Fversion%2Findex.html23
-rw-r--r--devdocs/go/hash%2Fadler32%2Findex.html23
-rw-r--r--devdocs/go/hash%2Fcrc32%2Findex.html62
-rw-r--r--devdocs/go/hash%2Fcrc64%2Findex.html30
-rw-r--r--devdocs/go/hash%2Ffnv%2Findex.html23
-rw-r--r--devdocs/go/hash%2Findex.html82
-rw-r--r--devdocs/go/hash%2Fmaphash%2Findex.html106
-rw-r--r--devdocs/go/html%2Findex.html23
-rw-r--r--devdocs/go/html%2Ftemplate%2Findex.html773
-rw-r--r--devdocs/go/image%2Fcolor%2Findex.html149
-rw-r--r--devdocs/go/image%2Fcolor%2Fpalette%2Findex.html488
-rw-r--r--devdocs/go/image%2Fdraw%2Findex.html85
-rw-r--r--devdocs/go/image%2Fgif%2Findex.html74
-rw-r--r--devdocs/go/image%2Findex.html721
-rw-r--r--devdocs/go/image%2Fjpeg%2Findex.html38
-rw-r--r--devdocs/go/image%2Fpng%2Findex.html104
-rw-r--r--devdocs/go/index1
-rw-r--r--devdocs/go/index%2Fsuffixarray%2Findex.html50
-rw-r--r--devdocs/go/index.html29
-rw-r--r--devdocs/go/internal%2Fgoarch%2Findex.html33
-rw-r--r--devdocs/go/internal%2Fgoos%2Findex.html10
-rw-r--r--devdocs/go/io%2Ffs%2Findex.html256
-rw-r--r--devdocs/go/io%2Findex.html461
-rw-r--r--devdocs/go/io%2Fioutil%2Findex.html147
-rw-r--r--devdocs/go/iter%2Findex.html7
-rw-r--r--devdocs/go/log%2Findex.html141
-rw-r--r--devdocs/go/log%2Fslog%2Findex.html931
-rw-r--r--devdocs/go/log%2Fsyslog%2Findex.html109
-rw-r--r--devdocs/go/maps%2Findex.html126
-rw-r--r--devdocs/go/math%2Fbig%2Findex.html912
-rw-r--r--devdocs/go/math%2Fbits%2Findex.html377
-rw-r--r--devdocs/go/math%2Fcmplx%2Findex.html74
-rw-r--r--devdocs/go/math%2Findex.html597
-rw-r--r--devdocs/go/math%2Frand%2Findex.html240
-rw-r--r--devdocs/go/math%2Frand%2Fv2%2Findex.html278
-rw-r--r--devdocs/go/metadata2
-rw-r--r--devdocs/go/mime%2Findex.html153
-rw-r--r--devdocs/go/mime%2Fmultipart%2Findex.html151
-rw-r--r--devdocs/go/mime%2Fquotedprintable%2Findex.html55
-rw-r--r--devdocs/go/net%2Fhttp%2Fcgi%2Findex.html48
-rw-r--r--devdocs/go/net%2Fhttp%2Fcookiejar%2Findex.html106
-rw-r--r--devdocs/go/net%2Fhttp%2Ffcgi%2Findex.html19
-rw-r--r--devdocs/go/net%2Fhttp%2Fhttptest%2Findex.html200
-rw-r--r--devdocs/go/net%2Fhttp%2Fhttptrace%2Findex.html167
-rw-r--r--devdocs/go/net%2Fhttp%2Fhttputil%2Findex.html341
-rw-r--r--devdocs/go/net%2Fhttp%2Findex.html2003
-rw-r--r--devdocs/go/net%2Fhttp%2Finternal%2Findex.html24
-rw-r--r--devdocs/go/net%2Fhttp%2Fpprof%2Findex.html48
-rw-r--r--devdocs/go/net%2Findex.html1610
-rw-r--r--devdocs/go/net%2Fmail%2Findex.html121
-rw-r--r--devdocs/go/net%2Fnetip%2Findex.html260
-rw-r--r--devdocs/go/net%2Frpc%2Findex.html218
-rw-r--r--devdocs/go/net%2Frpc%2Fjsonrpc%2Findex.html20
-rw-r--r--devdocs/go/net%2Fsmtp%2Findex.html168
-rw-r--r--devdocs/go/net%2Ftextproto%2Findex.html213
-rw-r--r--devdocs/go/net%2Furl%2Findex.html425
-rw-r--r--devdocs/go/os%2Fexec%2Findex.html413
-rw-r--r--devdocs/go/os%2Findex.html787
-rw-r--r--devdocs/go/os%2Fsignal%2Findex.html127
-rw-r--r--devdocs/go/os%2Fuser%2Findex.html79
-rw-r--r--devdocs/go/path%2Ffilepath%2Findex.html305
-rw-r--r--devdocs/go/path%2Findex.html132
-rw-r--r--devdocs/go/plugin%2Findex.html60
-rw-r--r--devdocs/go/reflect%2Findex.html870
-rw-r--r--devdocs/go/regexp%2Findex.html501
-rw-r--r--devdocs/go/regexp%2Fsyntax%2Findex.html284
-rw-r--r--devdocs/go/runtime%2Fasan%2Findex.html6
-rw-r--r--devdocs/go/runtime%2Fcgo%2Findex.html96
-rw-r--r--devdocs/go/runtime%2Fcoverage%2Findex.html20
-rw-r--r--devdocs/go/runtime%2Fdebug%2Findex.html120
-rw-r--r--devdocs/go/runtime%2Findex.html810
-rw-r--r--devdocs/go/runtime%2Fmetrics%2Findex.html618
-rw-r--r--devdocs/go/runtime%2Fpprof%2Findex.html136
-rw-r--r--devdocs/go/runtime%2Frace%2Findex.html11
-rw-r--r--devdocs/go/runtime%2Ftrace%2Findex.html136
-rw-r--r--devdocs/go/slices%2Findex.html277
-rw-r--r--devdocs/go/sort%2Findex.html648
-rw-r--r--devdocs/go/strconv%2Findex.html449
-rw-r--r--devdocs/go/strings%2Findex.html488
-rw-r--r--devdocs/go/sync%2Fatomic%2Findex.html295
-rw-r--r--devdocs/go/sync%2Findex.html290
-rw-r--r--devdocs/go/syscall%2Findex.html2897
-rw-r--r--devdocs/go/syscall%2Fjs%2Findex.html159
-rw-r--r--devdocs/go/testing%2Ffstest%2Findex.html43
-rw-r--r--devdocs/go/testing%2Findex.html661
-rw-r--r--devdocs/go/testing%2Fiotest%2Findex.html39
-rw-r--r--devdocs/go/testing%2Fquick%2Findex.html74
-rw-r--r--devdocs/go/testing%2Fslogtest%2Findex.html42
-rw-r--r--devdocs/go/text%2Fscanner%2Findex.html226
-rw-r--r--devdocs/go/text%2Ftabwriter%2Findex.html134
-rw-r--r--devdocs/go/text%2Ftemplate%2Findex.html640
-rw-r--r--devdocs/go/text%2Ftemplate%2Fparse%2Findex.html385
-rw-r--r--devdocs/go/time%2Findex.html1035
-rw-r--r--devdocs/go/time%2Ftzdata%2Findex.html13
-rw-r--r--devdocs/go/unicode%2Findex.html830
-rw-r--r--devdocs/go/unicode%2Futf16%2Findex.html22
-rw-r--r--devdocs/go/unicode%2Futf8%2Findex.html205
-rw-r--r--devdocs/go/unsafe%2Findex.html120
176 files changed, 50598 insertions, 0 deletions
diff --git a/devdocs/go/archive%2Ftar%2Findex.html b/devdocs/go/archive%2Ftar%2Findex.html
new file mode 100644
index 00000000..2c767046
--- /dev/null
+++ b/devdocs/go/archive%2Ftar%2Findex.html
@@ -0,0 +1,299 @@
+<h1> Package tar </h1> <ul id="short-nav">
+<li><code>import "archive/tar"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package tar implements access to tar archives. </p>
+<p>Tape archives (tar) are a file format for storing a sequence of files that can be read and written in a streaming manner. This package aims to cover most variations of the format, including those produced by GNU and BSD tar tools. </p> <h4 id="example__minimal"> <span class="text">Example (Minimal)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create and add some files to the archive.
+var buf bytes.Buffer
+tw := tar.NewWriter(&amp;buf)
+var files = []struct {
+ Name, Body string
+}{
+ {"readme.txt", "This archive contains some text files."},
+ {"gopher.txt", "Gopher names:\nGeorge\nGeoffrey\nGonzo"},
+ {"todo.txt", "Get animal handling license."},
+}
+for _, file := range files {
+ hdr := &amp;tar.Header{
+ Name: file.Name,
+ Mode: 0600,
+ Size: int64(len(file.Body)),
+ }
+ if err := tw.WriteHeader(hdr); err != nil {
+ log.Fatal(err)
+ }
+ if _, err := tw.Write([]byte(file.Body)); err != nil {
+ log.Fatal(err)
+ }
+}
+if err := tw.Close(); err != nil {
+ log.Fatal(err)
+}
+
+// Open and iterate through the files in the archive.
+tr := tar.NewReader(&amp;buf)
+for {
+ hdr, err := tr.Next()
+ if err == io.EOF {
+ break // End of archive
+ }
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("Contents of %s:\n", hdr.Name)
+ if _, err := io.Copy(os.Stdout, tr); err != nil {
+ log.Fatal(err)
+ }
+ fmt.Println()
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Contents of readme.txt:
+This archive contains some text files.
+Contents of gopher.txt:
+Gopher names:
+George
+Geoffrey
+Gonzo
+Contents of todo.txt:
+Get animal handling license.
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Format">type Format</a></li>
+<li> <a href="#Format.String">func (f Format) String() string</a>
+</li>
+<li><a href="#Header">type Header</a></li>
+<li> <a href="#FileInfoHeader">func FileInfoHeader(fi fs.FileInfo, link string) (*Header, error)</a>
+</li>
+<li> <a href="#Header.FileInfo">func (h *Header) FileInfo() fs.FileInfo</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(r io.Reader) *Reader</a>
+</li>
+<li> <a href="#Reader.Next">func (tr *Reader) Next() (*Header, error)</a>
+</li>
+<li> <a href="#Reader.Read">func (tr *Reader) Read(b []byte) (int, error)</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w io.Writer) *Writer</a>
+</li>
+<li> <a href="#Writer.AddFS">func (tw *Writer) AddFS(fsys fs.FS) error</a>
+</li>
+<li> <a href="#Writer.Close">func (tw *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.Flush">func (tw *Writer) Flush() error</a>
+</li>
+<li> <a href="#Writer.Write">func (tw *Writer) Write(b []byte) (int, error)</a>
+</li>
+<li> <a href="#Writer.WriteHeader">func (tw *Writer) WriteHeader(hdr *Header) error</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example__minimal">Package (Minimal)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>common.go</span> <span>format.go</span> <span>reader.go</span> <span>stat_actime1.go</span> <span>stat_unix.go</span> <span>strconv.go</span> <span>writer.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Type flags for Header.Typeflag. </p>
+<pre data-language="go">const (
+ // Type '0' indicates a regular file.
+ TypeReg = '0'
+
+ // Deprecated: Use TypeReg instead.
+ TypeRegA = '\x00'
+
+ // Type '1' to '6' are header-only flags and may not have a data body.
+ TypeLink = '1' // Hard link
+ TypeSymlink = '2' // Symbolic link
+ TypeChar = '3' // Character device node
+ TypeBlock = '4' // Block device node
+ TypeDir = '5' // Directory
+ TypeFifo = '6' // FIFO node
+
+ // Type '7' is reserved.
+ TypeCont = '7'
+
+ // Type 'x' is used by the PAX format to store key-value records that
+ // are only relevant to the next file.
+ // This package transparently handles these types.
+ TypeXHeader = 'x'
+
+ // Type 'g' is used by the PAX format to store key-value records that
+ // are relevant to all subsequent files.
+ // This package only supports parsing and composing such headers,
+ // but does not currently support persisting the global state across files.
+ TypeXGlobalHeader = 'g'
+
+ // Type 'S' indicates a sparse file in the GNU format.
+ TypeGNUSparse = 'S'
+
+ // Types 'L' and 'K' are used by the GNU format for a meta file
+ // used to store the path or link name for the next file.
+ // This package transparently handles these types.
+ TypeGNULongName = 'L'
+ TypeGNULongLink = 'K'
+)</pre> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var (
+ ErrHeader = errors.New("archive/tar: invalid tar header")
+ ErrWriteTooLong = errors.New("archive/tar: write too long")
+ ErrFieldTooLong = errors.New("archive/tar: header field too long")
+ ErrWriteAfterClose = errors.New("archive/tar: write after close")
+ ErrInsecurePath = errors.New("archive/tar: insecure file path")
+)</pre> <h2 id="Format">type <span>Format</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>Format represents the tar archive format. </p>
+<p>The original tar format was introduced in Unix V7. Since then, there have been multiple competing formats attempting to standardize or extend the V7 format to overcome its limitations. The most common formats are the USTAR, PAX, and GNU formats, each with their own advantages and limitations. </p>
+<p>The following table captures the capabilities of each format: </p>
+<pre data-language="go"> | USTAR | PAX | GNU
+------------------+--------+-----------+----------
+Name | 256B | unlimited | unlimited
+Linkname | 100B | unlimited | unlimited
+Size | uint33 | unlimited | uint89
+Mode | uint21 | uint21 | uint57
+Uid/Gid | uint21 | unlimited | uint57
+Uname/Gname | 32B | unlimited | 32B
+ModTime | uint33 | unlimited | int89
+AccessTime | n/a | unlimited | int89
+ChangeTime | n/a | unlimited | int89
+Devmajor/Devminor | uint21 | uint21 | uint57
+------------------+--------+-----------+----------
+string encoding | ASCII | UTF-8 | binary
+sub-second times | no | yes | no
+sparse files | no | yes | yes
+</pre> <p>The table's upper portion shows the <a href="#Header">Header</a> fields, where each format reports the maximum number of bytes allowed for each string field and the integer type used to store each numeric field (where timestamps are stored as the number of seconds since the Unix epoch). </p>
+<p>The table's lower portion shows specialized features of each format, such as supported string encodings, support for sub-second timestamps, or support for sparse files. </p>
+<p>The Writer currently provides no support for sparse files. </p>
+<pre data-language="go">type Format int</pre> <p>Constants to identify various tar formats. </p>
+<pre data-language="go">const (
+
+ // FormatUnknown indicates that the format is unknown.
+ FormatUnknown Format
+
+ // FormatUSTAR represents the USTAR header format defined in POSIX.1-1988.
+ //
+ // While this format is compatible with most tar readers,
+ // the format has several limitations making it unsuitable for some usages.
+ // Most notably, it cannot support sparse files, files larger than 8GiB,
+ // filenames larger than 256 characters, and non-ASCII filenames.
+ //
+ // Reference:
+ // http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06
+ FormatUSTAR
+
+ // FormatPAX represents the PAX header format defined in POSIX.1-2001.
+ //
+ // PAX extends USTAR by writing a special file with Typeflag TypeXHeader
+ // preceding the original header. This file contains a set of key-value
+ // records, which are used to overcome USTAR's shortcomings, in addition to
+ // providing the ability to have sub-second resolution for timestamps.
+ //
+ // Some newer formats add their own extensions to PAX by defining their
+ // own keys and assigning certain semantic meaning to the associated values.
+ // For example, sparse file support in PAX is implemented using keys
+ // defined by the GNU manual (e.g., "GNU.sparse.map").
+ //
+ // Reference:
+ // http://pubs.opengroup.org/onlinepubs/009695399/utilities/pax.html
+ FormatPAX
+
+ // FormatGNU represents the GNU header format.
+ //
+ // The GNU header format is older than the USTAR and PAX standards and
+ // is not compatible with them. The GNU format supports
+ // arbitrary file sizes, filenames of arbitrary encoding and length,
+ // sparse files, and other features.
+ //
+ // It is recommended that PAX be chosen over GNU unless the target
+ // application can only parse GNU formatted archives.
+ //
+ // Reference:
+ // https://www.gnu.org/software/tar/manual/html_node/Standard.html
+ FormatGNU
+)</pre> <h3 id="Format.String">func (Format) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (f Format) String() string</pre> <h2 id="Header">type <span>Header</span> </h2> <p>A Header represents a single header in a tar archive. Some fields may not be populated. </p>
+<p>For forward compatibility, users that retrieve a Header from Reader.Next, mutate it in some ways, and then pass it back to Writer.WriteHeader should do so by creating a new Header and copying the fields that they are interested in preserving. </p>
+<pre data-language="go">type Header struct {
+ // Typeflag is the type of header entry.
+ // The zero value is automatically promoted to either TypeReg or TypeDir
+ // depending on the presence of a trailing slash in Name.
+ Typeflag byte
+
+ Name string // Name of file entry
+ Linkname string // Target name of link (valid for TypeLink or TypeSymlink)
+
+ Size int64 // Logical file size in bytes
+ Mode int64 // Permission and mode bits
+ Uid int // User ID of owner
+ Gid int // Group ID of owner
+ Uname string // User name of owner
+ Gname string // Group name of owner
+
+ // If the Format is unspecified, then Writer.WriteHeader rounds ModTime
+ // to the nearest second and ignores the AccessTime and ChangeTime fields.
+ //
+ // To use AccessTime or ChangeTime, specify the Format as PAX or GNU.
+ // To use sub-second resolution, specify the Format as PAX.
+ ModTime time.Time // Modification time
+ AccessTime time.Time // Access time (requires either PAX or GNU support)
+ ChangeTime time.Time // Change time (requires either PAX or GNU support)
+
+ Devmajor int64 // Major device number (valid for TypeChar or TypeBlock)
+ Devminor int64 // Minor device number (valid for TypeChar or TypeBlock)
+
+ // Xattrs stores extended attributes as PAX records under the
+ // "SCHILY.xattr." namespace.
+ //
+ // The following are semantically equivalent:
+ // h.Xattrs[key] = value
+ // h.PAXRecords["SCHILY.xattr."+key] = value
+ //
+ // When Writer.WriteHeader is called, the contents of Xattrs will take
+ // precedence over those in PAXRecords.
+ //
+ // Deprecated: Use PAXRecords instead.
+ Xattrs map[string]string // Go 1.3
+
+ // PAXRecords is a map of PAX extended header records.
+ //
+ // User-defined records should have keys of the following form:
+ // VENDOR.keyword
+ // Where VENDOR is some namespace in all uppercase, and keyword may
+ // not contain the '=' character (e.g., "GOLANG.pkg.version").
+ // The key and value should be non-empty UTF-8 strings.
+ //
+ // When Writer.WriteHeader is called, PAX records derived from the
+ // other fields in Header take precedence over PAXRecords.
+ PAXRecords map[string]string // Go 1.10
+
+ // Format specifies the format of the tar header.
+ //
+ // This is set by Reader.Next as a best-effort guess at the format.
+ // Since the Reader liberally reads some non-compliant files,
+ // it is possible for this to be FormatUnknown.
+ //
+ // If the format is unspecified when Writer.WriteHeader is called,
+ // then it uses the first format (in the order of USTAR, PAX, GNU)
+ // capable of encoding this Header (see Format).
+ Format Format // Go 1.10
+}
+</pre> <h3 id="FileInfoHeader">func <span>FileInfoHeader</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func FileInfoHeader(fi fs.FileInfo, link string) (*Header, error)</pre> <p>FileInfoHeader creates a partially-populated <a href="#Header">Header</a> from fi. If fi describes a symlink, FileInfoHeader records link as the link target. If fi describes a directory, a slash is appended to the name. </p>
+<p>Since fs.FileInfo's Name method only returns the base name of the file it describes, it may be necessary to modify Header.Name to provide the full path name of the file. </p>
+<h3 id="Header.FileInfo">func (*Header) <span>FileInfo</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (h *Header) FileInfo() fs.FileInfo</pre> <p>FileInfo returns an fs.FileInfo for the Header. </p>
+<h2 id="Reader">type <span>Reader</span> </h2> <p>Reader provides sequential access to the contents of a tar archive. Reader.Next advances to the next file in the archive (including the first), and then Reader can be treated as an io.Reader to access the file's data. </p>
+<pre data-language="go">type Reader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewReader">func <span>NewReader</span> </h3> <pre data-language="go">func NewReader(r io.Reader) *Reader</pre> <p>NewReader creates a new <a href="#Reader">Reader</a> reading from r. </p>
+<h3 id="Reader.Next">func (*Reader) <span>Next</span> </h3> <pre data-language="go">func (tr *Reader) Next() (*Header, error)</pre> <p>Next advances to the next entry in the tar archive. The Header.Size determines how many bytes can be read for the next file. Any remaining data in the current file is automatically discarded. At the end of the archive, Next returns the error io.EOF. </p>
+<p>If Next encounters a non-local name (as defined by <span>filepath.IsLocal</span>) and the GODEBUG environment variable contains `tarinsecurepath=0`, Next returns the header with an <a href="#ErrInsecurePath">ErrInsecurePath</a> error. A future version of Go may introduce this behavior by default. Programs that want to accept non-local names can ignore the <a href="#ErrInsecurePath">ErrInsecurePath</a> error and use the returned header. </p>
+<h3 id="Reader.Read">func (*Reader) <span>Read</span> </h3> <pre data-language="go">func (tr *Reader) Read(b []byte) (int, error)</pre> <p>Read reads from the current file in the tar archive. It returns (0, io.EOF) when it reaches the end of that file, until [Next] is called to advance to the next file. </p>
+<p>If the current file is sparse, then the regions marked as a hole are read back as NUL-bytes. </p>
+<p>Calling Read on special types like <a href="#TypeLink">TypeLink</a>, <a href="#TypeSymlink">TypeSymlink</a>, <a href="#TypeChar">TypeChar</a>, <a href="#TypeBlock">TypeBlock</a>, <a href="#TypeDir">TypeDir</a>, and <a href="#TypeFifo">TypeFifo</a> returns (0, <span>io.EOF</span>) regardless of what the [Header.Size] claims. </p>
+<h2 id="Writer">type <span>Writer</span> </h2> <p>Writer provides sequential writing of a tar archive. <a href="#Writer.WriteHeader">Writer.WriteHeader</a> begins a new file with the provided <a href="#Header">Header</a>, and then Writer can be treated as an io.Writer to supply that file's data. </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(w io.Writer) *Writer</pre> <p>NewWriter creates a new Writer writing to w. </p>
+<h3 id="Writer.AddFS">func (*Writer) <span>AddFS</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (tw *Writer) AddFS(fsys fs.FS) error</pre> <p>AddFS adds the files from fs.FS to the archive. It walks the directory tree starting at the root of the filesystem adding each file to the tar archive while maintaining the directory structure. </p>
+<h3 id="Writer.Close">func (*Writer) <span>Close</span> </h3> <pre data-language="go">func (tw *Writer) Close() error</pre> <p>Close closes the tar archive by flushing the padding, and writing the footer. If the current file (from a prior call to <a href="#Writer.WriteHeader">Writer.WriteHeader</a>) is not fully written, then this returns an error. </p>
+<h3 id="Writer.Flush">func (*Writer) <span>Flush</span> </h3> <pre data-language="go">func (tw *Writer) Flush() error</pre> <p>Flush finishes writing the current file's block padding. The current file must be fully written before Flush can be called. </p>
+<p>This is unnecessary as the next call to <a href="#Writer.WriteHeader">Writer.WriteHeader</a> or <a href="#Writer.Close">Writer.Close</a> will implicitly flush out the file's padding. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> </h3> <pre data-language="go">func (tw *Writer) Write(b []byte) (int, error)</pre> <p>Write writes to the current file in the tar archive. Write returns the error <a href="#ErrWriteTooLong">ErrWriteTooLong</a> if more than Header.Size bytes are written after <a href="#Writer.WriteHeader">Writer.WriteHeader</a>. </p>
+<p>Calling Write on special types like <a href="#TypeLink">TypeLink</a>, <a href="#TypeSymlink">TypeSymlink</a>, <a href="#TypeChar">TypeChar</a>, <a href="#TypeBlock">TypeBlock</a>, <a href="#TypeDir">TypeDir</a>, and <a href="#TypeFifo">TypeFifo</a> returns (0, <a href="#ErrWriteTooLong">ErrWriteTooLong</a>) regardless of what the [Header.Size] claims. </p>
+<h3 id="Writer.WriteHeader">func (*Writer) <span>WriteHeader</span> </h3> <pre data-language="go">func (tw *Writer) WriteHeader(hdr *Header) error</pre> <p>WriteHeader writes hdr and prepares to accept the file's contents. The Header.Size determines how many bytes can be written for the next file. If the current file is not fully written, then this returns an error. This implicitly flushes any padding necessary before writing the header. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/archive/tar/" class="_attribution-link">http://golang.org/pkg/archive/tar/</a>
+ </p>
+</div>
diff --git a/devdocs/go/archive%2Fzip%2Findex.html b/devdocs/go/archive%2Fzip%2Findex.html
new file mode 100644
index 00000000..18031762
--- /dev/null
+++ b/devdocs/go/archive%2Fzip%2Findex.html
@@ -0,0 +1,290 @@
+<h1> Package zip </h1> <ul id="short-nav">
+<li><code>import "archive/zip"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package zip provides support for reading and writing ZIP archives. </p>
+<p>See the <a href="https://support.pkware.com/pkzip/appnote">ZIP specification</a> for details. </p>
+<p>This package does not support disk spanning. </p>
+<p>A note about ZIP64: </p>
+<p>To be backwards compatible the FileHeader has both 32 and 64 bit Size fields. The 64 bit fields will always contain the correct value and for normal archives both fields will be the same. For files requiring the ZIP64 format the 32 bit fields will be 0xffffffff and the 64 bit fields must be used instead. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#RegisterCompressor">func RegisterCompressor(method uint16, comp Compressor)</a></li>
+<li><a href="#RegisterDecompressor">func RegisterDecompressor(method uint16, dcomp Decompressor)</a></li>
+<li><a href="#Compressor">type Compressor</a></li>
+<li><a href="#Decompressor">type Decompressor</a></li>
+<li><a href="#File">type File</a></li>
+<li> <a href="#File.DataOffset">func (f *File) DataOffset() (offset int64, err error)</a>
+</li>
+<li> <a href="#File.Open">func (f *File) Open() (io.ReadCloser, error)</a>
+</li>
+<li> <a href="#File.OpenRaw">func (f *File) OpenRaw() (io.Reader, error)</a>
+</li>
+<li><a href="#FileHeader">type FileHeader</a></li>
+<li> <a href="#FileInfoHeader">func FileInfoHeader(fi fs.FileInfo) (*FileHeader, error)</a>
+</li>
+<li> <a href="#FileHeader.FileInfo">func (h *FileHeader) FileInfo() fs.FileInfo</a>
+</li>
+<li> <a href="#FileHeader.ModTime">func (h *FileHeader) ModTime() time.Time</a>
+</li>
+<li> <a href="#FileHeader.Mode">func (h *FileHeader) Mode() (mode fs.FileMode)</a>
+</li>
+<li> <a href="#FileHeader.SetModTime">func (h *FileHeader) SetModTime(t time.Time)</a>
+</li>
+<li> <a href="#FileHeader.SetMode">func (h *FileHeader) SetMode(mode fs.FileMode)</a>
+</li>
+<li><a href="#ReadCloser">type ReadCloser</a></li>
+<li> <a href="#OpenReader">func OpenReader(name string) (*ReadCloser, error)</a>
+</li>
+<li> <a href="#ReadCloser.Close">func (rc *ReadCloser) Close() error</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(r io.ReaderAt, size int64) (*Reader, error)</a>
+</li>
+<li> <a href="#Reader.Open">func (r *Reader) Open(name string) (fs.File, error)</a>
+</li>
+<li> <a href="#Reader.RegisterDecompressor">func (r *Reader) RegisterDecompressor(method uint16, dcomp Decompressor)</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w io.Writer) *Writer</a>
+</li>
+<li> <a href="#Writer.AddFS">func (w *Writer) AddFS(fsys fs.FS) error</a>
+</li>
+<li> <a href="#Writer.Close">func (w *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.Copy">func (w *Writer) Copy(f *File) error</a>
+</li>
+<li> <a href="#Writer.Create">func (w *Writer) Create(name string) (io.Writer, error)</a>
+</li>
+<li> <a href="#Writer.CreateHeader">func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error)</a>
+</li>
+<li> <a href="#Writer.CreateRaw">func (w *Writer) CreateRaw(fh *FileHeader) (io.Writer, error)</a>
+</li>
+<li> <a href="#Writer.Flush">func (w *Writer) Flush() error</a>
+</li>
+<li> <a href="#Writer.RegisterCompressor">func (w *Writer) RegisterCompressor(method uint16, comp Compressor)</a>
+</li>
+<li> <a href="#Writer.SetComment">func (w *Writer) SetComment(comment string) error</a>
+</li>
+<li> <a href="#Writer.SetOffset">func (w *Writer) SetOffset(n int64)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Reader">Reader</a></dd> <dd><a class="exampleLink" href="#example_Writer">Writer</a></dd> <dd><a class="exampleLink" href="#example_Writer_RegisterCompressor">Writer.RegisterCompressor</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>reader.go</span> <span>register.go</span> <span>struct.go</span> <span>writer.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Compression methods. </p>
+<pre data-language="go">const (
+ Store uint16 = 0 // no compression
+ Deflate uint16 = 8 // DEFLATE compressed
+)</pre> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var (
+ ErrFormat = errors.New("zip: not a valid zip file")
+ ErrAlgorithm = errors.New("zip: unsupported compression algorithm")
+ ErrChecksum = errors.New("zip: checksum error")
+ ErrInsecurePath = errors.New("zip: insecure file path")
+)</pre> <h2 id="RegisterCompressor">func <span>RegisterCompressor</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func RegisterCompressor(method uint16, comp Compressor)</pre> <p>RegisterCompressor registers custom compressors for a specified method ID. The common methods <a href="#Store">Store</a> and <a href="#Deflate">Deflate</a> are built in. </p>
+<h2 id="RegisterDecompressor">func <span>RegisterDecompressor</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func RegisterDecompressor(method uint16, dcomp Decompressor)</pre> <p>RegisterDecompressor allows custom decompressors for a specified method ID. The common methods <a href="#Store">Store</a> and <a href="#Deflate">Deflate</a> are built in. </p>
+<h2 id="Compressor">type <span>Compressor</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>A Compressor returns a new compressing writer, writing to w. The WriteCloser's Close method must be used to flush pending data to w. The Compressor itself must be safe to invoke from multiple goroutines simultaneously, but each returned writer will be used only by one goroutine at a time. </p>
+<pre data-language="go">type Compressor func(w io.Writer) (io.WriteCloser, error)</pre> <h2 id="Decompressor">type <span>Decompressor</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>A Decompressor returns a new decompressing reader, reading from r. The <span>io.ReadCloser</span>'s Close method must be used to release associated resources. The Decompressor itself must be safe to invoke from multiple goroutines simultaneously, but each returned reader will be used only by one goroutine at a time. </p>
+<pre data-language="go">type Decompressor func(r io.Reader) io.ReadCloser</pre> <h2 id="File">type <span>File</span> </h2> <p>A File is a single file in a ZIP archive. The file information is in the embedded <a href="#FileHeader">FileHeader</a>. The file content can be accessed by calling <a href="#File.Open">File.Open</a>. </p>
+<pre data-language="go">type File struct {
+ FileHeader
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="File.DataOffset">func (*File) <span>DataOffset</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (f *File) DataOffset() (offset int64, err error)</pre> <p>DataOffset returns the offset of the file's possibly-compressed data, relative to the beginning of the zip file. </p>
+<p>Most callers should instead use <a href="#File.Open">File.Open</a>, which transparently decompresses data and verifies checksums. </p>
+<h3 id="File.Open">func (*File) <span>Open</span> </h3> <pre data-language="go">func (f *File) Open() (io.ReadCloser, error)</pre> <p>Open returns a <a href="#ReadCloser">ReadCloser</a> that provides access to the <a href="#File">File</a>'s contents. Multiple files may be read concurrently. </p>
+<h3 id="File.OpenRaw">func (*File) <span>OpenRaw</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (f *File) OpenRaw() (io.Reader, error)</pre> <p>OpenRaw returns a <a href="#Reader">Reader</a> that provides access to the <a href="#File">File</a>'s contents without decompression. </p>
+<h2 id="FileHeader">type <span>FileHeader</span> </h2> <p>FileHeader describes a file within a ZIP file. See the <a href="https://support.pkware.com/pkzip/appnote">ZIP specification</a> for details. </p>
+<pre data-language="go">type FileHeader struct {
+ // Name is the name of the file.
+ //
+ // It must be a relative path, not start with a drive letter (such as "C:"),
+ // and must use forward slashes instead of back slashes. A trailing slash
+ // indicates that this file is a directory and should have no data.
+ Name string
+
+ // Comment is any arbitrary user-defined string shorter than 64KiB.
+ Comment string
+
+ // NonUTF8 indicates that Name and Comment are not encoded in UTF-8.
+ //
+ // By specification, the only other encoding permitted should be CP-437,
+ // but historically many ZIP readers interpret Name and Comment as whatever
+ // the system's local character encoding happens to be.
+ //
+ // This flag should only be set if the user intends to encode a non-portable
+ // ZIP file for a specific localized region. Otherwise, the Writer
+ // automatically sets the ZIP format's UTF-8 flag for valid UTF-8 strings.
+ NonUTF8 bool // Go 1.10
+
+ CreatorVersion uint16
+ ReaderVersion uint16
+ Flags uint16
+
+ // Method is the compression method. If zero, Store is used.
+ Method uint16
+
+ // Modified is the modified time of the file.
+ //
+ // When reading, an extended timestamp is preferred over the legacy MS-DOS
+ // date field, and the offset between the times is used as the timezone.
+ // If only the MS-DOS date is present, the timezone is assumed to be UTC.
+ //
+ // When writing, an extended timestamp (which is timezone-agnostic) is
+ // always emitted. The legacy MS-DOS date field is encoded according to the
+ // location of the Modified time.
+ Modified time.Time // Go 1.10
+
+ // ModifiedTime is an MS-DOS-encoded time.
+ //
+ // Deprecated: Use Modified instead.
+ ModifiedTime uint16
+
+ // ModifiedDate is an MS-DOS-encoded date.
+ //
+ // Deprecated: Use Modified instead.
+ ModifiedDate uint16
+
+ // CRC32 is the CRC32 checksum of the file content.
+ CRC32 uint32
+
+ // CompressedSize is the compressed size of the file in bytes.
+ // If either the uncompressed or compressed size of the file
+ // does not fit in 32 bits, CompressedSize is set to ^uint32(0).
+ //
+ // Deprecated: Use CompressedSize64 instead.
+ CompressedSize uint32
+
+ // UncompressedSize is the compressed size of the file in bytes.
+ // If either the uncompressed or compressed size of the file
+ // does not fit in 32 bits, CompressedSize is set to ^uint32(0).
+ //
+ // Deprecated: Use UncompressedSize64 instead.
+ UncompressedSize uint32
+
+ // CompressedSize64 is the compressed size of the file in bytes.
+ CompressedSize64 uint64 // Go 1.1
+
+ // UncompressedSize64 is the uncompressed size of the file in bytes.
+ UncompressedSize64 uint64 // Go 1.1
+
+ Extra []byte
+ ExternalAttrs uint32 // Meaning depends on CreatorVersion
+}
+</pre> <h3 id="FileInfoHeader">func <span>FileInfoHeader</span> </h3> <pre data-language="go">func FileInfoHeader(fi fs.FileInfo) (*FileHeader, error)</pre> <p>FileInfoHeader creates a partially-populated <a href="#FileHeader">FileHeader</a> from an fs.FileInfo. Because fs.FileInfo's Name method returns only the base name of the file it describes, it may be necessary to modify the Name field of the returned header to provide the full path name of the file. If compression is desired, callers should set the FileHeader.Method field; it is unset by default. </p>
+<h3 id="FileHeader.FileInfo">func (*FileHeader) <span>FileInfo</span> </h3> <pre data-language="go">func (h *FileHeader) FileInfo() fs.FileInfo</pre> <p>FileInfo returns an fs.FileInfo for the <a href="#FileHeader">FileHeader</a>. </p>
+<h3 id="FileHeader.ModTime">func (*FileHeader) <span>ModTime</span> </h3> <pre data-language="go">func (h *FileHeader) ModTime() time.Time</pre> <p>ModTime returns the modification time in UTC using the legacy [ModifiedDate] and [ModifiedTime] fields. </p>
+<p>Deprecated: Use [Modified] instead. </p>
+<h3 id="FileHeader.Mode">func (*FileHeader) <span>Mode</span> </h3> <pre data-language="go">func (h *FileHeader) Mode() (mode fs.FileMode)</pre> <p>Mode returns the permission and mode bits for the <a href="#FileHeader">FileHeader</a>. </p>
+<h3 id="FileHeader.SetModTime">func (*FileHeader) <span>SetModTime</span> </h3> <pre data-language="go">func (h *FileHeader) SetModTime(t time.Time)</pre> <p>SetModTime sets the [Modified], [ModifiedTime], and [ModifiedDate] fields to the given time in UTC. </p>
+<p>Deprecated: Use [Modified] instead. </p>
+<h3 id="FileHeader.SetMode">func (*FileHeader) <span>SetMode</span> </h3> <pre data-language="go">func (h *FileHeader) SetMode(mode fs.FileMode)</pre> <p>SetMode changes the permission and mode bits for the <a href="#FileHeader">FileHeader</a>. </p>
+<h2 id="ReadCloser">type <span>ReadCloser</span> </h2> <p>A ReadCloser is a <a href="#Reader">Reader</a> that must be closed when no longer needed. </p>
+<pre data-language="go">type ReadCloser struct {
+ Reader
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="OpenReader">func <span>OpenReader</span> </h3> <pre data-language="go">func OpenReader(name string) (*ReadCloser, error)</pre> <p>OpenReader will open the Zip file specified by name and return a ReadCloser. </p>
+<p>If any file inside the archive uses a non-local name (as defined by <span>filepath.IsLocal</span>) or a name containing backslashes and the GODEBUG environment variable contains `zipinsecurepath=0`, OpenReader returns the reader with an ErrInsecurePath error. A future version of Go may introduce this behavior by default. Programs that want to accept non-local names can ignore the ErrInsecurePath error and use the returned reader. </p>
+<h3 id="ReadCloser.Close">func (*ReadCloser) <span>Close</span> </h3> <pre data-language="go">func (rc *ReadCloser) Close() error</pre> <p>Close closes the Zip file, rendering it unusable for I/O. </p>
+<h2 id="Reader">type <span>Reader</span> </h2> <p>A Reader serves content from a ZIP archive. </p>
+<pre data-language="go">type Reader struct {
+ File []*File
+ Comment string
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Reader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Open a zip archive for reading.
+r, err := zip.OpenReader("testdata/readme.zip")
+if err != nil {
+ log.Fatal(err)
+}
+defer r.Close()
+
+// Iterate through the files in the archive,
+// printing some of their contents.
+for _, f := range r.File {
+ fmt.Printf("Contents of %s:\n", f.Name)
+ rc, err := f.Open()
+ if err != nil {
+ log.Fatal(err)
+ }
+ _, err = io.CopyN(os.Stdout, rc, 68)
+ if err != nil {
+ log.Fatal(err)
+ }
+ rc.Close()
+ fmt.Println()
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">Contents of README:
+This is the source code repository for the Go programming language.
+</pre> <h3 id="NewReader">func <span>NewReader</span> </h3> <pre data-language="go">func NewReader(r io.ReaderAt, size int64) (*Reader, error)</pre> <p>NewReader returns a new <a href="#Reader">Reader</a> reading from r, which is assumed to have the given size in bytes. </p>
+<p>If any file inside the archive uses a non-local name (as defined by <span>filepath.IsLocal</span>) or a name containing backslashes and the GODEBUG environment variable contains `zipinsecurepath=0`, NewReader returns the reader with an <a href="#ErrInsecurePath">ErrInsecurePath</a> error. A future version of Go may introduce this behavior by default. Programs that want to accept non-local names can ignore the <a href="#ErrInsecurePath">ErrInsecurePath</a> error and use the returned reader. </p>
+<h3 id="Reader.Open">func (*Reader) <span>Open</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (r *Reader) Open(name string) (fs.File, error)</pre> <p>Open opens the named file in the ZIP archive, using the semantics of fs.FS.Open: paths are always slash separated, with no leading / or ../ elements. </p>
+<h3 id="Reader.RegisterDecompressor">func (*Reader) <span>RegisterDecompressor</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (r *Reader) RegisterDecompressor(method uint16, dcomp Decompressor)</pre> <p>RegisterDecompressor registers or overrides a custom decompressor for a specific method ID. If a decompressor for a given method is not found, <a href="#Reader">Reader</a> will default to looking up the decompressor at the package level. </p>
+<h2 id="Writer">type <span>Writer</span> </h2> <p>Writer implements a zip file writer. </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Writer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Create a buffer to write our archive to.
+buf := new(bytes.Buffer)
+
+// Create a new zip archive.
+w := zip.NewWriter(buf)
+
+// Add some files to the archive.
+var files = []struct {
+ Name, Body string
+}{
+ {"readme.txt", "This archive contains some text files."},
+ {"gopher.txt", "Gopher names:\nGeorge\nGeoffrey\nGonzo"},
+ {"todo.txt", "Get animal handling licence.\nWrite more examples."},
+}
+for _, file := range files {
+ f, err := w.Create(file.Name)
+ if err != nil {
+ log.Fatal(err)
+ }
+ _, err = f.Write([]byte(file.Body))
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+
+// Make sure to check the error on Close.
+err := w.Close()
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(w io.Writer) *Writer</pre> <p>NewWriter returns a new <a href="#Writer">Writer</a> writing a zip file to w. </p>
+<h3 id="Writer.AddFS">func (*Writer) <span>AddFS</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (w *Writer) AddFS(fsys fs.FS) error</pre> <p>AddFS adds the files from fs.FS to the archive. It walks the directory tree starting at the root of the filesystem adding each file to the zip using deflate while maintaining the directory structure. </p>
+<h3 id="Writer.Close">func (*Writer) <span>Close</span> </h3> <pre data-language="go">func (w *Writer) Close() error</pre> <p>Close finishes writing the zip file by writing the central directory. It does not close the underlying writer. </p>
+<h3 id="Writer.Copy">func (*Writer) <span>Copy</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (w *Writer) Copy(f *File) error</pre> <p>Copy copies the file f (obtained from a <a href="#Reader">Reader</a>) into w. It copies the raw form directly bypassing decompression, compression, and validation. </p>
+<h3 id="Writer.Create">func (*Writer) <span>Create</span> </h3> <pre data-language="go">func (w *Writer) Create(name string) (io.Writer, error)</pre> <p>Create adds a file to the zip file using the provided name. It returns a <a href="#Writer">Writer</a> to which the file contents should be written. The file contents will be compressed using the <a href="#Deflate">Deflate</a> method. The name must be a relative path: it must not start with a drive letter (e.g. C:) or leading slash, and only forward slashes are allowed. To create a directory instead of a file, add a trailing slash to the name. The file's contents must be written to the <span>io.Writer</span> before the next call to <a href="#Writer.Create">Writer.Create</a>, <a href="#Writer.CreateHeader">Writer.CreateHeader</a>, or <a href="#Writer.Close">Writer.Close</a>. </p>
+<h3 id="Writer.CreateHeader">func (*Writer) <span>CreateHeader</span> </h3> <pre data-language="go">func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error)</pre> <p>CreateHeader adds a file to the zip archive using the provided <a href="#FileHeader">FileHeader</a> for the file metadata. <a href="#Writer">Writer</a> takes ownership of fh and may mutate its fields. The caller must not modify fh after calling <a href="#Writer.CreateHeader">Writer.CreateHeader</a>. </p>
+<p>This returns a <a href="#Writer">Writer</a> to which the file contents should be written. The file's contents must be written to the io.Writer before the next call to <a href="#Writer.Create">Writer.Create</a>, <a href="#Writer.CreateHeader">Writer.CreateHeader</a>, <a href="#Writer.CreateRaw">Writer.CreateRaw</a>, or <a href="#Writer.Close">Writer.Close</a>. </p>
+<h3 id="Writer.CreateRaw">func (*Writer) <span>CreateRaw</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (w *Writer) CreateRaw(fh *FileHeader) (io.Writer, error)</pre> <p>CreateRaw adds a file to the zip archive using the provided <a href="#FileHeader">FileHeader</a> and returns a <a href="#Writer">Writer</a> to which the file contents should be written. The file's contents must be written to the io.Writer before the next call to <a href="#Writer.Create">Writer.Create</a>, <a href="#Writer.CreateHeader">Writer.CreateHeader</a>, <a href="#Writer.CreateRaw">Writer.CreateRaw</a>, or <a href="#Writer.Close">Writer.Close</a>. </p>
+<p>In contrast to <a href="#Writer.CreateHeader">Writer.CreateHeader</a>, the bytes passed to Writer are not compressed. </p>
+<h3 id="Writer.Flush">func (*Writer) <span>Flush</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (w *Writer) Flush() error</pre> <p>Flush flushes any buffered data to the underlying writer. Calling Flush is not normally necessary; calling Close is sufficient. </p>
+<h3 id="Writer.RegisterCompressor">func (*Writer) <span>RegisterCompressor</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (w *Writer) RegisterCompressor(method uint16, comp Compressor)</pre> <p>RegisterCompressor registers or overrides a custom compressor for a specific method ID. If a compressor for a given method is not found, <a href="#Writer">Writer</a> will default to looking up the compressor at the package level. </p> <h4 id="example_Writer_RegisterCompressor"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Override the default Deflate compressor with a higher compression level.
+
+// Create a buffer to write our archive to.
+buf := new(bytes.Buffer)
+
+// Create a new zip archive.
+w := zip.NewWriter(buf)
+
+// Register a custom Deflate compressor.
+w.RegisterCompressor(zip.Deflate, func(out io.Writer) (io.WriteCloser, error) {
+ return flate.NewWriter(out, flate.BestCompression)
+})
+
+// Proceed to add files to w.
+</pre> <h3 id="Writer.SetComment">func (*Writer) <span>SetComment</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (w *Writer) SetComment(comment string) error</pre> <p>SetComment sets the end-of-central-directory comment field. It can only be called before <a href="#Writer.Close">Writer.Close</a>. </p>
+<h3 id="Writer.SetOffset">func (*Writer) <span>SetOffset</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (w *Writer) SetOffset(n int64)</pre> <p>SetOffset sets the offset of the beginning of the zip data within the underlying writer. It should be used when the zip data is appended to an existing file, such as a binary executable. It must be called before any data is written. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/archive/zip/" class="_attribution-link">http://golang.org/pkg/archive/zip/</a>
+ </p>
+</div>
diff --git a/devdocs/go/arena%2Findex.html b/devdocs/go/arena%2Findex.html
new file mode 100644
index 00000000..a1487901
--- /dev/null
+++ b/devdocs/go/arena%2Findex.html
@@ -0,0 +1,8 @@
+<h1> Command arena </h1> <p>The arena package provides the ability to allocate memory for a collection of Go values and free that space manually all at once, safely. The purpose of this functionality is to improve efficiency: manually freeing memory before a garbage collection delays that cycle. Less frequent cycles means the CPU cost of the garbage collector is incurred less frequently. </p>
+<p>This functionality in this package is mostly captured in the Arena type. Arenas allocate large chunks of memory for Go values, so they're likely to be inefficient for allocating only small amounts of small Go values. They're best used in bulk, on the order of MiB of memory allocated on each use. </p>
+<p>Note that by allowing for this limited form of manual memory allocation that use-after-free bugs are possible with regular Go values. This package limits the impact of these use-after-free bugs by preventing reuse of freed memory regions until the garbage collector is able to determine that it is safe. Typically, a use-after-free bug will result in a fault and a helpful error message, but this package reserves the right to not force a fault on freed memory. That means a valid implementation of this package is to just allocate all memory the way the runtime normally would, and in fact, it reserves the right to occasionally do so for some Go values. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/arena/" class="_attribution-link">http://golang.org/pkg/arena/</a>
+ </p>
+</div>
diff --git a/devdocs/go/bufio%2Findex.html b/devdocs/go/bufio%2Findex.html
new file mode 100644
index 00000000..415058a9
--- /dev/null
+++ b/devdocs/go/bufio%2Findex.html
@@ -0,0 +1,318 @@
+<h1> Package bufio </h1> <ul id="short-nav">
+<li><code>import "bufio"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#ScanBytes">func ScanBytes(data []byte, atEOF bool) (advance int, token []byte, err error)</a></li>
+<li><a href="#ScanLines">func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error)</a></li>
+<li><a href="#ScanRunes">func ScanRunes(data []byte, atEOF bool) (advance int, token []byte, err error)</a></li>
+<li><a href="#ScanWords">func ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error)</a></li>
+<li><a href="#ReadWriter">type ReadWriter</a></li>
+<li> <a href="#NewReadWriter">func NewReadWriter(r *Reader, w *Writer) *ReadWriter</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(rd io.Reader) *Reader</a>
+</li>
+<li> <a href="#NewReaderSize">func NewReaderSize(rd io.Reader, size int) *Reader</a>
+</li>
+<li> <a href="#Reader.Buffered">func (b *Reader) Buffered() int</a>
+</li>
+<li> <a href="#Reader.Discard">func (b *Reader) Discard(n int) (discarded int, err error)</a>
+</li>
+<li> <a href="#Reader.Peek">func (b *Reader) Peek(n int) ([]byte, error)</a>
+</li>
+<li> <a href="#Reader.Read">func (b *Reader) Read(p []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Reader.ReadByte">func (b *Reader) ReadByte() (byte, error)</a>
+</li>
+<li> <a href="#Reader.ReadBytes">func (b *Reader) ReadBytes(delim byte) ([]byte, error)</a>
+</li>
+<li> <a href="#Reader.ReadLine">func (b *Reader) ReadLine() (line []byte, isPrefix bool, err error)</a>
+</li>
+<li> <a href="#Reader.ReadRune">func (b *Reader) ReadRune() (r rune, size int, err error)</a>
+</li>
+<li> <a href="#Reader.ReadSlice">func (b *Reader) ReadSlice(delim byte) (line []byte, err error)</a>
+</li>
+<li> <a href="#Reader.ReadString">func (b *Reader) ReadString(delim byte) (string, error)</a>
+</li>
+<li> <a href="#Reader.Reset">func (b *Reader) Reset(r io.Reader)</a>
+</li>
+<li> <a href="#Reader.Size">func (b *Reader) Size() int</a>
+</li>
+<li> <a href="#Reader.UnreadByte">func (b *Reader) UnreadByte() error</a>
+</li>
+<li> <a href="#Reader.UnreadRune">func (b *Reader) UnreadRune() error</a>
+</li>
+<li> <a href="#Reader.WriteTo">func (b *Reader) WriteTo(w io.Writer) (n int64, err error)</a>
+</li>
+<li><a href="#Scanner">type Scanner</a></li>
+<li> <a href="#NewScanner">func NewScanner(r io.Reader) *Scanner</a>
+</li>
+<li> <a href="#Scanner.Buffer">func (s *Scanner) Buffer(buf []byte, max int)</a>
+</li>
+<li> <a href="#Scanner.Bytes">func (s *Scanner) Bytes() []byte</a>
+</li>
+<li> <a href="#Scanner.Err">func (s *Scanner) Err() error</a>
+</li>
+<li> <a href="#Scanner.Scan">func (s *Scanner) Scan() bool</a>
+</li>
+<li> <a href="#Scanner.Split">func (s *Scanner) Split(split SplitFunc)</a>
+</li>
+<li> <a href="#Scanner.Text">func (s *Scanner) Text() string</a>
+</li>
+<li><a href="#SplitFunc">type SplitFunc</a></li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w io.Writer) *Writer</a>
+</li>
+<li> <a href="#NewWriterSize">func NewWriterSize(w io.Writer, size int) *Writer</a>
+</li>
+<li> <a href="#Writer.Available">func (b *Writer) Available() int</a>
+</li>
+<li> <a href="#Writer.AvailableBuffer">func (b *Writer) AvailableBuffer() []byte</a>
+</li>
+<li> <a href="#Writer.Buffered">func (b *Writer) Buffered() int</a>
+</li>
+<li> <a href="#Writer.Flush">func (b *Writer) Flush() error</a>
+</li>
+<li> <a href="#Writer.ReadFrom">func (b *Writer) ReadFrom(r io.Reader) (n int64, err error)</a>
+</li>
+<li> <a href="#Writer.Reset">func (b *Writer) Reset(w io.Writer)</a>
+</li>
+<li> <a href="#Writer.Size">func (b *Writer) Size() int</a>
+</li>
+<li> <a href="#Writer.Write">func (b *Writer) Write(p []byte) (nn int, err error)</a>
+</li>
+<li> <a href="#Writer.WriteByte">func (b *Writer) WriteByte(c byte) error</a>
+</li>
+<li> <a href="#Writer.WriteRune">func (b *Writer) WriteRune(r rune) (size int, err error)</a>
+</li>
+<li> <a href="#Writer.WriteString">func (b *Writer) WriteString(s string) (int, error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Scanner_Bytes">Scanner.Bytes</a></dd> <dd><a class="exampleLink" href="#example_Scanner_custom">Scanner (Custom)</a></dd> <dd><a class="exampleLink" href="#example_Scanner_earlyStop">Scanner (EarlyStop)</a></dd> <dd><a class="exampleLink" href="#example_Scanner_emptyFinalToken">Scanner (EmptyFinalToken)</a></dd> <dd><a class="exampleLink" href="#example_Scanner_lines">Scanner (Lines)</a></dd> <dd><a class="exampleLink" href="#example_Scanner_words">Scanner (Words)</a></dd> <dd><a class="exampleLink" href="#example_Writer">Writer</a></dd> <dd><a class="exampleLink" href="#example_Writer_AvailableBuffer">Writer.AvailableBuffer</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>bufio.go</span> <span>scan.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ // MaxScanTokenSize is the maximum size used to buffer a token
+ // unless the user provides an explicit buffer with [Scanner.Buffer].
+ // The actual maximum token size may be smaller as the buffer
+ // may need to include, for instance, a newline.
+ MaxScanTokenSize = 64 * 1024
+)</pre> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var (
+ ErrInvalidUnreadByte = errors.New("bufio: invalid use of UnreadByte")
+ ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune")
+ ErrBufferFull = errors.New("bufio: buffer full")
+ ErrNegativeCount = errors.New("bufio: negative count")
+)</pre> <p>Errors returned by Scanner. </p>
+<pre data-language="go">var (
+ ErrTooLong = errors.New("bufio.Scanner: token too long")
+ ErrNegativeAdvance = errors.New("bufio.Scanner: SplitFunc returns negative advance count")
+ ErrAdvanceTooFar = errors.New("bufio.Scanner: SplitFunc returns advance count beyond input")
+ ErrBadReadCount = errors.New("bufio.Scanner: Read returned impossible count")
+)</pre> <p>ErrFinalToken is a special sentinel error value. It is intended to be returned by a Split function to indicate that the scanning should stop with no error. If the token being delivered with this error is not nil, the token is the last token. </p>
+<p>The value is useful to stop processing early or when it is necessary to deliver a final empty token (which is different from a nil token). One could achieve the same behavior with a custom error value but providing one here is tidier. See the emptyFinalToken example for a use of this value. </p>
+<pre data-language="go">var ErrFinalToken = errors.New("final token")</pre> <h2 id="ScanBytes">func <span>ScanBytes</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func ScanBytes(data []byte, atEOF bool) (advance int, token []byte, err error)</pre> <p>ScanBytes is a split function for a <a href="#Scanner">Scanner</a> that returns each byte as a token. </p>
+<h2 id="ScanLines">func <span>ScanLines</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error)</pre> <p>ScanLines is a split function for a <a href="#Scanner">Scanner</a> that returns each line of text, stripped of any trailing end-of-line marker. The returned line may be empty. The end-of-line marker is one optional carriage return followed by one mandatory newline. In regular expression notation, it is `\r?\n`. The last non-empty line of input will be returned even if it has no newline. </p>
+<h2 id="ScanRunes">func <span>ScanRunes</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func ScanRunes(data []byte, atEOF bool) (advance int, token []byte, err error)</pre> <p>ScanRunes is a split function for a <a href="#Scanner">Scanner</a> that returns each UTF-8-encoded rune as a token. The sequence of runes returned is equivalent to that from a range loop over the input as a string, which means that erroneous UTF-8 encodings translate to U+FFFD = "\xef\xbf\xbd". Because of the Scan interface, this makes it impossible for the client to distinguish correctly encoded replacement runes from encoding errors. </p>
+<h2 id="ScanWords">func <span>ScanWords</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error)</pre> <p>ScanWords is a split function for a <a href="#Scanner">Scanner</a> that returns each space-separated word of text, with surrounding spaces deleted. It will never return an empty string. The definition of space is set by unicode.IsSpace. </p>
+<h2 id="ReadWriter">type <span>ReadWriter</span> </h2> <p>ReadWriter stores pointers to a <a href="#Reader">Reader</a> and a <a href="#Writer">Writer</a>. It implements <span>io.ReadWriter</span>. </p>
+<pre data-language="go">type ReadWriter struct {
+ *Reader
+ *Writer
+}
+</pre> <h3 id="NewReadWriter">func <span>NewReadWriter</span> </h3> <pre data-language="go">func NewReadWriter(r *Reader, w *Writer) *ReadWriter</pre> <p>NewReadWriter allocates a new <a href="#ReadWriter">ReadWriter</a> that dispatches to r and w. </p>
+<h2 id="Reader">type <span>Reader</span> </h2> <p>Reader implements buffering for an io.Reader object. </p>
+<pre data-language="go">type Reader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewReader">func <span>NewReader</span> </h3> <pre data-language="go">func NewReader(rd io.Reader) *Reader</pre> <p>NewReader returns a new <a href="#Reader">Reader</a> whose buffer has the default size. </p>
+<h3 id="NewReaderSize">func <span>NewReaderSize</span> </h3> <pre data-language="go">func NewReaderSize(rd io.Reader, size int) *Reader</pre> <p>NewReaderSize returns a new <a href="#Reader">Reader</a> whose buffer has at least the specified size. If the argument io.Reader is already a <a href="#Reader">Reader</a> with large enough size, it returns the underlying <a href="#Reader">Reader</a>. </p>
+<h3 id="Reader.Buffered">func (*Reader) <span>Buffered</span> </h3> <pre data-language="go">func (b *Reader) Buffered() int</pre> <p>Buffered returns the number of bytes that can be read from the current buffer. </p>
+<h3 id="Reader.Discard">func (*Reader) <span>Discard</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (b *Reader) Discard(n int) (discarded int, err error)</pre> <p>Discard skips the next n bytes, returning the number of bytes discarded. </p>
+<p>If Discard skips fewer than n bytes, it also returns an error. If 0 &lt;= n &lt;= b.Buffered(), Discard is guaranteed to succeed without reading from the underlying io.Reader. </p>
+<h3 id="Reader.Peek">func (*Reader) <span>Peek</span> </h3> <pre data-language="go">func (b *Reader) Peek(n int) ([]byte, error)</pre> <p>Peek returns the next n bytes without advancing the reader. The bytes stop being valid at the next read call. If Peek returns fewer than n bytes, it also returns an error explaining why the read is short. The error is <a href="#ErrBufferFull">ErrBufferFull</a> if n is larger than b's buffer size. </p>
+<p>Calling Peek prevents a <a href="#Reader.UnreadByte">Reader.UnreadByte</a> or <a href="#Reader.UnreadRune">Reader.UnreadRune</a> call from succeeding until the next read operation. </p>
+<h3 id="Reader.Read">func (*Reader) <span>Read</span> </h3> <pre data-language="go">func (b *Reader) Read(p []byte) (n int, err error)</pre> <p>Read reads data into p. It returns the number of bytes read into p. The bytes are taken from at most one Read on the underlying <a href="#Reader">Reader</a>, hence n may be less than len(p). To read exactly len(p) bytes, use io.ReadFull(b, p). If the underlying <a href="#Reader">Reader</a> can return a non-zero count with io.EOF, then this Read method can do so as well; see the <span>io.Reader</span> docs. </p>
+<h3 id="Reader.ReadByte">func (*Reader) <span>ReadByte</span> </h3> <pre data-language="go">func (b *Reader) ReadByte() (byte, error)</pre> <p>ReadByte reads and returns a single byte. If no byte is available, returns an error. </p>
+<h3 id="Reader.ReadBytes">func (*Reader) <span>ReadBytes</span> </h3> <pre data-language="go">func (b *Reader) ReadBytes(delim byte) ([]byte, error)</pre> <p>ReadBytes reads until the first occurrence of delim in the input, returning a slice containing the data up to and including the delimiter. If ReadBytes encounters an error before finding a delimiter, it returns the data read before the error and the error itself (often io.EOF). ReadBytes returns err != nil if and only if the returned data does not end in delim. For simple uses, a Scanner may be more convenient. </p>
+<h3 id="Reader.ReadLine">func (*Reader) <span>ReadLine</span> </h3> <pre data-language="go">func (b *Reader) ReadLine() (line []byte, isPrefix bool, err error)</pre> <p>ReadLine is a low-level line-reading primitive. Most callers should use <a href="#Reader.ReadBytes">Reader.ReadBytes</a>('\n') or <a href="#Reader.ReadString">Reader.ReadString</a>('\n') instead or use a <a href="#Scanner">Scanner</a>. </p>
+<p>ReadLine tries to return a single line, not including the end-of-line bytes. If the line was too long for the buffer then isPrefix is set and the beginning of the line is returned. The rest of the line will be returned from future calls. isPrefix will be false when returning the last fragment of the line. The returned buffer is only valid until the next call to ReadLine. ReadLine either returns a non-nil line or it returns an error, never both. </p>
+<p>The text returned from ReadLine does not include the line end ("\r\n" or "\n"). No indication or error is given if the input ends without a final line end. Calling <a href="#Reader.UnreadByte">Reader.UnreadByte</a> after ReadLine will always unread the last byte read (possibly a character belonging to the line end) even if that byte is not part of the line returned by ReadLine. </p>
+<h3 id="Reader.ReadRune">func (*Reader) <span>ReadRune</span> </h3> <pre data-language="go">func (b *Reader) ReadRune() (r rune, size int, err error)</pre> <p>ReadRune reads a single UTF-8 encoded Unicode character and returns the rune and its size in bytes. If the encoded rune is invalid, it consumes one byte and returns unicode.ReplacementChar (U+FFFD) with a size of 1. </p>
+<h3 id="Reader.ReadSlice">func (*Reader) <span>ReadSlice</span> </h3> <pre data-language="go">func (b *Reader) ReadSlice(delim byte) (line []byte, err error)</pre> <p>ReadSlice reads until the first occurrence of delim in the input, returning a slice pointing at the bytes in the buffer. The bytes stop being valid at the next read. If ReadSlice encounters an error before finding a delimiter, it returns all the data in the buffer and the error itself (often io.EOF). ReadSlice fails with error <a href="#ErrBufferFull">ErrBufferFull</a> if the buffer fills without a delim. Because the data returned from ReadSlice will be overwritten by the next I/O operation, most clients should use <a href="#Reader.ReadBytes">Reader.ReadBytes</a> or ReadString instead. ReadSlice returns err != nil if and only if line does not end in delim. </p>
+<h3 id="Reader.ReadString">func (*Reader) <span>ReadString</span> </h3> <pre data-language="go">func (b *Reader) ReadString(delim byte) (string, error)</pre> <p>ReadString reads until the first occurrence of delim in the input, returning a string containing the data up to and including the delimiter. If ReadString encounters an error before finding a delimiter, it returns the data read before the error and the error itself (often io.EOF). ReadString returns err != nil if and only if the returned data does not end in delim. For simple uses, a Scanner may be more convenient. </p>
+<h3 id="Reader.Reset">func (*Reader) <span>Reset</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (b *Reader) Reset(r io.Reader)</pre> <p>Reset discards any buffered data, resets all state, and switches the buffered reader to read from r. Calling Reset on the zero value of <a href="#Reader">Reader</a> initializes the internal buffer to the default size. Calling b.Reset(b) (that is, resetting a <a href="#Reader">Reader</a> to itself) does nothing. </p>
+<h3 id="Reader.Size">func (*Reader) <span>Size</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Reader) Size() int</pre> <p>Size returns the size of the underlying buffer in bytes. </p>
+<h3 id="Reader.UnreadByte">func (*Reader) <span>UnreadByte</span> </h3> <pre data-language="go">func (b *Reader) UnreadByte() error</pre> <p>UnreadByte unreads the last byte. Only the most recently read byte can be unread. </p>
+<p>UnreadByte returns an error if the most recent method called on the <a href="#Reader">Reader</a> was not a read operation. Notably, <a href="#Reader.Peek">Reader.Peek</a>, <a href="#Reader.Discard">Reader.Discard</a>, and <a href="#Reader.WriteTo">Reader.WriteTo</a> are not considered read operations. </p>
+<h3 id="Reader.UnreadRune">func (*Reader) <span>UnreadRune</span> </h3> <pre data-language="go">func (b *Reader) UnreadRune() error</pre> <p>UnreadRune unreads the last rune. If the most recent method called on the <a href="#Reader">Reader</a> was not a <a href="#Reader.ReadRune">Reader.ReadRune</a>, <a href="#Reader.UnreadRune">Reader.UnreadRune</a> returns an error. (In this regard it is stricter than <a href="#Reader.UnreadByte">Reader.UnreadByte</a>, which will unread the last byte from any read operation.) </p>
+<h3 id="Reader.WriteTo">func (*Reader) <span>WriteTo</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (b *Reader) WriteTo(w io.Writer) (n int64, err error)</pre> <p>WriteTo implements io.WriterTo. This may make multiple calls to the <a href="#Reader.Read">Reader.Read</a> method of the underlying <a href="#Reader">Reader</a>. If the underlying reader supports the <a href="#Reader.WriteTo">Reader.WriteTo</a> method, this calls the underlying <a href="#Reader.WriteTo">Reader.WriteTo</a> without buffering. </p>
+<h2 id="Scanner">type <span>Scanner</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>Scanner provides a convenient interface for reading data such as a file of newline-delimited lines of text. Successive calls to the <a href="#Scanner.Scan">Scanner.Scan</a> method will step through the 'tokens' of a file, skipping the bytes between the tokens. The specification of a token is defined by a split function of type <a href="#SplitFunc">SplitFunc</a>; the default split function breaks the input into lines with line termination stripped. <a href="#Scanner.Split">Scanner.Split</a> functions are defined in this package for scanning a file into lines, bytes, UTF-8-encoded runes, and space-delimited words. The client may instead provide a custom split function. </p>
+<p>Scanning stops unrecoverably at EOF, the first I/O error, or a token too large to fit in the <a href="#Scanner.Buffer">Scanner.Buffer</a>. When a scan stops, the reader may have advanced arbitrarily far past the last token. Programs that need more control over error handling or large tokens, or must run sequential scans on a reader, should use <a href="#Reader">bufio.Reader</a> instead. </p>
+<pre data-language="go">type Scanner struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Scanner_custom"> <span class="text">Example (Custom)</span>
+</h4> <p>Use a Scanner with a custom split function (built by wrapping ScanWords) to validate 32-bit decimal input. </p> <p>Code:</p> <pre class="code" data-language="go">// An artificial input source.
+const input = "1234 5678 1234567901234567890"
+scanner := bufio.NewScanner(strings.NewReader(input))
+// Create a custom split function by wrapping the existing ScanWords function.
+split := func(data []byte, atEOF bool) (advance int, token []byte, err error) {
+ advance, token, err = bufio.ScanWords(data, atEOF)
+ if err == nil &amp;&amp; token != nil {
+ _, err = strconv.ParseInt(string(token), 10, 32)
+ }
+ return
+}
+// Set the split function for the scanning operation.
+scanner.Split(split)
+// Validate the input
+for scanner.Scan() {
+ fmt.Printf("%s\n", scanner.Text())
+}
+
+if err := scanner.Err(); err != nil {
+ fmt.Printf("Invalid input: %s", err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">1234
+5678
+Invalid input: strconv.ParseInt: parsing "1234567901234567890": value out of range
+</pre> <h4 id="example_Scanner_earlyStop"> <span class="text">Example (EarlyStop)</span>
+</h4> <p>Use a Scanner with a custom split function to parse a comma-separated list with an empty final value but stops at the token "STOP". </p> <p>Code:</p> <pre class="code" data-language="go">onComma := func(data []byte, atEOF bool) (advance int, token []byte, err error) {
+ i := bytes.IndexByte(data, ',')
+ if i == -1 {
+ if !atEOF {
+ return 0, nil, nil
+ }
+ // If we have reached the end, return the last token.
+ return 0, data, bufio.ErrFinalToken
+ }
+ // If the token is "STOP", stop the scanning and ignore the rest.
+ if string(data[:i]) == "STOP" {
+ return i + 1, nil, bufio.ErrFinalToken
+ }
+ // Otherwise, return the token before the comma.
+ return i + 1, data[:i], nil
+}
+const input = "1,2,STOP,4,"
+scanner := bufio.NewScanner(strings.NewReader(input))
+scanner.Split(onComma)
+for scanner.Scan() {
+ fmt.Printf("Got a token %q\n", scanner.Text())
+}
+if err := scanner.Err(); err != nil {
+ fmt.Fprintln(os.Stderr, "reading input:", err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">Got a token "1"
+Got a token "2"
+</pre> <h4 id="example_Scanner_emptyFinalToken"> <span class="text">Example (EmptyFinalToken)</span>
+</h4> <p>Use a Scanner with a custom split function to parse a comma-separated list with an empty final value. </p> <p>Code:</p> <pre class="code" data-language="go">// Comma-separated list; last entry is empty.
+const input = "1,2,3,4,"
+scanner := bufio.NewScanner(strings.NewReader(input))
+// Define a split function that separates on commas.
+onComma := func(data []byte, atEOF bool) (advance int, token []byte, err error) {
+ for i := 0; i &lt; len(data); i++ {
+ if data[i] == ',' {
+ return i + 1, data[:i], nil
+ }
+ }
+ if !atEOF {
+ return 0, nil, nil
+ }
+ // There is one final token to be delivered, which may be the empty string.
+ // Returning bufio.ErrFinalToken here tells Scan there are no more tokens after this
+ // but does not trigger an error to be returned from Scan itself.
+ return 0, data, bufio.ErrFinalToken
+}
+scanner.Split(onComma)
+// Scan.
+for scanner.Scan() {
+ fmt.Printf("%q ", scanner.Text())
+}
+if err := scanner.Err(); err != nil {
+ fmt.Fprintln(os.Stderr, "reading input:", err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">"1" "2" "3" "4" ""
+</pre> <h4 id="example_Scanner_lines"> <span class="text">Example (Lines)</span>
+</h4> <p>The simplest use of a Scanner, to read standard input as a set of lines. </p> <p>Code:</p> <pre class="code" data-language="go">
+scanner := bufio.NewScanner(os.Stdin)
+for scanner.Scan() {
+ fmt.Println(scanner.Text()) // Println will add back the final '\n'
+}
+if err := scanner.Err(); err != nil {
+ fmt.Fprintln(os.Stderr, "reading standard input:", err)
+}
+</pre> <h4 id="example_Scanner_words"> <span class="text">Example (Words)</span>
+</h4> <p>Use a Scanner to implement a simple word-count utility by scanning the input as a sequence of space-delimited tokens. </p> <p>Code:</p> <pre class="code" data-language="go">// An artificial input source.
+const input = "Now is the winter of our discontent,\nMade glorious summer by this sun of York.\n"
+scanner := bufio.NewScanner(strings.NewReader(input))
+// Set the split function for the scanning operation.
+scanner.Split(bufio.ScanWords)
+// Count the words.
+count := 0
+for scanner.Scan() {
+ count++
+}
+if err := scanner.Err(); err != nil {
+ fmt.Fprintln(os.Stderr, "reading input:", err)
+}
+fmt.Printf("%d\n", count)
+</pre> <p>Output:</p> <pre class="output" data-language="go">15
+</pre> <h3 id="NewScanner">func <span>NewScanner</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func NewScanner(r io.Reader) *Scanner</pre> <p>NewScanner returns a new <a href="#Scanner">Scanner</a> to read from r. The split function defaults to <a href="#ScanLines">ScanLines</a>. </p>
+<h3 id="Scanner.Buffer">func (*Scanner) <span>Buffer</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (s *Scanner) Buffer(buf []byte, max int)</pre> <p>Buffer sets the initial buffer to use when scanning and the maximum size of buffer that may be allocated during scanning. The maximum token size must be less than the larger of max and cap(buf). If max &lt;= cap(buf), <a href="#Scanner.Scan">Scanner.Scan</a> will use this buffer only and do no allocation. </p>
+<p>By default, <a href="#Scanner.Scan">Scanner.Scan</a> uses an internal buffer and sets the maximum token size to <a href="#MaxScanTokenSize">MaxScanTokenSize</a>. </p>
+<p>Buffer panics if it is called after scanning has started. </p>
+<h3 id="Scanner.Bytes">func (*Scanner) <span>Bytes</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (s *Scanner) Bytes() []byte</pre> <p>Bytes returns the most recent token generated by a call to <a href="#Scanner.Scan">Scanner.Scan</a>. The underlying array may point to data that will be overwritten by a subsequent call to Scan. It does no allocation. </p> <h4 id="example_Scanner_Bytes"> <span class="text">Example</span>
+</h4> <p>Return the most recent call to Scan as a []byte. </p> <p>Code:</p> <pre class="code" data-language="go">scanner := bufio.NewScanner(strings.NewReader("gopher"))
+for scanner.Scan() {
+ fmt.Println(len(scanner.Bytes()) == 6)
+}
+if err := scanner.Err(); err != nil {
+ fmt.Fprintln(os.Stderr, "shouldn't see an error scanning a string")
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+</pre> <h3 id="Scanner.Err">func (*Scanner) <span>Err</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (s *Scanner) Err() error</pre> <p>Err returns the first non-EOF error that was encountered by the <a href="#Scanner">Scanner</a>. </p>
+<h3 id="Scanner.Scan">func (*Scanner) <span>Scan</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (s *Scanner) Scan() bool</pre> <p>Scan advances the <a href="#Scanner">Scanner</a> to the next token, which will then be available through the <a href="#Scanner.Bytes">Scanner.Bytes</a> or <a href="#Scanner.Text">Scanner.Text</a> method. It returns false when there are no more tokens, either by reaching the end of the input or an error. After Scan returns false, the <a href="#Scanner.Err">Scanner.Err</a> method will return any error that occurred during scanning, except that if it was <span>io.EOF</span>, <a href="#Scanner.Err">Scanner.Err</a> will return nil. Scan panics if the split function returns too many empty tokens without advancing the input. This is a common error mode for scanners. </p>
+<h3 id="Scanner.Split">func (*Scanner) <span>Split</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (s *Scanner) Split(split SplitFunc)</pre> <p>Split sets the split function for the <a href="#Scanner">Scanner</a>. The default split function is <a href="#ScanLines">ScanLines</a>. </p>
+<p>Split panics if it is called after scanning has started. </p>
+<h3 id="Scanner.Text">func (*Scanner) <span>Text</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (s *Scanner) Text() string</pre> <p>Text returns the most recent token generated by a call to <a href="#Scanner.Scan">Scanner.Scan</a> as a newly allocated string holding its bytes. </p>
+<h2 id="SplitFunc">type <span>SplitFunc</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>SplitFunc is the signature of the split function used to tokenize the input. The arguments are an initial substring of the remaining unprocessed data and a flag, atEOF, that reports whether the <a href="#Reader">Reader</a> has no more data to give. The return values are the number of bytes to advance the input and the next token to return to the user, if any, plus an error, if any. </p>
+<p>Scanning stops if the function returns an error, in which case some of the input may be discarded. If that error is <a href="#ErrFinalToken">ErrFinalToken</a>, scanning stops with no error. A non-nil token delivered with <a href="#ErrFinalToken">ErrFinalToken</a> will be the last token, and a nil token with <a href="#ErrFinalToken">ErrFinalToken</a> immediately stops the scanning. </p>
+<p>Otherwise, the <a href="#Scanner">Scanner</a> advances the input. If the token is not nil, the <a href="#Scanner">Scanner</a> returns it to the user. If the token is nil, the Scanner reads more data and continues scanning; if there is no more data--if atEOF was true--the <a href="#Scanner">Scanner</a> returns. If the data does not yet hold a complete token, for instance if it has no newline while scanning lines, a <a href="#SplitFunc">SplitFunc</a> can return (0, nil, nil) to signal the <a href="#Scanner">Scanner</a> to read more data into the slice and try again with a longer slice starting at the same point in the input. </p>
+<p>The function is never called with an empty data slice unless atEOF is true. If atEOF is true, however, data may be non-empty and, as always, holds unprocessed text. </p>
+<pre data-language="go">type SplitFunc func(data []byte, atEOF bool) (advance int, token []byte, err error)</pre> <h2 id="Writer">type <span>Writer</span> </h2> <p>Writer implements buffering for an <span>io.Writer</span> object. If an error occurs writing to a <a href="#Writer">Writer</a>, no more data will be accepted and all subsequent writes, and <a href="#Writer.Flush">Writer.Flush</a>, will return the error. After all data has been written, the client should call the <a href="#Writer.Flush">Writer.Flush</a> method to guarantee all data has been forwarded to the underlying <span>io.Writer</span>. </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Writer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">w := bufio.NewWriter(os.Stdout)
+fmt.Fprint(w, "Hello, ")
+fmt.Fprint(w, "world!")
+w.Flush() // Don't forget to flush!
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, world!
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(w io.Writer) *Writer</pre> <p>NewWriter returns a new <a href="#Writer">Writer</a> whose buffer has the default size. If the argument io.Writer is already a <a href="#Writer">Writer</a> with large enough buffer size, it returns the underlying <a href="#Writer">Writer</a>. </p>
+<h3 id="NewWriterSize">func <span>NewWriterSize</span> </h3> <pre data-language="go">func NewWriterSize(w io.Writer, size int) *Writer</pre> <p>NewWriterSize returns a new <a href="#Writer">Writer</a> whose buffer has at least the specified size. If the argument io.Writer is already a <a href="#Writer">Writer</a> with large enough size, it returns the underlying <a href="#Writer">Writer</a>. </p>
+<h3 id="Writer.Available">func (*Writer) <span>Available</span> </h3> <pre data-language="go">func (b *Writer) Available() int</pre> <p>Available returns how many bytes are unused in the buffer. </p>
+<h3 id="Writer.AvailableBuffer">func (*Writer) <span>AvailableBuffer</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (b *Writer) AvailableBuffer() []byte</pre> <p>AvailableBuffer returns an empty buffer with b.Available() capacity. This buffer is intended to be appended to and passed to an immediately succeeding <a href="#Writer.Write">Writer.Write</a> call. The buffer is only valid until the next write operation on b. </p> <h4 id="example_Writer_AvailableBuffer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">w := bufio.NewWriter(os.Stdout)
+for _, i := range []int64{1, 2, 3, 4} {
+ b := w.AvailableBuffer()
+ b = strconv.AppendInt(b, i, 10)
+ b = append(b, ' ')
+ w.Write(b)
+}
+w.Flush()
+</pre> <p>Output:</p> <pre class="output" data-language="go">1 2 3 4
+</pre> <h3 id="Writer.Buffered">func (*Writer) <span>Buffered</span> </h3> <pre data-language="go">func (b *Writer) Buffered() int</pre> <p>Buffered returns the number of bytes that have been written into the current buffer. </p>
+<h3 id="Writer.Flush">func (*Writer) <span>Flush</span> </h3> <pre data-language="go">func (b *Writer) Flush() error</pre> <p>Flush writes any buffered data to the underlying <span>io.Writer</span>. </p>
+<h3 id="Writer.ReadFrom">func (*Writer) <span>ReadFrom</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (b *Writer) ReadFrom(r io.Reader) (n int64, err error)</pre> <p>ReadFrom implements <span>io.ReaderFrom</span>. If the underlying writer supports the ReadFrom method, this calls the underlying ReadFrom. If there is buffered data and an underlying ReadFrom, this fills the buffer and writes it before calling ReadFrom. </p>
+<h3 id="Writer.Reset">func (*Writer) <span>Reset</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (b *Writer) Reset(w io.Writer)</pre> <p>Reset discards any unflushed buffered data, clears any error, and resets b to write its output to w. Calling Reset on the zero value of <a href="#Writer">Writer</a> initializes the internal buffer to the default size. Calling w.Reset(w) (that is, resetting a <a href="#Writer">Writer</a> to itself) does nothing. </p>
+<h3 id="Writer.Size">func (*Writer) <span>Size</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Writer) Size() int</pre> <p>Size returns the size of the underlying buffer in bytes. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> </h3> <pre data-language="go">func (b *Writer) Write(p []byte) (nn int, err error)</pre> <p>Write writes the contents of p into the buffer. It returns the number of bytes written. If nn &lt; len(p), it also returns an error explaining why the write is short. </p>
+<h3 id="Writer.WriteByte">func (*Writer) <span>WriteByte</span> </h3> <pre data-language="go">func (b *Writer) WriteByte(c byte) error</pre> <p>WriteByte writes a single byte. </p>
+<h3 id="Writer.WriteRune">func (*Writer) <span>WriteRune</span> </h3> <pre data-language="go">func (b *Writer) WriteRune(r rune) (size int, err error)</pre> <p>WriteRune writes a single Unicode code point, returning the number of bytes written and any error. </p>
+<h3 id="Writer.WriteString">func (*Writer) <span>WriteString</span> </h3> <pre data-language="go">func (b *Writer) WriteString(s string) (int, error)</pre> <p>WriteString writes a string. It returns the number of bytes written. If the count is less than len(s), it also returns an error explaining why the write is short. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/bufio/" class="_attribution-link">http://golang.org/pkg/bufio/</a>
+ </p>
+</div>
diff --git a/devdocs/go/builtin%2Findex.html b/devdocs/go/builtin%2Findex.html
new file mode 100644
index 00000000..55bc205d
--- /dev/null
+++ b/devdocs/go/builtin%2Findex.html
@@ -0,0 +1,147 @@
+<h1> Package builtin </h1> <ul id="short-nav">
+<li><code>import "builtin"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package builtin provides documentation for Go's predeclared identifiers. The items documented here are not actually in package builtin but their descriptions here allow godoc to present documentation for the language's special identifiers. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#append">func append(slice []Type, elems ...Type) []Type</a></li>
+<li><a href="#cap">func cap(v Type) int</a></li>
+<li><a href="#clear">func clear[T ~[]Type | ~map[Type]Type1](t T)</a></li>
+<li><a href="#close">func close(c chan&lt;- Type)</a></li>
+<li><a href="#complex">func complex(r, i FloatType) ComplexType</a></li>
+<li><a href="#copy">func copy(dst, src []Type) int</a></li>
+<li><a href="#delete">func delete(m map[Type]Type1, key Type)</a></li>
+<li><a href="#imag">func imag(c ComplexType) FloatType</a></li>
+<li><a href="#len">func len(v Type) int</a></li>
+<li><a href="#make">func make(t Type, size ...IntegerType) Type</a></li>
+<li><a href="#max">func max[T cmp.Ordered](x T, y ...T) T</a></li>
+<li><a href="#min">func min[T cmp.Ordered](x T, y ...T) T</a></li>
+<li><a href="#new">func new(Type) *Type</a></li>
+<li><a href="#panic">func panic(v any)</a></li>
+<li><a href="#print">func print(args ...Type)</a></li>
+<li><a href="#println">func println(args ...Type)</a></li>
+<li><a href="#real">func real(c ComplexType) FloatType</a></li>
+<li><a href="#recover">func recover() any</a></li>
+<li><a href="#ComplexType">type ComplexType</a></li>
+<li><a href="#FloatType">type FloatType</a></li>
+<li><a href="#IntegerType">type IntegerType</a></li>
+<li><a href="#Type">type Type</a></li>
+<li><a href="#Type1">type Type1</a></li>
+<li><a href="#any">type any</a></li>
+<li><a href="#bool">type bool</a></li>
+<li><a href="#byte">type byte</a></li>
+<li><a href="#comparable">type comparable</a></li>
+<li><a href="#complex128">type complex128</a></li>
+<li><a href="#complex64">type complex64</a></li>
+<li><a href="#error">type error</a></li>
+<li><a href="#float32">type float32</a></li>
+<li><a href="#float64">type float64</a></li>
+<li><a href="#int">type int</a></li>
+<li><a href="#int16">type int16</a></li>
+<li><a href="#int32">type int32</a></li>
+<li><a href="#int64">type int64</a></li>
+<li><a href="#int8">type int8</a></li>
+<li><a href="#rune">type rune</a></li>
+<li><a href="#string">type string</a></li>
+<li><a href="#uint">type uint</a></li>
+<li><a href="#uint16">type uint16</a></li>
+<li><a href="#uint32">type uint32</a></li>
+<li><a href="#uint64">type uint64</a></li>
+<li><a href="#uint8">type uint8</a></li>
+<li><a href="#uintptr">type uintptr</a></li>
+</ul> <h3>Package files</h3> <p> <span>builtin.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>true and false are the two untyped boolean values. </p>
+<pre data-language="go">const (
+ true = 0 == 0 // Untyped bool.
+ false = 0 != 0 // Untyped bool.
+)</pre> <p>iota is a predeclared identifier representing the untyped integer ordinal number of the current const specification in a (usually parenthesized) const declaration. It is zero-indexed. </p>
+<pre data-language="go">const iota = 0 // Untyped int.
+</pre> <h2 id="pkg-variables">Variables</h2> <p>nil is a predeclared identifier representing the zero value for a pointer, channel, func, interface, map, or slice type. </p>
+<pre data-language="go">var nil Type // Type must be a pointer, channel, func, interface, map, or slice type
+</pre> <h2 id="append">func <span>append</span> </h2> <pre data-language="go">func append(slice []Type, elems ...Type) []Type</pre> <p>The append built-in function appends elements to the end of a slice. If it has sufficient capacity, the destination is resliced to accommodate the new elements. If it does not, a new underlying array will be allocated. Append returns the updated slice. It is therefore necessary to store the result of append, often in the variable holding the slice itself: </p>
+<pre data-language="go">slice = append(slice, elem1, elem2)
+slice = append(slice, anotherSlice...)
+</pre> <p>As a special case, it is legal to append a string to a byte slice, like this: </p>
+<pre data-language="go">slice = append([]byte("hello "), "world"...)
+</pre> <h2 id="cap">func <span>cap</span> </h2> <pre data-language="go">func cap(v Type) int</pre> <p>The cap built-in function returns the capacity of v, according to its type: </p>
+<pre data-language="go">Array: the number of elements in v (same as len(v)).
+Pointer to array: the number of elements in *v (same as len(v)).
+Slice: the maximum length the slice can reach when resliced;
+if v is nil, cap(v) is zero.
+Channel: the channel buffer capacity, in units of elements;
+if v is nil, cap(v) is zero.
+</pre> <p>For some arguments, such as a simple array expression, the result can be a constant. See the Go language specification's "Length and capacity" section for details. </p>
+<h2 id="clear">func <span>clear</span> </h2> <pre data-language="go">func clear[T ~[]Type | ~map[Type]Type1](t T)</pre> <p>The clear built-in function clears maps and slices. For maps, clear deletes all entries, resulting in an empty map. For slices, clear sets all elements up to the length of the slice to the zero value of the respective element type. If the argument type is a type parameter, the type parameter's type set must contain only map or slice types, and clear performs the operation implied by the type argument. </p>
+<h2 id="close">func <span>close</span> </h2> <pre data-language="go">func close(c chan&lt;- Type)</pre> <p>The close built-in function closes a channel, which must be either bidirectional or send-only. It should be executed only by the sender, never the receiver, and has the effect of shutting down the channel after the last sent value is received. After the last value has been received from a closed channel c, any receive from c will succeed without blocking, returning the zero value for the channel element. The form </p>
+<pre data-language="go">x, ok := &lt;-c
+</pre> <p>will also set ok to false for a closed and empty channel. </p>
+<h2 id="complex">func <span>complex</span> </h2> <pre data-language="go">func complex(r, i FloatType) ComplexType</pre> <p>The complex built-in function constructs a complex value from two floating-point values. The real and imaginary parts must be of the same size, either float32 or float64 (or assignable to them), and the return value will be the corresponding complex type (complex64 for float32, complex128 for float64). </p>
+<h2 id="copy">func <span>copy</span> </h2> <pre data-language="go">func copy(dst, src []Type) int</pre> <p>The copy built-in function copies elements from a source slice into a destination slice. (As a special case, it also will copy bytes from a string to a slice of bytes.) The source and destination may overlap. Copy returns the number of elements copied, which will be the minimum of len(src) and len(dst). </p>
+<h2 id="delete">func <span>delete</span> </h2> <pre data-language="go">func delete(m map[Type]Type1, key Type)</pre> <p>The delete built-in function deletes the element with the specified key (m[key]) from the map. If m is nil or there is no such element, delete is a no-op. </p>
+<h2 id="imag">func <span>imag</span> </h2> <pre data-language="go">func imag(c ComplexType) FloatType</pre> <p>The imag built-in function returns the imaginary part of the complex number c. The return value will be floating point type corresponding to the type of c. </p>
+<h2 id="len">func <span>len</span> </h2> <pre data-language="go">func len(v Type) int</pre> <p>The len built-in function returns the length of v, according to its type: </p>
+<pre data-language="go">Array: the number of elements in v.
+Pointer to array: the number of elements in *v (even if v is nil).
+Slice, or map: the number of elements in v; if v is nil, len(v) is zero.
+String: the number of bytes in v.
+Channel: the number of elements queued (unread) in the channel buffer;
+ if v is nil, len(v) is zero.
+</pre> <p>For some arguments, such as a string literal or a simple array expression, the result can be a constant. See the Go language specification's "Length and capacity" section for details. </p>
+<h2 id="make">func <span>make</span> </h2> <pre data-language="go">func make(t Type, size ...IntegerType) Type</pre> <p>The make built-in function allocates and initializes an object of type slice, map, or chan (only). Like new, the first argument is a type, not a value. Unlike new, make's return type is the same as the type of its argument, not a pointer to it. The specification of the result depends on the type: </p>
+<pre data-language="go">Slice: The size specifies the length. The capacity of the slice is
+equal to its length. A second integer argument may be provided to
+specify a different capacity; it must be no smaller than the
+length. For example, make([]int, 0, 10) allocates an underlying array
+of size 10 and returns a slice of length 0 and capacity 10 that is
+backed by this underlying array.
+Map: An empty map is allocated with enough space to hold the
+specified number of elements. The size may be omitted, in which case
+a small starting size is allocated.
+Channel: The channel's buffer is initialized with the specified
+buffer capacity. If zero, or the size is omitted, the channel is
+unbuffered.
+</pre> <h2 id="max">func <span>max</span> </h2> <pre data-language="go">func max[T cmp.Ordered](x T, y ...T) T</pre> <p>The max built-in function returns the largest value of a fixed number of arguments of <span>cmp.Ordered</span> types. There must be at least one argument. If T is a floating-point type and any of the arguments are NaNs, max will return NaN. </p>
+<h2 id="min">func <span>min</span> </h2> <pre data-language="go">func min[T cmp.Ordered](x T, y ...T) T</pre> <p>The min built-in function returns the smallest value of a fixed number of arguments of <span>cmp.Ordered</span> types. There must be at least one argument. If T is a floating-point type and any of the arguments are NaNs, min will return NaN. </p>
+<h2 id="new">func <span>new</span> </h2> <pre data-language="go">func new(Type) *Type</pre> <p>The new built-in function allocates memory. The first argument is a type, not a value, and the value returned is a pointer to a newly allocated zero value of that type. </p>
+<h2 id="panic">func <span>panic</span> </h2> <pre data-language="go">func panic(v any)</pre> <p>The panic built-in function stops normal execution of the current goroutine. When a function F calls panic, normal execution of F stops immediately. Any functions whose execution was deferred by F are run in the usual way, and then F returns to its caller. To the caller G, the invocation of F then behaves like a call to panic, terminating G's execution and running any deferred functions. This continues until all functions in the executing goroutine have stopped, in reverse order. At that point, the program is terminated with a non-zero exit code. This termination sequence is called panicking and can be controlled by the built-in function recover. </p>
+<p>Starting in Go 1.21, calling panic with a nil interface value or an untyped nil causes a run-time error (a different panic). The GODEBUG setting panicnil=1 disables the run-time error. </p>
+<h2 id="print">func <span>print</span> </h2> <pre data-language="go">func print(args ...Type)</pre> <p>The print built-in function formats its arguments in an implementation-specific way and writes the result to standard error. Print is useful for bootstrapping and debugging; it is not guaranteed to stay in the language. </p>
+<h2 id="println">func <span>println</span> </h2> <pre data-language="go">func println(args ...Type)</pre> <p>The println built-in function formats its arguments in an implementation-specific way and writes the result to standard error. Spaces are always added between arguments and a newline is appended. Println is useful for bootstrapping and debugging; it is not guaranteed to stay in the language. </p>
+<h2 id="real">func <span>real</span> </h2> <pre data-language="go">func real(c ComplexType) FloatType</pre> <p>The real built-in function returns the real part of the complex number c. The return value will be floating point type corresponding to the type of c. </p>
+<h2 id="recover">func <span>recover</span> </h2> <pre data-language="go">func recover() any</pre> <p>The recover built-in function allows a program to manage behavior of a panicking goroutine. Executing a call to recover inside a deferred function (but not any function called by it) stops the panicking sequence by restoring normal execution and retrieves the error value passed to the call of panic. If recover is called outside the deferred function it will not stop a panicking sequence. In this case, or when the goroutine is not panicking, recover returns nil. </p>
+<p>Prior to Go 1.21, recover would also return nil if panic is called with a nil argument. See [panic] for details. </p>
+<h2 id="ComplexType">type <span>ComplexType</span> </h2> <p>ComplexType is here for the purposes of documentation only. It is a stand-in for either complex type: complex64 or complex128. </p>
+<pre data-language="go">type ComplexType complex64</pre> <h2 id="FloatType">type <span>FloatType</span> </h2> <p>FloatType is here for the purposes of documentation only. It is a stand-in for either float type: float32 or float64. </p>
+<pre data-language="go">type FloatType float32</pre> <h2 id="IntegerType">type <span>IntegerType</span> </h2> <p>IntegerType is here for the purposes of documentation only. It is a stand-in for any integer type: int, uint, int8 etc. </p>
+<pre data-language="go">type IntegerType int</pre> <h2 id="Type">type <span>Type</span> </h2> <p>Type is here for the purposes of documentation only. It is a stand-in for any Go type, but represents the same type for any given function invocation. </p>
+<pre data-language="go">type Type int</pre> <h2 id="Type1">type <span>Type1</span> </h2> <p>Type1 is here for the purposes of documentation only. It is a stand-in for any Go type, but represents the same type for any given function invocation. </p>
+<pre data-language="go">type Type1 int</pre> <h2 id="any">type <span>any</span> </h2> <p>any is an alias for interface{} and is equivalent to interface{} in all ways. </p>
+<pre data-language="go">type any = interface{}</pre> <h2 id="bool">type <span>bool</span> </h2> <p>bool is the set of boolean values, true and false. </p>
+<pre data-language="go">type bool bool</pre> <h2 id="byte">type <span>byte</span> </h2> <p>byte is an alias for uint8 and is equivalent to uint8 in all ways. It is used, by convention, to distinguish byte values from 8-bit unsigned integer values. </p>
+<pre data-language="go">type byte = uint8</pre> <h2 id="comparable">type <span>comparable</span> </h2> <p>comparable is an interface that is implemented by all comparable types (booleans, numbers, strings, pointers, channels, arrays of comparable types, structs whose fields are all comparable types). The comparable interface may only be used as a type parameter constraint, not as the type of a variable. </p>
+<pre data-language="go">type comparable interface{ comparable }</pre> <h2 id="complex128">type <span>complex128</span> </h2> <p>complex128 is the set of all complex numbers with float64 real and imaginary parts. </p>
+<pre data-language="go">type complex128 complex128</pre> <h2 id="complex64">type <span>complex64</span> </h2> <p>complex64 is the set of all complex numbers with float32 real and imaginary parts. </p>
+<pre data-language="go">type complex64 complex64</pre> <h2 id="error">type <span>error</span> </h2> <p>The error built-in interface type is the conventional interface for representing an error condition, with the nil value representing no error. </p>
+<pre data-language="go">type error interface {
+ Error() string
+}</pre> <h2 id="float32">type <span>float32</span> </h2> <p>float32 is the set of all IEEE-754 32-bit floating-point numbers. </p>
+<pre data-language="go">type float32 float32</pre> <h2 id="float64">type <span>float64</span> </h2> <p>float64 is the set of all IEEE-754 64-bit floating-point numbers. </p>
+<pre data-language="go">type float64 float64</pre> <h2 id="int">type <span>int</span> </h2> <p>int is a signed integer type that is at least 32 bits in size. It is a distinct type, however, and not an alias for, say, int32. </p>
+<pre data-language="go">type int int</pre> <h2 id="int16">type <span>int16</span> </h2> <p>int16 is the set of all signed 16-bit integers. Range: -32768 through 32767. </p>
+<pre data-language="go">type int16 int16</pre> <h2 id="int32">type <span>int32</span> </h2> <p>int32 is the set of all signed 32-bit integers. Range: -2147483648 through 2147483647. </p>
+<pre data-language="go">type int32 int32</pre> <h2 id="int64">type <span>int64</span> </h2> <p>int64 is the set of all signed 64-bit integers. Range: -9223372036854775808 through 9223372036854775807. </p>
+<pre data-language="go">type int64 int64</pre> <h2 id="int8">type <span>int8</span> </h2> <p>int8 is the set of all signed 8-bit integers. Range: -128 through 127. </p>
+<pre data-language="go">type int8 int8</pre> <h2 id="rune">type <span>rune</span> </h2> <p>rune is an alias for int32 and is equivalent to int32 in all ways. It is used, by convention, to distinguish character values from integer values. </p>
+<pre data-language="go">type rune = int32</pre> <h2 id="string">type <span>string</span> </h2> <p>string is the set of all strings of 8-bit bytes, conventionally but not necessarily representing UTF-8-encoded text. A string may be empty, but not nil. Values of string type are immutable. </p>
+<pre data-language="go">type string string</pre> <h2 id="uint">type <span>uint</span> </h2> <p>uint is an unsigned integer type that is at least 32 bits in size. It is a distinct type, however, and not an alias for, say, uint32. </p>
+<pre data-language="go">type uint uint</pre> <h2 id="uint16">type <span>uint16</span> </h2> <p>uint16 is the set of all unsigned 16-bit integers. Range: 0 through 65535. </p>
+<pre data-language="go">type uint16 uint16</pre> <h2 id="uint32">type <span>uint32</span> </h2> <p>uint32 is the set of all unsigned 32-bit integers. Range: 0 through 4294967295. </p>
+<pre data-language="go">type uint32 uint32</pre> <h2 id="uint64">type <span>uint64</span> </h2> <p>uint64 is the set of all unsigned 64-bit integers. Range: 0 through 18446744073709551615. </p>
+<pre data-language="go">type uint64 uint64</pre> <h2 id="uint8">type <span>uint8</span> </h2> <p>uint8 is the set of all unsigned 8-bit integers. Range: 0 through 255. </p>
+<pre data-language="go">type uint8 uint8</pre> <h2 id="uintptr">type <span>uintptr</span> </h2> <p>uintptr is an integer type that is large enough to hold the bit pattern of any pointer. </p>
+<pre data-language="go">type uintptr uintptr</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/builtin/" class="_attribution-link">http://golang.org/pkg/builtin/</a>
+ </p>
+</div>
diff --git a/devdocs/go/bytes%2Findex.html b/devdocs/go/bytes%2Findex.html
new file mode 100644
index 00000000..08d37b2b
--- /dev/null
+++ b/devdocs/go/bytes%2Findex.html
@@ -0,0 +1,650 @@
+<h1> Package bytes </h1> <ul id="short-nav">
+<li><code>import "bytes"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package bytes implements functions for the manipulation of byte slices. It is analogous to the facilities of the <span>strings</span> package. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Clone">func Clone(b []byte) []byte</a></li>
+<li><a href="#Compare">func Compare(a, b []byte) int</a></li>
+<li><a href="#Contains">func Contains(b, subslice []byte) bool</a></li>
+<li><a href="#ContainsAny">func ContainsAny(b []byte, chars string) bool</a></li>
+<li><a href="#ContainsFunc">func ContainsFunc(b []byte, f func(rune) bool) bool</a></li>
+<li><a href="#ContainsRune">func ContainsRune(b []byte, r rune) bool</a></li>
+<li><a href="#Count">func Count(s, sep []byte) int</a></li>
+<li><a href="#Cut">func Cut(s, sep []byte) (before, after []byte, found bool)</a></li>
+<li><a href="#CutPrefix">func CutPrefix(s, prefix []byte) (after []byte, found bool)</a></li>
+<li><a href="#CutSuffix">func CutSuffix(s, suffix []byte) (before []byte, found bool)</a></li>
+<li><a href="#Equal">func Equal(a, b []byte) bool</a></li>
+<li><a href="#EqualFold">func EqualFold(s, t []byte) bool</a></li>
+<li><a href="#Fields">func Fields(s []byte) [][]byte</a></li>
+<li><a href="#FieldsFunc">func FieldsFunc(s []byte, f func(rune) bool) [][]byte</a></li>
+<li><a href="#HasPrefix">func HasPrefix(s, prefix []byte) bool</a></li>
+<li><a href="#HasSuffix">func HasSuffix(s, suffix []byte) bool</a></li>
+<li><a href="#Index">func Index(s, sep []byte) int</a></li>
+<li><a href="#IndexAny">func IndexAny(s []byte, chars string) int</a></li>
+<li><a href="#IndexByte">func IndexByte(b []byte, c byte) int</a></li>
+<li><a href="#IndexFunc">func IndexFunc(s []byte, f func(r rune) bool) int</a></li>
+<li><a href="#IndexRune">func IndexRune(s []byte, r rune) int</a></li>
+<li><a href="#Join">func Join(s [][]byte, sep []byte) []byte</a></li>
+<li><a href="#LastIndex">func LastIndex(s, sep []byte) int</a></li>
+<li><a href="#LastIndexAny">func LastIndexAny(s []byte, chars string) int</a></li>
+<li><a href="#LastIndexByte">func LastIndexByte(s []byte, c byte) int</a></li>
+<li><a href="#LastIndexFunc">func LastIndexFunc(s []byte, f func(r rune) bool) int</a></li>
+<li><a href="#Map">func Map(mapping func(r rune) rune, s []byte) []byte</a></li>
+<li><a href="#Repeat">func Repeat(b []byte, count int) []byte</a></li>
+<li><a href="#Replace">func Replace(s, old, new []byte, n int) []byte</a></li>
+<li><a href="#ReplaceAll">func ReplaceAll(s, old, new []byte) []byte</a></li>
+<li><a href="#Runes">func Runes(s []byte) []rune</a></li>
+<li><a href="#Split">func Split(s, sep []byte) [][]byte</a></li>
+<li><a href="#SplitAfter">func SplitAfter(s, sep []byte) [][]byte</a></li>
+<li><a href="#SplitAfterN">func SplitAfterN(s, sep []byte, n int) [][]byte</a></li>
+<li><a href="#SplitN">func SplitN(s, sep []byte, n int) [][]byte</a></li>
+<li><a href="#Title">func Title(s []byte) []byte</a></li>
+<li><a href="#ToLower">func ToLower(s []byte) []byte</a></li>
+<li><a href="#ToLowerSpecial">func ToLowerSpecial(c unicode.SpecialCase, s []byte) []byte</a></li>
+<li><a href="#ToTitle">func ToTitle(s []byte) []byte</a></li>
+<li><a href="#ToTitleSpecial">func ToTitleSpecial(c unicode.SpecialCase, s []byte) []byte</a></li>
+<li><a href="#ToUpper">func ToUpper(s []byte) []byte</a></li>
+<li><a href="#ToUpperSpecial">func ToUpperSpecial(c unicode.SpecialCase, s []byte) []byte</a></li>
+<li><a href="#ToValidUTF8">func ToValidUTF8(s, replacement []byte) []byte</a></li>
+<li><a href="#Trim">func Trim(s []byte, cutset string) []byte</a></li>
+<li><a href="#TrimFunc">func TrimFunc(s []byte, f func(r rune) bool) []byte</a></li>
+<li><a href="#TrimLeft">func TrimLeft(s []byte, cutset string) []byte</a></li>
+<li><a href="#TrimLeftFunc">func TrimLeftFunc(s []byte, f func(r rune) bool) []byte</a></li>
+<li><a href="#TrimPrefix">func TrimPrefix(s, prefix []byte) []byte</a></li>
+<li><a href="#TrimRight">func TrimRight(s []byte, cutset string) []byte</a></li>
+<li><a href="#TrimRightFunc">func TrimRightFunc(s []byte, f func(r rune) bool) []byte</a></li>
+<li><a href="#TrimSpace">func TrimSpace(s []byte) []byte</a></li>
+<li><a href="#TrimSuffix">func TrimSuffix(s, suffix []byte) []byte</a></li>
+<li><a href="#Buffer">type Buffer</a></li>
+<li> <a href="#NewBuffer">func NewBuffer(buf []byte) *Buffer</a>
+</li>
+<li> <a href="#NewBufferString">func NewBufferString(s string) *Buffer</a>
+</li>
+<li> <a href="#Buffer.Available">func (b *Buffer) Available() int</a>
+</li>
+<li> <a href="#Buffer.AvailableBuffer">func (b *Buffer) AvailableBuffer() []byte</a>
+</li>
+<li> <a href="#Buffer.Bytes">func (b *Buffer) Bytes() []byte</a>
+</li>
+<li> <a href="#Buffer.Cap">func (b *Buffer) Cap() int</a>
+</li>
+<li> <a href="#Buffer.Grow">func (b *Buffer) Grow(n int)</a>
+</li>
+<li> <a href="#Buffer.Len">func (b *Buffer) Len() int</a>
+</li>
+<li> <a href="#Buffer.Next">func (b *Buffer) Next(n int) []byte</a>
+</li>
+<li> <a href="#Buffer.Read">func (b *Buffer) Read(p []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Buffer.ReadByte">func (b *Buffer) ReadByte() (byte, error)</a>
+</li>
+<li> <a href="#Buffer.ReadBytes">func (b *Buffer) ReadBytes(delim byte) (line []byte, err error)</a>
+</li>
+<li> <a href="#Buffer.ReadFrom">func (b *Buffer) ReadFrom(r io.Reader) (n int64, err error)</a>
+</li>
+<li> <a href="#Buffer.ReadRune">func (b *Buffer) ReadRune() (r rune, size int, err error)</a>
+</li>
+<li> <a href="#Buffer.ReadString">func (b *Buffer) ReadString(delim byte) (line string, err error)</a>
+</li>
+<li> <a href="#Buffer.Reset">func (b *Buffer) Reset()</a>
+</li>
+<li> <a href="#Buffer.String">func (b *Buffer) String() string</a>
+</li>
+<li> <a href="#Buffer.Truncate">func (b *Buffer) Truncate(n int)</a>
+</li>
+<li> <a href="#Buffer.UnreadByte">func (b *Buffer) UnreadByte() error</a>
+</li>
+<li> <a href="#Buffer.UnreadRune">func (b *Buffer) UnreadRune() error</a>
+</li>
+<li> <a href="#Buffer.Write">func (b *Buffer) Write(p []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Buffer.WriteByte">func (b *Buffer) WriteByte(c byte) error</a>
+</li>
+<li> <a href="#Buffer.WriteRune">func (b *Buffer) WriteRune(r rune) (n int, err error)</a>
+</li>
+<li> <a href="#Buffer.WriteString">func (b *Buffer) WriteString(s string) (n int, err error)</a>
+</li>
+<li> <a href="#Buffer.WriteTo">func (b *Buffer) WriteTo(w io.Writer) (n int64, err error)</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(b []byte) *Reader</a>
+</li>
+<li> <a href="#Reader.Len">func (r *Reader) Len() int</a>
+</li>
+<li> <a href="#Reader.Read">func (r *Reader) Read(b []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Reader.ReadAt">func (r *Reader) ReadAt(b []byte, off int64) (n int, err error)</a>
+</li>
+<li> <a href="#Reader.ReadByte">func (r *Reader) ReadByte() (byte, error)</a>
+</li>
+<li> <a href="#Reader.ReadRune">func (r *Reader) ReadRune() (ch rune, size int, err error)</a>
+</li>
+<li> <a href="#Reader.Reset">func (r *Reader) Reset(b []byte)</a>
+</li>
+<li> <a href="#Reader.Seek">func (r *Reader) Seek(offset int64, whence int) (int64, error)</a>
+</li>
+<li> <a href="#Reader.Size">func (r *Reader) Size() int64</a>
+</li>
+<li> <a href="#Reader.UnreadByte">func (r *Reader) UnreadByte() error</a>
+</li>
+<li> <a href="#Reader.UnreadRune">func (r *Reader) UnreadRune() error</a>
+</li>
+<li> <a href="#Reader.WriteTo">func (r *Reader) WriteTo(w io.Writer) (n int64, err error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Buffer">Buffer</a></dd> <dd><a class="exampleLink" href="#example_Buffer_AvailableBuffer">Buffer.AvailableBuffer</a></dd> <dd><a class="exampleLink" href="#example_Buffer_Bytes">Buffer.Bytes</a></dd> <dd><a class="exampleLink" href="#example_Buffer_Cap">Buffer.Cap</a></dd> <dd><a class="exampleLink" href="#example_Buffer_Grow">Buffer.Grow</a></dd> <dd><a class="exampleLink" href="#example_Buffer_Len">Buffer.Len</a></dd> <dd><a class="exampleLink" href="#example_Buffer_Next">Buffer.Next</a></dd> <dd><a class="exampleLink" href="#example_Buffer_Read">Buffer.Read</a></dd> <dd><a class="exampleLink" href="#example_Buffer_ReadByte">Buffer.ReadByte</a></dd> <dd><a class="exampleLink" href="#example_Buffer_reader">Buffer (Reader)</a></dd> <dd><a class="exampleLink" href="#example_Clone">Clone</a></dd> <dd><a class="exampleLink" href="#example_Compare">Compare</a></dd> <dd><a class="exampleLink" href="#example_Compare_search">Compare (Search)</a></dd> <dd><a class="exampleLink" href="#example_Contains">Contains</a></dd> <dd><a class="exampleLink" href="#example_ContainsAny">ContainsAny</a></dd> <dd><a class="exampleLink" href="#example_ContainsFunc">ContainsFunc</a></dd> <dd><a class="exampleLink" href="#example_ContainsRune">ContainsRune</a></dd> <dd><a class="exampleLink" href="#example_Count">Count</a></dd> <dd><a class="exampleLink" href="#example_Cut">Cut</a></dd> <dd><a class="exampleLink" href="#example_CutPrefix">CutPrefix</a></dd> <dd><a class="exampleLink" href="#example_CutSuffix">CutSuffix</a></dd> <dd><a class="exampleLink" href="#example_Equal">Equal</a></dd> <dd><a class="exampleLink" href="#example_EqualFold">EqualFold</a></dd> <dd><a class="exampleLink" href="#example_Fields">Fields</a></dd> <dd><a class="exampleLink" href="#example_FieldsFunc">FieldsFunc</a></dd> <dd><a class="exampleLink" href="#example_HasPrefix">HasPrefix</a></dd> <dd><a class="exampleLink" href="#example_HasSuffix">HasSuffix</a></dd> <dd><a class="exampleLink" href="#example_Index">Index</a></dd> <dd><a class="exampleLink" href="#example_IndexAny">IndexAny</a></dd> <dd><a class="exampleLink" href="#example_IndexByte">IndexByte</a></dd> <dd><a class="exampleLink" href="#example_IndexFunc">IndexFunc</a></dd> <dd><a class="exampleLink" href="#example_IndexRune">IndexRune</a></dd> <dd><a class="exampleLink" href="#example_Join">Join</a></dd> <dd><a class="exampleLink" href="#example_LastIndex">LastIndex</a></dd> <dd><a class="exampleLink" href="#example_LastIndexAny">LastIndexAny</a></dd> <dd><a class="exampleLink" href="#example_LastIndexByte">LastIndexByte</a></dd> <dd><a class="exampleLink" href="#example_LastIndexFunc">LastIndexFunc</a></dd> <dd><a class="exampleLink" href="#example_Map">Map</a></dd> <dd><a class="exampleLink" href="#example_Reader_Len">Reader.Len</a></dd> <dd><a class="exampleLink" href="#example_Repeat">Repeat</a></dd> <dd><a class="exampleLink" href="#example_Replace">Replace</a></dd> <dd><a class="exampleLink" href="#example_ReplaceAll">ReplaceAll</a></dd> <dd><a class="exampleLink" href="#example_Runes">Runes</a></dd> <dd><a class="exampleLink" href="#example_Split">Split</a></dd> <dd><a class="exampleLink" href="#example_SplitAfter">SplitAfter</a></dd> <dd><a class="exampleLink" href="#example_SplitAfterN">SplitAfterN</a></dd> <dd><a class="exampleLink" href="#example_SplitN">SplitN</a></dd> <dd><a class="exampleLink" href="#example_Title">Title</a></dd> <dd><a class="exampleLink" href="#example_ToLower">ToLower</a></dd> <dd><a class="exampleLink" href="#example_ToLowerSpecial">ToLowerSpecial</a></dd> <dd><a class="exampleLink" href="#example_ToTitle">ToTitle</a></dd> <dd><a class="exampleLink" href="#example_ToTitleSpecial">ToTitleSpecial</a></dd> <dd><a class="exampleLink" href="#example_ToUpper">ToUpper</a></dd> <dd><a class="exampleLink" href="#example_ToUpperSpecial">ToUpperSpecial</a></dd> <dd><a class="exampleLink" href="#example_ToValidUTF8">ToValidUTF8</a></dd> <dd><a class="exampleLink" href="#example_Trim">Trim</a></dd> <dd><a class="exampleLink" href="#example_TrimFunc">TrimFunc</a></dd> <dd><a class="exampleLink" href="#example_TrimLeft">TrimLeft</a></dd> <dd><a class="exampleLink" href="#example_TrimLeftFunc">TrimLeftFunc</a></dd> <dd><a class="exampleLink" href="#example_TrimPrefix">TrimPrefix</a></dd> <dd><a class="exampleLink" href="#example_TrimRight">TrimRight</a></dd> <dd><a class="exampleLink" href="#example_TrimRightFunc">TrimRightFunc</a></dd> <dd><a class="exampleLink" href="#example_TrimSpace">TrimSpace</a></dd> <dd><a class="exampleLink" href="#example_TrimSuffix">TrimSuffix</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>buffer.go</span> <span>bytes.go</span> <span>reader.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>MinRead is the minimum slice size passed to a Read call by <a href="#Buffer.ReadFrom">Buffer.ReadFrom</a>. As long as the <a href="#Buffer">Buffer</a> has at least MinRead bytes beyond what is required to hold the contents of r, ReadFrom will not grow the underlying buffer. </p>
+<pre data-language="go">const MinRead = 512</pre> <h2 id="pkg-variables">Variables</h2> <p>ErrTooLarge is passed to panic if memory cannot be allocated to store data in a buffer. </p>
+<pre data-language="go">var ErrTooLarge = errors.New("bytes.Buffer: too large")</pre> <h2 id="Clone">func <span>Clone</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func Clone(b []byte) []byte</pre> <p>Clone returns a copy of b[:len(b)]. The result may have additional unused capacity. Clone(nil) returns nil. </p> <h4 id="example_Clone"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte("abc")
+clone := bytes.Clone(b)
+fmt.Printf("%s\n", clone)
+clone[0] = 'd'
+fmt.Printf("%s\n", b)
+fmt.Printf("%s\n", clone)
+</pre> <p>Output:</p> <pre class="output" data-language="go">abc
+abc
+dbc
+</pre> <h2 id="Compare">func <span>Compare</span> </h2> <pre data-language="go">func Compare(a, b []byte) int</pre> <p>Compare returns an integer comparing two byte slices lexicographically. The result will be 0 if a == b, -1 if a &lt; b, and +1 if a &gt; b. A nil argument is equivalent to an empty slice. </p> <h4 id="example_Compare"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Interpret Compare's result by comparing it to zero.
+var a, b []byte
+if bytes.Compare(a, b) &lt; 0 {
+ // a less b
+}
+if bytes.Compare(a, b) &lt;= 0 {
+ // a less or equal b
+}
+if bytes.Compare(a, b) &gt; 0 {
+ // a greater b
+}
+if bytes.Compare(a, b) &gt;= 0 {
+ // a greater or equal b
+}
+
+// Prefer Equal to Compare for equality comparisons.
+if bytes.Equal(a, b) {
+ // a equal b
+}
+if !bytes.Equal(a, b) {
+ // a not equal b
+}
+</pre> <h4 id="example_Compare_search"> <span class="text">Example (Search)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Binary search to find a matching byte slice.
+var needle []byte
+var haystack [][]byte // Assume sorted
+i := sort.Search(len(haystack), func(i int) bool {
+ // Return haystack[i] &gt;= needle.
+ return bytes.Compare(haystack[i], needle) &gt;= 0
+})
+if i &lt; len(haystack) &amp;&amp; bytes.Equal(haystack[i], needle) {
+ // Found it!
+}
+</pre> <h2 id="Contains">func <span>Contains</span> </h2> <pre data-language="go">func Contains(b, subslice []byte) bool</pre> <p>Contains reports whether subslice is within b. </p> <h4 id="example_Contains"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.Contains([]byte("seafood"), []byte("foo")))
+fmt.Println(bytes.Contains([]byte("seafood"), []byte("bar")))
+fmt.Println(bytes.Contains([]byte("seafood"), []byte("")))
+fmt.Println(bytes.Contains([]byte(""), []byte("")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+true
+</pre> <h2 id="ContainsAny">func <span>ContainsAny</span> <span title="Added in Go 1.7">1.7</span> </h2> <pre data-language="go">func ContainsAny(b []byte, chars string) bool</pre> <p>ContainsAny reports whether any of the UTF-8-encoded code points in chars are within b. </p> <h4 id="example_ContainsAny"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.ContainsAny([]byte("I like seafood."), "fÄo!"))
+fmt.Println(bytes.ContainsAny([]byte("I like seafood."), "去是伟大的."))
+fmt.Println(bytes.ContainsAny([]byte("I like seafood."), ""))
+fmt.Println(bytes.ContainsAny([]byte(""), ""))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+true
+false
+false
+</pre> <h2 id="ContainsFunc">func <span>ContainsFunc</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func ContainsFunc(b []byte, f func(rune) bool) bool</pre> <p>ContainsFunc reports whether any of the UTF-8-encoded code points r within b satisfy f(r). </p> <h4 id="example_ContainsFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">f := func(r rune) bool {
+ return r &gt;= 'a' &amp;&amp; r &lt;= 'z'
+}
+fmt.Println(bytes.ContainsFunc([]byte("HELLO"), f))
+fmt.Println(bytes.ContainsFunc([]byte("World"), f))
+</pre> <p>Output:</p> <pre class="output" data-language="go">false
+true
+</pre> <h2 id="ContainsRune">func <span>ContainsRune</span> <span title="Added in Go 1.7">1.7</span> </h2> <pre data-language="go">func ContainsRune(b []byte, r rune) bool</pre> <p>ContainsRune reports whether the rune is contained in the UTF-8-encoded byte slice b. </p> <h4 id="example_ContainsRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.ContainsRune([]byte("I like seafood."), 'f'))
+fmt.Println(bytes.ContainsRune([]byte("I like seafood."), 'ö'))
+fmt.Println(bytes.ContainsRune([]byte("去是伟大的!"), '大'))
+fmt.Println(bytes.ContainsRune([]byte("去是伟大的!"), '!'))
+fmt.Println(bytes.ContainsRune([]byte(""), '@'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+true
+false
+</pre> <h2 id="Count">func <span>Count</span> </h2> <pre data-language="go">func Count(s, sep []byte) int</pre> <p>Count counts the number of non-overlapping instances of sep in s. If sep is an empty slice, Count returns 1 + the number of UTF-8-encoded code points in s. </p> <h4 id="example_Count"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.Count([]byte("cheese"), []byte("e")))
+fmt.Println(bytes.Count([]byte("five"), []byte(""))) // before &amp; after each rune
+</pre> <p>Output:</p> <pre class="output" data-language="go">3
+5
+</pre> <h2 id="Cut">func <span>Cut</span> <span title="Added in Go 1.18">1.18</span> </h2> <pre data-language="go">func Cut(s, sep []byte) (before, after []byte, found bool)</pre> <p>Cut slices s around the first instance of sep, returning the text before and after sep. The found result reports whether sep appears in s. If sep does not appear in s, cut returns s, nil, false. </p>
+<p>Cut returns slices of the original slice s, not copies. </p> <h4 id="example_Cut"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">show := func(s, sep string) {
+ before, after, found := bytes.Cut([]byte(s), []byte(sep))
+ fmt.Printf("Cut(%q, %q) = %q, %q, %v\n", s, sep, before, after, found)
+}
+show("Gopher", "Go")
+show("Gopher", "ph")
+show("Gopher", "er")
+show("Gopher", "Badger")
+</pre> <p>Output:</p> <pre class="output" data-language="go">Cut("Gopher", "Go") = "", "pher", true
+Cut("Gopher", "ph") = "Go", "er", true
+Cut("Gopher", "er") = "Goph", "", true
+Cut("Gopher", "Badger") = "Gopher", "", false
+</pre> <h2 id="CutPrefix">func <span>CutPrefix</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func CutPrefix(s, prefix []byte) (after []byte, found bool)</pre> <p>CutPrefix returns s without the provided leading prefix byte slice and reports whether it found the prefix. If s doesn't start with prefix, CutPrefix returns s, false. If prefix is the empty byte slice, CutPrefix returns s, true. </p>
+<p>CutPrefix returns slices of the original slice s, not copies. </p> <h4 id="example_CutPrefix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">show := func(s, sep string) {
+ after, found := bytes.CutPrefix([]byte(s), []byte(sep))
+ fmt.Printf("CutPrefix(%q, %q) = %q, %v\n", s, sep, after, found)
+}
+show("Gopher", "Go")
+show("Gopher", "ph")
+</pre> <p>Output:</p> <pre class="output" data-language="go">CutPrefix("Gopher", "Go") = "pher", true
+CutPrefix("Gopher", "ph") = "Gopher", false
+</pre> <h2 id="CutSuffix">func <span>CutSuffix</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func CutSuffix(s, suffix []byte) (before []byte, found bool)</pre> <p>CutSuffix returns s without the provided ending suffix byte slice and reports whether it found the suffix. If s doesn't end with suffix, CutSuffix returns s, false. If suffix is the empty byte slice, CutSuffix returns s, true. </p>
+<p>CutSuffix returns slices of the original slice s, not copies. </p> <h4 id="example_CutSuffix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">show := func(s, sep string) {
+ before, found := bytes.CutSuffix([]byte(s), []byte(sep))
+ fmt.Printf("CutSuffix(%q, %q) = %q, %v\n", s, sep, before, found)
+}
+show("Gopher", "Go")
+show("Gopher", "er")
+</pre> <p>Output:</p> <pre class="output" data-language="go">CutSuffix("Gopher", "Go") = "Gopher", false
+CutSuffix("Gopher", "er") = "Goph", true
+</pre> <h2 id="Equal">func <span>Equal</span> </h2> <pre data-language="go">func Equal(a, b []byte) bool</pre> <p>Equal reports whether a and b are the same length and contain the same bytes. A nil argument is equivalent to an empty slice. </p> <h4 id="example_Equal"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.Equal([]byte("Go"), []byte("Go")))
+fmt.Println(bytes.Equal([]byte("Go"), []byte("C++")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="EqualFold">func <span>EqualFold</span> </h2> <pre data-language="go">func EqualFold(s, t []byte) bool</pre> <p>EqualFold reports whether s and t, interpreted as UTF-8 strings, are equal under simple Unicode case-folding, which is a more general form of case-insensitivity. </p> <h4 id="example_EqualFold"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.EqualFold([]byte("Go"), []byte("go")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+</pre> <h2 id="Fields">func <span>Fields</span> </h2> <pre data-language="go">func Fields(s []byte) [][]byte</pre> <p>Fields interprets s as a sequence of UTF-8-encoded code points. It splits the slice s around each instance of one or more consecutive white space characters, as defined by unicode.IsSpace, returning a slice of subslices of s or an empty slice if s contains only white space. </p> <h4 id="example_Fields"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("Fields are: %q", bytes.Fields([]byte(" foo bar baz ")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Fields are: ["foo" "bar" "baz"]
+</pre> <h2 id="FieldsFunc">func <span>FieldsFunc</span> </h2> <pre data-language="go">func FieldsFunc(s []byte, f func(rune) bool) [][]byte</pre> <p>FieldsFunc interprets s as a sequence of UTF-8-encoded code points. It splits the slice s at each run of code points c satisfying f(c) and returns a slice of subslices of s. If all code points in s satisfy f(c), or len(s) == 0, an empty slice is returned. </p>
+<p>FieldsFunc makes no guarantees about the order in which it calls f(c) and assumes that f always returns the same value for a given c. </p> <h4 id="example_FieldsFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">f := func(c rune) bool {
+ return !unicode.IsLetter(c) &amp;&amp; !unicode.IsNumber(c)
+}
+fmt.Printf("Fields are: %q", bytes.FieldsFunc([]byte(" foo1;bar2,baz3..."), f))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Fields are: ["foo1" "bar2" "baz3"]
+</pre> <h2 id="HasPrefix">func <span>HasPrefix</span> </h2> <pre data-language="go">func HasPrefix(s, prefix []byte) bool</pre> <p>HasPrefix reports whether the byte slice s begins with prefix. </p> <h4 id="example_HasPrefix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.HasPrefix([]byte("Gopher"), []byte("Go")))
+fmt.Println(bytes.HasPrefix([]byte("Gopher"), []byte("C")))
+fmt.Println(bytes.HasPrefix([]byte("Gopher"), []byte("")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+</pre> <h2 id="HasSuffix">func <span>HasSuffix</span> </h2> <pre data-language="go">func HasSuffix(s, suffix []byte) bool</pre> <p>HasSuffix reports whether the byte slice s ends with suffix. </p> <h4 id="example_HasSuffix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.HasSuffix([]byte("Amigo"), []byte("go")))
+fmt.Println(bytes.HasSuffix([]byte("Amigo"), []byte("O")))
+fmt.Println(bytes.HasSuffix([]byte("Amigo"), []byte("Ami")))
+fmt.Println(bytes.HasSuffix([]byte("Amigo"), []byte("")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+false
+true
+</pre> <h2 id="Index">func <span>Index</span> </h2> <pre data-language="go">func Index(s, sep []byte) int</pre> <p>Index returns the index of the first instance of sep in s, or -1 if sep is not present in s. </p> <h4 id="example_Index"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.Index([]byte("chicken"), []byte("ken")))
+fmt.Println(bytes.Index([]byte("chicken"), []byte("dmr")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">4
+-1
+</pre> <h2 id="IndexAny">func <span>IndexAny</span> </h2> <pre data-language="go">func IndexAny(s []byte, chars string) int</pre> <p>IndexAny interprets s as a sequence of UTF-8-encoded Unicode code points. It returns the byte index of the first occurrence in s of any of the Unicode code points in chars. It returns -1 if chars is empty or if there is no code point in common. </p> <h4 id="example_IndexAny"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.IndexAny([]byte("chicken"), "aeiouy"))
+fmt.Println(bytes.IndexAny([]byte("crwth"), "aeiouy"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">2
+-1
+</pre> <h2 id="IndexByte">func <span>IndexByte</span> </h2> <pre data-language="go">func IndexByte(b []byte, c byte) int</pre> <p>IndexByte returns the index of the first instance of c in b, or -1 if c is not present in b. </p> <h4 id="example_IndexByte"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.IndexByte([]byte("chicken"), byte('k')))
+fmt.Println(bytes.IndexByte([]byte("chicken"), byte('g')))
+</pre> <p>Output:</p> <pre class="output" data-language="go">4
+-1
+</pre> <h2 id="IndexFunc">func <span>IndexFunc</span> </h2> <pre data-language="go">func IndexFunc(s []byte, f func(r rune) bool) int</pre> <p>IndexFunc interprets s as a sequence of UTF-8-encoded code points. It returns the byte index in s of the first Unicode code point satisfying f(c), or -1 if none do. </p> <h4 id="example_IndexFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">f := func(c rune) bool {
+ return unicode.Is(unicode.Han, c)
+}
+fmt.Println(bytes.IndexFunc([]byte("Hello, 世界"), f))
+fmt.Println(bytes.IndexFunc([]byte("Hello, world"), f))
+</pre> <p>Output:</p> <pre class="output" data-language="go">7
+-1
+</pre> <h2 id="IndexRune">func <span>IndexRune</span> </h2> <pre data-language="go">func IndexRune(s []byte, r rune) int</pre> <p>IndexRune interprets s as a sequence of UTF-8-encoded code points. It returns the byte index of the first occurrence in s of the given rune. It returns -1 if rune is not present in s. If r is utf8.RuneError, it returns the first instance of any invalid UTF-8 byte sequence. </p> <h4 id="example_IndexRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.IndexRune([]byte("chicken"), 'k'))
+fmt.Println(bytes.IndexRune([]byte("chicken"), 'd'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">4
+-1
+</pre> <h2 id="Join">func <span>Join</span> </h2> <pre data-language="go">func Join(s [][]byte, sep []byte) []byte</pre> <p>Join concatenates the elements of s to create a new byte slice. The separator sep is placed between elements in the resulting slice. </p> <h4 id="example_Join"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := [][]byte{[]byte("foo"), []byte("bar"), []byte("baz")}
+fmt.Printf("%s", bytes.Join(s, []byte(", ")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">foo, bar, baz
+</pre> <h2 id="LastIndex">func <span>LastIndex</span> </h2> <pre data-language="go">func LastIndex(s, sep []byte) int</pre> <p>LastIndex returns the index of the last instance of sep in s, or -1 if sep is not present in s. </p> <h4 id="example_LastIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.Index([]byte("go gopher"), []byte("go")))
+fmt.Println(bytes.LastIndex([]byte("go gopher"), []byte("go")))
+fmt.Println(bytes.LastIndex([]byte("go gopher"), []byte("rodent")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0
+3
+-1
+</pre> <h2 id="LastIndexAny">func <span>LastIndexAny</span> </h2> <pre data-language="go">func LastIndexAny(s []byte, chars string) int</pre> <p>LastIndexAny interprets s as a sequence of UTF-8-encoded Unicode code points. It returns the byte index of the last occurrence in s of any of the Unicode code points in chars. It returns -1 if chars is empty or if there is no code point in common. </p> <h4 id="example_LastIndexAny"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.LastIndexAny([]byte("go gopher"), "MüQp"))
+fmt.Println(bytes.LastIndexAny([]byte("go 地鼠"), "地大"))
+fmt.Println(bytes.LastIndexAny([]byte("go gopher"), "z,!."))
+</pre> <p>Output:</p> <pre class="output" data-language="go">5
+3
+-1
+</pre> <h2 id="LastIndexByte">func <span>LastIndexByte</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func LastIndexByte(s []byte, c byte) int</pre> <p>LastIndexByte returns the index of the last instance of c in s, or -1 if c is not present in s. </p> <h4 id="example_LastIndexByte"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.LastIndexByte([]byte("go gopher"), byte('g')))
+fmt.Println(bytes.LastIndexByte([]byte("go gopher"), byte('r')))
+fmt.Println(bytes.LastIndexByte([]byte("go gopher"), byte('z')))
+</pre> <p>Output:</p> <pre class="output" data-language="go">3
+8
+-1
+</pre> <h2 id="LastIndexFunc">func <span>LastIndexFunc</span> </h2> <pre data-language="go">func LastIndexFunc(s []byte, f func(r rune) bool) int</pre> <p>LastIndexFunc interprets s as a sequence of UTF-8-encoded code points. It returns the byte index in s of the last Unicode code point satisfying f(c), or -1 if none do. </p> <h4 id="example_LastIndexFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.LastIndexFunc([]byte("go gopher!"), unicode.IsLetter))
+fmt.Println(bytes.LastIndexFunc([]byte("go gopher!"), unicode.IsPunct))
+fmt.Println(bytes.LastIndexFunc([]byte("go gopher!"), unicode.IsNumber))
+</pre> <p>Output:</p> <pre class="output" data-language="go">8
+9
+-1
+</pre> <h2 id="Map">func <span>Map</span> </h2> <pre data-language="go">func Map(mapping func(r rune) rune, s []byte) []byte</pre> <p>Map returns a copy of the byte slice s with all its characters modified according to the mapping function. If mapping returns a negative value, the character is dropped from the byte slice with no replacement. The characters in s and the output are interpreted as UTF-8-encoded code points. </p> <h4 id="example_Map"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">rot13 := func(r rune) rune {
+ switch {
+ case r &gt;= 'A' &amp;&amp; r &lt;= 'Z':
+ return 'A' + (r-'A'+13)%26
+ case r &gt;= 'a' &amp;&amp; r &lt;= 'z':
+ return 'a' + (r-'a'+13)%26
+ }
+ return r
+}
+fmt.Printf("%s\n", bytes.Map(rot13, []byte("'Twas brillig and the slithy gopher...")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">'Gjnf oevyyvt naq gur fyvgul tbcure...
+</pre> <h2 id="Repeat">func <span>Repeat</span> </h2> <pre data-language="go">func Repeat(b []byte, count int) []byte</pre> <p>Repeat returns a new byte slice consisting of count copies of b. </p>
+<p>It panics if count is negative or if the result of (len(b) * count) overflows. </p> <h4 id="example_Repeat"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("ba%s", bytes.Repeat([]byte("na"), 2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">banana
+</pre> <h2 id="Replace">func <span>Replace</span> </h2> <pre data-language="go">func Replace(s, old, new []byte, n int) []byte</pre> <p>Replace returns a copy of the slice s with the first n non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the slice and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune slice. If n &lt; 0, there is no limit on the number of replacements. </p> <h4 id="example_Replace"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%s\n", bytes.Replace([]byte("oink oink oink"), []byte("k"), []byte("ky"), 2))
+fmt.Printf("%s\n", bytes.Replace([]byte("oink oink oink"), []byte("oink"), []byte("moo"), -1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">oinky oinky oink
+moo moo moo
+</pre> <h2 id="ReplaceAll">func <span>ReplaceAll</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func ReplaceAll(s, old, new []byte) []byte</pre> <p>ReplaceAll returns a copy of the slice s with all non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the slice and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune slice. </p> <h4 id="example_ReplaceAll"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%s\n", bytes.ReplaceAll([]byte("oink oink oink"), []byte("oink"), []byte("moo")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">moo moo moo
+</pre> <h2 id="Runes">func <span>Runes</span> </h2> <pre data-language="go">func Runes(s []byte) []rune</pre> <p>Runes interprets s as a sequence of UTF-8-encoded code points. It returns a slice of runes (Unicode code points) equivalent to s. </p> <h4 id="example_Runes"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">rs := bytes.Runes([]byte("go gopher"))
+for _, r := range rs {
+ fmt.Printf("%#U\n", r)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">U+0067 'g'
+U+006F 'o'
+U+0020 ' '
+U+0067 'g'
+U+006F 'o'
+U+0070 'p'
+U+0068 'h'
+U+0065 'e'
+U+0072 'r'
+</pre> <h2 id="Split">func <span>Split</span> </h2> <pre data-language="go">func Split(s, sep []byte) [][]byte</pre> <p>Split slices s into all subslices separated by sep and returns a slice of the subslices between those separators. If sep is empty, Split splits after each UTF-8 sequence. It is equivalent to SplitN with a count of -1. </p>
+<p>To split around the first instance of a separator, see Cut. </p> <h4 id="example_Split"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%q\n", bytes.Split([]byte("a,b,c"), []byte(",")))
+fmt.Printf("%q\n", bytes.Split([]byte("a man a plan a canal panama"), []byte("a ")))
+fmt.Printf("%q\n", bytes.Split([]byte(" xyz "), []byte("")))
+fmt.Printf("%q\n", bytes.Split([]byte(""), []byte("Bernardo O'Higgins")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">["a" "b" "c"]
+["" "man " "plan " "canal panama"]
+[" " "x" "y" "z" " "]
+[""]
+</pre> <h2 id="SplitAfter">func <span>SplitAfter</span> </h2> <pre data-language="go">func SplitAfter(s, sep []byte) [][]byte</pre> <p>SplitAfter slices s into all subslices after each instance of sep and returns a slice of those subslices. If sep is empty, SplitAfter splits after each UTF-8 sequence. It is equivalent to SplitAfterN with a count of -1. </p> <h4 id="example_SplitAfter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%q\n", bytes.SplitAfter([]byte("a,b,c"), []byte(",")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">["a," "b," "c"]
+</pre> <h2 id="SplitAfterN">func <span>SplitAfterN</span> </h2> <pre data-language="go">func SplitAfterN(s, sep []byte, n int) [][]byte</pre> <p>SplitAfterN slices s into subslices after each instance of sep and returns a slice of those subslices. If sep is empty, SplitAfterN splits after each UTF-8 sequence. The count determines the number of subslices to return: </p>
+<pre data-language="go">n &gt; 0: at most n subslices; the last subslice will be the unsplit remainder.
+n == 0: the result is nil (zero subslices)
+n &lt; 0: all subslices
+</pre> <h4 id="example_SplitAfterN"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%q\n", bytes.SplitAfterN([]byte("a,b,c"), []byte(","), 2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">["a," "b,c"]
+</pre> <h2 id="SplitN">func <span>SplitN</span> </h2> <pre data-language="go">func SplitN(s, sep []byte, n int) [][]byte</pre> <p>SplitN slices s into subslices separated by sep and returns a slice of the subslices between those separators. If sep is empty, SplitN splits after each UTF-8 sequence. The count determines the number of subslices to return: </p>
+<pre data-language="go">n &gt; 0: at most n subslices; the last subslice will be the unsplit remainder.
+n == 0: the result is nil (zero subslices)
+n &lt; 0: all subslices
+</pre> <p>To split around the first instance of a separator, see Cut. </p> <h4 id="example_SplitN"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%q\n", bytes.SplitN([]byte("a,b,c"), []byte(","), 2))
+z := bytes.SplitN([]byte("a,b,c"), []byte(","), 0)
+fmt.Printf("%q (nil = %v)\n", z, z == nil)
+</pre> <p>Output:</p> <pre class="output" data-language="go">["a" "b,c"]
+[] (nil = true)
+</pre> <h2 id="Title">func <span>Title</span> </h2> <pre data-language="go">func Title(s []byte) []byte</pre> <p>Title treats s as UTF-8-encoded bytes and returns a copy with all Unicode letters that begin words mapped to their title case. </p>
+<p>Deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. </p> <h4 id="example_Title"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%s", bytes.Title([]byte("her royal highness")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Her Royal Highness
+</pre> <h2 id="ToLower">func <span>ToLower</span> </h2> <pre data-language="go">func ToLower(s []byte) []byte</pre> <p>ToLower returns a copy of the byte slice s with all Unicode letters mapped to their lower case. </p> <h4 id="example_ToLower"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%s", bytes.ToLower([]byte("Gopher")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">gopher
+</pre> <h2 id="ToLowerSpecial">func <span>ToLowerSpecial</span> </h2> <pre data-language="go">func ToLowerSpecial(c unicode.SpecialCase, s []byte) []byte</pre> <p>ToLowerSpecial treats s as UTF-8-encoded bytes and returns a copy with all the Unicode letters mapped to their lower case, giving priority to the special casing rules. </p> <h4 id="example_ToLowerSpecial"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := []byte("AHOJ VÝVOJÁRİ GOLANG")
+totitle := bytes.ToLowerSpecial(unicode.AzeriCase, str)
+fmt.Println("Original : " + string(str))
+fmt.Println("ToLower : " + string(totitle))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Original : AHOJ VÝVOJÁRİ GOLANG
+ToLower : ahoj vývojári golang
+</pre> <h2 id="ToTitle">func <span>ToTitle</span> </h2> <pre data-language="go">func ToTitle(s []byte) []byte</pre> <p>ToTitle treats s as UTF-8-encoded bytes and returns a copy with all the Unicode letters mapped to their title case. </p> <h4 id="example_ToTitle"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%s\n", bytes.ToTitle([]byte("loud noises")))
+fmt.Printf("%s\n", bytes.ToTitle([]byte("хлеб")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">LOUD NOISES
+ХЛЕБ
+</pre> <h2 id="ToTitleSpecial">func <span>ToTitleSpecial</span> </h2> <pre data-language="go">func ToTitleSpecial(c unicode.SpecialCase, s []byte) []byte</pre> <p>ToTitleSpecial treats s as UTF-8-encoded bytes and returns a copy with all the Unicode letters mapped to their title case, giving priority to the special casing rules. </p> <h4 id="example_ToTitleSpecial"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := []byte("ahoj vývojári golang")
+totitle := bytes.ToTitleSpecial(unicode.AzeriCase, str)
+fmt.Println("Original : " + string(str))
+fmt.Println("ToTitle : " + string(totitle))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Original : ahoj vývojári golang
+ToTitle : AHOJ VÝVOJÁRİ GOLANG
+</pre> <h2 id="ToUpper">func <span>ToUpper</span> </h2> <pre data-language="go">func ToUpper(s []byte) []byte</pre> <p>ToUpper returns a copy of the byte slice s with all Unicode letters mapped to their upper case. </p> <h4 id="example_ToUpper"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%s", bytes.ToUpper([]byte("Gopher")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">GOPHER
+</pre> <h2 id="ToUpperSpecial">func <span>ToUpperSpecial</span> </h2> <pre data-language="go">func ToUpperSpecial(c unicode.SpecialCase, s []byte) []byte</pre> <p>ToUpperSpecial treats s as UTF-8-encoded bytes and returns a copy with all the Unicode letters mapped to their upper case, giving priority to the special casing rules. </p> <h4 id="example_ToUpperSpecial"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := []byte("ahoj vývojári golang")
+totitle := bytes.ToUpperSpecial(unicode.AzeriCase, str)
+fmt.Println("Original : " + string(str))
+fmt.Println("ToUpper : " + string(totitle))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Original : ahoj vývojári golang
+ToUpper : AHOJ VÝVOJÁRİ GOLANG
+</pre> <h2 id="ToValidUTF8">func <span>ToValidUTF8</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func ToValidUTF8(s, replacement []byte) []byte</pre> <p>ToValidUTF8 treats s as UTF-8-encoded bytes and returns a copy with each run of bytes representing invalid UTF-8 replaced with the bytes in replacement, which may be empty. </p> <h4 id="example_ToValidUTF8"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%s\n", bytes.ToValidUTF8([]byte("abc"), []byte("\uFFFD")))
+fmt.Printf("%s\n", bytes.ToValidUTF8([]byte("a\xffb\xC0\xAFc\xff"), []byte("")))
+fmt.Printf("%s\n", bytes.ToValidUTF8([]byte("\xed\xa0\x80"), []byte("abc")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">abc
+abc
+abc
+</pre> <h2 id="Trim">func <span>Trim</span> </h2> <pre data-language="go">func Trim(s []byte, cutset string) []byte</pre> <p>Trim returns a subslice of s by slicing off all leading and trailing UTF-8-encoded code points contained in cutset. </p> <h4 id="example_Trim"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("[%q]", bytes.Trim([]byte(" !!! Achtung! Achtung! !!! "), "! "))
+</pre> <p>Output:</p> <pre class="output" data-language="go">["Achtung! Achtung"]
+</pre> <h2 id="TrimFunc">func <span>TrimFunc</span> </h2> <pre data-language="go">func TrimFunc(s []byte, f func(r rune) bool) []byte</pre> <p>TrimFunc returns a subslice of s by slicing off all leading and trailing UTF-8-encoded code points c that satisfy f(c). </p> <h4 id="example_TrimFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(string(bytes.TrimFunc([]byte("go-gopher!"), unicode.IsLetter)))
+fmt.Println(string(bytes.TrimFunc([]byte("\"go-gopher!\""), unicode.IsLetter)))
+fmt.Println(string(bytes.TrimFunc([]byte("go-gopher!"), unicode.IsPunct)))
+fmt.Println(string(bytes.TrimFunc([]byte("1234go-gopher!567"), unicode.IsNumber)))
+</pre> <p>Output:</p> <pre class="output" data-language="go">-gopher!
+"go-gopher!"
+go-gopher
+go-gopher!
+</pre> <h2 id="TrimLeft">func <span>TrimLeft</span> </h2> <pre data-language="go">func TrimLeft(s []byte, cutset string) []byte</pre> <p>TrimLeft returns a subslice of s by slicing off all leading UTF-8-encoded code points contained in cutset. </p> <h4 id="example_TrimLeft"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Print(string(bytes.TrimLeft([]byte("453gopher8257"), "0123456789")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">gopher8257
+</pre> <h2 id="TrimLeftFunc">func <span>TrimLeftFunc</span> </h2> <pre data-language="go">func TrimLeftFunc(s []byte, f func(r rune) bool) []byte</pre> <p>TrimLeftFunc treats s as UTF-8-encoded bytes and returns a subslice of s by slicing off all leading UTF-8-encoded code points c that satisfy f(c). </p> <h4 id="example_TrimLeftFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(string(bytes.TrimLeftFunc([]byte("go-gopher"), unicode.IsLetter)))
+fmt.Println(string(bytes.TrimLeftFunc([]byte("go-gopher!"), unicode.IsPunct)))
+fmt.Println(string(bytes.TrimLeftFunc([]byte("1234go-gopher!567"), unicode.IsNumber)))
+</pre> <p>Output:</p> <pre class="output" data-language="go">-gopher
+go-gopher!
+go-gopher!567
+</pre> <h2 id="TrimPrefix">func <span>TrimPrefix</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func TrimPrefix(s, prefix []byte) []byte</pre> <p>TrimPrefix returns s without the provided leading prefix string. If s doesn't start with prefix, s is returned unchanged. </p> <h4 id="example_TrimPrefix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var b = []byte("Goodbye,, world!")
+b = bytes.TrimPrefix(b, []byte("Goodbye,"))
+b = bytes.TrimPrefix(b, []byte("See ya,"))
+fmt.Printf("Hello%s", b)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, world!
+</pre> <h2 id="TrimRight">func <span>TrimRight</span> </h2> <pre data-language="go">func TrimRight(s []byte, cutset string) []byte</pre> <p>TrimRight returns a subslice of s by slicing off all trailing UTF-8-encoded code points that are contained in cutset. </p> <h4 id="example_TrimRight"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Print(string(bytes.TrimRight([]byte("453gopher8257"), "0123456789")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">453gopher
+</pre> <h2 id="TrimRightFunc">func <span>TrimRightFunc</span> </h2> <pre data-language="go">func TrimRightFunc(s []byte, f func(r rune) bool) []byte</pre> <p>TrimRightFunc returns a subslice of s by slicing off all trailing UTF-8-encoded code points c that satisfy f(c). </p> <h4 id="example_TrimRightFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(string(bytes.TrimRightFunc([]byte("go-gopher"), unicode.IsLetter)))
+fmt.Println(string(bytes.TrimRightFunc([]byte("go-gopher!"), unicode.IsPunct)))
+fmt.Println(string(bytes.TrimRightFunc([]byte("1234go-gopher!567"), unicode.IsNumber)))
+</pre> <p>Output:</p> <pre class="output" data-language="go">go-
+go-gopher
+1234go-gopher!
+</pre> <h2 id="TrimSpace">func <span>TrimSpace</span> </h2> <pre data-language="go">func TrimSpace(s []byte) []byte</pre> <p>TrimSpace returns a subslice of s by slicing off all leading and trailing white space, as defined by Unicode. </p> <h4 id="example_TrimSpace"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%s", bytes.TrimSpace([]byte(" \t\n a lone gopher \n\t\r\n")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">a lone gopher
+</pre> <h2 id="TrimSuffix">func <span>TrimSuffix</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func TrimSuffix(s, suffix []byte) []byte</pre> <p>TrimSuffix returns s without the provided trailing suffix string. If s doesn't end with suffix, s is returned unchanged. </p> <h4 id="example_TrimSuffix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var b = []byte("Hello, goodbye, etc!")
+b = bytes.TrimSuffix(b, []byte("goodbye, etc!"))
+b = bytes.TrimSuffix(b, []byte("gopher"))
+b = append(b, bytes.TrimSuffix([]byte("world!"), []byte("x!"))...)
+os.Stdout.Write(b)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, world!
+</pre> <h2 id="Buffer">type <span>Buffer</span> </h2> <p>A Buffer is a variable-sized buffer of bytes with <a href="#Buffer.Read">Buffer.Read</a> and <a href="#Buffer.Write">Buffer.Write</a> methods. The zero value for Buffer is an empty buffer ready to use. </p>
+<pre data-language="go">type Buffer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Buffer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var b bytes.Buffer // A Buffer needs no initialization.
+b.Write([]byte("Hello "))
+fmt.Fprintf(&amp;b, "world!")
+b.WriteTo(os.Stdout)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello world!
+</pre> <h4 id="example_Buffer_reader"> <span class="text">Example (Reader)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// A Buffer can turn a string or a []byte into an io.Reader.
+buf := bytes.NewBufferString("R29waGVycyBydWxlIQ==")
+dec := base64.NewDecoder(base64.StdEncoding, buf)
+io.Copy(os.Stdout, dec)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Gophers rule!
+</pre> <h3 id="NewBuffer">func <span>NewBuffer</span> </h3> <pre data-language="go">func NewBuffer(buf []byte) *Buffer</pre> <p>NewBuffer creates and initializes a new <a href="#Buffer">Buffer</a> using buf as its initial contents. The new <a href="#Buffer">Buffer</a> takes ownership of buf, and the caller should not use buf after this call. NewBuffer is intended to prepare a <a href="#Buffer">Buffer</a> to read existing data. It can also be used to set the initial size of the internal buffer for writing. To do that, buf should have the desired capacity but a length of zero. </p>
+<p>In most cases, new(<a href="#Buffer">Buffer</a>) (or just declaring a <a href="#Buffer">Buffer</a> variable) is sufficient to initialize a <a href="#Buffer">Buffer</a>. </p>
+<h3 id="NewBufferString">func <span>NewBufferString</span> </h3> <pre data-language="go">func NewBufferString(s string) *Buffer</pre> <p>NewBufferString creates and initializes a new <a href="#Buffer">Buffer</a> using string s as its initial contents. It is intended to prepare a buffer to read an existing string. </p>
+<p>In most cases, new(<a href="#Buffer">Buffer</a>) (or just declaring a <a href="#Buffer">Buffer</a> variable) is sufficient to initialize a <a href="#Buffer">Buffer</a>. </p>
+<h3 id="Buffer.Available">func (*Buffer) <span>Available</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (b *Buffer) Available() int</pre> <p>Available returns how many bytes are unused in the buffer. </p>
+<h3 id="Buffer.AvailableBuffer">func (*Buffer) <span>AvailableBuffer</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (b *Buffer) AvailableBuffer() []byte</pre> <p>AvailableBuffer returns an empty buffer with b.Available() capacity. This buffer is intended to be appended to and passed to an immediately succeeding <a href="#Buffer.Write">Buffer.Write</a> call. The buffer is only valid until the next write operation on b. </p> <h4 id="example_Buffer_AvailableBuffer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var buf bytes.Buffer
+for i := 0; i &lt; 4; i++ {
+ b := buf.AvailableBuffer()
+ b = strconv.AppendInt(b, int64(i), 10)
+ b = append(b, ' ')
+ buf.Write(b)
+}
+os.Stdout.Write(buf.Bytes())
+</pre> <p>Output:</p> <pre class="output" data-language="go">0 1 2 3
+</pre> <h3 id="Buffer.Bytes">func (*Buffer) <span>Bytes</span> </h3> <pre data-language="go">func (b *Buffer) Bytes() []byte</pre> <p>Bytes returns a slice of length b.Len() holding the unread portion of the buffer. The slice is valid for use only until the next buffer modification (that is, only until the next call to a method like <a href="#Buffer.Read">Buffer.Read</a>, <a href="#Buffer.Write">Buffer.Write</a>, <a href="#Buffer.Reset">Buffer.Reset</a>, or <a href="#Buffer.Truncate">Buffer.Truncate</a>). The slice aliases the buffer content at least until the next buffer modification, so immediate changes to the slice will affect the result of future reads. </p> <h4 id="example_Buffer_Bytes"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf := bytes.Buffer{}
+buf.Write([]byte{'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'})
+os.Stdout.Write(buf.Bytes())
+</pre> <p>Output:</p> <pre class="output" data-language="go">hello world
+</pre> <h3 id="Buffer.Cap">func (*Buffer) <span>Cap</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (b *Buffer) Cap() int</pre> <p>Cap returns the capacity of the buffer's underlying byte slice, that is, the total space allocated for the buffer's data. </p> <h4 id="example_Buffer_Cap"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf1 := bytes.NewBuffer(make([]byte, 10))
+buf2 := bytes.NewBuffer(make([]byte, 0, 10))
+fmt.Println(buf1.Cap())
+fmt.Println(buf2.Cap())
+</pre> <p>Output:</p> <pre class="output" data-language="go">10
+10
+</pre> <h3 id="Buffer.Grow">func (*Buffer) <span>Grow</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (b *Buffer) Grow(n int)</pre> <p>Grow grows the buffer's capacity, if necessary, to guarantee space for another n bytes. After Grow(n), at least n bytes can be written to the buffer without another allocation. If n is negative, Grow will panic. If the buffer can't grow it will panic with <a href="#ErrTooLarge">ErrTooLarge</a>. </p> <h4 id="example_Buffer_Grow"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var b bytes.Buffer
+b.Grow(64)
+bb := b.Bytes()
+b.Write([]byte("64 bytes or fewer"))
+fmt.Printf("%q", bb[:b.Len()])
+</pre> <p>Output:</p> <pre class="output" data-language="go">"64 bytes or fewer"
+</pre> <h3 id="Buffer.Len">func (*Buffer) <span>Len</span> </h3> <pre data-language="go">func (b *Buffer) Len() int</pre> <p>Len returns the number of bytes of the unread portion of the buffer; b.Len() == len(b.Bytes()). </p> <h4 id="example_Buffer_Len"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var b bytes.Buffer
+b.Grow(64)
+b.Write([]byte("abcde"))
+fmt.Printf("%d", b.Len())
+</pre> <p>Output:</p> <pre class="output" data-language="go">5
+</pre> <h3 id="Buffer.Next">func (*Buffer) <span>Next</span> </h3> <pre data-language="go">func (b *Buffer) Next(n int) []byte</pre> <p>Next returns a slice containing the next n bytes from the buffer, advancing the buffer as if the bytes had been returned by <a href="#Buffer.Read">Buffer.Read</a>. If there are fewer than n bytes in the buffer, Next returns the entire buffer. The slice is only valid until the next call to a read or write method. </p> <h4 id="example_Buffer_Next"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var b bytes.Buffer
+b.Grow(64)
+b.Write([]byte("abcde"))
+fmt.Printf("%s\n", b.Next(2))
+fmt.Printf("%s\n", b.Next(2))
+fmt.Printf("%s", b.Next(2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">ab
+cd
+e
+</pre> <h3 id="Buffer.Read">func (*Buffer) <span>Read</span> </h3> <pre data-language="go">func (b *Buffer) Read(p []byte) (n int, err error)</pre> <p>Read reads the next len(p) bytes from the buffer or until the buffer is drained. The return value n is the number of bytes read. If the buffer has no data to return, err is io.EOF (unless len(p) is zero); otherwise it is nil. </p> <h4 id="example_Buffer_Read"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+var b bytes.Buffer
+b.Grow(64)
+b.Write([]byte("abcde"))
+rdbuf := make([]byte, 1)
+n, err := b.Read(rdbuf)
+if err != nil {
+ panic(err)
+}
+fmt.Println(n)
+fmt.Println(b.String())
+fmt.Println(string(rdbuf))
+// Output
+// 1
+// bcde
+// a
+</pre> <h3 id="Buffer.ReadByte">func (*Buffer) <span>ReadByte</span> </h3> <pre data-language="go">func (b *Buffer) ReadByte() (byte, error)</pre> <p>ReadByte reads and returns the next byte from the buffer. If no byte is available, it returns error io.EOF. </p> <h4 id="example_Buffer_ReadByte"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+var b bytes.Buffer
+b.Grow(64)
+b.Write([]byte("abcde"))
+c, err := b.ReadByte()
+if err != nil {
+ panic(err)
+}
+fmt.Println(c)
+fmt.Println(b.String())
+// Output
+// 97
+// bcde
+</pre> <h3 id="Buffer.ReadBytes">func (*Buffer) <span>ReadBytes</span> </h3> <pre data-language="go">func (b *Buffer) ReadBytes(delim byte) (line []byte, err error)</pre> <p>ReadBytes reads until the first occurrence of delim in the input, returning a slice containing the data up to and including the delimiter. If ReadBytes encounters an error before finding a delimiter, it returns the data read before the error and the error itself (often io.EOF). ReadBytes returns err != nil if and only if the returned data does not end in delim. </p>
+<h3 id="Buffer.ReadFrom">func (*Buffer) <span>ReadFrom</span> </h3> <pre data-language="go">func (b *Buffer) ReadFrom(r io.Reader) (n int64, err error)</pre> <p>ReadFrom reads data from r until EOF and appends it to the buffer, growing the buffer as needed. The return value n is the number of bytes read. Any error except io.EOF encountered during the read is also returned. If the buffer becomes too large, ReadFrom will panic with <a href="#ErrTooLarge">ErrTooLarge</a>. </p>
+<h3 id="Buffer.ReadRune">func (*Buffer) <span>ReadRune</span> </h3> <pre data-language="go">func (b *Buffer) ReadRune() (r rune, size int, err error)</pre> <p>ReadRune reads and returns the next UTF-8-encoded Unicode code point from the buffer. If no bytes are available, the error returned is io.EOF. If the bytes are an erroneous UTF-8 encoding, it consumes one byte and returns U+FFFD, 1. </p>
+<h3 id="Buffer.ReadString">func (*Buffer) <span>ReadString</span> </h3> <pre data-language="go">func (b *Buffer) ReadString(delim byte) (line string, err error)</pre> <p>ReadString reads until the first occurrence of delim in the input, returning a string containing the data up to and including the delimiter. If ReadString encounters an error before finding a delimiter, it returns the data read before the error and the error itself (often io.EOF). ReadString returns err != nil if and only if the returned data does not end in delim. </p>
+<h3 id="Buffer.Reset">func (*Buffer) <span>Reset</span> </h3> <pre data-language="go">func (b *Buffer) Reset()</pre> <p>Reset resets the buffer to be empty, but it retains the underlying storage for use by future writes. Reset is the same as <a href="#Buffer.Truncate">Buffer.Truncate</a>(0). </p>
+<h3 id="Buffer.String">func (*Buffer) <span>String</span> </h3> <pre data-language="go">func (b *Buffer) String() string</pre> <p>String returns the contents of the unread portion of the buffer as a string. If the <a href="#Buffer">Buffer</a> is a nil pointer, it returns "&lt;nil&gt;". </p>
+<p>To build strings more efficiently, see the strings.Builder type. </p>
+<h3 id="Buffer.Truncate">func (*Buffer) <span>Truncate</span> </h3> <pre data-language="go">func (b *Buffer) Truncate(n int)</pre> <p>Truncate discards all but the first n unread bytes from the buffer but continues to use the same allocated storage. It panics if n is negative or greater than the length of the buffer. </p>
+<h3 id="Buffer.UnreadByte">func (*Buffer) <span>UnreadByte</span> </h3> <pre data-language="go">func (b *Buffer) UnreadByte() error</pre> <p>UnreadByte unreads the last byte returned by the most recent successful read operation that read at least one byte. If a write has happened since the last read, if the last read returned an error, or if the read read zero bytes, UnreadByte returns an error. </p>
+<h3 id="Buffer.UnreadRune">func (*Buffer) <span>UnreadRune</span> </h3> <pre data-language="go">func (b *Buffer) UnreadRune() error</pre> <p>UnreadRune unreads the last rune returned by <a href="#Buffer.ReadRune">Buffer.ReadRune</a>. If the most recent read or write operation on the buffer was not a successful <a href="#Buffer.ReadRune">Buffer.ReadRune</a>, UnreadRune returns an error. (In this regard it is stricter than <a href="#Buffer.UnreadByte">Buffer.UnreadByte</a>, which will unread the last byte from any read operation.) </p>
+<h3 id="Buffer.Write">func (*Buffer) <span>Write</span> </h3> <pre data-language="go">func (b *Buffer) Write(p []byte) (n int, err error)</pre> <p>Write appends the contents of p to the buffer, growing the buffer as needed. The return value n is the length of p; err is always nil. If the buffer becomes too large, Write will panic with <a href="#ErrTooLarge">ErrTooLarge</a>. </p>
+<h3 id="Buffer.WriteByte">func (*Buffer) <span>WriteByte</span> </h3> <pre data-language="go">func (b *Buffer) WriteByte(c byte) error</pre> <p>WriteByte appends the byte c to the buffer, growing the buffer as needed. The returned error is always nil, but is included to match <span>bufio.Writer</span>'s WriteByte. If the buffer becomes too large, WriteByte will panic with <a href="#ErrTooLarge">ErrTooLarge</a>. </p>
+<h3 id="Buffer.WriteRune">func (*Buffer) <span>WriteRune</span> </h3> <pre data-language="go">func (b *Buffer) WriteRune(r rune) (n int, err error)</pre> <p>WriteRune appends the UTF-8 encoding of Unicode code point r to the buffer, returning its length and an error, which is always nil but is included to match <span>bufio.Writer</span>'s WriteRune. The buffer is grown as needed; if it becomes too large, WriteRune will panic with <a href="#ErrTooLarge">ErrTooLarge</a>. </p>
+<h3 id="Buffer.WriteString">func (*Buffer) <span>WriteString</span> </h3> <pre data-language="go">func (b *Buffer) WriteString(s string) (n int, err error)</pre> <p>WriteString appends the contents of s to the buffer, growing the buffer as needed. The return value n is the length of s; err is always nil. If the buffer becomes too large, WriteString will panic with <a href="#ErrTooLarge">ErrTooLarge</a>. </p>
+<h3 id="Buffer.WriteTo">func (*Buffer) <span>WriteTo</span> </h3> <pre data-language="go">func (b *Buffer) WriteTo(w io.Writer) (n int64, err error)</pre> <p>WriteTo writes data to w until the buffer is drained or an error occurs. The return value n is the number of bytes written; it always fits into an int, but it is int64 to match the io.WriterTo interface. Any error encountered during the write is also returned. </p>
+<h2 id="Reader">type <span>Reader</span> </h2> <p>A Reader implements the io.Reader, io.ReaderAt, io.WriterTo, io.Seeker, io.ByteScanner, and io.RuneScanner interfaces by reading from a byte slice. Unlike a <a href="#Buffer">Buffer</a>, a Reader is read-only and supports seeking. The zero value for Reader operates like a Reader of an empty slice. </p>
+<pre data-language="go">type Reader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewReader">func <span>NewReader</span> </h3> <pre data-language="go">func NewReader(b []byte) *Reader</pre> <p>NewReader returns a new [Reader.Reader] reading from b. </p>
+<h3 id="Reader.Len">func (*Reader) <span>Len</span> </h3> <pre data-language="go">func (r *Reader) Len() int</pre> <p>Len returns the number of bytes of the unread portion of the slice. </p> <h4 id="example_Reader_Len"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(bytes.NewReader([]byte("Hi!")).Len())
+fmt.Println(bytes.NewReader([]byte("こんにちは!")).Len())
+</pre> <p>Output:</p> <pre class="output" data-language="go">3
+16
+</pre> <h3 id="Reader.Read">func (*Reader) <span>Read</span> </h3> <pre data-language="go">func (r *Reader) Read(b []byte) (n int, err error)</pre> <p>Read implements the <span>io.Reader</span> interface. </p>
+<h3 id="Reader.ReadAt">func (*Reader) <span>ReadAt</span> </h3> <pre data-language="go">func (r *Reader) ReadAt(b []byte, off int64) (n int, err error)</pre> <p>ReadAt implements the <span>io.ReaderAt</span> interface. </p>
+<h3 id="Reader.ReadByte">func (*Reader) <span>ReadByte</span> </h3> <pre data-language="go">func (r *Reader) ReadByte() (byte, error)</pre> <p>ReadByte implements the <span>io.ByteReader</span> interface. </p>
+<h3 id="Reader.ReadRune">func (*Reader) <span>ReadRune</span> </h3> <pre data-language="go">func (r *Reader) ReadRune() (ch rune, size int, err error)</pre> <p>ReadRune implements the <span>io.RuneReader</span> interface. </p>
+<h3 id="Reader.Reset">func (*Reader) <span>Reset</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (r *Reader) Reset(b []byte)</pre> <p>Reset resets the [Reader.Reader] to be reading from b. </p>
+<h3 id="Reader.Seek">func (*Reader) <span>Seek</span> </h3> <pre data-language="go">func (r *Reader) Seek(offset int64, whence int) (int64, error)</pre> <p>Seek implements the <span>io.Seeker</span> interface. </p>
+<h3 id="Reader.Size">func (*Reader) <span>Size</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r *Reader) Size() int64</pre> <p>Size returns the original length of the underlying byte slice. Size is the number of bytes available for reading via <a href="#Reader.ReadAt">Reader.ReadAt</a>. The result is unaffected by any method calls except <a href="#Reader.Reset">Reader.Reset</a>. </p>
+<h3 id="Reader.UnreadByte">func (*Reader) <span>UnreadByte</span> </h3> <pre data-language="go">func (r *Reader) UnreadByte() error</pre> <p>UnreadByte complements <a href="#Reader.ReadByte">Reader.ReadByte</a> in implementing the <span>io.ByteScanner</span> interface. </p>
+<h3 id="Reader.UnreadRune">func (*Reader) <span>UnreadRune</span> </h3> <pre data-language="go">func (r *Reader) UnreadRune() error</pre> <p>UnreadRune complements <a href="#Reader.ReadRune">Reader.ReadRune</a> in implementing the <span>io.RuneScanner</span> interface. </p>
+<h3 id="Reader.WriteTo">func (*Reader) <span>WriteTo</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (r *Reader) WriteTo(w io.Writer) (n int64, err error)</pre> <p>WriteTo implements the <span>io.WriterTo</span> interface. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/bytes/" class="_attribution-link">http://golang.org/pkg/bytes/</a>
+ </p>
+</div>
diff --git a/devdocs/go/cmp%2Findex.html b/devdocs/go/cmp%2Findex.html
new file mode 100644
index 00000000..d13c7f2c
--- /dev/null
+++ b/devdocs/go/cmp%2Findex.html
@@ -0,0 +1,73 @@
+<h1> Package cmp </h1> <ul id="short-nav">
+<li><code>import "cmp"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package cmp provides types and functions related to comparing ordered values. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Compare">func Compare[T Ordered](x, y T) int</a></li>
+<li><a href="#Less">func Less[T Ordered](x, y T) bool</a></li>
+<li><a href="#Or">func Or[T comparable](vals ...T) T</a></li>
+<li><a href="#Ordered">type Ordered</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Or">Or</a></dd> <dd><a class="exampleLink" href="#example_Or_sort">Or (Sort)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>cmp.go</span> </p> <h2 id="Compare">func <span>Compare</span> </h2> <pre data-language="go">func Compare[T Ordered](x, y T) int</pre> <p>Compare returns </p>
+<pre data-language="go">-1 if x is less than y,
+ 0 if x equals y,
++1 if x is greater than y.
+</pre> <p>For floating-point types, a NaN is considered less than any non-NaN, a NaN is considered equal to a NaN, and -0.0 is equal to 0.0. </p>
+<h2 id="Less">func <span>Less</span> </h2> <pre data-language="go">func Less[T Ordered](x, y T) bool</pre> <p>Less reports whether x is less than y. For floating-point types, a NaN is considered less than any non-NaN, and -0.0 is not less than (is equal to) 0.0. </p>
+<h2 id="Or">func <span>Or</span> </h2> <pre data-language="go">func Or[T comparable](vals ...T) T</pre> <p>Or returns the first of its arguments that is not equal to the zero value. If no argument is non-zero, it returns the zero value. </p> <h4 id="example_Or"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Suppose we have some user input
+// that may or may not be an empty string
+userInput1 := ""
+userInput2 := "some text"
+
+fmt.Println(cmp.Or(userInput1, "default"))
+fmt.Println(cmp.Or(userInput2, "default"))
+fmt.Println(cmp.Or(userInput1, userInput2, "default"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">default
+some text
+some text
+</pre> <h4 id="example_Or_sort"> <span class="text">Example (Sort)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type Order struct {
+ Product string
+ Customer string
+ Price float64
+}
+orders := []Order{
+ {"foo", "alice", 1.00},
+ {"bar", "bob", 3.00},
+ {"baz", "carol", 4.00},
+ {"foo", "alice", 2.00},
+ {"bar", "carol", 1.00},
+ {"foo", "bob", 4.00},
+}
+// Sort by customer first, product second, and last by higher price
+slices.SortFunc(orders, func(a, b Order) int {
+ return cmp.Or(
+ cmp.Compare(a.Customer, b.Customer),
+ cmp.Compare(a.Product, b.Product),
+ cmp.Compare(b.Price, a.Price),
+ )
+})
+for _, order := range orders {
+ fmt.Printf("%s %s %.2f\n", order.Product, order.Customer, order.Price)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">foo alice 2.00
+foo alice 1.00
+bar bob 3.00
+foo bob 4.00
+bar carol 1.00
+baz carol 4.00
+</pre> <h2 id="Ordered">type <span>Ordered</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>Ordered is a constraint that permits any ordered type: any type that supports the operators &lt; &lt;= &gt;= &gt;. If future releases of Go add new ordered types, this constraint will be modified to include them. </p>
+<p>Note that floating-point types may contain NaN ("not-a-number") values. An operator such as == or &lt; will always report false when comparing a NaN value with any other value, NaN or not. See the <a href="#Compare">Compare</a> function for a consistent way to compare NaN values. </p>
+<pre data-language="go">type Ordered interface {
+ ~int | ~int8 | ~int16 | ~int32 | ~int64 |
+ ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
+ ~float32 | ~float64 |
+ ~string
+}</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/cmp/" class="_attribution-link">http://golang.org/pkg/cmp/</a>
+ </p>
+</div>
diff --git a/devdocs/go/compress%2Fbzip2%2Findex.html b/devdocs/go/compress%2Fbzip2%2Findex.html
new file mode 100644
index 00000000..523f71cb
--- /dev/null
+++ b/devdocs/go/compress%2Fbzip2%2Findex.html
@@ -0,0 +1,17 @@
+<h1> Package bzip2 </h1> <ul id="short-nav">
+<li><code>import "compress/bzip2"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package bzip2 implements bzip2 decompression. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#NewReader">func NewReader(r io.Reader) io.Reader</a></li>
+<li><a href="#StructuralError">type StructuralError</a></li>
+<li> <a href="#StructuralError.Error">func (s StructuralError) Error() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>bit_reader.go</span> <span>bzip2.go</span> <span>huffman.go</span> <span>move_to_front.go</span> </p> <h2 id="NewReader">func <span>NewReader</span> </h2> <pre data-language="go">func NewReader(r io.Reader) io.Reader</pre> <p>NewReader returns an io.Reader which decompresses bzip2 data from r. If r does not also implement <span>io.ByteReader</span>, the decompressor may read more data than necessary from r. </p>
+<h2 id="StructuralError">type <span>StructuralError</span> </h2> <p>A StructuralError is returned when the bzip2 data is found to be syntactically invalid. </p>
+<pre data-language="go">type StructuralError string</pre> <h3 id="StructuralError.Error">func (StructuralError) <span>Error</span> </h3> <pre data-language="go">func (s StructuralError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/compress/bzip2/" class="_attribution-link">http://golang.org/pkg/compress/bzip2/</a>
+ </p>
+</div>
diff --git a/devdocs/go/compress%2Fflate%2Findex.html b/devdocs/go/compress%2Fflate%2Findex.html
new file mode 100644
index 00000000..88631066
--- /dev/null
+++ b/devdocs/go/compress%2Fflate%2Findex.html
@@ -0,0 +1,307 @@
+<h1> Package flate </h1> <ul id="short-nav">
+<li><code>import "compress/flate"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package flate implements the DEFLATE compressed data format, described in RFC 1951. The gzip and zlib packages implement access to DEFLATE-based file formats. </p> <h4 id="example__dictionary"> <span class="text">Example (Dictionary)</span>
+</h4> <p>A preset dictionary can be used to improve the compression ratio. The downside to using a dictionary is that the compressor and decompressor must agree in advance what dictionary to use. </p> <p>Code:</p> <pre class="code" data-language="go">// The dictionary is a string of bytes. When compressing some input data,
+// the compressor will attempt to substitute substrings with matches found
+// in the dictionary. As such, the dictionary should only contain substrings
+// that are expected to be found in the actual data stream.
+const dict = `&lt;?xml version="1.0"?&gt;` + `&lt;book&gt;` + `&lt;data&gt;` + `&lt;meta name="` + `" content="`
+
+// The data to compress should (but is not required to) contain frequent
+// substrings that match those in the dictionary.
+const data = `&lt;?xml version="1.0"?&gt;
+&lt;book&gt;
+ &lt;meta name="title" content="The Go Programming Language"/&gt;
+ &lt;meta name="authors" content="Alan Donovan and Brian Kernighan"/&gt;
+ &lt;meta name="published" content="2015-10-26"/&gt;
+ &lt;meta name="isbn" content="978-0134190440"/&gt;
+ &lt;data&gt;...&lt;/data&gt;
+&lt;/book&gt;
+`
+
+var b bytes.Buffer
+
+// Compress the data using the specially crafted dictionary.
+zw, err := flate.NewWriterDict(&amp;b, flate.DefaultCompression, []byte(dict))
+if err != nil {
+ log.Fatal(err)
+}
+if _, err := io.Copy(zw, strings.NewReader(data)); err != nil {
+ log.Fatal(err)
+}
+if err := zw.Close(); err != nil {
+ log.Fatal(err)
+}
+
+// The decompressor must use the same dictionary as the compressor.
+// Otherwise, the input may appear as corrupted.
+fmt.Println("Decompressed output using the dictionary:")
+zr := flate.NewReaderDict(bytes.NewReader(b.Bytes()), []byte(dict))
+if _, err := io.Copy(os.Stdout, zr); err != nil {
+ log.Fatal(err)
+}
+if err := zr.Close(); err != nil {
+ log.Fatal(err)
+}
+
+fmt.Println()
+
+// Substitute all of the bytes in the dictionary with a '#' to visually
+// demonstrate the approximate effectiveness of using a preset dictionary.
+fmt.Println("Substrings matched by the dictionary are marked with #:")
+hashDict := []byte(dict)
+for i := range hashDict {
+ hashDict[i] = '#'
+}
+zr = flate.NewReaderDict(&amp;b, hashDict)
+if _, err := io.Copy(os.Stdout, zr); err != nil {
+ log.Fatal(err)
+}
+if err := zr.Close(); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Decompressed output using the dictionary:
+&lt;?xml version="1.0"?&gt;
+&lt;book&gt;
+ &lt;meta name="title" content="The Go Programming Language"/&gt;
+ &lt;meta name="authors" content="Alan Donovan and Brian Kernighan"/&gt;
+ &lt;meta name="published" content="2015-10-26"/&gt;
+ &lt;meta name="isbn" content="978-0134190440"/&gt;
+ &lt;data&gt;...&lt;/data&gt;
+&lt;/book&gt;
+
+Substrings matched by the dictionary are marked with #:
+#####################
+######
+ ############title###########The Go Programming Language"/#
+ ############authors###########Alan Donovan and Brian Kernighan"/#
+ ############published###########2015-10-26"/#
+ ############isbn###########978-0134190440"/#
+ ######...&lt;/#####
+&lt;/#####
+</pre> <h4 id="example__reset"> <span class="text">Example (Reset)</span>
+</h4> <p>In performance critical applications, Reset can be used to discard the current compressor or decompressor state and reinitialize them quickly by taking advantage of previously allocated memory. </p> <p>Code:</p> <pre class="code" data-language="go">proverbs := []string{
+ "Don't communicate by sharing memory, share memory by communicating.\n",
+ "Concurrency is not parallelism.\n",
+ "The bigger the interface, the weaker the abstraction.\n",
+ "Documentation is for users.\n",
+}
+
+var r strings.Reader
+var b bytes.Buffer
+buf := make([]byte, 32&lt;&lt;10)
+
+zw, err := flate.NewWriter(nil, flate.DefaultCompression)
+if err != nil {
+ log.Fatal(err)
+}
+zr := flate.NewReader(nil)
+
+for _, s := range proverbs {
+ r.Reset(s)
+ b.Reset()
+
+ // Reset the compressor and encode from some input stream.
+ zw.Reset(&amp;b)
+ if _, err := io.CopyBuffer(zw, &amp;r, buf); err != nil {
+ log.Fatal(err)
+ }
+ if err := zw.Close(); err != nil {
+ log.Fatal(err)
+ }
+
+ // Reset the decompressor and decode to some output stream.
+ if err := zr.(flate.Resetter).Reset(&amp;b, nil); err != nil {
+ log.Fatal(err)
+ }
+ if _, err := io.CopyBuffer(os.Stdout, zr, buf); err != nil {
+ log.Fatal(err)
+ }
+ if err := zr.Close(); err != nil {
+ log.Fatal(err)
+ }
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Don't communicate by sharing memory, share memory by communicating.
+Concurrency is not parallelism.
+The bigger the interface, the weaker the abstraction.
+Documentation is for users.
+</pre> <h4 id="example__synchronization"> <span class="text">Example (Synchronization)</span>
+</h4> <p>DEFLATE is suitable for transmitting compressed data across the network. </p> <p>Code:</p> <pre class="code" data-language="go">var wg sync.WaitGroup
+defer wg.Wait()
+
+// Use io.Pipe to simulate a network connection.
+// A real network application should take care to properly close the
+// underlying connection.
+rp, wp := io.Pipe()
+
+// Start a goroutine to act as the transmitter.
+wg.Add(1)
+go func() {
+ defer wg.Done()
+
+ zw, err := flate.NewWriter(wp, flate.BestSpeed)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ b := make([]byte, 256)
+ for _, m := range strings.Fields("A long time ago in a galaxy far, far away...") {
+ // We use a simple framing format where the first byte is the
+ // message length, followed the message itself.
+ b[0] = uint8(copy(b[1:], m))
+
+ if _, err := zw.Write(b[:1+len(m)]); err != nil {
+ log.Fatal(err)
+ }
+
+ // Flush ensures that the receiver can read all data sent so far.
+ if err := zw.Flush(); err != nil {
+ log.Fatal(err)
+ }
+ }
+
+ if err := zw.Close(); err != nil {
+ log.Fatal(err)
+ }
+}()
+
+// Start a goroutine to act as the receiver.
+wg.Add(1)
+go func() {
+ defer wg.Done()
+
+ zr := flate.NewReader(rp)
+
+ b := make([]byte, 256)
+ for {
+ // Read the message length.
+ // This is guaranteed to return for every corresponding
+ // Flush and Close on the transmitter side.
+ if _, err := io.ReadFull(zr, b[:1]); err != nil {
+ if err == io.EOF {
+ break // The transmitter closed the stream
+ }
+ log.Fatal(err)
+ }
+
+ // Read the message content.
+ n := int(b[0])
+ if _, err := io.ReadFull(zr, b[:n]); err != nil {
+ log.Fatal(err)
+ }
+
+ fmt.Printf("Received %d bytes: %s\n", n, b[:n])
+ }
+ fmt.Println()
+
+ if err := zr.Close(); err != nil {
+ log.Fatal(err)
+ }
+}()
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Received 1 bytes: A
+Received 4 bytes: long
+Received 4 bytes: time
+Received 3 bytes: ago
+Received 2 bytes: in
+Received 1 bytes: a
+Received 6 bytes: galaxy
+Received 4 bytes: far,
+Received 3 bytes: far
+Received 7 bytes: away...
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#NewReader">func NewReader(r io.Reader) io.ReadCloser</a></li>
+<li><a href="#NewReaderDict">func NewReaderDict(r io.Reader, dict []byte) io.ReadCloser</a></li>
+<li><a href="#CorruptInputError">type CorruptInputError</a></li>
+<li> <a href="#CorruptInputError.Error">func (e CorruptInputError) Error() string</a>
+</li>
+<li><a href="#InternalError">type InternalError</a></li>
+<li> <a href="#InternalError.Error">func (e InternalError) Error() string</a>
+</li>
+<li><a href="#ReadError">type ReadError</a></li>
+<li> <a href="#ReadError.Error">func (e *ReadError) Error() string</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li><a href="#Resetter">type Resetter</a></li>
+<li><a href="#WriteError">type WriteError</a></li>
+<li> <a href="#WriteError.Error">func (e *WriteError) Error() string</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w io.Writer, level int) (*Writer, error)</a>
+</li>
+<li> <a href="#NewWriterDict">func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error)</a>
+</li>
+<li> <a href="#Writer.Close">func (w *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.Flush">func (w *Writer) Flush() error</a>
+</li>
+<li> <a href="#Writer.Reset">func (w *Writer) Reset(dst io.Writer)</a>
+</li>
+<li> <a href="#Writer.Write">func (w *Writer) Write(data []byte) (n int, err error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example__dictionary">Package (Dictionary)</a></dd> <dd><a class="exampleLink" href="#example__reset">Package (Reset)</a></dd> <dd><a class="exampleLink" href="#example__synchronization">Package (Synchronization)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>deflate.go</span> <span>deflatefast.go</span> <span>dict_decoder.go</span> <span>huffman_bit_writer.go</span> <span>huffman_code.go</span> <span>inflate.go</span> <span>token.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ NoCompression = 0
+ BestSpeed = 1
+ BestCompression = 9
+ DefaultCompression = -1
+
+ // HuffmanOnly disables Lempel-Ziv match searching and only performs Huffman
+ // entropy encoding. This mode is useful in compressing data that has
+ // already been compressed with an LZ style algorithm (e.g. Snappy or LZ4)
+ // that lacks an entropy encoder. Compression gains are achieved when
+ // certain bytes in the input stream occur more frequently than others.
+ //
+ // Note that HuffmanOnly produces a compressed output that is
+ // RFC 1951 compliant. That is, any valid DEFLATE decompressor will
+ // continue to be able to decompress this output.
+ HuffmanOnly = -2
+)</pre> <h2 id="NewReader">func <span>NewReader</span> </h2> <pre data-language="go">func NewReader(r io.Reader) io.ReadCloser</pre> <p>NewReader returns a new ReadCloser that can be used to read the uncompressed version of r. If r does not also implement <span>io.ByteReader</span>, the decompressor may read more data than necessary from r. The reader returns <span>io.EOF</span> after the final block in the DEFLATE stream has been encountered. Any trailing data after the final block is ignored. </p>
+<p>The <span>io.ReadCloser</span> returned by NewReader also implements <a href="#Resetter">Resetter</a>. </p>
+<h2 id="NewReaderDict">func <span>NewReaderDict</span> </h2> <pre data-language="go">func NewReaderDict(r io.Reader, dict []byte) io.ReadCloser</pre> <p>NewReaderDict is like <a href="#NewReader">NewReader</a> but initializes the reader with a preset dictionary. The returned <a href="#Reader">Reader</a> behaves as if the uncompressed data stream started with the given dictionary, which has already been read. NewReaderDict is typically used to read data compressed by NewWriterDict. </p>
+<p>The ReadCloser returned by NewReaderDict also implements <a href="#Resetter">Resetter</a>. </p>
+<h2 id="CorruptInputError">type <span>CorruptInputError</span> </h2> <p>A CorruptInputError reports the presence of corrupt input at a given offset. </p>
+<pre data-language="go">type CorruptInputError int64</pre> <h3 id="CorruptInputError.Error">func (CorruptInputError) <span>Error</span> </h3> <pre data-language="go">func (e CorruptInputError) Error() string</pre> <h2 id="InternalError">type <span>InternalError</span> </h2> <p>An InternalError reports an error in the flate code itself. </p>
+<pre data-language="go">type InternalError string</pre> <h3 id="InternalError.Error">func (InternalError) <span>Error</span> </h3> <pre data-language="go">func (e InternalError) Error() string</pre> <h2 id="ReadError">type <span>ReadError</span> </h2> <p>A ReadError reports an error encountered while reading input. </p>
+<p>Deprecated: No longer returned. </p>
+<pre data-language="go">type ReadError struct {
+ Offset int64 // byte offset where error occurred
+ Err error // error returned by underlying Read
+}
+</pre> <h3 id="ReadError.Error">func (*ReadError) <span>Error</span> </h3> <pre data-language="go">func (e *ReadError) Error() string</pre> <h2 id="Reader">type <span>Reader</span> </h2> <p>The actual read interface needed by <a href="#NewReader">NewReader</a>. If the passed in io.Reader does not also have ReadByte, the <a href="#NewReader">NewReader</a> will introduce its own buffering. </p>
+<pre data-language="go">type Reader interface {
+ io.Reader
+ io.ByteReader
+}</pre> <h2 id="Resetter">type <span>Resetter</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>Resetter resets a ReadCloser returned by <a href="#NewReader">NewReader</a> or <a href="#NewReaderDict">NewReaderDict</a> to switch to a new underlying <a href="#Reader">Reader</a>. This permits reusing a ReadCloser instead of allocating a new one. </p>
+<pre data-language="go">type Resetter interface {
+ // Reset discards any buffered data and resets the Resetter as if it was
+ // newly initialized with the given reader.
+ Reset(r io.Reader, dict []byte) error
+}</pre> <h2 id="WriteError">type <span>WriteError</span> </h2> <p>A WriteError reports an error encountered while writing output. </p>
+<p>Deprecated: No longer returned. </p>
+<pre data-language="go">type WriteError struct {
+ Offset int64 // byte offset where error occurred
+ Err error // error returned by underlying Write
+}
+</pre> <h3 id="WriteError.Error">func (*WriteError) <span>Error</span> </h3> <pre data-language="go">func (e *WriteError) Error() string</pre> <h2 id="Writer">type <span>Writer</span> </h2> <p>A Writer takes data written to it and writes the compressed form of that data to an underlying writer (see <a href="#NewWriter">NewWriter</a>). </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(w io.Writer, level int) (*Writer, error)</pre> <p>NewWriter returns a new <a href="#Writer">Writer</a> compressing data at the given level. Following zlib, levels range from 1 (<a href="#BestSpeed">BestSpeed</a>) to 9 (<a href="#BestCompression">BestCompression</a>); higher levels typically run slower but compress more. Level 0 (<a href="#NoCompression">NoCompression</a>) does not attempt any compression; it only adds the necessary DEFLATE framing. Level -1 (<a href="#DefaultCompression">DefaultCompression</a>) uses the default compression level. Level -2 (<a href="#HuffmanOnly">HuffmanOnly</a>) will use Huffman compression only, giving a very fast compression for all types of input, but sacrificing considerable compression efficiency. </p>
+<p>If level is in the range [-2, 9] then the error returned will be nil. Otherwise the error returned will be non-nil. </p>
+<h3 id="NewWriterDict">func <span>NewWriterDict</span> </h3> <pre data-language="go">func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error)</pre> <p>NewWriterDict is like <a href="#NewWriter">NewWriter</a> but initializes the new <a href="#Writer">Writer</a> with a preset dictionary. The returned <a href="#Writer">Writer</a> behaves as if the dictionary had been written to it without producing any compressed output. The compressed data written to w can only be decompressed by a <a href="#Reader">Reader</a> initialized with the same dictionary. </p>
+<h3 id="Writer.Close">func (*Writer) <span>Close</span> </h3> <pre data-language="go">func (w *Writer) Close() error</pre> <p>Close flushes and closes the writer. </p>
+<h3 id="Writer.Flush">func (*Writer) <span>Flush</span> </h3> <pre data-language="go">func (w *Writer) Flush() error</pre> <p>Flush flushes any pending data to the underlying writer. It is useful mainly in compressed network protocols, to ensure that a remote reader has enough data to reconstruct a packet. Flush does not return until the data has been written. Calling Flush when there is no pending data still causes the <a href="#Writer">Writer</a> to emit a sync marker of at least 4 bytes. If the underlying writer returns an error, Flush returns that error. </p>
+<p>In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH. </p>
+<h3 id="Writer.Reset">func (*Writer) <span>Reset</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (w *Writer) Reset(dst io.Writer)</pre> <p>Reset discards the writer's state and makes it equivalent to the result of <a href="#NewWriter">NewWriter</a> or <a href="#NewWriterDict">NewWriterDict</a> called with dst and w's level and dictionary. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> </h3> <pre data-language="go">func (w *Writer) Write(data []byte) (n int, err error)</pre> <p>Write writes data to w, which will eventually write the compressed form of data to its underlying writer. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/compress/flate/" class="_attribution-link">http://golang.org/pkg/compress/flate/</a>
+ </p>
+</div>
diff --git a/devdocs/go/compress%2Fgzip%2Findex.html b/devdocs/go/compress%2Fgzip%2Findex.html
new file mode 100644
index 00000000..6a4d0d8b
--- /dev/null
+++ b/devdocs/go/compress%2Fgzip%2Findex.html
@@ -0,0 +1,282 @@
+<h1> Package gzip </h1> <ul id="short-nav">
+<li><code>import "compress/gzip"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package gzip implements reading and writing of gzip format compressed files, as specified in RFC 1952. </p> <h4 id="example__compressingReader"> <span class="text">Example (CompressingReader)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// This is an example of writing a compressing reader.
+// This can be useful for an HTTP client body, as shown.
+
+const testdata = "the data to be compressed"
+
+// This HTTP handler is just for testing purposes.
+handler := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
+ zr, err := gzip.NewReader(req.Body)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // Just output the data for the example.
+ if _, err := io.Copy(os.Stdout, zr); err != nil {
+ log.Fatal(err)
+ }
+})
+ts := httptest.NewServer(handler)
+defer ts.Close()
+
+// The remainder is the example code.
+
+// The data we want to compress, as an io.Reader
+dataReader := strings.NewReader(testdata)
+
+// bodyReader is the body of the HTTP request, as an io.Reader.
+// httpWriter is the body of the HTTP request, as an io.Writer.
+bodyReader, httpWriter := io.Pipe()
+
+// Make sure that bodyReader is always closed, so that the
+// goroutine below will always exit.
+defer bodyReader.Close()
+
+// gzipWriter compresses data to httpWriter.
+gzipWriter := gzip.NewWriter(httpWriter)
+
+// errch collects any errors from the writing goroutine.
+errch := make(chan error, 1)
+
+go func() {
+ defer close(errch)
+ sentErr := false
+ sendErr := func(err error) {
+ if !sentErr {
+ errch &lt;- err
+ sentErr = true
+ }
+ }
+
+ // Copy our data to gzipWriter, which compresses it to
+ // gzipWriter, which feeds it to bodyReader.
+ if _, err := io.Copy(gzipWriter, dataReader); err != nil &amp;&amp; err != io.ErrClosedPipe {
+ sendErr(err)
+ }
+ if err := gzipWriter.Close(); err != nil &amp;&amp; err != io.ErrClosedPipe {
+ sendErr(err)
+ }
+ if err := httpWriter.Close(); err != nil &amp;&amp; err != io.ErrClosedPipe {
+ sendErr(err)
+ }
+}()
+
+// Send an HTTP request to the test server.
+req, err := http.NewRequest("PUT", ts.URL, bodyReader)
+if err != nil {
+ log.Fatal(err)
+}
+
+// Note that passing req to http.Client.Do promises that it
+// will close the body, in this case bodyReader.
+resp, err := ts.Client().Do(req)
+if err != nil {
+ log.Fatal(err)
+}
+
+// Check whether there was an error compressing the data.
+if err := &lt;-errch; err != nil {
+ log.Fatal(err)
+}
+
+// For this example we don't care about the response.
+resp.Body.Close()
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">the data to be compressed
+</pre> <h4 id="example__writerReader"> <span class="text">Example (WriterReader)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var buf bytes.Buffer
+zw := gzip.NewWriter(&amp;buf)
+
+// Setting the Header fields is optional.
+zw.Name = "a-new-hope.txt"
+zw.Comment = "an epic space opera by George Lucas"
+zw.ModTime = time.Date(1977, time.May, 25, 0, 0, 0, 0, time.UTC)
+
+_, err := zw.Write([]byte("A long time ago in a galaxy far, far away..."))
+if err != nil {
+ log.Fatal(err)
+}
+
+if err := zw.Close(); err != nil {
+ log.Fatal(err)
+}
+
+zr, err := gzip.NewReader(&amp;buf)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("Name: %s\nComment: %s\nModTime: %s\n\n", zr.Name, zr.Comment, zr.ModTime.UTC())
+
+if _, err := io.Copy(os.Stdout, zr); err != nil {
+ log.Fatal(err)
+}
+
+if err := zr.Close(); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Name: a-new-hope.txt
+Comment: an epic space opera by George Lucas
+ModTime: 1977-05-25 00:00:00 +0000 UTC
+
+A long time ago in a galaxy far, far away...
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Header">type Header</a></li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(r io.Reader) (*Reader, error)</a>
+</li>
+<li> <a href="#Reader.Close">func (z *Reader) Close() error</a>
+</li>
+<li> <a href="#Reader.Multistream">func (z *Reader) Multistream(ok bool)</a>
+</li>
+<li> <a href="#Reader.Read">func (z *Reader) Read(p []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Reader.Reset">func (z *Reader) Reset(r io.Reader) error</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w io.Writer) *Writer</a>
+</li>
+<li> <a href="#NewWriterLevel">func NewWriterLevel(w io.Writer, level int) (*Writer, error)</a>
+</li>
+<li> <a href="#Writer.Close">func (z *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.Flush">func (z *Writer) Flush() error</a>
+</li>
+<li> <a href="#Writer.Reset">func (z *Writer) Reset(w io.Writer)</a>
+</li>
+<li> <a href="#Writer.Write">func (z *Writer) Write(p []byte) (int, error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Reader_Multistream">Reader.Multistream</a></dd> <dd><a class="exampleLink" href="#example__compressingReader">Package (CompressingReader)</a></dd> <dd><a class="exampleLink" href="#example__writerReader">Package (WriterReader)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>gunzip.go</span> <span>gzip.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>These constants are copied from the flate package, so that code that imports "compress/gzip" does not also have to import "compress/flate". </p>
+<pre data-language="go">const (
+ NoCompression = flate.NoCompression
+ BestSpeed = flate.BestSpeed
+ BestCompression = flate.BestCompression
+ DefaultCompression = flate.DefaultCompression
+ HuffmanOnly = flate.HuffmanOnly
+)</pre> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var (
+ // ErrChecksum is returned when reading GZIP data that has an invalid checksum.
+ ErrChecksum = errors.New("gzip: invalid checksum")
+ // ErrHeader is returned when reading GZIP data that has an invalid header.
+ ErrHeader = errors.New("gzip: invalid header")
+)</pre> <h2 id="Header">type <span>Header</span> </h2> <p>The gzip file stores a header giving metadata about the compressed file. That header is exposed as the fields of the <a href="#Writer">Writer</a> and <a href="#Reader">Reader</a> structs. </p>
+<p>Strings must be UTF-8 encoded and may only contain Unicode code points U+0001 through U+00FF, due to limitations of the GZIP file format. </p>
+<pre data-language="go">type Header struct {
+ Comment string // comment
+ Extra []byte // "extra data"
+ ModTime time.Time // modification time
+ Name string // file name
+ OS byte // operating system type
+}
+</pre> <h2 id="Reader">type <span>Reader</span> </h2> <p>A Reader is an <span>io.Reader</span> that can be read to retrieve uncompressed data from a gzip-format compressed file. </p>
+<p>In general, a gzip file can be a concatenation of gzip files, each with its own header. Reads from the Reader return the concatenation of the uncompressed data of each. Only the first header is recorded in the Reader fields. </p>
+<p>Gzip files store a length and checksum of the uncompressed data. The Reader will return an <a href="#ErrChecksum">ErrChecksum</a> when <a href="#Reader.Read">Reader.Read</a> reaches the end of the uncompressed data if it does not have the expected length or checksum. Clients should treat data returned by <a href="#Reader.Read">Reader.Read</a> as tentative until they receive the <span>io.EOF</span> marking the end of the data. </p>
+<pre data-language="go">type Reader struct {
+ Header // valid after NewReader or Reader.Reset
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewReader">func <span>NewReader</span> </h3> <pre data-language="go">func NewReader(r io.Reader) (*Reader, error)</pre> <p>NewReader creates a new <a href="#Reader">Reader</a> reading the given reader. If r does not also implement <span>io.ByteReader</span>, the decompressor may read more data than necessary from r. </p>
+<p>It is the caller's responsibility to call Close on the <a href="#Reader">Reader</a> when done. </p>
+<p>The [Reader.Header] fields will be valid in the <a href="#Reader">Reader</a> returned. </p>
+<h3 id="Reader.Close">func (*Reader) <span>Close</span> </h3> <pre data-language="go">func (z *Reader) Close() error</pre> <p>Close closes the <a href="#Reader">Reader</a>. It does not close the underlying <span>io.Reader</span>. In order for the GZIP checksum to be verified, the reader must be fully consumed until the <span>io.EOF</span>. </p>
+<h3 id="Reader.Multistream">func (*Reader) <span>Multistream</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (z *Reader) Multistream(ok bool)</pre> <p>Multistream controls whether the reader supports multistream files. </p>
+<p>If enabled (the default), the <a href="#Reader">Reader</a> expects the input to be a sequence of individually gzipped data streams, each with its own header and trailer, ending at EOF. The effect is that the concatenation of a sequence of gzipped files is treated as equivalent to the gzip of the concatenation of the sequence. This is standard behavior for gzip readers. </p>
+<p>Calling Multistream(false) disables this behavior; disabling the behavior can be useful when reading file formats that distinguish individual gzip data streams or mix gzip data streams with other data streams. In this mode, when the <a href="#Reader">Reader</a> reaches the end of the data stream, <a href="#Reader.Read">Reader.Read</a> returns <span>io.EOF</span>. The underlying reader must implement <span>io.ByteReader</span> in order to be left positioned just after the gzip stream. To start the next stream, call z.Reset(r) followed by z.Multistream(false). If there is no next stream, z.Reset(r) will return <span>io.EOF</span>. </p> <h4 id="example_Reader_Multistream"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var buf bytes.Buffer
+zw := gzip.NewWriter(&amp;buf)
+
+var files = []struct {
+ name string
+ comment string
+ modTime time.Time
+ data string
+}{
+ {"file-1.txt", "file-header-1", time.Date(2006, time.February, 1, 3, 4, 5, 0, time.UTC), "Hello Gophers - 1"},
+ {"file-2.txt", "file-header-2", time.Date(2007, time.March, 2, 4, 5, 6, 1, time.UTC), "Hello Gophers - 2"},
+}
+
+for _, file := range files {
+ zw.Name = file.name
+ zw.Comment = file.comment
+ zw.ModTime = file.modTime
+
+ if _, err := zw.Write([]byte(file.data)); err != nil {
+ log.Fatal(err)
+ }
+
+ if err := zw.Close(); err != nil {
+ log.Fatal(err)
+ }
+
+ zw.Reset(&amp;buf)
+}
+
+zr, err := gzip.NewReader(&amp;buf)
+if err != nil {
+ log.Fatal(err)
+}
+
+for {
+ zr.Multistream(false)
+ fmt.Printf("Name: %s\nComment: %s\nModTime: %s\n\n", zr.Name, zr.Comment, zr.ModTime.UTC())
+
+ if _, err := io.Copy(os.Stdout, zr); err != nil {
+ log.Fatal(err)
+ }
+
+ fmt.Print("\n\n")
+
+ err = zr.Reset(&amp;buf)
+ if err == io.EOF {
+ break
+ }
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+
+if err := zr.Close(); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Name: file-1.txt
+Comment: file-header-1
+ModTime: 2006-02-01 03:04:05 +0000 UTC
+
+Hello Gophers - 1
+
+Name: file-2.txt
+Comment: file-header-2
+ModTime: 2007-03-02 04:05:06 +0000 UTC
+
+Hello Gophers - 2
+</pre> <h3 id="Reader.Read">func (*Reader) <span>Read</span> </h3> <pre data-language="go">func (z *Reader) Read(p []byte) (n int, err error)</pre> <p>Read implements <span>io.Reader</span>, reading uncompressed bytes from its underlying <a href="#Reader">Reader</a>. </p>
+<h3 id="Reader.Reset">func (*Reader) <span>Reset</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (z *Reader) Reset(r io.Reader) error</pre> <p>Reset discards the <a href="#Reader">Reader</a> z's state and makes it equivalent to the result of its original state from <a href="#NewReader">NewReader</a>, but reading from r instead. This permits reusing a <a href="#Reader">Reader</a> rather than allocating a new one. </p>
+<h2 id="Writer">type <span>Writer</span> </h2> <p>A Writer is an io.WriteCloser. Writes to a Writer are compressed and written to w. </p>
+<pre data-language="go">type Writer struct {
+ Header // written at first call to Write, Flush, or Close
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(w io.Writer) *Writer</pre> <p>NewWriter returns a new <a href="#Writer">Writer</a>. Writes to the returned writer are compressed and written to w. </p>
+<p>It is the caller's responsibility to call Close on the <a href="#Writer">Writer</a> when done. Writes may be buffered and not flushed until Close. </p>
+<p>Callers that wish to set the fields in Writer.Header must do so before the first call to Write, Flush, or Close. </p>
+<h3 id="NewWriterLevel">func <span>NewWriterLevel</span> </h3> <pre data-language="go">func NewWriterLevel(w io.Writer, level int) (*Writer, error)</pre> <p>NewWriterLevel is like <a href="#NewWriter">NewWriter</a> but specifies the compression level instead of assuming <a href="#DefaultCompression">DefaultCompression</a>. </p>
+<p>The compression level can be <a href="#DefaultCompression">DefaultCompression</a>, <a href="#NoCompression">NoCompression</a>, <a href="#HuffmanOnly">HuffmanOnly</a> or any integer value between <a href="#BestSpeed">BestSpeed</a> and <a href="#BestCompression">BestCompression</a> inclusive. The error returned will be nil if the level is valid. </p>
+<h3 id="Writer.Close">func (*Writer) <span>Close</span> </h3> <pre data-language="go">func (z *Writer) Close() error</pre> <p>Close closes the <a href="#Writer">Writer</a> by flushing any unwritten data to the underlying <span>io.Writer</span> and writing the GZIP footer. It does not close the underlying <span>io.Writer</span>. </p>
+<h3 id="Writer.Flush">func (*Writer) <span>Flush</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (z *Writer) Flush() error</pre> <p>Flush flushes any pending compressed data to the underlying writer. </p>
+<p>It is useful mainly in compressed network protocols, to ensure that a remote reader has enough data to reconstruct a packet. Flush does not return until the data has been written. If the underlying writer returns an error, Flush returns that error. </p>
+<p>In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH. </p>
+<h3 id="Writer.Reset">func (*Writer) <span>Reset</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (z *Writer) Reset(w io.Writer)</pre> <p>Reset discards the <a href="#Writer">Writer</a> z's state and makes it equivalent to the result of its original state from <a href="#NewWriter">NewWriter</a> or <a href="#NewWriterLevel">NewWriterLevel</a>, but writing to w instead. This permits reusing a <a href="#Writer">Writer</a> rather than allocating a new one. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> </h3> <pre data-language="go">func (z *Writer) Write(p []byte) (int, error)</pre> <p>Write writes a compressed form of p to the underlying <span>io.Writer</span>. The compressed bytes are not necessarily flushed until the <a href="#Writer">Writer</a> is closed. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/compress/gzip/" class="_attribution-link">http://golang.org/pkg/compress/gzip/</a>
+ </p>
+</div>
diff --git a/devdocs/go/compress%2Flzw%2Findex.html b/devdocs/go/compress%2Flzw%2Findex.html
new file mode 100644
index 00000000..fd2df20e
--- /dev/null
+++ b/devdocs/go/compress%2Flzw%2Findex.html
@@ -0,0 +1,54 @@
+<h1> Package lzw </h1> <ul id="short-nav">
+<li><code>import "compress/lzw"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19. </p>
+<p>In particular, it implements LZW as used by the GIF and PDF file formats, which means variable-width codes up to 12 bits and the first two non-literal codes are a clear code and an EOF code. </p>
+<p>The TIFF file format uses a similar but incompatible version of the LZW algorithm. See the golang.org/x/image/tiff/lzw package for an implementation. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#NewReader">func NewReader(r io.Reader, order Order, litWidth int) io.ReadCloser</a></li>
+<li><a href="#NewWriter">func NewWriter(w io.Writer, order Order, litWidth int) io.WriteCloser</a></li>
+<li><a href="#Order">type Order</a></li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#Reader.Close">func (r *Reader) Close() error</a>
+</li>
+<li> <a href="#Reader.Read">func (r *Reader) Read(b []byte) (int, error)</a>
+</li>
+<li> <a href="#Reader.Reset">func (r *Reader) Reset(src io.Reader, order Order, litWidth int)</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#Writer.Close">func (w *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.Reset">func (w *Writer) Reset(dst io.Writer, order Order, litWidth int)</a>
+</li>
+<li> <a href="#Writer.Write">func (w *Writer) Write(p []byte) (n int, err error)</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>reader.go</span> <span>writer.go</span> </p> <h2 id="NewReader">func <span>NewReader</span> </h2> <pre data-language="go">func NewReader(r io.Reader, order Order, litWidth int) io.ReadCloser</pre> <p>NewReader creates a new <span>io.ReadCloser</span>. Reads from the returned <span>io.ReadCloser</span> read and decompress data from r. If r does not also implement <span>io.ByteReader</span>, the decompressor may read more data than necessary from r. It is the caller's responsibility to call Close on the ReadCloser when finished reading. The number of bits to use for literal codes, litWidth, must be in the range [2,8] and is typically 8. It must equal the litWidth used during compression. </p>
+<p>It is guaranteed that the underlying type of the returned <span>io.ReadCloser</span> is a *<a href="#Reader">Reader</a>. </p>
+<h2 id="NewWriter">func <span>NewWriter</span> </h2> <pre data-language="go">func NewWriter(w io.Writer, order Order, litWidth int) io.WriteCloser</pre> <p>NewWriter creates a new <span>io.WriteCloser</span>. Writes to the returned <span>io.WriteCloser</span> are compressed and written to w. It is the caller's responsibility to call Close on the WriteCloser when finished writing. The number of bits to use for literal codes, litWidth, must be in the range [2,8] and is typically 8. Input bytes must be less than 1&lt;&lt;litWidth. </p>
+<p>It is guaranteed that the underlying type of the returned <span>io.WriteCloser</span> is a *<a href="#Writer">Writer</a>. </p>
+<h2 id="Order">type <span>Order</span> </h2> <p>Order specifies the bit ordering in an LZW data stream. </p>
+<pre data-language="go">type Order int</pre> <pre data-language="go">const (
+ // LSB means Least Significant Bits first, as used in the GIF file format.
+ LSB Order = iota
+ // MSB means Most Significant Bits first, as used in the TIFF and PDF
+ // file formats.
+ MSB
+)</pre> <h2 id="Reader">type <span>Reader</span> <span title="Added in Go 1.17">1.17</span> </h2> <p>Reader is an io.Reader which can be used to read compressed data in the LZW format. </p>
+<pre data-language="go">type Reader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Reader.Close">func (*Reader) <span>Close</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (r *Reader) Close() error</pre> <p>Close closes the <a href="#Reader">Reader</a> and returns an error for any future read operation. It does not close the underlying <span>io.Reader</span>. </p>
+<h3 id="Reader.Read">func (*Reader) <span>Read</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (r *Reader) Read(b []byte) (int, error)</pre> <p>Read implements io.Reader, reading uncompressed bytes from its underlying <a href="#Reader">Reader</a>. </p>
+<h3 id="Reader.Reset">func (*Reader) <span>Reset</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (r *Reader) Reset(src io.Reader, order Order, litWidth int)</pre> <p>Reset clears the <a href="#Reader">Reader</a>'s state and allows it to be reused again as a new <a href="#Reader">Reader</a>. </p>
+<h2 id="Writer">type <span>Writer</span> <span title="Added in Go 1.17">1.17</span> </h2> <p>Writer is an LZW compressor. It writes the compressed form of the data to an underlying writer (see <a href="#NewWriter">NewWriter</a>). </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Writer.Close">func (*Writer) <span>Close</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (w *Writer) Close() error</pre> <p>Close closes the <a href="#Writer">Writer</a>, flushing any pending output. It does not close w's underlying writer. </p>
+<h3 id="Writer.Reset">func (*Writer) <span>Reset</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (w *Writer) Reset(dst io.Writer, order Order, litWidth int)</pre> <p>Reset clears the <a href="#Writer">Writer</a>'s state and allows it to be reused again as a new <a href="#Writer">Writer</a>. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (w *Writer) Write(p []byte) (n int, err error)</pre> <p>Write writes a compressed representation of p to w's underlying writer. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/compress/lzw/" class="_attribution-link">http://golang.org/pkg/compress/lzw/</a>
+ </p>
+</div>
diff --git a/devdocs/go/compress%2Fzlib%2Findex.html b/devdocs/go/compress%2Fzlib%2Findex.html
new file mode 100644
index 00000000..393ad89d
--- /dev/null
+++ b/devdocs/go/compress%2Fzlib%2Findex.html
@@ -0,0 +1,95 @@
+<h1> Package zlib </h1> <ul id="short-nav">
+<li><code>import "compress/zlib"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package zlib implements reading and writing of zlib format compressed data, as specified in RFC 1950. </p>
+<p>The implementation provides filters that uncompress during reading and compress during writing. For example, to write compressed data to a buffer: </p>
+<pre data-language="go">var b bytes.Buffer
+w := zlib.NewWriter(&amp;b)
+w.Write([]byte("hello, world\n"))
+w.Close()
+</pre> <p>and to read that data back: </p>
+<pre data-language="go">r, err := zlib.NewReader(&amp;b)
+io.Copy(os.Stdout, r)
+r.Close()
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#NewReader">func NewReader(r io.Reader) (io.ReadCloser, error)</a></li>
+<li><a href="#NewReaderDict">func NewReaderDict(r io.Reader, dict []byte) (io.ReadCloser, error)</a></li>
+<li><a href="#Resetter">type Resetter</a></li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w io.Writer) *Writer</a>
+</li>
+<li> <a href="#NewWriterLevel">func NewWriterLevel(w io.Writer, level int) (*Writer, error)</a>
+</li>
+<li> <a href="#NewWriterLevelDict">func NewWriterLevelDict(w io.Writer, level int, dict []byte) (*Writer, error)</a>
+</li>
+<li> <a href="#Writer.Close">func (z *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.Flush">func (z *Writer) Flush() error</a>
+</li>
+<li> <a href="#Writer.Reset">func (z *Writer) Reset(w io.Writer)</a>
+</li>
+<li> <a href="#Writer.Write">func (z *Writer) Write(p []byte) (n int, err error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_NewReader">NewReader</a></dd> <dd><a class="exampleLink" href="#example_NewWriter">NewWriter</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>reader.go</span> <span>writer.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>These constants are copied from the flate package, so that code that imports "compress/zlib" does not also have to import "compress/flate". </p>
+<pre data-language="go">const (
+ NoCompression = flate.NoCompression
+ BestSpeed = flate.BestSpeed
+ BestCompression = flate.BestCompression
+ DefaultCompression = flate.DefaultCompression
+ HuffmanOnly = flate.HuffmanOnly
+)</pre> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var (
+ // ErrChecksum is returned when reading ZLIB data that has an invalid checksum.
+ ErrChecksum = errors.New("zlib: invalid checksum")
+ // ErrDictionary is returned when reading ZLIB data that has an invalid dictionary.
+ ErrDictionary = errors.New("zlib: invalid dictionary")
+ // ErrHeader is returned when reading ZLIB data that has an invalid header.
+ ErrHeader = errors.New("zlib: invalid header")
+)</pre> <h2 id="NewReader">func <span>NewReader</span> </h2> <pre data-language="go">func NewReader(r io.Reader) (io.ReadCloser, error)</pre> <p>NewReader creates a new ReadCloser. Reads from the returned ReadCloser read and decompress data from r. If r does not implement <span>io.ByteReader</span>, the decompressor may read more data than necessary from r. It is the caller's responsibility to call Close on the ReadCloser when done. </p>
+<p>The <span>io.ReadCloser</span> returned by NewReader also implements <a href="#Resetter">Resetter</a>. </p> <h4 id="example_NewReader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buff := []byte{120, 156, 202, 72, 205, 201, 201, 215, 81, 40, 207,
+ 47, 202, 73, 225, 2, 4, 0, 0, 255, 255, 33, 231, 4, 147}
+b := bytes.NewReader(buff)
+
+r, err := zlib.NewReader(b)
+if err != nil {
+ panic(err)
+}
+io.Copy(os.Stdout, r)
+</pre> <p>Output:</p> <pre class="output" data-language="go">hello, world
+</pre> <h2 id="NewReaderDict">func <span>NewReaderDict</span> </h2> <pre data-language="go">func NewReaderDict(r io.Reader, dict []byte) (io.ReadCloser, error)</pre> <p>NewReaderDict is like <a href="#NewReader">NewReader</a> but uses a preset dictionary. NewReaderDict ignores the dictionary if the compressed data does not refer to it. If the compressed data refers to a different dictionary, NewReaderDict returns <a href="#ErrDictionary">ErrDictionary</a>. </p>
+<p>The ReadCloser returned by NewReaderDict also implements <a href="#Resetter">Resetter</a>. </p>
+<h2 id="Resetter">type <span>Resetter</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>Resetter resets a ReadCloser returned by <a href="#NewReader">NewReader</a> or <a href="#NewReaderDict">NewReaderDict</a> to switch to a new underlying Reader. This permits reusing a ReadCloser instead of allocating a new one. </p>
+<pre data-language="go">type Resetter interface {
+ // Reset discards any buffered data and resets the Resetter as if it was
+ // newly initialized with the given reader.
+ Reset(r io.Reader, dict []byte) error
+}</pre> <h2 id="Writer">type <span>Writer</span> </h2> <p>A Writer takes data written to it and writes the compressed form of that data to an underlying writer (see NewWriter). </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(w io.Writer) *Writer</pre> <p>NewWriter creates a new Writer. Writes to the returned Writer are compressed and written to w. </p>
+<p>It is the caller's responsibility to call Close on the Writer when done. Writes may be buffered and not flushed until Close. </p> <h4 id="example_NewWriter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var b bytes.Buffer
+
+w := zlib.NewWriter(&amp;b)
+w.Write([]byte("hello, world\n"))
+w.Close()
+fmt.Println(b.Bytes())
+</pre> <p>Output:</p> <pre class="output" data-language="go">[120 156 202 72 205 201 201 215 81 40 207 47 202 73 225 2 4 0 0 255 255 33 231 4 147]
+</pre> <h3 id="NewWriterLevel">func <span>NewWriterLevel</span> </h3> <pre data-language="go">func NewWriterLevel(w io.Writer, level int) (*Writer, error)</pre> <p>NewWriterLevel is like NewWriter but specifies the compression level instead of assuming DefaultCompression. </p>
+<p>The compression level can be DefaultCompression, NoCompression, HuffmanOnly or any integer value between BestSpeed and BestCompression inclusive. The error returned will be nil if the level is valid. </p>
+<h3 id="NewWriterLevelDict">func <span>NewWriterLevelDict</span> </h3> <pre data-language="go">func NewWriterLevelDict(w io.Writer, level int, dict []byte) (*Writer, error)</pre> <p>NewWriterLevelDict is like NewWriterLevel but specifies a dictionary to compress with. </p>
+<p>The dictionary may be nil. If not, its contents should not be modified until the Writer is closed. </p>
+<h3 id="Writer.Close">func (*Writer) <span>Close</span> </h3> <pre data-language="go">func (z *Writer) Close() error</pre> <p>Close closes the Writer, flushing any unwritten data to the underlying io.Writer, but does not close the underlying io.Writer. </p>
+<h3 id="Writer.Flush">func (*Writer) <span>Flush</span> </h3> <pre data-language="go">func (z *Writer) Flush() error</pre> <p>Flush flushes the Writer to its underlying io.Writer. </p>
+<h3 id="Writer.Reset">func (*Writer) <span>Reset</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (z *Writer) Reset(w io.Writer)</pre> <p>Reset clears the state of the Writer z such that it is equivalent to its initial state from NewWriterLevel or NewWriterLevelDict, but instead writing to w. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> </h3> <pre data-language="go">func (z *Writer) Write(p []byte) (n int, err error)</pre> <p>Write writes a compressed form of p to the underlying io.Writer. The compressed bytes are not necessarily flushed until the Writer is closed or explicitly flushed. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/compress/zlib/" class="_attribution-link">http://golang.org/pkg/compress/zlib/</a>
+ </p>
+</div>
diff --git a/devdocs/go/container%2Fheap%2Findex.html b/devdocs/go/container%2Fheap%2Findex.html
new file mode 100644
index 00000000..8c236281
--- /dev/null
+++ b/devdocs/go/container%2Fheap%2Findex.html
@@ -0,0 +1,171 @@
+<h1> Package heap </h1> <ul id="short-nav">
+<li><code>import "container/heap"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package heap provides heap operations for any type that implements heap.Interface. A heap is a tree with the property that each node is the minimum-valued node in its subtree. </p>
+<p>The minimum element in the tree is the root, at index 0. </p>
+<p>A heap is a common way to implement a priority queue. To build a priority queue, implement the Heap interface with the (negative) priority as the ordering for the Less method, so Push adds items while Pop removes the highest-priority item from the queue. The Examples include such an implementation; the file example_pq_test.go has the complete source. </p> <h4 id="example__intHeap"> <span class="text">Example (IntHeap)</span>
+</h4> <p>This example inserts several ints into an IntHeap, checks the minimum, and removes them in order of priority. </p> <p>Code:</p> <pre class="code" data-language="go">// This example demonstrates an integer heap built using the heap interface.
+package heap_test
+
+import (
+ "container/heap"
+ "fmt"
+)
+
+// An IntHeap is a min-heap of ints.
+type IntHeap []int
+
+func (h IntHeap) Len() int { return len(h) }
+func (h IntHeap) Less(i, j int) bool { return h[i] &lt; h[j] }
+func (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
+
+func (h *IntHeap) Push(x any) {
+ // Push and Pop use pointer receivers because they modify the slice's length,
+ // not just its contents.
+ *h = append(*h, x.(int))
+}
+
+func (h *IntHeap) Pop() any {
+ old := *h
+ n := len(old)
+ x := old[n-1]
+ *h = old[0 : n-1]
+ return x
+}
+
+// This example inserts several ints into an IntHeap, checks the minimum,
+// and removes them in order of priority.
+func Example_intHeap() {
+ h := &amp;IntHeap{2, 1, 5}
+ heap.Init(h)
+ heap.Push(h, 3)
+ fmt.Printf("minimum: %d\n", (*h)[0])
+ for h.Len() &gt; 0 {
+ fmt.Printf("%d ", heap.Pop(h))
+ }
+ // Output:
+ // minimum: 1
+ // 1 2 3 5
+}
+</pre> <h4 id="example__priorityQueue"> <span class="text">Example (PriorityQueue)</span>
+</h4> <p>This example creates a PriorityQueue with some items, adds and manipulates an item, and then removes the items in priority order. </p> <p>Code:</p> <pre class="code" data-language="go">// This example demonstrates a priority queue built using the heap interface.
+package heap_test
+
+import (
+ "container/heap"
+ "fmt"
+)
+
+// An Item is something we manage in a priority queue.
+type Item struct {
+ value string // The value of the item; arbitrary.
+ priority int // The priority of the item in the queue.
+ // The index is needed by update and is maintained by the heap.Interface methods.
+ index int // The index of the item in the heap.
+}
+
+// A PriorityQueue implements heap.Interface and holds Items.
+type PriorityQueue []*Item
+
+func (pq PriorityQueue) Len() int { return len(pq) }
+
+func (pq PriorityQueue) Less(i, j int) bool {
+ // We want Pop to give us the highest, not lowest, priority so we use greater than here.
+ return pq[i].priority &gt; pq[j].priority
+}
+
+func (pq PriorityQueue) Swap(i, j int) {
+ pq[i], pq[j] = pq[j], pq[i]
+ pq[i].index = i
+ pq[j].index = j
+}
+
+func (pq *PriorityQueue) Push(x any) {
+ n := len(*pq)
+ item := x.(*Item)
+ item.index = n
+ *pq = append(*pq, item)
+}
+
+func (pq *PriorityQueue) Pop() any {
+ old := *pq
+ n := len(old)
+ item := old[n-1]
+ old[n-1] = nil // avoid memory leak
+ item.index = -1 // for safety
+ *pq = old[0 : n-1]
+ return item
+}
+
+// update modifies the priority and value of an Item in the queue.
+func (pq *PriorityQueue) update(item *Item, value string, priority int) {
+ item.value = value
+ item.priority = priority
+ heap.Fix(pq, item.index)
+}
+
+// This example creates a PriorityQueue with some items, adds and manipulates an item,
+// and then removes the items in priority order.
+func Example_priorityQueue() {
+ // Some items and their priorities.
+ items := map[string]int{
+ "banana": 3, "apple": 2, "pear": 4,
+ }
+
+ // Create a priority queue, put the items in it, and
+ // establish the priority queue (heap) invariants.
+ pq := make(PriorityQueue, len(items))
+ i := 0
+ for value, priority := range items {
+ pq[i] = &amp;Item{
+ value: value,
+ priority: priority,
+ index: i,
+ }
+ i++
+ }
+ heap.Init(&amp;pq)
+
+ // Insert a new item and then modify its priority.
+ item := &amp;Item{
+ value: "orange",
+ priority: 1,
+ }
+ heap.Push(&amp;pq, item)
+ pq.update(item, item.value, 5)
+
+ // Take the items out; they arrive in decreasing priority order.
+ for pq.Len() &gt; 0 {
+ item := heap.Pop(&amp;pq).(*Item)
+ fmt.Printf("%.2d:%s ", item.priority, item.value)
+ }
+ // Output:
+ // 05:orange 04:pear 03:banana 02:apple
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Fix">func Fix(h Interface, i int)</a></li>
+<li><a href="#Init">func Init(h Interface)</a></li>
+<li><a href="#Pop">func Pop(h Interface) any</a></li>
+<li><a href="#Push">func Push(h Interface, x any)</a></li>
+<li><a href="#Remove">func Remove(h Interface, i int) any</a></li>
+<li><a href="#Interface">type Interface</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example__intHeap">Package (IntHeap)</a></dd> <dd><a class="exampleLink" href="#example__priorityQueue">Package (PriorityQueue)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>heap.go</span> </p> <h2 id="Fix">func <span>Fix</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Fix(h Interface, i int)</pre> <p>Fix re-establishes the heap ordering after the element at index i has changed its value. Changing the value of the element at index i and then calling Fix is equivalent to, but less expensive than, calling <a href="#Remove">Remove</a>(h, i) followed by a Push of the new value. The complexity is O(log n) where n = h.Len(). </p>
+<h2 id="Init">func <span>Init</span> </h2> <pre data-language="go">func Init(h Interface)</pre> <p>Init establishes the heap invariants required by the other routines in this package. Init is idempotent with respect to the heap invariants and may be called whenever the heap invariants may have been invalidated. The complexity is O(n) where n = h.Len(). </p>
+<h2 id="Pop">func <span>Pop</span> </h2> <pre data-language="go">func Pop(h Interface) any</pre> <p>Pop removes and returns the minimum element (according to Less) from the heap. The complexity is O(log n) where n = h.Len(). Pop is equivalent to <a href="#Remove">Remove</a>(h, 0). </p>
+<h2 id="Push">func <span>Push</span> </h2> <pre data-language="go">func Push(h Interface, x any)</pre> <p>Push pushes the element x onto the heap. The complexity is O(log n) where n = h.Len(). </p>
+<h2 id="Remove">func <span>Remove</span> </h2> <pre data-language="go">func Remove(h Interface, i int) any</pre> <p>Remove removes and returns the element at index i from the heap. The complexity is O(log n) where n = h.Len(). </p>
+<h2 id="Interface">type <span>Interface</span> </h2> <p>The Interface type describes the requirements for a type using the routines in this package. Any type that implements it may be used as a min-heap with the following invariants (established after <a href="#Init">Init</a> has been called or if the data is empty or sorted): </p>
+<pre data-language="go">!h.Less(j, i) for 0 &lt;= i &lt; h.Len() and 2*i+1 &lt;= j &lt;= 2*i+2 and j &lt; h.Len()
+</pre> <p>Note that <a href="#Push">Push</a> and <a href="#Pop">Pop</a> in this interface are for package heap's implementation to call. To add and remove things from the heap, use <a href="#Push">heap.Push</a> and <a href="#Pop">heap.Pop</a>. </p>
+<pre data-language="go">type Interface interface {
+ sort.Interface
+ Push(x any) // add x as element Len()
+ Pop() any // remove and return element Len() - 1.
+}</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/container/heap/" class="_attribution-link">http://golang.org/pkg/container/heap/</a>
+ </p>
+</div>
diff --git a/devdocs/go/container%2Flist%2Findex.html b/devdocs/go/container%2Flist%2Findex.html
new file mode 100644
index 00000000..ba081a0e
--- /dev/null
+++ b/devdocs/go/container%2Flist%2Findex.html
@@ -0,0 +1,100 @@
+<h1> Package list </h1> <ul id="short-nav">
+<li><code>import "container/list"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package list implements a doubly linked list. </p>
+<p>To iterate over a list (where l is a *List): </p>
+<pre data-language="go">for e := l.Front(); e != nil; e = e.Next() {
+ // do something with e.Value
+}
+</pre> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create a new list and put some numbers in it.
+l := list.New()
+e4 := l.PushBack(4)
+e1 := l.PushFront(1)
+l.InsertBefore(3, e4)
+l.InsertAfter(2, e1)
+
+// Iterate through list and print its contents.
+for e := l.Front(); e != nil; e = e.Next() {
+ fmt.Println(e.Value)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1
+2
+3
+4
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Element">type Element</a></li>
+<li> <a href="#Element.Next">func (e *Element) Next() *Element</a>
+</li>
+<li> <a href="#Element.Prev">func (e *Element) Prev() *Element</a>
+</li>
+<li><a href="#List">type List</a></li>
+<li> <a href="#New">func New() *List</a>
+</li>
+<li> <a href="#List.Back">func (l *List) Back() *Element</a>
+</li>
+<li> <a href="#List.Front">func (l *List) Front() *Element</a>
+</li>
+<li> <a href="#List.Init">func (l *List) Init() *List</a>
+</li>
+<li> <a href="#List.InsertAfter">func (l *List) InsertAfter(v any, mark *Element) *Element</a>
+</li>
+<li> <a href="#List.InsertBefore">func (l *List) InsertBefore(v any, mark *Element) *Element</a>
+</li>
+<li> <a href="#List.Len">func (l *List) Len() int</a>
+</li>
+<li> <a href="#List.MoveAfter">func (l *List) MoveAfter(e, mark *Element)</a>
+</li>
+<li> <a href="#List.MoveBefore">func (l *List) MoveBefore(e, mark *Element)</a>
+</li>
+<li> <a href="#List.MoveToBack">func (l *List) MoveToBack(e *Element)</a>
+</li>
+<li> <a href="#List.MoveToFront">func (l *List) MoveToFront(e *Element)</a>
+</li>
+<li> <a href="#List.PushBack">func (l *List) PushBack(v any) *Element</a>
+</li>
+<li> <a href="#List.PushBackList">func (l *List) PushBackList(other *List)</a>
+</li>
+<li> <a href="#List.PushFront">func (l *List) PushFront(v any) *Element</a>
+</li>
+<li> <a href="#List.PushFrontList">func (l *List) PushFrontList(other *List)</a>
+</li>
+<li> <a href="#List.Remove">func (l *List) Remove(e *Element) any</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>list.go</span> </p> <h2 id="Element">type <span>Element</span> </h2> <p>Element is an element of a linked list. </p>
+<pre data-language="go">type Element struct {
+
+ // The value stored with this element.
+ Value any
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Element.Next">func (*Element) <span>Next</span> </h3> <pre data-language="go">func (e *Element) Next() *Element</pre> <p>Next returns the next list element or nil. </p>
+<h3 id="Element.Prev">func (*Element) <span>Prev</span> </h3> <pre data-language="go">func (e *Element) Prev() *Element</pre> <p>Prev returns the previous list element or nil. </p>
+<h2 id="List">type <span>List</span> </h2> <p>List represents a doubly linked list. The zero value for List is an empty list ready to use. </p>
+<pre data-language="go">type List struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New() *List</pre> <p>New returns an initialized list. </p>
+<h3 id="List.Back">func (*List) <span>Back</span> </h3> <pre data-language="go">func (l *List) Back() *Element</pre> <p>Back returns the last element of list l or nil if the list is empty. </p>
+<h3 id="List.Front">func (*List) <span>Front</span> </h3> <pre data-language="go">func (l *List) Front() *Element</pre> <p>Front returns the first element of list l or nil if the list is empty. </p>
+<h3 id="List.Init">func (*List) <span>Init</span> </h3> <pre data-language="go">func (l *List) Init() *List</pre> <p>Init initializes or clears list l. </p>
+<h3 id="List.InsertAfter">func (*List) <span>InsertAfter</span> </h3> <pre data-language="go">func (l *List) InsertAfter(v any, mark *Element) *Element</pre> <p>InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil. </p>
+<h3 id="List.InsertBefore">func (*List) <span>InsertBefore</span> </h3> <pre data-language="go">func (l *List) InsertBefore(v any, mark *Element) *Element</pre> <p>InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil. </p>
+<h3 id="List.Len">func (*List) <span>Len</span> </h3> <pre data-language="go">func (l *List) Len() int</pre> <p>Len returns the number of elements of list l. The complexity is O(1). </p>
+<h3 id="List.MoveAfter">func (*List) <span>MoveAfter</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (l *List) MoveAfter(e, mark *Element)</pre> <p>MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil. </p>
+<h3 id="List.MoveBefore">func (*List) <span>MoveBefore</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (l *List) MoveBefore(e, mark *Element)</pre> <p>MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil. </p>
+<h3 id="List.MoveToBack">func (*List) <span>MoveToBack</span> </h3> <pre data-language="go">func (l *List) MoveToBack(e *Element)</pre> <p>MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified. The element must not be nil. </p>
+<h3 id="List.MoveToFront">func (*List) <span>MoveToFront</span> </h3> <pre data-language="go">func (l *List) MoveToFront(e *Element)</pre> <p>MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil. </p>
+<h3 id="List.PushBack">func (*List) <span>PushBack</span> </h3> <pre data-language="go">func (l *List) PushBack(v any) *Element</pre> <p>PushBack inserts a new element e with value v at the back of list l and returns e. </p>
+<h3 id="List.PushBackList">func (*List) <span>PushBackList</span> </h3> <pre data-language="go">func (l *List) PushBackList(other *List)</pre> <p>PushBackList inserts a copy of another list at the back of list l. The lists l and other may be the same. They must not be nil. </p>
+<h3 id="List.PushFront">func (*List) <span>PushFront</span> </h3> <pre data-language="go">func (l *List) PushFront(v any) *Element</pre> <p>PushFront inserts a new element e with value v at the front of list l and returns e. </p>
+<h3 id="List.PushFrontList">func (*List) <span>PushFrontList</span> </h3> <pre data-language="go">func (l *List) PushFrontList(other *List)</pre> <p>PushFrontList inserts a copy of another list at the front of list l. The lists l and other may be the same. They must not be nil. </p>
+<h3 id="List.Remove">func (*List) <span>Remove</span> </h3> <pre data-language="go">func (l *List) Remove(e *Element) any</pre> <p>Remove removes e from l if e is an element of list l. It returns the element value e.Value. The element must not be nil. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/container/list/" class="_attribution-link">http://golang.org/pkg/container/list/</a>
+ </p>
+</div>
diff --git a/devdocs/go/container%2Fring%2Findex.html b/devdocs/go/container%2Fring%2Findex.html
new file mode 100644
index 00000000..6abf62b0
--- /dev/null
+++ b/devdocs/go/container%2Fring%2Findex.html
@@ -0,0 +1,199 @@
+<h1> Package ring </h1> <ul id="short-nav">
+<li><code>import "container/ring"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package ring implements operations on circular lists. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Ring">type Ring</a></li>
+<li> <a href="#New">func New(n int) *Ring</a>
+</li>
+<li> <a href="#Ring.Do">func (r *Ring) Do(f func(any))</a>
+</li>
+<li> <a href="#Ring.Len">func (r *Ring) Len() int</a>
+</li>
+<li> <a href="#Ring.Link">func (r *Ring) Link(s *Ring) *Ring</a>
+</li>
+<li> <a href="#Ring.Move">func (r *Ring) Move(n int) *Ring</a>
+</li>
+<li> <a href="#Ring.Next">func (r *Ring) Next() *Ring</a>
+</li>
+<li> <a href="#Ring.Prev">func (r *Ring) Prev() *Ring</a>
+</li>
+<li> <a href="#Ring.Unlink">func (r *Ring) Unlink(n int) *Ring</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Ring_Do">Ring.Do</a></dd> <dd><a class="exampleLink" href="#example_Ring_Len">Ring.Len</a></dd> <dd><a class="exampleLink" href="#example_Ring_Link">Ring.Link</a></dd> <dd><a class="exampleLink" href="#example_Ring_Move">Ring.Move</a></dd> <dd><a class="exampleLink" href="#example_Ring_Next">Ring.Next</a></dd> <dd><a class="exampleLink" href="#example_Ring_Prev">Ring.Prev</a></dd> <dd><a class="exampleLink" href="#example_Ring_Unlink">Ring.Unlink</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>ring.go</span> </p> <h2 id="Ring">type <span>Ring</span> </h2> <p>A Ring is an element of a circular list, or ring. Rings do not have a beginning or end; a pointer to any ring element serves as reference to the entire ring. Empty rings are represented as nil Ring pointers. The zero value for a Ring is a one-element ring with a nil Value. </p>
+<pre data-language="go">type Ring struct {
+ Value any // for use by client; untouched by this library
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(n int) *Ring</pre> <p>New creates a ring of n elements. </p>
+<h3 id="Ring.Do">func (*Ring) <span>Do</span> </h3> <pre data-language="go">func (r *Ring) Do(f func(any))</pre> <p>Do calls function f on each element of the ring, in forward order. The behavior of Do is undefined if f changes *r. </p> <h4 id="example_Ring_Do"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create a new ring of size 5
+r := ring.New(5)
+
+// Get the length of the ring
+n := r.Len()
+
+// Initialize the ring with some integer values
+for i := 0; i &lt; n; i++ {
+ r.Value = i
+ r = r.Next()
+}
+
+// Iterate through the ring and print its contents
+r.Do(func(p any) {
+ fmt.Println(p.(int))
+})
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">0
+1
+2
+3
+4
+</pre> <h3 id="Ring.Len">func (*Ring) <span>Len</span> </h3> <pre data-language="go">func (r *Ring) Len() int</pre> <p>Len computes the number of elements in ring r. It executes in time proportional to the number of elements. </p> <h4 id="example_Ring_Len"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create a new ring of size 4
+r := ring.New(4)
+
+// Print out its length
+fmt.Println(r.Len())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">4
+</pre> <h3 id="Ring.Link">func (*Ring) <span>Link</span> </h3> <pre data-language="go">func (r *Ring) Link(s *Ring) *Ring</pre> <p>Link connects ring r with ring s such that r.Next() becomes s and returns the original value for r.Next(). r must not be empty. </p>
+<p>If r and s point to the same ring, linking them removes the elements between r and s from the ring. The removed elements form a subring and the result is a reference to that subring (if no elements were removed, the result is still the original value for r.Next(), and not nil). </p>
+<p>If r and s point to different rings, linking them creates a single ring with the elements of s inserted after r. The result points to the element following the last element of s after insertion. </p> <h4 id="example_Ring_Link"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create two rings, r and s, of size 2
+r := ring.New(2)
+s := ring.New(2)
+
+// Get the length of the ring
+lr := r.Len()
+ls := s.Len()
+
+// Initialize r with 0s
+for i := 0; i &lt; lr; i++ {
+ r.Value = 0
+ r = r.Next()
+}
+
+// Initialize s with 1s
+for j := 0; j &lt; ls; j++ {
+ s.Value = 1
+ s = s.Next()
+}
+
+// Link ring r and ring s
+rs := r.Link(s)
+
+// Iterate through the combined ring and print its contents
+rs.Do(func(p any) {
+ fmt.Println(p.(int))
+})
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">0
+0
+1
+1
+</pre> <h3 id="Ring.Move">func (*Ring) <span>Move</span> </h3> <pre data-language="go">func (r *Ring) Move(n int) *Ring</pre> <p>Move moves n % r.Len() elements backward (n &lt; 0) or forward (n &gt;= 0) in the ring and returns that ring element. r must not be empty. </p> <h4 id="example_Ring_Move"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create a new ring of size 5
+r := ring.New(5)
+
+// Get the length of the ring
+n := r.Len()
+
+// Initialize the ring with some integer values
+for i := 0; i &lt; n; i++ {
+ r.Value = i
+ r = r.Next()
+}
+
+// Move the pointer forward by three steps
+r = r.Move(3)
+
+// Iterate through the ring and print its contents
+r.Do(func(p any) {
+ fmt.Println(p.(int))
+})
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">3
+4
+0
+1
+2
+</pre> <h3 id="Ring.Next">func (*Ring) <span>Next</span> </h3> <pre data-language="go">func (r *Ring) Next() *Ring</pre> <p>Next returns the next ring element. r must not be empty. </p> <h4 id="example_Ring_Next"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create a new ring of size 5
+r := ring.New(5)
+
+// Get the length of the ring
+n := r.Len()
+
+// Initialize the ring with some integer values
+for i := 0; i &lt; n; i++ {
+ r.Value = i
+ r = r.Next()
+}
+
+// Iterate through the ring and print its contents
+for j := 0; j &lt; n; j++ {
+ fmt.Println(r.Value)
+ r = r.Next()
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">0
+1
+2
+3
+4
+</pre> <h3 id="Ring.Prev">func (*Ring) <span>Prev</span> </h3> <pre data-language="go">func (r *Ring) Prev() *Ring</pre> <p>Prev returns the previous ring element. r must not be empty. </p> <h4 id="example_Ring_Prev"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create a new ring of size 5
+r := ring.New(5)
+
+// Get the length of the ring
+n := r.Len()
+
+// Initialize the ring with some integer values
+for i := 0; i &lt; n; i++ {
+ r.Value = i
+ r = r.Next()
+}
+
+// Iterate through the ring backwards and print its contents
+for j := 0; j &lt; n; j++ {
+ r = r.Prev()
+ fmt.Println(r.Value)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">4
+3
+2
+1
+0
+</pre> <h3 id="Ring.Unlink">func (*Ring) <span>Unlink</span> </h3> <pre data-language="go">func (r *Ring) Unlink(n int) *Ring</pre> <p>Unlink removes n % r.Len() elements from the ring r, starting at r.Next(). If n % r.Len() == 0, r remains unchanged. The result is the removed subring. r must not be empty. </p> <h4 id="example_Ring_Unlink"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create a new ring of size 6
+r := ring.New(6)
+
+// Get the length of the ring
+n := r.Len()
+
+// Initialize the ring with some integer values
+for i := 0; i &lt; n; i++ {
+ r.Value = i
+ r = r.Next()
+}
+
+// Unlink three elements from r, starting from r.Next()
+r.Unlink(3)
+
+// Iterate through the remaining ring and print its contents
+r.Do(func(p any) {
+ fmt.Println(p.(int))
+})
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">0
+4
+5
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/container/ring/" class="_attribution-link">http://golang.org/pkg/container/ring/</a>
+ </p>
+</div>
diff --git a/devdocs/go/context%2Findex.html b/devdocs/go/context%2Findex.html
new file mode 100644
index 00000000..62f03ee1
--- /dev/null
+++ b/devdocs/go/context%2Findex.html
@@ -0,0 +1,381 @@
+<h1> Package context </h1> <ul id="short-nav">
+<li><code>import "context"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package context defines the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes. </p>
+<p>Incoming requests to a server should create a <a href="#Context">Context</a>, and outgoing calls to servers should accept a Context. The chain of function calls between them must propagate the Context, optionally replacing it with a derived Context created using <a href="#WithCancel">WithCancel</a>, <a href="#WithDeadline">WithDeadline</a>, <a href="#WithTimeout">WithTimeout</a>, or <a href="#WithValue">WithValue</a>. When a Context is canceled, all Contexts derived from it are also canceled. </p>
+<p>The <a href="#WithCancel">WithCancel</a>, <a href="#WithDeadline">WithDeadline</a>, and <a href="#WithTimeout">WithTimeout</a> functions take a Context (the parent) and return a derived Context (the child) and a <a href="#CancelFunc">CancelFunc</a>. Calling the CancelFunc cancels the child and its children, removes the parent's reference to the child, and stops any associated timers. Failing to call the CancelFunc leaks the child and its children until the parent is canceled or the timer fires. The go vet tool checks that CancelFuncs are used on all control-flow paths. </p>
+<p>The <a href="#WithCancelCause">WithCancelCause</a> function returns a <a href="#CancelCauseFunc">CancelCauseFunc</a>, which takes an error and records it as the cancellation cause. Calling <a href="#Cause">Cause</a> on the canceled context or any of its children retrieves the cause. If no cause is specified, Cause(ctx) returns the same value as ctx.Err(). </p>
+<p>Programs that use Contexts should follow these rules to keep interfaces consistent across packages and enable static analysis tools to check context propagation: </p>
+<p>Do not store Contexts inside a struct type; instead, pass a Context explicitly to each function that needs it. The Context should be the first parameter, typically named ctx: </p>
+<pre data-language="go">func DoSomething(ctx context.Context, arg Arg) error {
+ // ... use ctx ...
+}
+</pre> <p>Do not pass a nil <a href="#Context">Context</a>, even if a function permits it. Pass <a href="#TODO">context.TODO</a> if you are unsure about which Context to use. </p>
+<p>Use context Values only for request-scoped data that transits processes and APIs, not for passing optional parameters to functions. </p>
+<p>The same Context may be passed to functions running in different goroutines; Contexts are safe for simultaneous use by multiple goroutines. </p>
+<p>See <a href="https://blog.golang.org/context">https://blog.golang.org/context</a> for example code for a server that uses Contexts. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#AfterFunc">func AfterFunc(ctx Context, f func()) (stop func() bool)</a></li>
+<li><a href="#Cause">func Cause(c Context) error</a></li>
+<li><a href="#WithCancel">func WithCancel(parent Context) (ctx Context, cancel CancelFunc)</a></li>
+<li><a href="#WithCancelCause">func WithCancelCause(parent Context) (ctx Context, cancel CancelCauseFunc)</a></li>
+<li><a href="#WithDeadline">func WithDeadline(parent Context, d time.Time) (Context, CancelFunc)</a></li>
+<li><a href="#WithDeadlineCause">func WithDeadlineCause(parent Context, d time.Time, cause error) (Context, CancelFunc)</a></li>
+<li><a href="#WithTimeout">func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc)</a></li>
+<li><a href="#WithTimeoutCause">func WithTimeoutCause(parent Context, timeout time.Duration, cause error) (Context, CancelFunc)</a></li>
+<li><a href="#CancelCauseFunc">type CancelCauseFunc</a></li>
+<li><a href="#CancelFunc">type CancelFunc</a></li>
+<li><a href="#Context">type Context</a></li>
+<li> <a href="#Background">func Background() Context</a>
+</li>
+<li> <a href="#TODO">func TODO() Context</a>
+</li>
+<li> <a href="#WithValue">func WithValue(parent Context, key, val any) Context</a>
+</li>
+<li> <a href="#WithoutCancel">func WithoutCancel(parent Context) Context</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_AfterFunc_cond">AfterFunc (Cond)</a></dd> <dd><a class="exampleLink" href="#example_AfterFunc_connection">AfterFunc (Connection)</a></dd> <dd><a class="exampleLink" href="#example_AfterFunc_merge">AfterFunc (Merge)</a></dd> <dd><a class="exampleLink" href="#example_WithCancel">WithCancel</a></dd> <dd><a class="exampleLink" href="#example_WithDeadline">WithDeadline</a></dd> <dd><a class="exampleLink" href="#example_WithTimeout">WithTimeout</a></dd> <dd><a class="exampleLink" href="#example_WithValue">WithValue</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>context.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>Canceled is the error returned by [Context.Err] when the context is canceled. </p>
+<pre data-language="go">var Canceled = errors.New("context canceled")</pre> <p>DeadlineExceeded is the error returned by [Context.Err] when the context's deadline passes. </p>
+<pre data-language="go">var DeadlineExceeded error = deadlineExceededError{}</pre> <h2 id="AfterFunc">func <span>AfterFunc</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func AfterFunc(ctx Context, f func()) (stop func() bool)</pre> <p>AfterFunc arranges to call f in its own goroutine after ctx is done (cancelled or timed out). If ctx is already done, AfterFunc calls f immediately in its own goroutine. </p>
+<p>Multiple calls to AfterFunc on a context operate independently; one does not replace another. </p>
+<p>Calling the returned stop function stops the association of ctx with f. It returns true if the call stopped f from being run. If stop returns false, either the context is done and f has been started in its own goroutine; or f was already stopped. The stop function does not wait for f to complete before returning. If the caller needs to know whether f is completed, it must coordinate with f explicitly. </p>
+<p>If ctx has a "AfterFunc(func()) func() bool" method, AfterFunc will use it to schedule the call. </p> <h4 id="example_AfterFunc_cond"> <span class="text">Example (Cond)</span>
+</h4> <p>This example uses AfterFunc to define a function which waits on a sync.Cond, stopping the wait when a context is canceled. </p> <p>Code:</p> <pre class="code" data-language="go">waitOnCond := func(ctx context.Context, cond *sync.Cond, conditionMet func() bool) error {
+ stopf := context.AfterFunc(ctx, func() {
+ // We need to acquire cond.L here to be sure that the Broadcast
+ // below won't occur before the call to Wait, which would result
+ // in a missed signal (and deadlock).
+ cond.L.Lock()
+ defer cond.L.Unlock()
+
+ // If multiple goroutines are waiting on cond simultaneously,
+ // we need to make sure we wake up exactly this one.
+ // That means that we need to Broadcast to all of the goroutines,
+ // which will wake them all up.
+ //
+ // If there are N concurrent calls to waitOnCond, each of the goroutines
+ // will spuriously wake up O(N) other goroutines that aren't ready yet,
+ // so this will cause the overall CPU cost to be O(N²).
+ cond.Broadcast()
+ })
+ defer stopf()
+
+ // Since the wakeups are using Broadcast instead of Signal, this call to
+ // Wait may unblock due to some other goroutine's context becoming done,
+ // so to be sure that ctx is actually done we need to check it in a loop.
+ for !conditionMet() {
+ cond.Wait()
+ if ctx.Err() != nil {
+ return ctx.Err()
+ }
+ }
+
+ return nil
+}
+
+cond := sync.NewCond(new(sync.Mutex))
+
+var wg sync.WaitGroup
+for i := 0; i &lt; 4; i++ {
+ wg.Add(1)
+ go func() {
+ defer wg.Done()
+
+ ctx, cancel := context.WithTimeout(context.Background(), 1*time.Millisecond)
+ defer cancel()
+
+ cond.L.Lock()
+ defer cond.L.Unlock()
+
+ err := waitOnCond(ctx, cond, func() bool { return false })
+ fmt.Println(err)
+ }()
+}
+wg.Wait()
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">context deadline exceeded
+context deadline exceeded
+context deadline exceeded
+context deadline exceeded
+</pre> <h4 id="example_AfterFunc_connection"> <span class="text">Example (Connection)</span>
+</h4> <p>This example uses AfterFunc to define a function which reads from a net.Conn, stopping the read when a context is canceled. </p> <p>Code:</p> <pre class="code" data-language="go">readFromConn := func(ctx context.Context, conn net.Conn, b []byte) (n int, err error) {
+ stopc := make(chan struct{})
+ stop := context.AfterFunc(ctx, func() {
+ conn.SetReadDeadline(time.Now())
+ close(stopc)
+ })
+ n, err = conn.Read(b)
+ if !stop() {
+ // The AfterFunc was started.
+ // Wait for it to complete, and reset the Conn's deadline.
+ &lt;-stopc
+ conn.SetReadDeadline(time.Time{})
+ return n, ctx.Err()
+ }
+ return n, err
+}
+
+listener, err := net.Listen("tcp", ":0")
+if err != nil {
+ fmt.Println(err)
+ return
+}
+defer listener.Close()
+
+conn, err := net.Dial(listener.Addr().Network(), listener.Addr().String())
+if err != nil {
+ fmt.Println(err)
+ return
+}
+defer conn.Close()
+
+ctx, cancel := context.WithTimeout(context.Background(), 1*time.Millisecond)
+defer cancel()
+
+b := make([]byte, 1024)
+_, err = readFromConn(ctx, conn, b)
+fmt.Println(err)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">context deadline exceeded
+</pre> <h4 id="example_AfterFunc_merge"> <span class="text">Example (Merge)</span>
+</h4> <p>This example uses AfterFunc to define a function which combines the cancellation signals of two Contexts. </p> <p>Code:</p> <pre class="code" data-language="go">// mergeCancel returns a context that contains the values of ctx,
+// and which is canceled when either ctx or cancelCtx is canceled.
+mergeCancel := func(ctx, cancelCtx context.Context) (context.Context, context.CancelFunc) {
+ ctx, cancel := context.WithCancelCause(ctx)
+ stop := context.AfterFunc(cancelCtx, func() {
+ cancel(context.Cause(cancelCtx))
+ })
+ return ctx, func() {
+ stop()
+ cancel(context.Canceled)
+ }
+}
+
+ctx1, cancel1 := context.WithCancelCause(context.Background())
+defer cancel1(errors.New("ctx1 canceled"))
+
+ctx2, cancel2 := context.WithCancelCause(context.Background())
+
+mergedCtx, mergedCancel := mergeCancel(ctx1, ctx2)
+defer mergedCancel()
+
+cancel2(errors.New("ctx2 canceled"))
+&lt;-mergedCtx.Done()
+fmt.Println(context.Cause(mergedCtx))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">ctx2 canceled
+</pre> <h2 id="Cause">func <span>Cause</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func Cause(c Context) error</pre> <p>Cause returns a non-nil error explaining why c was canceled. The first cancellation of c or one of its parents sets the cause. If that cancellation happened via a call to CancelCauseFunc(err), then <a href="#Cause">Cause</a> returns err. Otherwise Cause(c) returns the same value as c.Err(). Cause returns nil if c has not been canceled yet. </p>
+<h2 id="WithCancel">func <span>WithCancel</span> <span title="Added in Go 1.7">1.7</span> </h2> <pre data-language="go">func WithCancel(parent Context) (ctx Context, cancel CancelFunc)</pre> <p>WithCancel returns a copy of parent with a new Done channel. The returned context's Done channel is closed when the returned cancel function is called or when the parent context's Done channel is closed, whichever happens first. </p>
+<p>Canceling this context releases resources associated with it, so code should call cancel as soon as the operations running in this Context complete. </p> <h4 id="example_WithCancel"> <span class="text">Example</span>
+</h4> <p>This example demonstrates the use of a cancelable context to prevent a goroutine leak. By the end of the example function, the goroutine started by gen will return without leaking. </p> <p>Code:</p> <pre class="code" data-language="go">// gen generates integers in a separate goroutine and
+// sends them to the returned channel.
+// The callers of gen need to cancel the context once
+// they are done consuming generated integers not to leak
+// the internal goroutine started by gen.
+gen := func(ctx context.Context) &lt;-chan int {
+ dst := make(chan int)
+ n := 1
+ go func() {
+ for {
+ select {
+ case &lt;-ctx.Done():
+ return // returning not to leak the goroutine
+ case dst &lt;- n:
+ n++
+ }
+ }
+ }()
+ return dst
+}
+
+ctx, cancel := context.WithCancel(context.Background())
+defer cancel() // cancel when we are finished consuming integers
+
+for n := range gen(ctx) {
+ fmt.Println(n)
+ if n == 5 {
+ break
+ }
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">1
+2
+3
+4
+5
+</pre> <h2 id="WithCancelCause">func <span>WithCancelCause</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func WithCancelCause(parent Context) (ctx Context, cancel CancelCauseFunc)</pre> <p>WithCancelCause behaves like <a href="#WithCancel">WithCancel</a> but returns a <a href="#CancelCauseFunc">CancelCauseFunc</a> instead of a <a href="#CancelFunc">CancelFunc</a>. Calling cancel with a non-nil error (the "cause") records that error in ctx; it can then be retrieved using Cause(ctx). Calling cancel with nil sets the cause to Canceled. </p>
+<p>Example use: </p>
+<pre data-language="go">ctx, cancel := context.WithCancelCause(parent)
+cancel(myError)
+ctx.Err() // returns context.Canceled
+context.Cause(ctx) // returns myError
+</pre> <h2 id="WithDeadline">func <span>WithDeadline</span> <span title="Added in Go 1.7">1.7</span> </h2> <pre data-language="go">func WithDeadline(parent Context, d time.Time) (Context, CancelFunc)</pre> <p>WithDeadline returns a copy of the parent context with the deadline adjusted to be no later than d. If the parent's deadline is already earlier than d, WithDeadline(parent, d) is semantically equivalent to parent. The returned [Context.Done] channel is closed when the deadline expires, when the returned cancel function is called, or when the parent context's Done channel is closed, whichever happens first. </p>
+<p>Canceling this context releases resources associated with it, so code should call cancel as soon as the operations running in this <a href="#Context">Context</a> complete. </p> <h4 id="example_WithDeadline"> <span class="text">Example</span>
+</h4> <p>This example passes a context with an arbitrary deadline to tell a blocking function that it should abandon its work as soon as it gets to it. </p> <p>Code:</p> <pre class="code" data-language="go">d := time.Now().Add(shortDuration)
+ctx, cancel := context.WithDeadline(context.Background(), d)
+
+// Even though ctx will be expired, it is good practice to call its
+// cancellation function in any case. Failure to do so may keep the
+// context and its parent alive longer than necessary.
+defer cancel()
+
+select {
+case &lt;-neverReady:
+ fmt.Println("ready")
+case &lt;-ctx.Done():
+ fmt.Println(ctx.Err())
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">context deadline exceeded
+</pre> <h2 id="WithDeadlineCause">func <span>WithDeadlineCause</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func WithDeadlineCause(parent Context, d time.Time, cause error) (Context, CancelFunc)</pre> <p>WithDeadlineCause behaves like <a href="#WithDeadline">WithDeadline</a> but also sets the cause of the returned Context when the deadline is exceeded. The returned <a href="#CancelFunc">CancelFunc</a> does not set the cause. </p>
+<h2 id="WithTimeout">func <span>WithTimeout</span> <span title="Added in Go 1.7">1.7</span> </h2> <pre data-language="go">func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc)</pre> <p>WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). </p>
+<p>Canceling this context releases resources associated with it, so code should call cancel as soon as the operations running in this <a href="#Context">Context</a> complete: </p>
+<pre data-language="go">func slowOperationWithTimeout(ctx context.Context) (Result, error) {
+ ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)
+ defer cancel() // releases resources if slowOperation completes before timeout elapses
+ return slowOperation(ctx)
+}
+</pre> <h4 id="example_WithTimeout"> <span class="text">Example</span>
+</h4> <p>This example passes a context with a timeout to tell a blocking function that it should abandon its work after the timeout elapses. </p> <p>Code:</p> <pre class="code" data-language="go">// Pass a context with a timeout to tell a blocking function that it
+// should abandon its work after the timeout elapses.
+ctx, cancel := context.WithTimeout(context.Background(), shortDuration)
+defer cancel()
+
+select {
+case &lt;-neverReady:
+ fmt.Println("ready")
+case &lt;-ctx.Done():
+ fmt.Println(ctx.Err()) // prints "context deadline exceeded"
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">context deadline exceeded
+</pre> <h2 id="WithTimeoutCause">func <span>WithTimeoutCause</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func WithTimeoutCause(parent Context, timeout time.Duration, cause error) (Context, CancelFunc)</pre> <p>WithTimeoutCause behaves like <a href="#WithTimeout">WithTimeout</a> but also sets the cause of the returned Context when the timeout expires. The returned <a href="#CancelFunc">CancelFunc</a> does not set the cause. </p>
+<h2 id="CancelCauseFunc">type <span>CancelCauseFunc</span> <span title="Added in Go 1.20">1.20</span> </h2> <p>A CancelCauseFunc behaves like a <a href="#CancelFunc">CancelFunc</a> but additionally sets the cancellation cause. This cause can be retrieved by calling <a href="#Cause">Cause</a> on the canceled Context or on any of its derived Contexts. </p>
+<p>If the context has already been canceled, CancelCauseFunc does not set the cause. For example, if childContext is derived from parentContext: </p>
+<ul> <li>if parentContext is canceled with cause1 before childContext is canceled with cause2, then Cause(parentContext) == Cause(childContext) == cause1 </li>
+<li>if childContext is canceled with cause2 before parentContext is canceled with cause1, then Cause(parentContext) == cause1 and Cause(childContext) == cause2 </li>
+</ul> <pre data-language="go">type CancelCauseFunc func(cause error)</pre> <h2 id="CancelFunc">type <span>CancelFunc</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>A CancelFunc tells an operation to abandon its work. A CancelFunc does not wait for the work to stop. A CancelFunc may be called by multiple goroutines simultaneously. After the first call, subsequent calls to a CancelFunc do nothing. </p>
+<pre data-language="go">type CancelFunc func()</pre> <h2 id="Context">type <span>Context</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>A Context carries a deadline, a cancellation signal, and other values across API boundaries. </p>
+<p>Context's methods may be called by multiple goroutines simultaneously. </p>
+<pre data-language="go">type Context interface {
+ // Deadline returns the time when work done on behalf of this context
+ // should be canceled. Deadline returns ok==false when no deadline is
+ // set. Successive calls to Deadline return the same results.
+ Deadline() (deadline time.Time, ok bool)
+
+ // Done returns a channel that's closed when work done on behalf of this
+ // context should be canceled. Done may return nil if this context can
+ // never be canceled. Successive calls to Done return the same value.
+ // The close of the Done channel may happen asynchronously,
+ // after the cancel function returns.
+ //
+ // WithCancel arranges for Done to be closed when cancel is called;
+ // WithDeadline arranges for Done to be closed when the deadline
+ // expires; WithTimeout arranges for Done to be closed when the timeout
+ // elapses.
+ //
+ // Done is provided for use in select statements:
+ //
+ // // Stream generates values with DoSomething and sends them to out
+ // // until DoSomething returns an error or ctx.Done is closed.
+ // func Stream(ctx context.Context, out chan&lt;- Value) error {
+ // for {
+ // v, err := DoSomething(ctx)
+ // if err != nil {
+ // return err
+ // }
+ // select {
+ // case &lt;-ctx.Done():
+ // return ctx.Err()
+ // case out &lt;- v:
+ // }
+ // }
+ // }
+ //
+ // See https://blog.golang.org/pipelines for more examples of how to use
+ // a Done channel for cancellation.
+ Done() &lt;-chan struct{}
+
+ // If Done is not yet closed, Err returns nil.
+ // If Done is closed, Err returns a non-nil error explaining why:
+ // Canceled if the context was canceled
+ // or DeadlineExceeded if the context's deadline passed.
+ // After Err returns a non-nil error, successive calls to Err return the same error.
+ Err() error
+
+ // Value returns the value associated with this context for key, or nil
+ // if no value is associated with key. Successive calls to Value with
+ // the same key returns the same result.
+ //
+ // Use context values only for request-scoped data that transits
+ // processes and API boundaries, not for passing optional parameters to
+ // functions.
+ //
+ // A key identifies a specific value in a Context. Functions that wish
+ // to store values in Context typically allocate a key in a global
+ // variable then use that key as the argument to context.WithValue and
+ // Context.Value. A key can be any type that supports equality;
+ // packages should define keys as an unexported type to avoid
+ // collisions.
+ //
+ // Packages that define a Context key should provide type-safe accessors
+ // for the values stored using that key:
+ //
+ // // Package user defines a User type that's stored in Contexts.
+ // package user
+ //
+ // import "context"
+ //
+ // // User is the type of value stored in the Contexts.
+ // type User struct {...}
+ //
+ // // key is an unexported type for keys defined in this package.
+ // // This prevents collisions with keys defined in other packages.
+ // type key int
+ //
+ // // userKey is the key for user.User values in Contexts. It is
+ // // unexported; clients use user.NewContext and user.FromContext
+ // // instead of using this key directly.
+ // var userKey key
+ //
+ // // NewContext returns a new Context that carries value u.
+ // func NewContext(ctx context.Context, u *User) context.Context {
+ // return context.WithValue(ctx, userKey, u)
+ // }
+ //
+ // // FromContext returns the User value stored in ctx, if any.
+ // func FromContext(ctx context.Context) (*User, bool) {
+ // u, ok := ctx.Value(userKey).(*User)
+ // return u, ok
+ // }
+ Value(key any) any
+}</pre> <h3 id="Background">func <span>Background</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func Background() Context</pre> <p>Background returns a non-nil, empty <a href="#Context">Context</a>. It is never canceled, has no values, and has no deadline. It is typically used by the main function, initialization, and tests, and as the top-level Context for incoming requests. </p>
+<h3 id="TODO">func <span>TODO</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func TODO() Context</pre> <p>TODO returns a non-nil, empty <a href="#Context">Context</a>. Code should use context.TODO when it's unclear which Context to use or it is not yet available (because the surrounding function has not yet been extended to accept a Context parameter). </p>
+<h3 id="WithValue">func <span>WithValue</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func WithValue(parent Context, key, val any) Context</pre> <p>WithValue returns a copy of parent in which the value associated with key is val. </p>
+<p>Use context Values only for request-scoped data that transits processes and APIs, not for passing optional parameters to functions. </p>
+<p>The provided key must be comparable and should not be of type string or any other built-in type to avoid collisions between packages using context. Users of WithValue should define their own types for keys. To avoid allocating when assigning to an interface{}, context keys often have concrete type struct{}. Alternatively, exported context key variables' static type should be a pointer or interface. </p> <h4 id="example_WithValue"> <span class="text">Example</span>
+</h4> <p>This example demonstrates how a value can be passed to the context and also how to retrieve it if it exists. </p> <p>Code:</p> <pre class="code" data-language="go">type favContextKey string
+
+f := func(ctx context.Context, k favContextKey) {
+ if v := ctx.Value(k); v != nil {
+ fmt.Println("found value:", v)
+ return
+ }
+ fmt.Println("key not found:", k)
+}
+
+k := favContextKey("language")
+ctx := context.WithValue(context.Background(), k, "Go")
+
+f(ctx, k)
+f(ctx, favContextKey("color"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">found value: Go
+key not found: color
+</pre> <h3 id="WithoutCancel">func <span>WithoutCancel</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func WithoutCancel(parent Context) Context</pre> <p>WithoutCancel returns a copy of parent that is not canceled when parent is canceled. The returned context returns no Deadline or Err, and its Done channel is nil. Calling <a href="#Cause">Cause</a> on the returned context returns nil. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/context/" class="_attribution-link">http://golang.org/pkg/context/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Faes%2Findex.html b/devdocs/go/crypto%2Faes%2Findex.html
new file mode 100644
index 00000000..24507c43
--- /dev/null
+++ b/devdocs/go/crypto%2Faes%2Findex.html
@@ -0,0 +1,19 @@
+<h1> Package aes </h1> <ul id="short-nav">
+<li><code>import "crypto/aes"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package aes implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197. </p>
+<p>The AES operations in this package are not implemented using constant-time algorithms. An exception is when running on systems with enabled hardware support for AES that makes these operations constant-time. Examples include amd64 systems using AES-NI extensions and s390x systems using Message-Security-Assist extensions. On such systems, when the result of NewCipher is passed to cipher.NewGCM, the GHASH operation used by GCM is also constant-time. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#NewCipher">func NewCipher(key []byte) (cipher.Block, error)</a></li>
+<li><a href="#KeySizeError">type KeySizeError</a></li>
+<li> <a href="#KeySizeError.Error">func (k KeySizeError) Error() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>aes_gcm.go</span> <span>block.go</span> <span>cipher.go</span> <span>cipher_asm.go</span> <span>const.go</span> <span>modes.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>The AES block size in bytes. </p>
+<pre data-language="go">const BlockSize = 16</pre> <h2 id="NewCipher">func <span>NewCipher</span> </h2> <pre data-language="go">func NewCipher(key []byte) (cipher.Block, error)</pre> <p>NewCipher creates and returns a new <span>cipher.Block</span>. The key argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256. </p>
+<h2 id="KeySizeError">type <span>KeySizeError</span> </h2> <pre data-language="go">type KeySizeError int</pre> <h3 id="KeySizeError.Error">func (KeySizeError) <span>Error</span> </h3> <pre data-language="go">func (k KeySizeError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/aes/" class="_attribution-link">http://golang.org/pkg/crypto/aes/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fboring%2Findex.html b/devdocs/go/crypto%2Fboring%2Findex.html
new file mode 100644
index 00000000..ba809331
--- /dev/null
+++ b/devdocs/go/crypto%2Fboring%2Findex.html
@@ -0,0 +1,7 @@
+<h1> Command boring </h1> <p>Package boring exposes functions that are only available when building with Go+BoringCrypto. This package is available on all targets as long as the Go+BoringCrypto toolchain is used. Use the Enabled function to determine whether the BoringCrypto core is actually in use. </p>
+<p>Any time the Go+BoringCrypto toolchain is used, the "boringcrypto" build tag is satisfied, so that applications can tag files that use this package. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/boring/" class="_attribution-link">http://golang.org/pkg/crypto/boring/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fcipher%2Findex.html b/devdocs/go/crypto%2Fcipher%2Findex.html
new file mode 100644
index 00000000..4abc775c
--- /dev/null
+++ b/devdocs/go/crypto%2Fcipher%2Findex.html
@@ -0,0 +1,463 @@
+<h1> Package cipher </h1> <ul id="short-nav">
+<li><code>import "crypto/cipher"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package cipher implements standard block cipher modes that can be wrapped around low-level block cipher implementations. See <a href="https://csrc.nist.gov/groups/ST/toolkit/BCM/current_modes.html">https://csrc.nist.gov/groups/ST/toolkit/BCM/current_modes.html</a> and NIST Special Publication 800-38A. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#AEAD">type AEAD</a></li>
+<li> <a href="#NewGCM">func NewGCM(cipher Block) (AEAD, error)</a>
+</li>
+<li> <a href="#NewGCMWithNonceSize">func NewGCMWithNonceSize(cipher Block, size int) (AEAD, error)</a>
+</li>
+<li> <a href="#NewGCMWithTagSize">func NewGCMWithTagSize(cipher Block, tagSize int) (AEAD, error)</a>
+</li>
+<li><a href="#Block">type Block</a></li>
+<li><a href="#BlockMode">type BlockMode</a></li>
+<li> <a href="#NewCBCDecrypter">func NewCBCDecrypter(b Block, iv []byte) BlockMode</a>
+</li>
+<li> <a href="#NewCBCEncrypter">func NewCBCEncrypter(b Block, iv []byte) BlockMode</a>
+</li>
+<li><a href="#Stream">type Stream</a></li>
+<li> <a href="#NewCFBDecrypter">func NewCFBDecrypter(block Block, iv []byte) Stream</a>
+</li>
+<li> <a href="#NewCFBEncrypter">func NewCFBEncrypter(block Block, iv []byte) Stream</a>
+</li>
+<li> <a href="#NewCTR">func NewCTR(block Block, iv []byte) Stream</a>
+</li>
+<li> <a href="#NewOFB">func NewOFB(b Block, iv []byte) Stream</a>
+</li>
+<li><a href="#StreamReader">type StreamReader</a></li>
+<li> <a href="#StreamReader.Read">func (r StreamReader) Read(dst []byte) (n int, err error)</a>
+</li>
+<li><a href="#StreamWriter">type StreamWriter</a></li>
+<li> <a href="#StreamWriter.Close">func (w StreamWriter) Close() error</a>
+</li>
+<li> <a href="#StreamWriter.Write">func (w StreamWriter) Write(src []byte) (n int, err error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_NewCBCDecrypter">NewCBCDecrypter</a></dd> <dd><a class="exampleLink" href="#example_NewCBCEncrypter">NewCBCEncrypter</a></dd> <dd><a class="exampleLink" href="#example_NewCFBDecrypter">NewCFBDecrypter</a></dd> <dd><a class="exampleLink" href="#example_NewCFBEncrypter">NewCFBEncrypter</a></dd> <dd><a class="exampleLink" href="#example_NewCTR">NewCTR</a></dd> <dd><a class="exampleLink" href="#example_NewGCM_decrypt">NewGCM (Decrypt)</a></dd> <dd><a class="exampleLink" href="#example_NewGCM_encrypt">NewGCM (Encrypt)</a></dd> <dd><a class="exampleLink" href="#example_NewOFB">NewOFB</a></dd> <dd><a class="exampleLink" href="#example_StreamReader">StreamReader</a></dd> <dd><a class="exampleLink" href="#example_StreamWriter">StreamWriter</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>cbc.go</span> <span>cfb.go</span> <span>cipher.go</span> <span>ctr.go</span> <span>gcm.go</span> <span>io.go</span> <span>ofb.go</span> </p> <h2 id="AEAD">type <span>AEAD</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>AEAD is a cipher mode providing authenticated encryption with associated data. For a description of the methodology, see <a href="https://en.wikipedia.org/wiki/Authenticated_encryption">https://en.wikipedia.org/wiki/Authenticated_encryption</a>. </p>
+<pre data-language="go">type AEAD interface {
+ // NonceSize returns the size of the nonce that must be passed to Seal
+ // and Open.
+ NonceSize() int
+
+ // Overhead returns the maximum difference between the lengths of a
+ // plaintext and its ciphertext.
+ Overhead() int
+
+ // Seal encrypts and authenticates plaintext, authenticates the
+ // additional data and appends the result to dst, returning the updated
+ // slice. The nonce must be NonceSize() bytes long and unique for all
+ // time, for a given key.
+ //
+ // To reuse plaintext's storage for the encrypted output, use plaintext[:0]
+ // as dst. Otherwise, the remaining capacity of dst must not overlap plaintext.
+ Seal(dst, nonce, plaintext, additionalData []byte) []byte
+
+ // Open decrypts and authenticates ciphertext, authenticates the
+ // additional data and, if successful, appends the resulting plaintext
+ // to dst, returning the updated slice. The nonce must be NonceSize()
+ // bytes long and both it and the additional data must match the
+ // value passed to Seal.
+ //
+ // To reuse ciphertext's storage for the decrypted output, use ciphertext[:0]
+ // as dst. Otherwise, the remaining capacity of dst must not overlap plaintext.
+ //
+ // Even if the function fails, the contents of dst, up to its capacity,
+ // may be overwritten.
+ Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error)
+}</pre> <h3 id="NewGCM">func <span>NewGCM</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func NewGCM(cipher Block) (AEAD, error)</pre> <p>NewGCM returns the given 128-bit, block cipher wrapped in Galois Counter Mode with the standard nonce length. </p>
+<p>In general, the GHASH operation performed by this implementation of GCM is not constant-time. An exception is when the underlying <a href="#Block">Block</a> was created by aes.NewCipher on systems with hardware support for AES. See the <span>crypto/aes</span> package documentation for details. </p> <h4 id="example_NewGCM_decrypt"> <span class="text">Example (Decrypt)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Load your secret key from a safe place and reuse it across multiple
+// Seal/Open calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+// When decoded the key should be 16 bytes (AES-128) or 32 (AES-256).
+key, _ := hex.DecodeString("6368616e676520746869732070617373776f726420746f206120736563726574")
+ciphertext, _ := hex.DecodeString("c3aaa29f002ca75870806e44086700f62ce4d43e902b3888e23ceff797a7a471")
+nonce, _ := hex.DecodeString("64a9433eae7ccceee2fc0eda")
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err.Error())
+}
+
+aesgcm, err := cipher.NewGCM(block)
+if err != nil {
+ panic(err.Error())
+}
+
+plaintext, err := aesgcm.Open(nil, nonce, ciphertext, nil)
+if err != nil {
+ panic(err.Error())
+}
+
+fmt.Printf("%s\n", plaintext)
+</pre> <p>Output:</p> <pre class="output" data-language="go">exampleplaintext
+</pre> <h4 id="example_NewGCM_encrypt"> <span class="text">Example (Encrypt)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Load your secret key from a safe place and reuse it across multiple
+// Seal/Open calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+// When decoded the key should be 16 bytes (AES-128) or 32 (AES-256).
+key, _ := hex.DecodeString("6368616e676520746869732070617373776f726420746f206120736563726574")
+plaintext := []byte("exampleplaintext")
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err.Error())
+}
+
+// Never use more than 2^32 random nonces with a given key because of the risk of a repeat.
+nonce := make([]byte, 12)
+if _, err := io.ReadFull(rand.Reader, nonce); err != nil {
+ panic(err.Error())
+}
+
+aesgcm, err := cipher.NewGCM(block)
+if err != nil {
+ panic(err.Error())
+}
+
+ciphertext := aesgcm.Seal(nil, nonce, plaintext, nil)
+fmt.Printf("%x\n", ciphertext)
+</pre> <h3 id="NewGCMWithNonceSize">func <span>NewGCMWithNonceSize</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewGCMWithNonceSize(cipher Block, size int) (AEAD, error)</pre> <p>NewGCMWithNonceSize returns the given 128-bit, block cipher wrapped in Galois Counter Mode, which accepts nonces of the given length. The length must not be zero. </p>
+<p>Only use this function if you require compatibility with an existing cryptosystem that uses non-standard nonce lengths. All other users should use <a href="#NewGCM">NewGCM</a>, which is faster and more resistant to misuse. </p>
+<h3 id="NewGCMWithTagSize">func <span>NewGCMWithTagSize</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func NewGCMWithTagSize(cipher Block, tagSize int) (AEAD, error)</pre> <p>NewGCMWithTagSize returns the given 128-bit, block cipher wrapped in Galois Counter Mode, which generates tags with the given length. </p>
+<p>Tag sizes between 12 and 16 bytes are allowed. </p>
+<p>Only use this function if you require compatibility with an existing cryptosystem that uses non-standard tag lengths. All other users should use <a href="#NewGCM">NewGCM</a>, which is more resistant to misuse. </p>
+<h2 id="Block">type <span>Block</span> </h2> <p>A Block represents an implementation of block cipher using a given key. It provides the capability to encrypt or decrypt individual blocks. The mode implementations extend that capability to streams of blocks. </p>
+<pre data-language="go">type Block interface {
+ // BlockSize returns the cipher's block size.
+ BlockSize() int
+
+ // Encrypt encrypts the first block in src into dst.
+ // Dst and src must overlap entirely or not at all.
+ Encrypt(dst, src []byte)
+
+ // Decrypt decrypts the first block in src into dst.
+ // Dst and src must overlap entirely or not at all.
+ Decrypt(dst, src []byte)
+}</pre> <h2 id="BlockMode">type <span>BlockMode</span> </h2> <p>A BlockMode represents a block cipher running in a block-based mode (CBC, ECB etc). </p>
+<pre data-language="go">type BlockMode interface {
+ // BlockSize returns the mode's block size.
+ BlockSize() int
+
+ // CryptBlocks encrypts or decrypts a number of blocks. The length of
+ // src must be a multiple of the block size. Dst and src must overlap
+ // entirely or not at all.
+ //
+ // If len(dst) &lt; len(src), CryptBlocks should panic. It is acceptable
+ // to pass a dst bigger than src, and in that case, CryptBlocks will
+ // only update dst[:len(src)] and will not touch the rest of dst.
+ //
+ // Multiple calls to CryptBlocks behave as if the concatenation of
+ // the src buffers was passed in a single run. That is, BlockMode
+ // maintains state and does not reset at each CryptBlocks call.
+ CryptBlocks(dst, src []byte)
+}</pre> <h3 id="NewCBCDecrypter">func <span>NewCBCDecrypter</span> </h3> <pre data-language="go">func NewCBCDecrypter(b Block, iv []byte) BlockMode</pre> <p>NewCBCDecrypter returns a BlockMode which decrypts in cipher block chaining mode, using the given Block. The length of iv must be the same as the Block's block size and must match the iv used to encrypt the data. </p> <h4 id="example_NewCBCDecrypter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Load your secret key from a safe place and reuse it across multiple
+// NewCipher calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+key, _ := hex.DecodeString("6368616e676520746869732070617373")
+ciphertext, _ := hex.DecodeString("73c86d43a9d700a253a96c85b0f6b03ac9792e0e757f869cca306bd3cba1c62b")
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err)
+}
+
+// The IV needs to be unique, but not secure. Therefore it's common to
+// include it at the beginning of the ciphertext.
+if len(ciphertext) &lt; aes.BlockSize {
+ panic("ciphertext too short")
+}
+iv := ciphertext[:aes.BlockSize]
+ciphertext = ciphertext[aes.BlockSize:]
+
+// CBC mode always works in whole blocks.
+if len(ciphertext)%aes.BlockSize != 0 {
+ panic("ciphertext is not a multiple of the block size")
+}
+
+mode := cipher.NewCBCDecrypter(block, iv)
+
+// CryptBlocks can work in-place if the two arguments are the same.
+mode.CryptBlocks(ciphertext, ciphertext)
+
+// If the original plaintext lengths are not a multiple of the block
+// size, padding would have to be added when encrypting, which would be
+// removed at this point. For an example, see
+// https://tools.ietf.org/html/rfc5246#section-6.2.3.2. However, it's
+// critical to note that ciphertexts must be authenticated (i.e. by
+// using crypto/hmac) before being decrypted in order to avoid creating
+// a padding oracle.
+
+fmt.Printf("%s\n", ciphertext)
+</pre> <p>Output:</p> <pre class="output" data-language="go">exampleplaintext
+</pre> <h3 id="NewCBCEncrypter">func <span>NewCBCEncrypter</span> </h3> <pre data-language="go">func NewCBCEncrypter(b Block, iv []byte) BlockMode</pre> <p>NewCBCEncrypter returns a BlockMode which encrypts in cipher block chaining mode, using the given Block. The length of iv must be the same as the Block's block size. </p> <h4 id="example_NewCBCEncrypter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Load your secret key from a safe place and reuse it across multiple
+// NewCipher calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+key, _ := hex.DecodeString("6368616e676520746869732070617373")
+plaintext := []byte("exampleplaintext")
+
+// CBC mode works on blocks so plaintexts may need to be padded to the
+// next whole block. For an example of such padding, see
+// https://tools.ietf.org/html/rfc5246#section-6.2.3.2. Here we'll
+// assume that the plaintext is already of the correct length.
+if len(plaintext)%aes.BlockSize != 0 {
+ panic("plaintext is not a multiple of the block size")
+}
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err)
+}
+
+// The IV needs to be unique, but not secure. Therefore it's common to
+// include it at the beginning of the ciphertext.
+ciphertext := make([]byte, aes.BlockSize+len(plaintext))
+iv := ciphertext[:aes.BlockSize]
+if _, err := io.ReadFull(rand.Reader, iv); err != nil {
+ panic(err)
+}
+
+mode := cipher.NewCBCEncrypter(block, iv)
+mode.CryptBlocks(ciphertext[aes.BlockSize:], plaintext)
+
+// It's important to remember that ciphertexts must be authenticated
+// (i.e. by using crypto/hmac) as well as being encrypted in order to
+// be secure.
+
+fmt.Printf("%x\n", ciphertext)
+</pre> <h2 id="Stream">type <span>Stream</span> </h2> <p>A Stream represents a stream cipher. </p>
+<pre data-language="go">type Stream interface {
+ // XORKeyStream XORs each byte in the given slice with a byte from the
+ // cipher's key stream. Dst and src must overlap entirely or not at all.
+ //
+ // If len(dst) &lt; len(src), XORKeyStream should panic. It is acceptable
+ // to pass a dst bigger than src, and in that case, XORKeyStream will
+ // only update dst[:len(src)] and will not touch the rest of dst.
+ //
+ // Multiple calls to XORKeyStream behave as if the concatenation of
+ // the src buffers was passed in a single run. That is, Stream
+ // maintains state and does not reset at each XORKeyStream call.
+ XORKeyStream(dst, src []byte)
+}</pre> <h3 id="NewCFBDecrypter">func <span>NewCFBDecrypter</span> </h3> <pre data-language="go">func NewCFBDecrypter(block Block, iv []byte) Stream</pre> <p>NewCFBDecrypter returns a <a href="#Stream">Stream</a> which decrypts with cipher feedback mode, using the given <a href="#Block">Block</a>. The iv must be the same length as the <a href="#Block">Block</a>'s block size. </p> <h4 id="example_NewCFBDecrypter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Load your secret key from a safe place and reuse it across multiple
+// NewCipher calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+key, _ := hex.DecodeString("6368616e676520746869732070617373")
+ciphertext, _ := hex.DecodeString("7dd015f06bec7f1b8f6559dad89f4131da62261786845100056b353194ad")
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err)
+}
+
+// The IV needs to be unique, but not secure. Therefore it's common to
+// include it at the beginning of the ciphertext.
+if len(ciphertext) &lt; aes.BlockSize {
+ panic("ciphertext too short")
+}
+iv := ciphertext[:aes.BlockSize]
+ciphertext = ciphertext[aes.BlockSize:]
+
+stream := cipher.NewCFBDecrypter(block, iv)
+
+// XORKeyStream can work in-place if the two arguments are the same.
+stream.XORKeyStream(ciphertext, ciphertext)
+fmt.Printf("%s", ciphertext)
+</pre> <p>Output:</p> <pre class="output" data-language="go">some plaintext
+</pre> <h3 id="NewCFBEncrypter">func <span>NewCFBEncrypter</span> </h3> <pre data-language="go">func NewCFBEncrypter(block Block, iv []byte) Stream</pre> <p>NewCFBEncrypter returns a <a href="#Stream">Stream</a> which encrypts with cipher feedback mode, using the given <a href="#Block">Block</a>. The iv must be the same length as the <a href="#Block">Block</a>'s block size. </p> <h4 id="example_NewCFBEncrypter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Load your secret key from a safe place and reuse it across multiple
+// NewCipher calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+key, _ := hex.DecodeString("6368616e676520746869732070617373")
+plaintext := []byte("some plaintext")
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err)
+}
+
+// The IV needs to be unique, but not secure. Therefore it's common to
+// include it at the beginning of the ciphertext.
+ciphertext := make([]byte, aes.BlockSize+len(plaintext))
+iv := ciphertext[:aes.BlockSize]
+if _, err := io.ReadFull(rand.Reader, iv); err != nil {
+ panic(err)
+}
+
+stream := cipher.NewCFBEncrypter(block, iv)
+stream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)
+
+// It's important to remember that ciphertexts must be authenticated
+// (i.e. by using crypto/hmac) as well as being encrypted in order to
+// be secure.
+fmt.Printf("%x\n", ciphertext)
+</pre> <h3 id="NewCTR">func <span>NewCTR</span> </h3> <pre data-language="go">func NewCTR(block Block, iv []byte) Stream</pre> <p>NewCTR returns a <a href="#Stream">Stream</a> which encrypts/decrypts using the given <a href="#Block">Block</a> in counter mode. The length of iv must be the same as the <a href="#Block">Block</a>'s block size. </p> <h4 id="example_NewCTR"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Load your secret key from a safe place and reuse it across multiple
+// NewCipher calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+key, _ := hex.DecodeString("6368616e676520746869732070617373")
+plaintext := []byte("some plaintext")
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err)
+}
+
+// The IV needs to be unique, but not secure. Therefore it's common to
+// include it at the beginning of the ciphertext.
+ciphertext := make([]byte, aes.BlockSize+len(plaintext))
+iv := ciphertext[:aes.BlockSize]
+if _, err := io.ReadFull(rand.Reader, iv); err != nil {
+ panic(err)
+}
+
+stream := cipher.NewCTR(block, iv)
+stream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)
+
+// It's important to remember that ciphertexts must be authenticated
+// (i.e. by using crypto/hmac) as well as being encrypted in order to
+// be secure.
+
+// CTR mode is the same for both encryption and decryption, so we can
+// also decrypt that ciphertext with NewCTR.
+
+plaintext2 := make([]byte, len(plaintext))
+stream = cipher.NewCTR(block, iv)
+stream.XORKeyStream(plaintext2, ciphertext[aes.BlockSize:])
+
+fmt.Printf("%s\n", plaintext2)
+</pre> <p>Output:</p> <pre class="output" data-language="go">some plaintext
+</pre> <h3 id="NewOFB">func <span>NewOFB</span> </h3> <pre data-language="go">func NewOFB(b Block, iv []byte) Stream</pre> <p>NewOFB returns a <a href="#Stream">Stream</a> that encrypts or decrypts using the block cipher b in output feedback mode. The initialization vector iv's length must be equal to b's block size. </p> <h4 id="example_NewOFB"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Load your secret key from a safe place and reuse it across multiple
+// NewCipher calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+key, _ := hex.DecodeString("6368616e676520746869732070617373")
+plaintext := []byte("some plaintext")
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err)
+}
+
+// The IV needs to be unique, but not secure. Therefore it's common to
+// include it at the beginning of the ciphertext.
+ciphertext := make([]byte, aes.BlockSize+len(plaintext))
+iv := ciphertext[:aes.BlockSize]
+if _, err := io.ReadFull(rand.Reader, iv); err != nil {
+ panic(err)
+}
+
+stream := cipher.NewOFB(block, iv)
+stream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)
+
+// It's important to remember that ciphertexts must be authenticated
+// (i.e. by using crypto/hmac) as well as being encrypted in order to
+// be secure.
+
+// OFB mode is the same for both encryption and decryption, so we can
+// also decrypt that ciphertext with NewOFB.
+
+plaintext2 := make([]byte, len(plaintext))
+stream = cipher.NewOFB(block, iv)
+stream.XORKeyStream(plaintext2, ciphertext[aes.BlockSize:])
+
+fmt.Printf("%s\n", plaintext2)
+</pre> <p>Output:</p> <pre class="output" data-language="go">some plaintext
+</pre> <h2 id="StreamReader">type <span>StreamReader</span> </h2> <p>StreamReader wraps a <a href="#Stream">Stream</a> into an <span>io.Reader</span>. It calls XORKeyStream to process each slice of data which passes through. </p>
+<pre data-language="go">type StreamReader struct {
+ S Stream
+ R io.Reader
+}
+</pre> <h4 id="example_StreamReader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Load your secret key from a safe place and reuse it across multiple
+// NewCipher calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+key, _ := hex.DecodeString("6368616e676520746869732070617373")
+
+encrypted, _ := hex.DecodeString("cf0495cc6f75dafc23948538e79904a9")
+bReader := bytes.NewReader(encrypted)
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err)
+}
+
+// If the key is unique for each ciphertext, then it's ok to use a zero
+// IV.
+var iv [aes.BlockSize]byte
+stream := cipher.NewOFB(block, iv[:])
+
+reader := &amp;cipher.StreamReader{S: stream, R: bReader}
+// Copy the input to the output stream, decrypting as we go.
+if _, err := io.Copy(os.Stdout, reader); err != nil {
+ panic(err)
+}
+
+// Note that this example is simplistic in that it omits any
+// authentication of the encrypted data. If you were actually to use
+// StreamReader in this manner, an attacker could flip arbitrary bits in
+// the output.
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">some secret text
+</pre> <h3 id="StreamReader.Read">func (StreamReader) <span>Read</span> </h3> <pre data-language="go">func (r StreamReader) Read(dst []byte) (n int, err error)</pre> <h2 id="StreamWriter">type <span>StreamWriter</span> </h2> <p>StreamWriter wraps a <a href="#Stream">Stream</a> into an io.Writer. It calls XORKeyStream to process each slice of data which passes through. If any <a href="#StreamWriter.Write">StreamWriter.Write</a> call returns short then the StreamWriter is out of sync and must be discarded. A StreamWriter has no internal buffering; <a href="#StreamWriter.Close">StreamWriter.Close</a> does not need to be called to flush write data. </p>
+<pre data-language="go">type StreamWriter struct {
+ S Stream
+ W io.Writer
+ Err error // unused
+}
+</pre> <h4 id="example_StreamWriter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Load your secret key from a safe place and reuse it across multiple
+// NewCipher calls. (Obviously don't use this example key for anything
+// real.) If you want to convert a passphrase to a key, use a suitable
+// package like bcrypt or scrypt.
+key, _ := hex.DecodeString("6368616e676520746869732070617373")
+
+bReader := bytes.NewReader([]byte("some secret text"))
+
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic(err)
+}
+
+// If the key is unique for each ciphertext, then it's ok to use a zero
+// IV.
+var iv [aes.BlockSize]byte
+stream := cipher.NewOFB(block, iv[:])
+
+var out bytes.Buffer
+
+writer := &amp;cipher.StreamWriter{S: stream, W: &amp;out}
+// Copy the input to the output buffer, encrypting as we go.
+if _, err := io.Copy(writer, bReader); err != nil {
+ panic(err)
+}
+
+// Note that this example is simplistic in that it omits any
+// authentication of the encrypted data. If you were actually to use
+// StreamReader in this manner, an attacker could flip arbitrary bits in
+// the decrypted result.
+
+fmt.Printf("%x\n", out.Bytes())
+</pre> <p>Output:</p> <pre class="output" data-language="go">cf0495cc6f75dafc23948538e79904a9
+</pre> <h3 id="StreamWriter.Close">func (StreamWriter) <span>Close</span> </h3> <pre data-language="go">func (w StreamWriter) Close() error</pre> <p>Close closes the underlying Writer and returns its Close return value, if the Writer is also an io.Closer. Otherwise it returns nil. </p>
+<h3 id="StreamWriter.Write">func (StreamWriter) <span>Write</span> </h3> <pre data-language="go">func (w StreamWriter) Write(src []byte) (n int, err error)</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/cipher/" class="_attribution-link">http://golang.org/pkg/crypto/cipher/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fdes%2Findex.html b/devdocs/go/crypto%2Fdes%2Findex.html
new file mode 100644
index 00000000..1a7845ae
--- /dev/null
+++ b/devdocs/go/crypto%2Fdes%2Findex.html
@@ -0,0 +1,38 @@
+<h1> Package des </h1> <ul id="short-nav">
+<li><code>import "crypto/des"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package des implements the Data Encryption Standard (DES) and the Triple Data Encryption Algorithm (TDEA) as defined in U.S. Federal Information Processing Standards Publication 46-3. </p>
+<p>DES is cryptographically broken and should not be used for secure applications. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#NewCipher">func NewCipher(key []byte) (cipher.Block, error)</a></li>
+<li><a href="#NewTripleDESCipher">func NewTripleDESCipher(key []byte) (cipher.Block, error)</a></li>
+<li><a href="#KeySizeError">type KeySizeError</a></li>
+<li> <a href="#KeySizeError.Error">func (k KeySizeError) Error() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_NewTripleDESCipher">NewTripleDESCipher</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>block.go</span> <span>cipher.go</span> <span>const.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>The DES block size in bytes. </p>
+<pre data-language="go">const BlockSize = 8</pre> <h2 id="NewCipher">func <span>NewCipher</span> </h2> <pre data-language="go">func NewCipher(key []byte) (cipher.Block, error)</pre> <p>NewCipher creates and returns a new <span>cipher.Block</span>. </p>
+<h2 id="NewTripleDESCipher">func <span>NewTripleDESCipher</span> </h2> <pre data-language="go">func NewTripleDESCipher(key []byte) (cipher.Block, error)</pre> <p>NewTripleDESCipher creates and returns a new <span>cipher.Block</span>. </p> <h4 id="example_NewTripleDESCipher"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// NewTripleDESCipher can also be used when EDE2 is required by
+// duplicating the first 8 bytes of the 16-byte key.
+ede2Key := []byte("example key 1234")
+
+var tripleDESKey []byte
+tripleDESKey = append(tripleDESKey, ede2Key[:16]...)
+tripleDESKey = append(tripleDESKey, ede2Key[:8]...)
+
+_, err := des.NewTripleDESCipher(tripleDESKey)
+if err != nil {
+ panic(err)
+}
+
+// See crypto/cipher for how to use a cipher.Block for encryption and
+// decryption.
+</pre> <h2 id="KeySizeError">type <span>KeySizeError</span> </h2> <pre data-language="go">type KeySizeError int</pre> <h3 id="KeySizeError.Error">func (KeySizeError) <span>Error</span> </h3> <pre data-language="go">func (k KeySizeError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/des/" class="_attribution-link">http://golang.org/pkg/crypto/des/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fdsa%2Findex.html b/devdocs/go/crypto%2Fdsa%2Findex.html
new file mode 100644
index 00000000..2be6caf1
--- /dev/null
+++ b/devdocs/go/crypto%2Fdsa%2Findex.html
@@ -0,0 +1,50 @@
+<h1> Package dsa </h1> <ul id="short-nav">
+<li><code>import "crypto/dsa"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package dsa implements the Digital Signature Algorithm, as defined in FIPS 186-3. </p>
+<p>The DSA operations in this package are not implemented using constant-time algorithms. </p>
+<p>Deprecated: DSA is a legacy algorithm, and modern alternatives such as Ed25519 (implemented by package crypto/ed25519) should be used instead. Keys with 1024-bit moduli (L1024N160 parameters) are cryptographically weak, while bigger keys are not widely supported. Note that FIPS 186-5 no longer approves DSA for signature generation. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#GenerateKey">func GenerateKey(priv *PrivateKey, rand io.Reader) error</a></li>
+<li><a href="#GenerateParameters">func GenerateParameters(params *Parameters, rand io.Reader, sizes ParameterSizes) error</a></li>
+<li><a href="#Sign">func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error)</a></li>
+<li><a href="#Verify">func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool</a></li>
+<li><a href="#ParameterSizes">type ParameterSizes</a></li>
+<li><a href="#Parameters">type Parameters</a></li>
+<li><a href="#PrivateKey">type PrivateKey</a></li>
+<li><a href="#PublicKey">type PublicKey</a></li>
+</ul> <h3>Package files</h3> <p> <span>dsa.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrInvalidPublicKey results when a public key is not usable by this code. FIPS is quite strict about the format of DSA keys, but other code may be less so. Thus, when using keys which may have been generated by other code, this error must be handled. </p>
+<pre data-language="go">var ErrInvalidPublicKey = errors.New("crypto/dsa: invalid public key")</pre> <h2 id="GenerateKey">func <span>GenerateKey</span> </h2> <pre data-language="go">func GenerateKey(priv *PrivateKey, rand io.Reader) error</pre> <p>GenerateKey generates a public&amp;private key pair. The Parameters of the <a href="#PrivateKey">PrivateKey</a> must already be valid (see <a href="#GenerateParameters">GenerateParameters</a>). </p>
+<h2 id="GenerateParameters">func <span>GenerateParameters</span> </h2> <pre data-language="go">func GenerateParameters(params *Parameters, rand io.Reader, sizes ParameterSizes) error</pre> <p>GenerateParameters puts a random, valid set of DSA parameters into params. This function can take many seconds, even on fast machines. </p>
+<h2 id="Sign">func <span>Sign</span> </h2> <pre data-language="go">func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error)</pre> <p>Sign signs an arbitrary length hash (which should be the result of hashing a larger message) using the private key, priv. It returns the signature as a pair of integers. The security of the private key depends on the entropy of rand. </p>
+<p>Note that FIPS 186-3 section 4.6 specifies that the hash should be truncated to the byte-length of the subgroup. This function does not perform that truncation itself. </p>
+<p>Be aware that calling Sign with an attacker-controlled <a href="#PrivateKey">PrivateKey</a> may require an arbitrary amount of CPU. </p>
+<h2 id="Verify">func <span>Verify</span> </h2> <pre data-language="go">func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool</pre> <p>Verify verifies the signature in r, s of hash using the public key, pub. It reports whether the signature is valid. </p>
+<p>Note that FIPS 186-3 section 4.6 specifies that the hash should be truncated to the byte-length of the subgroup. This function does not perform that truncation itself. </p>
+<h2 id="ParameterSizes">type <span>ParameterSizes</span> </h2> <p>ParameterSizes is an enumeration of the acceptable bit lengths of the primes in a set of DSA parameters. See FIPS 186-3, section 4.2. </p>
+<pre data-language="go">type ParameterSizes int</pre> <pre data-language="go">const (
+ L1024N160 ParameterSizes = iota
+ L2048N224
+ L2048N256
+ L3072N256
+)</pre> <h2 id="Parameters">type <span>Parameters</span> </h2> <p>Parameters represents the domain parameters for a key. These parameters can be shared across many keys. The bit length of Q must be a multiple of 8. </p>
+<pre data-language="go">type Parameters struct {
+ P, Q, G *big.Int
+}
+</pre> <h2 id="PrivateKey">type <span>PrivateKey</span> </h2> <p>PrivateKey represents a DSA private key. </p>
+<pre data-language="go">type PrivateKey struct {
+ PublicKey
+ X *big.Int
+}
+</pre> <h2 id="PublicKey">type <span>PublicKey</span> </h2> <p>PublicKey represents a DSA public key. </p>
+<pre data-language="go">type PublicKey struct {
+ Parameters
+ Y *big.Int
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/dsa/" class="_attribution-link">http://golang.org/pkg/crypto/dsa/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fecdh%2Findex.html b/devdocs/go/crypto%2Fecdh%2Findex.html
new file mode 100644
index 00000000..162cc854
--- /dev/null
+++ b/devdocs/go/crypto%2Fecdh%2Findex.html
@@ -0,0 +1,98 @@
+<h1> Package ecdh </h1> <ul id="short-nav">
+<li><code>import "crypto/ecdh"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package ecdh implements Elliptic Curve Diffie-Hellman over NIST curves and Curve25519. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Curve">type Curve</a></li>
+<li> <a href="#P256">func P256() Curve</a>
+</li>
+<li> <a href="#P384">func P384() Curve</a>
+</li>
+<li> <a href="#P521">func P521() Curve</a>
+</li>
+<li> <a href="#X25519">func X25519() Curve</a>
+</li>
+<li><a href="#PrivateKey">type PrivateKey</a></li>
+<li> <a href="#PrivateKey.Bytes">func (k *PrivateKey) Bytes() []byte</a>
+</li>
+<li> <a href="#PrivateKey.Curve">func (k *PrivateKey) Curve() Curve</a>
+</li>
+<li> <a href="#PrivateKey.ECDH">func (k *PrivateKey) ECDH(remote *PublicKey) ([]byte, error)</a>
+</li>
+<li> <a href="#PrivateKey.Equal">func (k *PrivateKey) Equal(x crypto.PrivateKey) bool</a>
+</li>
+<li> <a href="#PrivateKey.Public">func (k *PrivateKey) Public() crypto.PublicKey</a>
+</li>
+<li> <a href="#PrivateKey.PublicKey">func (k *PrivateKey) PublicKey() *PublicKey</a>
+</li>
+<li><a href="#PublicKey">type PublicKey</a></li>
+<li> <a href="#PublicKey.Bytes">func (k *PublicKey) Bytes() []byte</a>
+</li>
+<li> <a href="#PublicKey.Curve">func (k *PublicKey) Curve() Curve</a>
+</li>
+<li> <a href="#PublicKey.Equal">func (k *PublicKey) Equal(x crypto.PublicKey) bool</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>ecdh.go</span> <span>nist.go</span> <span>x25519.go</span> </p> <h2 id="Curve">type <span>Curve</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">type Curve interface {
+ // GenerateKey generates a random PrivateKey.
+ //
+ // Most applications should use [crypto/rand.Reader] as rand. Note that the
+ // returned key does not depend deterministically on the bytes read from rand,
+ // and may change between calls and/or between versions.
+ GenerateKey(rand io.Reader) (*PrivateKey, error)
+
+ // NewPrivateKey checks that key is valid and returns a PrivateKey.
+ //
+ // For NIST curves, this follows SEC 1, Version 2.0, Section 2.3.6, which
+ // amounts to decoding the bytes as a fixed length big endian integer and
+ // checking that the result is lower than the order of the curve. The zero
+ // private key is also rejected, as the encoding of the corresponding public
+ // key would be irregular.
+ //
+ // For X25519, this only checks the scalar length.
+ NewPrivateKey(key []byte) (*PrivateKey, error)
+
+ // NewPublicKey checks that key is valid and returns a PublicKey.
+ //
+ // For NIST curves, this decodes an uncompressed point according to SEC 1,
+ // Version 2.0, Section 2.3.4. Compressed encodings and the point at
+ // infinity are rejected.
+ //
+ // For X25519, this only checks the u-coordinate length. Adversarially
+ // selected public keys can cause ECDH to return an error.
+ NewPublicKey(key []byte) (*PublicKey, error)
+ // contains filtered or unexported methods
+}</pre> <h3 id="P256">func <span>P256</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func P256() Curve</pre> <p>P256 returns a <a href="#Curve">Curve</a> which implements NIST P-256 (FIPS 186-3, section D.2.3), also known as secp256r1 or prime256v1. </p>
+<p>Multiple invocations of this function will return the same value, which can be used for equality checks and switch statements. </p>
+<h3 id="P384">func <span>P384</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func P384() Curve</pre> <p>P384 returns a <a href="#Curve">Curve</a> which implements NIST P-384 (FIPS 186-3, section D.2.4), also known as secp384r1. </p>
+<p>Multiple invocations of this function will return the same value, which can be used for equality checks and switch statements. </p>
+<h3 id="P521">func <span>P521</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func P521() Curve</pre> <p>P521 returns a <a href="#Curve">Curve</a> which implements NIST P-521 (FIPS 186-3, section D.2.5), also known as secp521r1. </p>
+<p>Multiple invocations of this function will return the same value, which can be used for equality checks and switch statements. </p>
+<h3 id="X25519">func <span>X25519</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func X25519() Curve</pre> <p>X25519 returns a <a href="#Curve">Curve</a> which implements the X25519 function over Curve25519 (RFC 7748, Section 5). </p>
+<p>Multiple invocations of this function will return the same value, so it can be used for equality checks and switch statements. </p>
+<h2 id="PrivateKey">type <span>PrivateKey</span> <span title="Added in Go 1.20">1.20</span> </h2> <p>PrivateKey is an ECDH private key, usually kept secret. </p>
+<p>These keys can be parsed with <span>crypto/x509.ParsePKCS8PrivateKey</span> and encoded with <span>crypto/x509.MarshalPKCS8PrivateKey</span>. For NIST curves, they then need to be converted with <span>crypto/ecdsa.PrivateKey.ECDH</span> after parsing. </p>
+<pre data-language="go">type PrivateKey struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="PrivateKey.Bytes">func (*PrivateKey) <span>Bytes</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PrivateKey) Bytes() []byte</pre> <p>Bytes returns a copy of the encoding of the private key. </p>
+<h3 id="PrivateKey.Curve">func (*PrivateKey) <span>Curve</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PrivateKey) Curve() Curve</pre> <h3 id="PrivateKey.ECDH">func (*PrivateKey) <span>ECDH</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PrivateKey) ECDH(remote *PublicKey) ([]byte, error)</pre> <p>ECDH performs an ECDH exchange and returns the shared secret. The <a href="#PrivateKey">PrivateKey</a> and <a href="#PublicKey">PublicKey</a> must use the same curve. </p>
+<p>For NIST curves, this performs ECDH as specified in SEC 1, Version 2.0, Section 3.3.1, and returns the x-coordinate encoded according to SEC 1, Version 2.0, Section 2.3.5. The result is never the point at infinity. </p>
+<p>For <a href="#X25519">X25519</a>, this performs ECDH as specified in RFC 7748, Section 6.1. If the result is the all-zero value, ECDH returns an error. </p>
+<h3 id="PrivateKey.Equal">func (*PrivateKey) <span>Equal</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PrivateKey) Equal(x crypto.PrivateKey) bool</pre> <p>Equal returns whether x represents the same private key as k. </p>
+<p>Note that there can be equivalent private keys with different encodings which would return false from this check but behave the same way as inputs to [ECDH]. </p>
+<p>This check is performed in constant time as long as the key types and their curve match. </p>
+<h3 id="PrivateKey.Public">func (*PrivateKey) <span>Public</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PrivateKey) Public() crypto.PublicKey</pre> <p>Public implements the implicit interface of all standard library private keys. See the docs of <span>crypto.PrivateKey</span>. </p>
+<h3 id="PrivateKey.PublicKey">func (*PrivateKey) <span>PublicKey</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PrivateKey) PublicKey() *PublicKey</pre> <h2 id="PublicKey">type <span>PublicKey</span> <span title="Added in Go 1.20">1.20</span> </h2> <p>PublicKey is an ECDH public key, usually a peer's ECDH share sent over the wire. </p>
+<p>These keys can be parsed with <span>crypto/x509.ParsePKIXPublicKey</span> and encoded with <span>crypto/x509.MarshalPKIXPublicKey</span>. For NIST curves, they then need to be converted with <span>crypto/ecdsa.PublicKey.ECDH</span> after parsing. </p>
+<pre data-language="go">type PublicKey struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="PublicKey.Bytes">func (*PublicKey) <span>Bytes</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PublicKey) Bytes() []byte</pre> <p>Bytes returns a copy of the encoding of the public key. </p>
+<h3 id="PublicKey.Curve">func (*PublicKey) <span>Curve</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PublicKey) Curve() Curve</pre> <h3 id="PublicKey.Equal">func (*PublicKey) <span>Equal</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PublicKey) Equal(x crypto.PublicKey) bool</pre> <p>Equal returns whether x represents the same public key as k. </p>
+<p>Note that there can be equivalent public keys with different encodings which would return false from this check but behave the same way as inputs to ECDH. </p>
+<p>This check is performed in constant time as long as the key types and their curve match. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/ecdh/" class="_attribution-link">http://golang.org/pkg/crypto/ecdh/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fecdsa%2Findex.html b/devdocs/go/crypto%2Fecdsa%2Findex.html
new file mode 100644
index 00000000..712672fb
--- /dev/null
+++ b/devdocs/go/crypto%2Fecdsa%2Findex.html
@@ -0,0 +1,76 @@
+<h1> Package ecdsa </h1> <ul id="short-nav">
+<li><code>import "crypto/ecdsa"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package ecdsa implements the Elliptic Curve Digital Signature Algorithm, as defined in FIPS 186-4 and SEC 1, Version 2.0. </p>
+<p>Signatures generated by this package are not deterministic, but entropy is mixed with the private key and the message, achieving the same level of security in case of randomness source failure. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+privateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
+if err != nil {
+ panic(err)
+}
+
+msg := "hello, world"
+hash := sha256.Sum256([]byte(msg))
+
+sig, err := ecdsa.SignASN1(rand.Reader, privateKey, hash[:])
+if err != nil {
+ panic(err)
+}
+fmt.Printf("signature: %x\n", sig)
+
+valid := ecdsa.VerifyASN1(&amp;privateKey.PublicKey, hash[:], sig)
+fmt.Println("signature verified:", valid)
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Sign">func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error)</a></li>
+<li><a href="#SignASN1">func SignASN1(rand io.Reader, priv *PrivateKey, hash []byte) ([]byte, error)</a></li>
+<li><a href="#Verify">func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool</a></li>
+<li><a href="#VerifyASN1">func VerifyASN1(pub *PublicKey, hash, sig []byte) bool</a></li>
+<li><a href="#PrivateKey">type PrivateKey</a></li>
+<li> <a href="#GenerateKey">func GenerateKey(c elliptic.Curve, rand io.Reader) (*PrivateKey, error)</a>
+</li>
+<li> <a href="#PrivateKey.ECDH">func (k *PrivateKey) ECDH() (*ecdh.PrivateKey, error)</a>
+</li>
+<li> <a href="#PrivateKey.Equal">func (priv *PrivateKey) Equal(x crypto.PrivateKey) bool</a>
+</li>
+<li> <a href="#PrivateKey.Public">func (priv *PrivateKey) Public() crypto.PublicKey</a>
+</li>
+<li> <a href="#PrivateKey.Sign">func (priv *PrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)</a>
+</li>
+<li><a href="#PublicKey">type PublicKey</a></li>
+<li> <a href="#PublicKey.ECDH">func (k *PublicKey) ECDH() (*ecdh.PublicKey, error)</a>
+</li>
+<li> <a href="#PublicKey.Equal">func (pub *PublicKey) Equal(x crypto.PublicKey) bool</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>ecdsa.go</span> <span>ecdsa_legacy.go</span> <span>ecdsa_noasm.go</span> <span>notboring.go</span> </p> <h2 id="Sign">func <span>Sign</span> </h2> <pre data-language="go">func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error)</pre> <p>Sign signs a hash (which should be the result of hashing a larger message) using the private key, priv. If the hash is longer than the bit-length of the private key's curve order, the hash will be truncated to that length. It returns the signature as a pair of integers. Most applications should use <a href="#SignASN1">SignASN1</a> instead of dealing directly with r, s. </p>
+<h2 id="SignASN1">func <span>SignASN1</span> <span title="Added in Go 1.15">1.15</span> </h2> <pre data-language="go">func SignASN1(rand io.Reader, priv *PrivateKey, hash []byte) ([]byte, error)</pre> <p>SignASN1 signs a hash (which should be the result of hashing a larger message) using the private key, priv. If the hash is longer than the bit-length of the private key's curve order, the hash will be truncated to that length. It returns the ASN.1 encoded signature. </p>
+<p>The signature is randomized. Most applications should use <span>crypto/rand.Reader</span> as rand. Note that the returned signature does not depend deterministically on the bytes read from rand, and may change between calls and/or between versions. </p>
+<h2 id="Verify">func <span>Verify</span> </h2> <pre data-language="go">func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool</pre> <p>Verify verifies the signature in r, s of hash using the public key, pub. Its return value records whether the signature is valid. Most applications should use VerifyASN1 instead of dealing directly with r, s. </p>
+<h2 id="VerifyASN1">func <span>VerifyASN1</span> <span title="Added in Go 1.15">1.15</span> </h2> <pre data-language="go">func VerifyASN1(pub *PublicKey, hash, sig []byte) bool</pre> <p>VerifyASN1 verifies the ASN.1 encoded signature, sig, of hash using the public key, pub. Its return value records whether the signature is valid. </p>
+<h2 id="PrivateKey">type <span>PrivateKey</span> </h2> <p>PrivateKey represents an ECDSA private key. </p>
+<pre data-language="go">type PrivateKey struct {
+ PublicKey
+ D *big.Int
+}
+</pre> <h3 id="GenerateKey">func <span>GenerateKey</span> </h3> <pre data-language="go">func GenerateKey(c elliptic.Curve, rand io.Reader) (*PrivateKey, error)</pre> <p>GenerateKey generates a new ECDSA private key for the specified curve. </p>
+<p>Most applications should use <span>crypto/rand.Reader</span> as rand. Note that the returned key does not depend deterministically on the bytes read from rand, and may change between calls and/or between versions. </p>
+<h3 id="PrivateKey.ECDH">func (*PrivateKey) <span>ECDH</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PrivateKey) ECDH() (*ecdh.PrivateKey, error)</pre> <p>ECDH returns k as a <span>ecdh.PrivateKey</span>. It returns an error if the key is invalid according to the definition of <span>ecdh.Curve.NewPrivateKey</span>, or if the Curve is not supported by <span>crypto/ecdh</span>. </p>
+<h3 id="PrivateKey.Equal">func (*PrivateKey) <span>Equal</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (priv *PrivateKey) Equal(x crypto.PrivateKey) bool</pre> <p>Equal reports whether priv and x have the same value. </p>
+<p>See <a href="#PublicKey.Equal">PublicKey.Equal</a> for details on how Curve is compared. </p>
+<h3 id="PrivateKey.Public">func (*PrivateKey) <span>Public</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (priv *PrivateKey) Public() crypto.PublicKey</pre> <p>Public returns the public key corresponding to priv. </p>
+<h3 id="PrivateKey.Sign">func (*PrivateKey) <span>Sign</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (priv *PrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)</pre> <p>Sign signs digest with priv, reading randomness from rand. The opts argument is not currently used but, in keeping with the crypto.Signer interface, should be the hash function used to digest the message. </p>
+<p>This method implements crypto.Signer, which is an interface to support keys where the private part is kept in, for example, a hardware module. Common uses can use the <a href="#SignASN1">SignASN1</a> function in this package directly. </p>
+<h2 id="PublicKey">type <span>PublicKey</span> </h2> <p>PublicKey represents an ECDSA public key. </p>
+<pre data-language="go">type PublicKey struct {
+ elliptic.Curve
+ X, Y *big.Int
+}
+</pre> <h3 id="PublicKey.ECDH">func (*PublicKey) <span>ECDH</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (k *PublicKey) ECDH() (*ecdh.PublicKey, error)</pre> <p>ECDH returns k as a <span>ecdh.PublicKey</span>. It returns an error if the key is invalid according to the definition of <span>ecdh.Curve.NewPublicKey</span>, or if the Curve is not supported by crypto/ecdh. </p>
+<h3 id="PublicKey.Equal">func (*PublicKey) <span>Equal</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (pub *PublicKey) Equal(x crypto.PublicKey) bool</pre> <p>Equal reports whether pub and x have the same value. </p>
+<p>Two keys are only considered to have the same value if they have the same Curve value. Note that for example <span>elliptic.P256</span> and elliptic.P256().Params() are different values, as the latter is a generic not constant time implementation. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/ecdsa/" class="_attribution-link">http://golang.org/pkg/crypto/ecdsa/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fed25519%2Findex.html b/devdocs/go/crypto%2Fed25519%2Findex.html
new file mode 100644
index 00000000..0a2ce4fa
--- /dev/null
+++ b/devdocs/go/crypto%2Fed25519%2Findex.html
@@ -0,0 +1,90 @@
+<h1> Package ed25519 </h1> <ul id="short-nav">
+<li><code>import "crypto/ed25519"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package ed25519 implements the Ed25519 signature algorithm. See <a href="https://ed25519.cr.yp.to/">https://ed25519.cr.yp.to/</a>. </p>
+<p>These functions are also compatible with the “Ed25519” function defined in RFC 8032. However, unlike RFC 8032's formulation, this package's private key representation includes a public key suffix to make multiple signing operations with the same key more efficient. This package refers to the RFC 8032 private key as the “seed”. </p> <h4 id="example__ed25519ctx"> <span class="text">Example (Ed25519ctx)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+pub, priv, err := GenerateKey(nil)
+if err != nil {
+ log.Fatal(err)
+}
+
+msg := []byte("The quick brown fox jumps over the lazy dog")
+
+sig, err := priv.Sign(nil, msg, &amp;Options{
+ Context: "Example_ed25519ctx",
+})
+if err != nil {
+ log.Fatal(err)
+}
+
+if err := VerifyWithOptions(pub, msg, sig, &amp;Options{
+ Context: "Example_ed25519ctx",
+}); err != nil {
+ log.Fatal("invalid signature")
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#GenerateKey">func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error)</a></li>
+<li><a href="#Sign">func Sign(privateKey PrivateKey, message []byte) []byte</a></li>
+<li><a href="#Verify">func Verify(publicKey PublicKey, message, sig []byte) bool</a></li>
+<li><a href="#VerifyWithOptions">func VerifyWithOptions(publicKey PublicKey, message, sig []byte, opts *Options) error</a></li>
+<li><a href="#Options">type Options</a></li>
+<li> <a href="#Options.HashFunc">func (o *Options) HashFunc() crypto.Hash</a>
+</li>
+<li><a href="#PrivateKey">type PrivateKey</a></li>
+<li> <a href="#NewKeyFromSeed">func NewKeyFromSeed(seed []byte) PrivateKey</a>
+</li>
+<li> <a href="#PrivateKey.Equal">func (priv PrivateKey) Equal(x crypto.PrivateKey) bool</a>
+</li>
+<li> <a href="#PrivateKey.Public">func (priv PrivateKey) Public() crypto.PublicKey</a>
+</li>
+<li> <a href="#PrivateKey.Seed">func (priv PrivateKey) Seed() []byte</a>
+</li>
+<li> <a href="#PrivateKey.Sign">func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error)</a>
+</li>
+<li><a href="#PublicKey">type PublicKey</a></li>
+<li> <a href="#PublicKey.Equal">func (pub PublicKey) Equal(x crypto.PublicKey) bool</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example__ed25519ctx">Package (Ed25519ctx)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>ed25519.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ // PublicKeySize is the size, in bytes, of public keys as used in this package.
+ PublicKeySize = 32
+ // PrivateKeySize is the size, in bytes, of private keys as used in this package.
+ PrivateKeySize = 64
+ // SignatureSize is the size, in bytes, of signatures generated and verified by this package.
+ SignatureSize = 64
+ // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032.
+ SeedSize = 32
+)</pre> <h2 id="GenerateKey">func <span>GenerateKey</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error)</pre> <p>GenerateKey generates a public/private key pair using entropy from rand. If rand is nil, <span>crypto/rand.Reader</span> will be used. </p>
+<p>The output of this function is deterministic, and equivalent to reading <a href="#SeedSize">SeedSize</a> bytes from rand, and passing them to <a href="#NewKeyFromSeed">NewKeyFromSeed</a>. </p>
+<h2 id="Sign">func <span>Sign</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func Sign(privateKey PrivateKey, message []byte) []byte</pre> <p>Sign signs the message with privateKey and returns a signature. It will panic if len(privateKey) is not <a href="#PrivateKeySize">PrivateKeySize</a>. </p>
+<h2 id="Verify">func <span>Verify</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func Verify(publicKey PublicKey, message, sig []byte) bool</pre> <p>Verify reports whether sig is a valid signature of message by publicKey. It will panic if len(publicKey) is not <a href="#PublicKeySize">PublicKeySize</a>. </p>
+<h2 id="VerifyWithOptions">func <span>VerifyWithOptions</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func VerifyWithOptions(publicKey PublicKey, message, sig []byte, opts *Options) error</pre> <p>VerifyWithOptions reports whether sig is a valid signature of message by publicKey. A valid signature is indicated by returning a nil error. It will panic if len(publicKey) is not <a href="#PublicKeySize">PublicKeySize</a>. </p>
+<p>If opts.Hash is <span>crypto.SHA512</span>, the pre-hashed variant Ed25519ph is used and message is expected to be a SHA-512 hash, otherwise opts.Hash must be <span>crypto.Hash</span>(0) and the message must not be hashed, as Ed25519 performs two passes over messages to be signed. </p>
+<h2 id="Options">type <span>Options</span> <span title="Added in Go 1.20">1.20</span> </h2> <p>Options can be used with <a href="#PrivateKey.Sign">PrivateKey.Sign</a> or <a href="#VerifyWithOptions">VerifyWithOptions</a> to select Ed25519 variants. </p>
+<pre data-language="go">type Options struct {
+ // Hash can be zero for regular Ed25519, or crypto.SHA512 for Ed25519ph.
+ Hash crypto.Hash
+
+ // Context, if not empty, selects Ed25519ctx or provides the context string
+ // for Ed25519ph. It can be at most 255 bytes in length.
+ Context string
+}
+</pre> <h3 id="Options.HashFunc">func (*Options) <span>HashFunc</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (o *Options) HashFunc() crypto.Hash</pre> <p>HashFunc returns o.Hash. </p>
+<h2 id="PrivateKey">type <span>PrivateKey</span> <span title="Added in Go 1.13">1.13</span> </h2> <p>PrivateKey is the type of Ed25519 private keys. It implements <span>crypto.Signer</span>. </p>
+<pre data-language="go">type PrivateKey []byte</pre> <h3 id="NewKeyFromSeed">func <span>NewKeyFromSeed</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func NewKeyFromSeed(seed []byte) PrivateKey</pre> <p>NewKeyFromSeed calculates a private key from a seed. It will panic if len(seed) is not <a href="#SeedSize">SeedSize</a>. This function is provided for interoperability with RFC 8032. RFC 8032's private keys correspond to seeds in this package. </p>
+<h3 id="PrivateKey.Equal">func (PrivateKey) <span>Equal</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (priv PrivateKey) Equal(x crypto.PrivateKey) bool</pre> <p>Equal reports whether priv and x have the same value. </p>
+<h3 id="PrivateKey.Public">func (PrivateKey) <span>Public</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (priv PrivateKey) Public() crypto.PublicKey</pre> <p>Public returns the <a href="#PublicKey">PublicKey</a> corresponding to priv. </p>
+<h3 id="PrivateKey.Seed">func (PrivateKey) <span>Seed</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (priv PrivateKey) Seed() []byte</pre> <p>Seed returns the private key seed corresponding to priv. It is provided for interoperability with RFC 8032. RFC 8032's private keys correspond to seeds in this package. </p>
+<h3 id="PrivateKey.Sign">func (PrivateKey) <span>Sign</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error)</pre> <p>Sign signs the given message with priv. rand is ignored and can be nil. </p>
+<p>If opts.HashFunc() is <span>crypto.SHA512</span>, the pre-hashed variant Ed25519ph is used and message is expected to be a SHA-512 hash, otherwise opts.HashFunc() must be <span>crypto.Hash</span>(0) and the message must not be hashed, as Ed25519 performs two passes over messages to be signed. </p>
+<p>A value of type <a href="#Options">Options</a> can be used as opts, or crypto.Hash(0) or crypto.SHA512 directly to select plain Ed25519 or Ed25519ph, respectively. </p>
+<h2 id="PublicKey">type <span>PublicKey</span> <span title="Added in Go 1.13">1.13</span> </h2> <p>PublicKey is the type of Ed25519 public keys. </p>
+<pre data-language="go">type PublicKey []byte</pre> <h3 id="PublicKey.Equal">func (PublicKey) <span>Equal</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (pub PublicKey) Equal(x crypto.PublicKey) bool</pre> <p>Equal reports whether pub and x have the same value. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/ed25519/" class="_attribution-link">http://golang.org/pkg/crypto/ed25519/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Felliptic%2Findex.html b/devdocs/go/crypto%2Felliptic%2Findex.html
new file mode 100644
index 00000000..496c473a
--- /dev/null
+++ b/devdocs/go/crypto%2Felliptic%2Findex.html
@@ -0,0 +1,117 @@
+<h1> Package elliptic </h1> <ul id="short-nav">
+<li><code>import "crypto/elliptic"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package elliptic implements the standard NIST P-224, P-256, P-384, and P-521 elliptic curves over prime fields. </p>
+<p>Direct use of this package is deprecated, beyond the <a href="#P224">P224</a>, <a href="#P256">P256</a>, <a href="#P384">P384</a>, and <a href="#P521">P521</a> values necessary to use <span>crypto/ecdsa</span>. Most other uses should migrate to the more efficient and safer <span>crypto/ecdh</span>, or to third-party modules for lower-level functionality. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#GenerateKey">func GenerateKey(curve Curve, rand io.Reader) (priv []byte, x, y *big.Int, err error)</a></li>
+<li><a href="#Marshal">func Marshal(curve Curve, x, y *big.Int) []byte</a></li>
+<li><a href="#MarshalCompressed">func MarshalCompressed(curve Curve, x, y *big.Int) []byte</a></li>
+<li><a href="#Unmarshal">func Unmarshal(curve Curve, data []byte) (x, y *big.Int)</a></li>
+<li><a href="#UnmarshalCompressed">func UnmarshalCompressed(curve Curve, data []byte) (x, y *big.Int)</a></li>
+<li><a href="#Curve">type Curve</a></li>
+<li> <a href="#P224">func P224() Curve</a>
+</li>
+<li> <a href="#P256">func P256() Curve</a>
+</li>
+<li> <a href="#P384">func P384() Curve</a>
+</li>
+<li> <a href="#P521">func P521() Curve</a>
+</li>
+<li><a href="#CurveParams">type CurveParams</a></li>
+<li> <a href="#CurveParams.Add">func (curve *CurveParams) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)</a>
+</li>
+<li> <a href="#CurveParams.Double">func (curve *CurveParams) Double(x1, y1 *big.Int) (*big.Int, *big.Int)</a>
+</li>
+<li> <a href="#CurveParams.IsOnCurve">func (curve *CurveParams) IsOnCurve(x, y *big.Int) bool</a>
+</li>
+<li> <a href="#CurveParams.Params">func (curve *CurveParams) Params() *CurveParams</a>
+</li>
+<li> <a href="#CurveParams.ScalarBaseMult">func (curve *CurveParams) ScalarBaseMult(k []byte) (*big.Int, *big.Int)</a>
+</li>
+<li> <a href="#CurveParams.ScalarMult">func (curve *CurveParams) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>elliptic.go</span> <span>nistec.go</span> <span>nistec_p256.go</span> <span>params.go</span> </p> <h2 id="GenerateKey">func <span>GenerateKey</span> </h2> <pre data-language="go">func GenerateKey(curve Curve, rand io.Reader) (priv []byte, x, y *big.Int, err error)</pre> <p>GenerateKey returns a public/private key pair. The private key is generated using the given reader, which must return random data. </p>
+<p>Deprecated: for ECDH, use the GenerateKey methods of the <span>crypto/ecdh</span> package; for ECDSA, use the GenerateKey function of the crypto/ecdsa package. </p>
+<h2 id="Marshal">func <span>Marshal</span> </h2> <pre data-language="go">func Marshal(curve Curve, x, y *big.Int) []byte</pre> <p>Marshal converts a point on the curve into the uncompressed form specified in SEC 1, Version 2.0, Section 2.3.3. If the point is not on the curve (or is the conventional point at infinity), the behavior is undefined. </p>
+<p>Deprecated: for ECDH, use the crypto/ecdh package. This function returns an encoding equivalent to that of PublicKey.Bytes in crypto/ecdh. </p>
+<h2 id="MarshalCompressed">func <span>MarshalCompressed</span> <span title="Added in Go 1.15">1.15</span> </h2> <pre data-language="go">func MarshalCompressed(curve Curve, x, y *big.Int) []byte</pre> <p>MarshalCompressed converts a point on the curve into the compressed form specified in SEC 1, Version 2.0, Section 2.3.3. If the point is not on the curve (or is the conventional point at infinity), the behavior is undefined. </p>
+<h2 id="Unmarshal">func <span>Unmarshal</span> </h2> <pre data-language="go">func Unmarshal(curve Curve, data []byte) (x, y *big.Int)</pre> <p>Unmarshal converts a point, serialized by <a href="#Marshal">Marshal</a>, into an x, y pair. It is an error if the point is not in uncompressed form, is not on the curve, or is the point at infinity. On error, x = nil. </p>
+<p>Deprecated: for ECDH, use the crypto/ecdh package. This function accepts an encoding equivalent to that of the NewPublicKey methods in crypto/ecdh. </p>
+<h2 id="UnmarshalCompressed">func <span>UnmarshalCompressed</span> <span title="Added in Go 1.15">1.15</span> </h2> <pre data-language="go">func UnmarshalCompressed(curve Curve, data []byte) (x, y *big.Int)</pre> <p>UnmarshalCompressed converts a point, serialized by <a href="#MarshalCompressed">MarshalCompressed</a>, into an x, y pair. It is an error if the point is not in compressed form, is not on the curve, or is the point at infinity. On error, x = nil. </p>
+<h2 id="Curve">type <span>Curve</span> </h2> <p>A Curve represents a short-form Weierstrass curve with a=-3. </p>
+<p>The behavior of Add, Double, and ScalarMult when the input is not a point on the curve is undefined. </p>
+<p>Note that the conventional point at infinity (0, 0) is not considered on the curve, although it can be returned by Add, Double, ScalarMult, or ScalarBaseMult (but not the <a href="#Unmarshal">Unmarshal</a> or <a href="#UnmarshalCompressed">UnmarshalCompressed</a> functions). </p>
+<p>Using Curve implementations besides those returned by <a href="#P224">P224</a>, <a href="#P256">P256</a>, <a href="#P384">P384</a>, and <a href="#P521">P521</a> is deprecated. </p>
+<pre data-language="go">type Curve interface {
+ // Params returns the parameters for the curve.
+ Params() *CurveParams
+
+ // IsOnCurve reports whether the given (x,y) lies on the curve.
+ //
+ // Deprecated: this is a low-level unsafe API. For ECDH, use the crypto/ecdh
+ // package. The NewPublicKey methods of NIST curves in crypto/ecdh accept
+ // the same encoding as the Unmarshal function, and perform on-curve checks.
+ IsOnCurve(x, y *big.Int) bool
+
+ // Add returns the sum of (x1,y1) and (x2,y2).
+ //
+ // Deprecated: this is a low-level unsafe API.
+ Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int)
+
+ // Double returns 2*(x,y).
+ //
+ // Deprecated: this is a low-level unsafe API.
+ Double(x1, y1 *big.Int) (x, y *big.Int)
+
+ // ScalarMult returns k*(x,y) where k is an integer in big-endian form.
+ //
+ // Deprecated: this is a low-level unsafe API. For ECDH, use the crypto/ecdh
+ // package. Most uses of ScalarMult can be replaced by a call to the ECDH
+ // methods of NIST curves in crypto/ecdh.
+ ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int)
+
+ // ScalarBaseMult returns k*G, where G is the base point of the group
+ // and k is an integer in big-endian form.
+ //
+ // Deprecated: this is a low-level unsafe API. For ECDH, use the crypto/ecdh
+ // package. Most uses of ScalarBaseMult can be replaced by a call to the
+ // PrivateKey.PublicKey method in crypto/ecdh.
+ ScalarBaseMult(k []byte) (x, y *big.Int)
+}</pre> <h3 id="P224">func <span>P224</span> </h3> <pre data-language="go">func P224() Curve</pre> <p>P224 returns a <a href="#Curve">Curve</a> which implements NIST P-224 (FIPS 186-3, section D.2.2), also known as secp224r1. The CurveParams.Name of this <a href="#Curve">Curve</a> is "P-224". </p>
+<p>Multiple invocations of this function will return the same value, so it can be used for equality checks and switch statements. </p>
+<p>The cryptographic operations are implemented using constant-time algorithms. </p>
+<h3 id="P256">func <span>P256</span> </h3> <pre data-language="go">func P256() Curve</pre> <p>P256 returns a <a href="#Curve">Curve</a> which implements NIST P-256 (FIPS 186-3, section D.2.3), also known as secp256r1 or prime256v1. The CurveParams.Name of this <a href="#Curve">Curve</a> is "P-256". </p>
+<p>Multiple invocations of this function will return the same value, so it can be used for equality checks and switch statements. </p>
+<p>The cryptographic operations are implemented using constant-time algorithms. </p>
+<h3 id="P384">func <span>P384</span> </h3> <pre data-language="go">func P384() Curve</pre> <p>P384 returns a <a href="#Curve">Curve</a> which implements NIST P-384 (FIPS 186-3, section D.2.4), also known as secp384r1. The CurveParams.Name of this <a href="#Curve">Curve</a> is "P-384". </p>
+<p>Multiple invocations of this function will return the same value, so it can be used for equality checks and switch statements. </p>
+<p>The cryptographic operations are implemented using constant-time algorithms. </p>
+<h3 id="P521">func <span>P521</span> </h3> <pre data-language="go">func P521() Curve</pre> <p>P521 returns a <a href="#Curve">Curve</a> which implements NIST P-521 (FIPS 186-3, section D.2.5), also known as secp521r1. The CurveParams.Name of this <a href="#Curve">Curve</a> is "P-521". </p>
+<p>Multiple invocations of this function will return the same value, so it can be used for equality checks and switch statements. </p>
+<p>The cryptographic operations are implemented using constant-time algorithms. </p>
+<h2 id="CurveParams">type <span>CurveParams</span> </h2> <p>CurveParams contains the parameters of an elliptic curve and also provides a generic, non-constant time implementation of <a href="#Curve">Curve</a>. </p>
+<p>The generic Curve implementation is deprecated, and using custom curves (those not returned by <a href="#P224">P224</a>, <a href="#P256">P256</a>, <a href="#P384">P384</a>, and <a href="#P521">P521</a>) is not guaranteed to provide any security property. </p>
+<pre data-language="go">type CurveParams struct {
+ P *big.Int // the order of the underlying field
+ N *big.Int // the order of the base point
+ B *big.Int // the constant of the curve equation
+ Gx, Gy *big.Int // (x,y) of the base point
+ BitSize int // the size of the underlying field
+ Name string // the canonical name of the curve; added in Go 1.5
+}
+</pre> <h3 id="CurveParams.Add">func (*CurveParams) <span>Add</span> </h3> <pre data-language="go">func (curve *CurveParams) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)</pre> <p>Add implements [Curve.Add]. </p>
+<p>Deprecated: the <a href="#CurveParams">CurveParams</a> methods are deprecated and are not guaranteed to provide any security property. For ECDH, use the <span>crypto/ecdh</span> package. For ECDSA, use the <span>crypto/ecdsa</span> package with a <a href="#Curve">Curve</a> value returned directly from <a href="#P224">P224</a>, <a href="#P256">P256</a>, <a href="#P384">P384</a>, or <a href="#P521">P521</a>. </p>
+<h3 id="CurveParams.Double">func (*CurveParams) <span>Double</span> </h3> <pre data-language="go">func (curve *CurveParams) Double(x1, y1 *big.Int) (*big.Int, *big.Int)</pre> <p>Double implements [Curve.Double]. </p>
+<p>Deprecated: the [CurveParams】 methods are deprecated and are not guaranteed to provide any security property. For ECDH, use the <span>crypto/ecdh</span> package. For ECDSA, use the <span>crypto/ecdsa</span> package with a <a href="#Curve">Curve</a> value returned directly from <a href="#P224">P224</a>, <a href="#P256">P256</a>, <a href="#P384">P384</a>, or <a href="#P521">P521</a>. </p>
+<h3 id="CurveParams.IsOnCurve">func (*CurveParams) <span>IsOnCurve</span> </h3> <pre data-language="go">func (curve *CurveParams) IsOnCurve(x, y *big.Int) bool</pre> <p>IsOnCurve implements [Curve.IsOnCurve]. </p>
+<p>Deprecated: the <a href="#CurveParams">CurveParams</a> methods are deprecated and are not guaranteed to provide any security property. For ECDH, use the <span>crypto/ecdh</span> package. For ECDSA, use the <span>crypto/ecdsa</span> package with a <a href="#Curve">Curve</a> value returned directly from <a href="#P224">P224</a>, <a href="#P256">P256</a>, <a href="#P384">P384</a>, or <a href="#P521">P521</a>. </p>
+<h3 id="CurveParams.Params">func (*CurveParams) <span>Params</span> </h3> <pre data-language="go">func (curve *CurveParams) Params() *CurveParams</pre> <h3 id="CurveParams.ScalarBaseMult">func (*CurveParams) <span>ScalarBaseMult</span> </h3> <pre data-language="go">func (curve *CurveParams) ScalarBaseMult(k []byte) (*big.Int, *big.Int)</pre> <p>ScalarBaseMult implements [Curve.ScalarBaseMult]. </p>
+<p>Deprecated: the <a href="#CurveParams">CurveParams</a> methods are deprecated and are not guaranteed to provide any security property. For ECDH, use the <span>crypto/ecdh</span> package. For ECDSA, use the <span>crypto/ecdsa</span> package with a <a href="#Curve">Curve</a> value returned directly from <a href="#P224">P224</a>, <a href="#P256">P256</a>, <a href="#P384">P384</a>, or <a href="#P521">P521</a>. </p>
+<h3 id="CurveParams.ScalarMult">func (*CurveParams) <span>ScalarMult</span> </h3> <pre data-language="go">func (curve *CurveParams) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)</pre> <p>ScalarMult implements [Curve.ScalarMult]. </p>
+<p>Deprecated: the <a href="#CurveParams">CurveParams</a> methods are deprecated and are not guaranteed to provide any security property. For ECDH, use the <span>crypto/ecdh</span> package. For ECDSA, use the <span>crypto/ecdsa</span> package with a <a href="#Curve">Curve</a> value returned directly from <a href="#P224">P224</a>, <a href="#P256">P256</a>, <a href="#P384">P384</a>, or <a href="#P521">P521</a>. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/elliptic/" class="_attribution-link">http://golang.org/pkg/crypto/elliptic/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fhmac%2Findex.html b/devdocs/go/crypto%2Fhmac%2Findex.html
new file mode 100644
index 00000000..e08e7719
--- /dev/null
+++ b/devdocs/go/crypto%2Fhmac%2Findex.html
@@ -0,0 +1,23 @@
+<h1> Package hmac </h1> <ul id="short-nav">
+<li><code>import "crypto/hmac"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package hmac implements the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198. An HMAC is a cryptographic hash that uses a key to sign a message. The receiver verifies the hash by recomputing it using the same key. </p>
+<p>Receivers should be careful to use Equal to compare MACs in order to avoid timing side-channels: </p>
+<pre data-language="go">// ValidMAC reports whether messageMAC is a valid HMAC tag for message.
+func ValidMAC(message, messageMAC, key []byte) bool {
+ mac := hmac.New(sha256.New, key)
+ mac.Write(message)
+ expectedMAC := mac.Sum(nil)
+ return hmac.Equal(messageMAC, expectedMAC)
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Equal">func Equal(mac1, mac2 []byte) bool</a></li>
+<li><a href="#New">func New(h func() hash.Hash, key []byte) hash.Hash</a></li>
+</ul> <h3>Package files</h3> <p> <span>hmac.go</span> </p> <h2 id="Equal">func <span>Equal</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func Equal(mac1, mac2 []byte) bool</pre> <p>Equal compares two MACs for equality without leaking timing information. </p>
+<h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New(h func() hash.Hash, key []byte) hash.Hash</pre> <p>New returns a new HMAC hash using the given <span>hash.Hash</span> type and key. New functions like sha256.New from <span>crypto/sha256</span> can be used as h. h must return a new Hash every time it is called. Note that unlike other hash implementations in the standard library, the returned Hash does not implement <span>encoding.BinaryMarshaler</span> or <span>encoding.BinaryUnmarshaler</span>. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/hmac/" class="_attribution-link">http://golang.org/pkg/crypto/hmac/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Findex.html b/devdocs/go/crypto%2Findex.html
new file mode 100644
index 00000000..40f5c02a
--- /dev/null
+++ b/devdocs/go/crypto%2Findex.html
@@ -0,0 +1,106 @@
+<h1> Package crypto </h1> <ul id="short-nav">
+<li><code>import "crypto"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package crypto collects common cryptographic constants. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#RegisterHash">func RegisterHash(h Hash, f func() hash.Hash)</a></li>
+<li><a href="#Decrypter">type Decrypter</a></li>
+<li><a href="#DecrypterOpts">type DecrypterOpts</a></li>
+<li><a href="#Hash">type Hash</a></li>
+<li> <a href="#Hash.Available">func (h Hash) Available() bool</a>
+</li>
+<li> <a href="#Hash.HashFunc">func (h Hash) HashFunc() Hash</a>
+</li>
+<li> <a href="#Hash.New">func (h Hash) New() hash.Hash</a>
+</li>
+<li> <a href="#Hash.Size">func (h Hash) Size() int</a>
+</li>
+<li> <a href="#Hash.String">func (h Hash) String() string</a>
+</li>
+<li><a href="#PrivateKey">type PrivateKey</a></li>
+<li><a href="#PublicKey">type PublicKey</a></li>
+<li><a href="#Signer">type Signer</a></li>
+<li><a href="#SignerOpts">type SignerOpts</a></li>
+</ul> <h3>Package files</h3> <p> <span>crypto.go</span> </p> <h2 id="RegisterHash">func <span>RegisterHash</span> </h2> <pre data-language="go">func RegisterHash(h Hash, f func() hash.Hash)</pre> <p>RegisterHash registers a function that returns a new instance of the given hash function. This is intended to be called from the init function in packages that implement hash functions. </p>
+<h2 id="Decrypter">type <span>Decrypter</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>Decrypter is an interface for an opaque private key that can be used for asymmetric decryption operations. An example would be an RSA key kept in a hardware module. </p>
+<pre data-language="go">type Decrypter interface {
+ // Public returns the public key corresponding to the opaque,
+ // private key.
+ Public() PublicKey
+
+ // Decrypt decrypts msg. The opts argument should be appropriate for
+ // the primitive used. See the documentation in each implementation for
+ // details.
+ Decrypt(rand io.Reader, msg []byte, opts DecrypterOpts) (plaintext []byte, err error)
+}</pre> <h2 id="DecrypterOpts">type <span>DecrypterOpts</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">type DecrypterOpts any</pre> <h2 id="Hash">type <span>Hash</span> </h2> <p>Hash identifies a cryptographic hash function that is implemented in another package. </p>
+<pre data-language="go">type Hash uint</pre> <pre data-language="go">const (
+ MD4 Hash = 1 + iota // import golang.org/x/crypto/md4
+ MD5 // import crypto/md5
+ SHA1 // import crypto/sha1
+ SHA224 // import crypto/sha256
+ SHA256 // import crypto/sha256
+ SHA384 // import crypto/sha512
+ SHA512 // import crypto/sha512
+ MD5SHA1 // no implementation; MD5+SHA1 used for TLS RSA
+ RIPEMD160 // import golang.org/x/crypto/ripemd160
+ SHA3_224 // import golang.org/x/crypto/sha3
+ SHA3_256 // import golang.org/x/crypto/sha3
+ SHA3_384 // import golang.org/x/crypto/sha3
+ SHA3_512 // import golang.org/x/crypto/sha3
+ SHA512_224 // import crypto/sha512
+ SHA512_256 // import crypto/sha512
+ BLAKE2s_256 // import golang.org/x/crypto/blake2s
+ BLAKE2b_256 // import golang.org/x/crypto/blake2b
+ BLAKE2b_384 // import golang.org/x/crypto/blake2b
+ BLAKE2b_512 // import golang.org/x/crypto/blake2b
+
+)</pre> <h3 id="Hash.Available">func (Hash) <span>Available</span> </h3> <pre data-language="go">func (h Hash) Available() bool</pre> <p>Available reports whether the given hash function is linked into the binary. </p>
+<h3 id="Hash.HashFunc">func (Hash) <span>HashFunc</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (h Hash) HashFunc() Hash</pre> <p>HashFunc simply returns the value of h so that <a href="#Hash">Hash</a> implements <a href="#SignerOpts">SignerOpts</a>. </p>
+<h3 id="Hash.New">func (Hash) <span>New</span> </h3> <pre data-language="go">func (h Hash) New() hash.Hash</pre> <p>New returns a new hash.Hash calculating the given hash function. New panics if the hash function is not linked into the binary. </p>
+<h3 id="Hash.Size">func (Hash) <span>Size</span> </h3> <pre data-language="go">func (h Hash) Size() int</pre> <p>Size returns the length, in bytes, of a digest resulting from the given hash function. It doesn't require that the hash function in question be linked into the program. </p>
+<h3 id="Hash.String">func (Hash) <span>String</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (h Hash) String() string</pre> <h2 id="PrivateKey">type <span>PrivateKey</span> </h2> <p>PrivateKey represents a private key using an unspecified algorithm. </p>
+<p>Although this type is an empty interface for backwards compatibility reasons, all private key types in the standard library implement the following interface </p>
+<pre data-language="go">interface{
+ Public() crypto.PublicKey
+ Equal(x crypto.PrivateKey) bool
+}
+</pre> <p>as well as purpose-specific interfaces such as <a href="#Signer">Signer</a> and <a href="#Decrypter">Decrypter</a>, which can be used for increased type safety within applications. </p>
+<pre data-language="go">type PrivateKey any</pre> <h2 id="PublicKey">type <span>PublicKey</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>PublicKey represents a public key using an unspecified algorithm. </p>
+<p>Although this type is an empty interface for backwards compatibility reasons, all public key types in the standard library implement the following interface </p>
+<pre data-language="go">interface{
+ Equal(x crypto.PublicKey) bool
+}
+</pre> <p>which can be used for increased type safety within applications. </p>
+<pre data-language="go">type PublicKey any</pre> <h2 id="Signer">type <span>Signer</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>Signer is an interface for an opaque private key that can be used for signing operations. For example, an RSA key kept in a hardware module. </p>
+<pre data-language="go">type Signer interface {
+ // Public returns the public key corresponding to the opaque,
+ // private key.
+ Public() PublicKey
+
+ // Sign signs digest with the private key, possibly using entropy from
+ // rand. For an RSA key, the resulting signature should be either a
+ // PKCS #1 v1.5 or PSS signature (as indicated by opts). For an (EC)DSA
+ // key, it should be a DER-serialised, ASN.1 signature structure.
+ //
+ // Hash implements the SignerOpts interface and, in most cases, one can
+ // simply pass in the hash function used as opts. Sign may also attempt
+ // to type assert opts to other types in order to obtain algorithm
+ // specific values. See the documentation in each package for details.
+ //
+ // Note that when a signature of a hash of a larger message is needed,
+ // the caller is responsible for hashing the larger message and passing
+ // the hash (as digest) and the hash function (as opts) to Sign.
+ Sign(rand io.Reader, digest []byte, opts SignerOpts) (signature []byte, err error)
+}</pre> <h2 id="SignerOpts">type <span>SignerOpts</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>SignerOpts contains options for signing with a <a href="#Signer">Signer</a>. </p>
+<pre data-language="go">type SignerOpts interface {
+ // HashFunc returns an identifier for the hash function used to produce
+ // the message passed to Signer.Sign, or else zero to indicate that no
+ // hashing was done.
+ HashFunc() Hash
+}</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="aes/index">aes</a> </td> <td class="pkg-synopsis"> Package aes implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197. </td> </tr> <tr> <td class="pkg-name"> <a href="boring/index">boring</a> </td> <td class="pkg-synopsis"> Package boring exposes functions that are only available when building with Go+BoringCrypto. </td> </tr> <tr> <td class="pkg-name"> <a href="cipher/index">cipher</a> </td> <td class="pkg-synopsis"> Package cipher implements standard block cipher modes that can be wrapped around low-level block cipher implementations. </td> </tr> <tr> <td class="pkg-name"> <a href="des/index">des</a> </td> <td class="pkg-synopsis"> Package des implements the Data Encryption Standard (DES) and the Triple Data Encryption Algorithm (TDEA) as defined in U.S. Federal Information Processing Standards Publication 46-3. </td> </tr> <tr> <td class="pkg-name"> <a href="dsa/index">dsa</a> </td> <td class="pkg-synopsis"> Package dsa implements the Digital Signature Algorithm, as defined in FIPS 186-3. </td> </tr> <tr> <td class="pkg-name"> <a href="ecdh/index">ecdh</a> </td> <td class="pkg-synopsis"> Package ecdh implements Elliptic Curve Diffie-Hellman over NIST curves and Curve25519. </td> </tr> <tr> <td class="pkg-name"> <a href="ecdsa/index">ecdsa</a> </td> <td class="pkg-synopsis"> Package ecdsa implements the Elliptic Curve Digital Signature Algorithm, as defined in FIPS 186-4 and SEC 1, Version 2.0. </td> </tr> <tr> <td class="pkg-name"> <a href="ed25519/index">ed25519</a> </td> <td class="pkg-synopsis"> Package ed25519 implements the Ed25519 signature algorithm. </td> </tr> <tr> <td class="pkg-name"> <a href="elliptic/index">elliptic</a> </td> <td class="pkg-synopsis"> Package elliptic implements the standard NIST P-224, P-256, P-384, and P-521 elliptic curves over prime fields. </td> </tr> <tr> <td class="pkg-name"> <a href="hmac/index">hmac</a> </td> <td class="pkg-synopsis"> Package hmac implements the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198. </td> </tr> <tr> <td class="pkg-name"> <a href="md5/index">md5</a> </td> <td class="pkg-synopsis"> Package md5 implements the MD5 hash algorithm as defined in RFC 1321. </td> </tr> <tr> <td class="pkg-name"> <a href="rand/index">rand</a> </td> <td class="pkg-synopsis"> Package rand implements a cryptographically secure random number generator. </td> </tr> <tr> <td class="pkg-name"> <a href="rc4/index">rc4</a> </td> <td class="pkg-synopsis"> Package rc4 implements RC4 encryption, as defined in Bruce Schneier's Applied Cryptography. </td> </tr> <tr> <td class="pkg-name"> <a href="rsa/index">rsa</a> </td> <td class="pkg-synopsis"> Package rsa implements RSA encryption as specified in PKCS #1 and RFC 8017. </td> </tr> <tr> <td class="pkg-name"> <a href="sha1/index">sha1</a> </td> <td class="pkg-synopsis"> Package sha1 implements the SHA-1 hash algorithm as defined in RFC 3174. </td> </tr> <tr> <td class="pkg-name"> <a href="sha256/index">sha256</a> </td> <td class="pkg-synopsis"> Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4. </td> </tr> <tr> <td class="pkg-name"> <a href="sha512/index">sha512</a> </td> <td class="pkg-synopsis"> Package sha512 implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 hash algorithms as defined in FIPS 180-4. </td> </tr> <tr> <td class="pkg-name"> <a href="subtle/index">subtle</a> </td> <td class="pkg-synopsis"> Package subtle implements functions that are often useful in cryptographic code but require careful thought to use correctly. </td> </tr> <tr> <td class="pkg-name"> <a href="tls/index">tls</a> </td> <td class="pkg-synopsis"> Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446. </td> </tr> <tr> <td class="pkg-name"> <a href="tls/fipsonly/index">fipsonly</a> </td> <td class="pkg-synopsis"> Package fipsonly restricts all TLS configuration to FIPS-approved settings. </td> </tr> <tr> <td class="pkg-name"> <a href="x509/index">x509</a> </td> <td class="pkg-synopsis"> Package x509 implements a subset of the X.509 standard. </td> </tr> <tr> <td class="pkg-name"> <a href="x509/pkix/index">pkix</a> </td> <td class="pkg-synopsis"> Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/" class="_attribution-link">http://golang.org/pkg/crypto/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fmd5%2Findex.html b/devdocs/go/crypto%2Fmd5%2Findex.html
new file mode 100644
index 00000000..a41a5b8d
--- /dev/null
+++ b/devdocs/go/crypto%2Fmd5%2Findex.html
@@ -0,0 +1,42 @@
+<h1> Package md5 </h1> <ul id="short-nav">
+<li><code>import "crypto/md5"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package md5 implements the MD5 hash algorithm as defined in RFC 1321. </p>
+<p>MD5 is cryptographically broken and should not be used for secure applications. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#New">func New() hash.Hash</a></li>
+<li><a href="#Sum">func Sum(data []byte) [Size]byte</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_New">New</a></dd> <dd><a class="exampleLink" href="#example_New_file">New (File)</a></dd> <dd><a class="exampleLink" href="#example_Sum">Sum</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>md5.go</span> <span>md5block.go</span> <span>md5block_decl.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>The blocksize of MD5 in bytes. </p>
+<pre data-language="go">const BlockSize = 64</pre> <p>The size of an MD5 checksum in bytes. </p>
+<pre data-language="go">const Size = 16</pre> <h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New() hash.Hash</pre> <p>New returns a new hash.Hash computing the MD5 checksum. The Hash also implements <span>encoding.BinaryMarshaler</span> and <span>encoding.BinaryUnmarshaler</span> to marshal and unmarshal the internal state of the hash. </p> <h4 id="example_New"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">h := md5.New()
+io.WriteString(h, "The fog is getting thicker!")
+io.WriteString(h, "And Leon's getting laaarger!")
+fmt.Printf("%x", h.Sum(nil))
+</pre> <p>Output:</p> <pre class="output" data-language="go">e2c569be17396eca2a2e3c11578123ed
+</pre> <h4 id="example_New_file"> <span class="text">Example (File)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+f, err := os.Open("file.txt")
+if err != nil {
+ log.Fatal(err)
+}
+defer f.Close()
+
+h := md5.New()
+if _, err := io.Copy(h, f); err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%x", h.Sum(nil))
+</pre> <h2 id="Sum">func <span>Sum</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Sum(data []byte) [Size]byte</pre> <p>Sum returns the MD5 checksum of the data. </p> <h4 id="example_Sum"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">data := []byte("These pretzels are making me thirsty.")
+fmt.Printf("%x", md5.Sum(data))
+</pre> <p>Output:</p> <pre class="output" data-language="go">b0804ec967f48520697662a204f5fe72
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/md5/" class="_attribution-link">http://golang.org/pkg/crypto/md5/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Frand%2Findex.html b/devdocs/go/crypto%2Frand%2Findex.html
new file mode 100644
index 00000000..0ffd3e5b
--- /dev/null
+++ b/devdocs/go/crypto%2Frand%2Findex.html
@@ -0,0 +1,32 @@
+<h1> Package rand </h1> <ul id="short-nav">
+<li><code>import "crypto/rand"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package rand implements a cryptographically secure random number generator. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Int">func Int(rand io.Reader, max *big.Int) (n *big.Int, err error)</a></li>
+<li><a href="#Prime">func Prime(rand io.Reader, bits int) (*big.Int, error)</a></li>
+<li><a href="#Read">func Read(b []byte) (n int, err error)</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Read">Read</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>rand.go</span> <span>rand_getrandom.go</span> <span>rand_unix.go</span> <span>util.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>Reader is a global, shared instance of a cryptographically secure random number generator. </p>
+<p>On Linux, FreeBSD, Dragonfly, NetBSD and Solaris, Reader uses getrandom(2) if available, /dev/urandom otherwise. On OpenBSD and macOS, Reader uses getentropy(2). On other Unix-like systems, Reader reads from /dev/urandom. On Windows systems, Reader uses the ProcessPrng API. On JS/Wasm, Reader uses the Web Crypto API. On WASIP1/Wasm, Reader uses random_get from wasi_snapshot_preview1. </p>
+<pre data-language="go">var Reader io.Reader</pre> <h2 id="Int">func <span>Int</span> </h2> <pre data-language="go">func Int(rand io.Reader, max *big.Int) (n *big.Int, err error)</pre> <p>Int returns a uniform random value in [0, max). It panics if max &lt;= 0. </p>
+<h2 id="Prime">func <span>Prime</span> </h2> <pre data-language="go">func Prime(rand io.Reader, bits int) (*big.Int, error)</pre> <p>Prime returns a number of the given bit length that is prime with high probability. Prime will return error for any error returned by <a href="#Read">rand.Read</a> or if bits &lt; 2. </p>
+<h2 id="Read">func <span>Read</span> </h2> <pre data-language="go">func Read(b []byte) (n int, err error)</pre> <p>Read is a helper function that calls Reader.Read using io.ReadFull. On return, n == len(b) if and only if err == nil. </p> <h4 id="example_Read"> <span class="text">Example</span>
+</h4> <p>This example reads 10 cryptographically secure pseudorandom numbers from rand.Reader and writes them to a byte slice. </p> <p>Code:</p> <pre class="code" data-language="go">c := 10
+b := make([]byte, c)
+_, err := rand.Read(b)
+if err != nil {
+ fmt.Println("error:", err)
+ return
+}
+// The slice should now contain random bytes instead of only zeroes.
+fmt.Println(bytes.Equal(b, make([]byte, c)))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">false
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/rand/" class="_attribution-link">http://golang.org/pkg/crypto/rand/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Frc4%2Findex.html b/devdocs/go/crypto%2Frc4%2Findex.html
new file mode 100644
index 00000000..51f33835
--- /dev/null
+++ b/devdocs/go/crypto%2Frc4%2Findex.html
@@ -0,0 +1,30 @@
+<h1> Package rc4 </h1> <ul id="short-nav">
+<li><code>import "crypto/rc4"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package rc4 implements RC4 encryption, as defined in Bruce Schneier's Applied Cryptography. </p>
+<p>RC4 is cryptographically broken and should not be used for secure applications. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Cipher">type Cipher</a></li>
+<li> <a href="#NewCipher">func NewCipher(key []byte) (*Cipher, error)</a>
+</li>
+<li> <a href="#Cipher.Reset">func (c *Cipher) Reset()</a>
+</li>
+<li> <a href="#Cipher.XORKeyStream">func (c *Cipher) XORKeyStream(dst, src []byte)</a>
+</li>
+<li><a href="#KeySizeError">type KeySizeError</a></li>
+<li> <a href="#KeySizeError.Error">func (k KeySizeError) Error() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>rc4.go</span> </p> <h2 id="Cipher">type <span>Cipher</span> </h2> <p>A Cipher is an instance of RC4 using a particular key. </p>
+<pre data-language="go">type Cipher struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewCipher">func <span>NewCipher</span> </h3> <pre data-language="go">func NewCipher(key []byte) (*Cipher, error)</pre> <p>NewCipher creates and returns a new <a href="#Cipher">Cipher</a>. The key argument should be the RC4 key, at least 1 byte and at most 256 bytes. </p>
+<h3 id="Cipher.Reset">func (*Cipher) <span>Reset</span> </h3> <pre data-language="go">func (c *Cipher) Reset()</pre> <p>Reset zeros the key data and makes the <a href="#Cipher">Cipher</a> unusable. </p>
+<p>Deprecated: Reset can't guarantee that the key will be entirely removed from the process's memory. </p>
+<h3 id="Cipher.XORKeyStream">func (*Cipher) <span>XORKeyStream</span> </h3> <pre data-language="go">func (c *Cipher) XORKeyStream(dst, src []byte)</pre> <p>XORKeyStream sets dst to the result of XORing src with the key stream. Dst and src must overlap entirely or not at all. </p>
+<h2 id="KeySizeError">type <span>KeySizeError</span> </h2> <pre data-language="go">type KeySizeError int</pre> <h3 id="KeySizeError.Error">func (KeySizeError) <span>Error</span> </h3> <pre data-language="go">func (k KeySizeError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/rc4/" class="_attribution-link">http://golang.org/pkg/crypto/rc4/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Frsa%2Findex.html b/devdocs/go/crypto%2Frsa%2Findex.html
new file mode 100644
index 00000000..6bfdc892
--- /dev/null
+++ b/devdocs/go/crypto%2Frsa%2Findex.html
@@ -0,0 +1,295 @@
+<h1> Package rsa </h1> <ul id="short-nav">
+<li><code>import "crypto/rsa"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package rsa implements RSA encryption as specified in PKCS #1 and RFC 8017. </p>
+<p>RSA is a single, fundamental operation that is used in this package to implement either public-key encryption or public-key signatures. </p>
+<p>The original specification for encryption and signatures with RSA is PKCS #1 and the terms "RSA encryption" and "RSA signatures" by default refer to PKCS #1 version 1.5. However, that specification has flaws and new designs should use version 2, usually called by just OAEP and PSS, where possible. </p>
+<p>Two sets of interfaces are included in this package. When a more abstract interface isn't necessary, there are functions for encrypting/decrypting with v1.5/OAEP and signing/verifying with v1.5/PSS. If one needs to abstract over the public key primitive, the PrivateKey type implements the Decrypter and Signer interfaces from the crypto package. </p>
+<p>Operations in this package are implemented using constant-time algorithms, except for <a href="#GenerateKey">GenerateKey</a>, <a href="#PrivateKey.Precompute">PrivateKey.Precompute</a>, and <a href="#PrivateKey.Validate">PrivateKey.Validate</a>. Every other operation only leaks the bit size of the involved values, which all depend on the selected key size. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#DecryptOAEP">func DecryptOAEP(hash hash.Hash, random io.Reader, priv *PrivateKey, ciphertext []byte, label []byte) ([]byte, error)</a></li>
+<li><a href="#DecryptPKCS1v15">func DecryptPKCS1v15(random io.Reader, priv *PrivateKey, ciphertext []byte) ([]byte, error)</a></li>
+<li><a href="#DecryptPKCS1v15SessionKey">func DecryptPKCS1v15SessionKey(random io.Reader, priv *PrivateKey, ciphertext []byte, key []byte) error</a></li>
+<li><a href="#EncryptOAEP">func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte) ([]byte, error)</a></li>
+<li><a href="#EncryptPKCS1v15">func EncryptPKCS1v15(random io.Reader, pub *PublicKey, msg []byte) ([]byte, error)</a></li>
+<li><a href="#SignPKCS1v15">func SignPKCS1v15(random io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte) ([]byte, error)</a></li>
+<li><a href="#SignPSS">func SignPSS(rand io.Reader, priv *PrivateKey, hash crypto.Hash, digest []byte, opts *PSSOptions) ([]byte, error)</a></li>
+<li><a href="#VerifyPKCS1v15">func VerifyPKCS1v15(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte) error</a></li>
+<li><a href="#VerifyPSS">func VerifyPSS(pub *PublicKey, hash crypto.Hash, digest []byte, sig []byte, opts *PSSOptions) error</a></li>
+<li><a href="#CRTValue">type CRTValue</a></li>
+<li><a href="#OAEPOptions">type OAEPOptions</a></li>
+<li><a href="#PKCS1v15DecryptOptions">type PKCS1v15DecryptOptions</a></li>
+<li><a href="#PSSOptions">type PSSOptions</a></li>
+<li> <a href="#PSSOptions.HashFunc">func (opts *PSSOptions) HashFunc() crypto.Hash</a>
+</li>
+<li><a href="#PrecomputedValues">type PrecomputedValues</a></li>
+<li><a href="#PrivateKey">type PrivateKey</a></li>
+<li> <a href="#GenerateKey">func GenerateKey(random io.Reader, bits int) (*PrivateKey, error)</a>
+</li>
+<li> <a href="#GenerateMultiPrimeKey">func GenerateMultiPrimeKey(random io.Reader, nprimes int, bits int) (*PrivateKey, error)</a>
+</li>
+<li> <a href="#PrivateKey.Decrypt">func (priv *PrivateKey) Decrypt(rand io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error)</a>
+</li>
+<li> <a href="#PrivateKey.Equal">func (priv *PrivateKey) Equal(x crypto.PrivateKey) bool</a>
+</li>
+<li> <a href="#PrivateKey.Precompute">func (priv *PrivateKey) Precompute()</a>
+</li>
+<li> <a href="#PrivateKey.Public">func (priv *PrivateKey) Public() crypto.PublicKey</a>
+</li>
+<li> <a href="#PrivateKey.Sign">func (priv *PrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)</a>
+</li>
+<li> <a href="#PrivateKey.Validate">func (priv *PrivateKey) Validate() error</a>
+</li>
+<li><a href="#PublicKey">type PublicKey</a></li>
+<li> <a href="#PublicKey.Equal">func (pub *PublicKey) Equal(x crypto.PublicKey) bool</a>
+</li>
+<li> <a href="#PublicKey.Size">func (pub *PublicKey) Size() int</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_DecryptOAEP">DecryptOAEP</a></dd> <dd><a class="exampleLink" href="#example_DecryptPKCS1v15SessionKey">DecryptPKCS1v15SessionKey</a></dd> <dd><a class="exampleLink" href="#example_EncryptOAEP">EncryptOAEP</a></dd> <dd><a class="exampleLink" href="#example_SignPKCS1v15">SignPKCS1v15</a></dd> <dd><a class="exampleLink" href="#example_VerifyPKCS1v15">VerifyPKCS1v15</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>notboring.go</span> <span>pkcs1v15.go</span> <span>pss.go</span> <span>rsa.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ // PSSSaltLengthAuto causes the salt in a PSS signature to be as large
+ // as possible when signing, and to be auto-detected when verifying.
+ PSSSaltLengthAuto = 0
+ // PSSSaltLengthEqualsHash causes the salt length to equal the length
+ // of the hash used in the signature.
+ PSSSaltLengthEqualsHash = -1
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>ErrDecryption represents a failure to decrypt a message. It is deliberately vague to avoid adaptive attacks. </p>
+<pre data-language="go">var ErrDecryption = errors.New("crypto/rsa: decryption error")</pre> <p>ErrMessageTooLong is returned when attempting to encrypt or sign a message which is too large for the size of the key. When using <a href="#SignPSS">SignPSS</a>, this can also be returned if the size of the salt is too large. </p>
+<pre data-language="go">var ErrMessageTooLong = errors.New("crypto/rsa: message too long for RSA key size")</pre> <p>ErrVerification represents a failure to verify a signature. It is deliberately vague to avoid adaptive attacks. </p>
+<pre data-language="go">var ErrVerification = errors.New("crypto/rsa: verification error")</pre> <h2 id="DecryptOAEP">func <span>DecryptOAEP</span> </h2> <pre data-language="go">func DecryptOAEP(hash hash.Hash, random io.Reader, priv *PrivateKey, ciphertext []byte, label []byte) ([]byte, error)</pre> <p>DecryptOAEP decrypts ciphertext using RSA-OAEP. </p>
+<p>OAEP is parameterised by a hash function that is used as a random oracle. Encryption and decryption of a given message must use the same hash function and sha256.New() is a reasonable choice. </p>
+<p>The random parameter is legacy and ignored, and it can be nil. </p>
+<p>The label parameter must match the value given when encrypting. See <a href="#EncryptOAEP">EncryptOAEP</a> for details. </p> <h4 id="example_DecryptOAEP"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+ciphertext, _ := hex.DecodeString("4d1ee10e8f286390258c51a5e80802844c3e6358ad6690b7285218a7c7ed7fc3a4c7b950fbd04d4b0239cc060dcc7065ca6f84c1756deb71ca5685cadbb82be025e16449b905c568a19c088a1abfad54bf7ecc67a7df39943ec511091a34c0f2348d04e058fcff4d55644de3cd1d580791d4524b92f3e91695582e6e340a1c50b6c6d78e80b4e42c5b4d45e479b492de42bbd39cc642ebb80226bb5200020d501b24a37bcc2ec7f34e596b4fd6b063de4858dbf5a4e3dd18e262eda0ec2d19dbd8e890d672b63d368768360b20c0b6b8592a438fa275e5fa7f60bef0dd39673fd3989cc54d2cb80c08fcd19dacbc265ee1c6014616b0e04ea0328c2a04e73460")
+label := []byte("orders")
+
+plaintext, err := rsa.DecryptOAEP(sha256.New(), nil, test2048Key, ciphertext, label)
+if err != nil {
+ fmt.Fprintf(os.Stderr, "Error from decryption: %s\n", err)
+ return
+}
+
+fmt.Printf("Plaintext: %s\n", plaintext)
+
+// Remember that encryption only provides confidentiality. The
+// ciphertext should be signed before authenticity is assumed and, even
+// then, consider that messages might be reordered.
+</pre> <h2 id="DecryptPKCS1v15">func <span>DecryptPKCS1v15</span> </h2> <pre data-language="go">func DecryptPKCS1v15(random io.Reader, priv *PrivateKey, ciphertext []byte) ([]byte, error)</pre> <p>DecryptPKCS1v15 decrypts a plaintext using RSA and the padding scheme from PKCS #1 v1.5. The random parameter is legacy and ignored, and it can be nil. </p>
+<p>Note that whether this function returns an error or not discloses secret information. If an attacker can cause this function to run repeatedly and learn whether each instance returned an error then they can decrypt and forge signatures as if they had the private key. See DecryptPKCS1v15SessionKey for a way of solving this problem. </p>
+<h2 id="DecryptPKCS1v15SessionKey">func <span>DecryptPKCS1v15SessionKey</span> </h2> <pre data-language="go">func DecryptPKCS1v15SessionKey(random io.Reader, priv *PrivateKey, ciphertext []byte, key []byte) error</pre> <p>DecryptPKCS1v15SessionKey decrypts a session key using RSA and the padding scheme from PKCS #1 v1.5. The random parameter is legacy and ignored, and it can be nil. </p>
+<p>DecryptPKCS1v15SessionKey returns an error if the ciphertext is the wrong length or if the ciphertext is greater than the public modulus. Otherwise, no error is returned. If the padding is valid, the resulting plaintext message is copied into key. Otherwise, key is unchanged. These alternatives occur in constant time. It is intended that the user of this function generate a random session key beforehand and continue the protocol with the resulting value. </p>
+<p>Note that if the session key is too small then it may be possible for an attacker to brute-force it. If they can do that then they can learn whether a random value was used (because it'll be different for the same ciphertext) and thus whether the padding was correct. This also defeats the point of this function. Using at least a 16-byte key will protect against this attack. </p>
+<p>This method implements protections against Bleichenbacher chosen ciphertext attacks [0] described in RFC 3218 Section 2.3.2 [1]. While these protections make a Bleichenbacher attack significantly more difficult, the protections are only effective if the rest of the protocol which uses DecryptPKCS1v15SessionKey is designed with these considerations in mind. In particular, if any subsequent operations which use the decrypted session key leak any information about the key (e.g. whether it is a static or random key) then the mitigations are defeated. This method must be used extremely carefully, and typically should only be used when absolutely necessary for compatibility with an existing protocol (such as TLS) that is designed with these properties in mind. </p>
+<ul> <li>[0] “Chosen Ciphertext Attacks Against Protocols Based on the RSA Encryption Standard PKCS #1”, Daniel Bleichenbacher, Advances in Cryptology (Crypto '98) </li>
+<li>[1] RFC 3218, Preventing the Million Message Attack on CMS, <a href="https://www.rfc-editor.org/rfc/rfc3218.html">https://www.rfc-editor.org/rfc/rfc3218.html</a> </li>
+</ul> <h4 id="example_DecryptPKCS1v15SessionKey"> <span class="text">Example</span>
+</h4> <p>RSA is able to encrypt only a very limited amount of data. In order to encrypt reasonable amounts of data a hybrid scheme is commonly used: RSA is used to encrypt a key for a symmetric primitive like AES-GCM. Before encrypting, data is “padded” by embedding it in a known structure. This is done for a number of reasons, but the most obvious is to ensure that the value is large enough that the exponentiation is larger than the modulus. (Otherwise it could be decrypted with a square-root.) In these designs, when using PKCS #1 v1.5, it's vitally important to avoid disclosing whether the received RSA message was well-formed (that is, whether the result of decrypting is a correctly padded message) because this leaks secret information. DecryptPKCS1v15SessionKey is designed for this situation and copies the decrypted, symmetric key (if well-formed) in constant-time over a buffer that contains a random key. Thus, if the RSA result isn't well-formed, the implementation uses a random key in constant time. </p> <p>Code:</p> <pre class="code" data-language="go">
+// The hybrid scheme should use at least a 16-byte symmetric key. Here
+// we read the random key that will be used if the RSA decryption isn't
+// well-formed.
+key := make([]byte, 32)
+if _, err := rand.Read(key); err != nil {
+ panic("RNG failure")
+}
+
+rsaCiphertext, _ := hex.DecodeString("aabbccddeeff")
+
+if err := rsa.DecryptPKCS1v15SessionKey(nil, rsaPrivateKey, rsaCiphertext, key); err != nil {
+ // Any errors that result will be “public” – meaning that they
+ // can be determined without any secret information. (For
+ // instance, if the length of key is impossible given the RSA
+ // public key.)
+ fmt.Fprintf(os.Stderr, "Error from RSA decryption: %s\n", err)
+ return
+}
+
+// Given the resulting key, a symmetric scheme can be used to decrypt a
+// larger ciphertext.
+block, err := aes.NewCipher(key)
+if err != nil {
+ panic("aes.NewCipher failed: " + err.Error())
+}
+
+// Since the key is random, using a fixed nonce is acceptable as the
+// (key, nonce) pair will still be unique, as required.
+var zeroNonce [12]byte
+aead, err := cipher.NewGCM(block)
+if err != nil {
+ panic("cipher.NewGCM failed: " + err.Error())
+}
+ciphertext, _ := hex.DecodeString("00112233445566")
+plaintext, err := aead.Open(nil, zeroNonce[:], ciphertext, nil)
+if err != nil {
+ // The RSA ciphertext was badly formed; the decryption will
+ // fail here because the AES-GCM key will be incorrect.
+ fmt.Fprintf(os.Stderr, "Error decrypting: %s\n", err)
+ return
+}
+
+fmt.Printf("Plaintext: %s\n", plaintext)
+</pre> <h2 id="EncryptOAEP">func <span>EncryptOAEP</span> </h2> <pre data-language="go">func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte) ([]byte, error)</pre> <p>EncryptOAEP encrypts the given message with RSA-OAEP. </p>
+<p>OAEP is parameterised by a hash function that is used as a random oracle. Encryption and decryption of a given message must use the same hash function and sha256.New() is a reasonable choice. </p>
+<p>The random parameter is used as a source of entropy to ensure that encrypting the same message twice doesn't result in the same ciphertext. Most applications should use <span>crypto/rand.Reader</span> as random. </p>
+<p>The label parameter may contain arbitrary data that will not be encrypted, but which gives important context to the message. For example, if a given public key is used to encrypt two types of messages then distinct label values could be used to ensure that a ciphertext for one purpose cannot be used for another by an attacker. If not required it can be empty. </p>
+<p>The message must be no longer than the length of the public modulus minus twice the hash length, minus a further 2. </p> <h4 id="example_EncryptOAEP"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+secretMessage := []byte("send reinforcements, we're going to advance")
+label := []byte("orders")
+
+// crypto/rand.Reader is a good source of entropy for randomizing the
+// encryption function.
+rng := rand.Reader
+
+ciphertext, err := rsa.EncryptOAEP(sha256.New(), rng, &amp;test2048Key.PublicKey, secretMessage, label)
+if err != nil {
+ fmt.Fprintf(os.Stderr, "Error from encryption: %s\n", err)
+ return
+}
+
+// Since encryption is a randomized function, ciphertext will be
+// different each time.
+fmt.Printf("Ciphertext: %x\n", ciphertext)
+</pre> <h2 id="EncryptPKCS1v15">func <span>EncryptPKCS1v15</span> </h2> <pre data-language="go">func EncryptPKCS1v15(random io.Reader, pub *PublicKey, msg []byte) ([]byte, error)</pre> <p>EncryptPKCS1v15 encrypts the given message with RSA and the padding scheme from PKCS #1 v1.5. The message must be no longer than the length of the public modulus minus 11 bytes. </p>
+<p>The random parameter is used as a source of entropy to ensure that encrypting the same message twice doesn't result in the same ciphertext. Most applications should use <span>crypto/rand.Reader</span> as random. Note that the returned ciphertext does not depend deterministically on the bytes read from random, and may change between calls and/or between versions. </p>
+<p>WARNING: use of this function to encrypt plaintexts other than session keys is dangerous. Use RSA OAEP in new protocols. </p>
+<h2 id="SignPKCS1v15">func <span>SignPKCS1v15</span> </h2> <pre data-language="go">func SignPKCS1v15(random io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte) ([]byte, error)</pre> <p>SignPKCS1v15 calculates the signature of hashed using RSASSA-PKCS1-V1_5-SIGN from RSA PKCS #1 v1.5. Note that hashed must be the result of hashing the input message using the given hash function. If hash is zero, hashed is signed directly. This isn't advisable except for interoperability. </p>
+<p>The random parameter is legacy and ignored, and it can be nil. </p>
+<p>This function is deterministic. Thus, if the set of possible messages is small, an attacker may be able to build a map from messages to signatures and identify the signed messages. As ever, signatures provide authenticity, not confidentiality. </p> <h4 id="example_SignPKCS1v15"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+message := []byte("message to be signed")
+
+// Only small messages can be signed directly; thus the hash of a
+// message, rather than the message itself, is signed. This requires
+// that the hash function be collision resistant. SHA-256 is the
+// least-strong hash function that should be used for this at the time
+// of writing (2016).
+hashed := sha256.Sum256(message)
+
+signature, err := rsa.SignPKCS1v15(nil, rsaPrivateKey, crypto.SHA256, hashed[:])
+if err != nil {
+ fmt.Fprintf(os.Stderr, "Error from signing: %s\n", err)
+ return
+}
+
+fmt.Printf("Signature: %x\n", signature)
+</pre> <h2 id="SignPSS">func <span>SignPSS</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func SignPSS(rand io.Reader, priv *PrivateKey, hash crypto.Hash, digest []byte, opts *PSSOptions) ([]byte, error)</pre> <p>SignPSS calculates the signature of digest using PSS. </p>
+<p>digest must be the result of hashing the input message using the given hash function. The opts argument may be nil, in which case sensible defaults are used. If opts.Hash is set, it overrides hash. </p>
+<p>The signature is randomized depending on the message, key, and salt size, using bytes from rand. Most applications should use <span>crypto/rand.Reader</span> as rand. </p>
+<h2 id="VerifyPKCS1v15">func <span>VerifyPKCS1v15</span> </h2> <pre data-language="go">func VerifyPKCS1v15(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte) error</pre> <p>VerifyPKCS1v15 verifies an RSA PKCS #1 v1.5 signature. hashed is the result of hashing the input message using the given hash function and sig is the signature. A valid signature is indicated by returning a nil error. If hash is zero then hashed is used directly. This isn't advisable except for interoperability. </p> <h4 id="example_VerifyPKCS1v15"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+message := []byte("message to be signed")
+signature, _ := hex.DecodeString("ad2766728615cc7a746cc553916380ca7bfa4f8983b990913bc69eb0556539a350ff0f8fe65ddfd3ebe91fe1c299c2fac135bc8c61e26be44ee259f2f80c1530")
+
+// Only small messages can be signed directly; thus the hash of a
+// message, rather than the message itself, is signed. This requires
+// that the hash function be collision resistant. SHA-256 is the
+// least-strong hash function that should be used for this at the time
+// of writing (2016).
+hashed := sha256.Sum256(message)
+
+err := rsa.VerifyPKCS1v15(&amp;rsaPrivateKey.PublicKey, crypto.SHA256, hashed[:], signature)
+if err != nil {
+ fmt.Fprintf(os.Stderr, "Error from verification: %s\n", err)
+ return
+}
+
+// signature is a valid signature of message from the public key.
+</pre> <h2 id="VerifyPSS">func <span>VerifyPSS</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func VerifyPSS(pub *PublicKey, hash crypto.Hash, digest []byte, sig []byte, opts *PSSOptions) error</pre> <p>VerifyPSS verifies a PSS signature. </p>
+<p>A valid signature is indicated by returning a nil error. digest must be the result of hashing the input message using the given hash function. The opts argument may be nil, in which case sensible defaults are used. opts.Hash is ignored. </p>
+<h2 id="CRTValue">type <span>CRTValue</span> </h2> <p>CRTValue contains the precomputed Chinese remainder theorem values. </p>
+<pre data-language="go">type CRTValue struct {
+ Exp *big.Int // D mod (prime-1).
+ Coeff *big.Int // R·Coeff ≡ 1 mod Prime.
+ R *big.Int // product of primes prior to this (inc p and q).
+}
+</pre> <h2 id="OAEPOptions">type <span>OAEPOptions</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>OAEPOptions is an interface for passing options to OAEP decryption using the crypto.Decrypter interface. </p>
+<pre data-language="go">type OAEPOptions struct {
+ // Hash is the hash function that will be used when generating the mask.
+ Hash crypto.Hash
+
+ // MGFHash is the hash function used for MGF1.
+ // If zero, Hash is used instead.
+ MGFHash crypto.Hash // Go 1.20
+
+ // Label is an arbitrary byte string that must be equal to the value
+ // used when encrypting.
+ Label []byte
+}
+</pre> <h2 id="PKCS1v15DecryptOptions">type <span>PKCS1v15DecryptOptions</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>PKCS1v15DecryptOptions is for passing options to PKCS #1 v1.5 decryption using the <span>crypto.Decrypter</span> interface. </p>
+<pre data-language="go">type PKCS1v15DecryptOptions struct {
+ // SessionKeyLen is the length of the session key that is being
+ // decrypted. If not zero, then a padding error during decryption will
+ // cause a random plaintext of this length to be returned rather than
+ // an error. These alternatives happen in constant time.
+ SessionKeyLen int
+}
+</pre> <h2 id="PSSOptions">type <span>PSSOptions</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>PSSOptions contains options for creating and verifying PSS signatures. </p>
+<pre data-language="go">type PSSOptions struct {
+ // SaltLength controls the length of the salt used in the PSS signature. It
+ // can either be a positive number of bytes, or one of the special
+ // PSSSaltLength constants.
+ SaltLength int
+
+ // Hash is the hash function used to generate the message digest. If not
+ // zero, it overrides the hash function passed to SignPSS. It's required
+ // when using PrivateKey.Sign.
+ Hash crypto.Hash // Go 1.4
+}
+</pre> <h3 id="PSSOptions.HashFunc">func (*PSSOptions) <span>HashFunc</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (opts *PSSOptions) HashFunc() crypto.Hash</pre> <p>HashFunc returns opts.Hash so that <a href="#PSSOptions">PSSOptions</a> implements <span>crypto.SignerOpts</span>. </p>
+<h2 id="PrecomputedValues">type <span>PrecomputedValues</span> </h2> <pre data-language="go">type PrecomputedValues struct {
+ Dp, Dq *big.Int // D mod (P-1) (or mod Q-1)
+ Qinv *big.Int // Q^-1 mod P
+
+ // CRTValues is used for the 3rd and subsequent primes. Due to a
+ // historical accident, the CRT for the first two primes is handled
+ // differently in PKCS #1 and interoperability is sufficiently
+ // important that we mirror this.
+ //
+ // Deprecated: These values are still filled in by Precompute for
+ // backwards compatibility but are not used. Multi-prime RSA is very rare,
+ // and is implemented by this package without CRT optimizations to limit
+ // complexity.
+ CRTValues []CRTValue
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="PrivateKey">type <span>PrivateKey</span> </h2> <p>A PrivateKey represents an RSA key </p>
+<pre data-language="go">type PrivateKey struct {
+ PublicKey // public part.
+ D *big.Int // private exponent
+ Primes []*big.Int // prime factors of N, has &gt;= 2 elements.
+
+ // Precomputed contains precomputed values that speed up RSA operations,
+ // if available. It must be generated by calling PrivateKey.Precompute and
+ // must not be modified.
+ Precomputed PrecomputedValues
+}
+</pre> <h3 id="GenerateKey">func <span>GenerateKey</span> </h3> <pre data-language="go">func GenerateKey(random io.Reader, bits int) (*PrivateKey, error)</pre> <p>GenerateKey generates a random RSA private key of the given bit size. </p>
+<p>Most applications should use <span>crypto/rand.Reader</span> as rand. Note that the returned key does not depend deterministically on the bytes read from rand, and may change between calls and/or between versions. </p>
+<h3 id="GenerateMultiPrimeKey">func <span>GenerateMultiPrimeKey</span> </h3> <pre data-language="go">func GenerateMultiPrimeKey(random io.Reader, nprimes int, bits int) (*PrivateKey, error)</pre> <p>GenerateMultiPrimeKey generates a multi-prime RSA keypair of the given bit size and the given random source. </p>
+<p>Table 1 in "<a href="http://www.cacr.math.uwaterloo.ca/techreports/2006/cacr2006-16.pdf">On the Security of Multi-prime RSA</a>" suggests maximum numbers of primes for a given bit size. </p>
+<p>Although the public keys are compatible (actually, indistinguishable) from the 2-prime case, the private keys are not. Thus it may not be possible to export multi-prime private keys in certain formats or to subsequently import them into other code. </p>
+<p>This package does not implement CRT optimizations for multi-prime RSA, so the keys with more than two primes will have worse performance. </p>
+<p>Deprecated: The use of this function with a number of primes different from two is not recommended for the above security, compatibility, and performance reasons. Use <a href="#GenerateKey">GenerateKey</a> instead. </p>
+<h3 id="PrivateKey.Decrypt">func (*PrivateKey) <span>Decrypt</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (priv *PrivateKey) Decrypt(rand io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error)</pre> <p>Decrypt decrypts ciphertext with priv. If opts is nil or of type *<a href="#PKCS1v15DecryptOptions">PKCS1v15DecryptOptions</a> then PKCS #1 v1.5 decryption is performed. Otherwise opts must have type *<a href="#OAEPOptions">OAEPOptions</a> and OAEP decryption is done. </p>
+<h3 id="PrivateKey.Equal">func (*PrivateKey) <span>Equal</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (priv *PrivateKey) Equal(x crypto.PrivateKey) bool</pre> <p>Equal reports whether priv and x have equivalent values. It ignores Precomputed values. </p>
+<h3 id="PrivateKey.Precompute">func (*PrivateKey) <span>Precompute</span> </h3> <pre data-language="go">func (priv *PrivateKey) Precompute()</pre> <p>Precompute performs some calculations that speed up private key operations in the future. </p>
+<h3 id="PrivateKey.Public">func (*PrivateKey) <span>Public</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (priv *PrivateKey) Public() crypto.PublicKey</pre> <p>Public returns the public key corresponding to priv. </p>
+<h3 id="PrivateKey.Sign">func (*PrivateKey) <span>Sign</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (priv *PrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)</pre> <p>Sign signs digest with priv, reading randomness from rand. If opts is a *<a href="#PSSOptions">PSSOptions</a> then the PSS algorithm will be used, otherwise PKCS #1 v1.5 will be used. digest must be the result of hashing the input message using opts.HashFunc(). </p>
+<p>This method implements <span>crypto.Signer</span>, which is an interface to support keys where the private part is kept in, for example, a hardware module. Common uses should use the Sign* functions in this package directly. </p>
+<h3 id="PrivateKey.Validate">func (*PrivateKey) <span>Validate</span> </h3> <pre data-language="go">func (priv *PrivateKey) Validate() error</pre> <p>Validate performs basic sanity checks on the key. It returns nil if the key is valid, or else an error describing a problem. </p>
+<h2 id="PublicKey">type <span>PublicKey</span> </h2> <p>A PublicKey represents the public part of an RSA key. </p>
+<p>The value of the modulus N is considered secret by this library and protected from leaking through timing side-channels. However, neither the value of the exponent E nor the precise bit size of N are similarly protected. </p>
+<pre data-language="go">type PublicKey struct {
+ N *big.Int // modulus
+ E int // public exponent
+}
+</pre> <h3 id="PublicKey.Equal">func (*PublicKey) <span>Equal</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (pub *PublicKey) Equal(x crypto.PublicKey) bool</pre> <p>Equal reports whether pub and x have the same value. </p>
+<h3 id="PublicKey.Size">func (*PublicKey) <span>Size</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (pub *PublicKey) Size() int</pre> <p>Size returns the modulus size in bytes. Raw signatures and ciphertexts for or by this public key will have the same size. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/rsa/" class="_attribution-link">http://golang.org/pkg/crypto/rsa/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fsha1%2Findex.html b/devdocs/go/crypto%2Fsha1%2Findex.html
new file mode 100644
index 00000000..0173cd7a
--- /dev/null
+++ b/devdocs/go/crypto%2Fsha1%2Findex.html
@@ -0,0 +1,42 @@
+<h1> Package sha1 </h1> <ul id="short-nav">
+<li><code>import "crypto/sha1"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package sha1 implements the SHA-1 hash algorithm as defined in RFC 3174. </p>
+<p>SHA-1 is cryptographically broken and should not be used for secure applications. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#New">func New() hash.Hash</a></li>
+<li><a href="#Sum">func Sum(data []byte) [Size]byte</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_New">New</a></dd> <dd><a class="exampleLink" href="#example_New_file">New (File)</a></dd> <dd><a class="exampleLink" href="#example_Sum">Sum</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>sha1.go</span> <span>sha1block.go</span> <span>sha1block_amd64.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>The blocksize of SHA-1 in bytes. </p>
+<pre data-language="go">const BlockSize = 64</pre> <p>The size of a SHA-1 checksum in bytes. </p>
+<pre data-language="go">const Size = 20</pre> <h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New() hash.Hash</pre> <p>New returns a new hash.Hash computing the SHA1 checksum. The Hash also implements <span>encoding.BinaryMarshaler</span> and <span>encoding.BinaryUnmarshaler</span> to marshal and unmarshal the internal state of the hash. </p> <h4 id="example_New"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">h := sha1.New()
+io.WriteString(h, "His money is twice tainted:")
+io.WriteString(h, " 'taint yours and 'taint mine.")
+fmt.Printf("% x", h.Sum(nil))
+</pre> <p>Output:</p> <pre class="output" data-language="go">59 7f 6a 54 00 10 f9 4c 15 d7 18 06 a9 9a 2c 87 10 e7 47 bd
+</pre> <h4 id="example_New_file"> <span class="text">Example (File)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+f, err := os.Open("file.txt")
+if err != nil {
+ log.Fatal(err)
+}
+defer f.Close()
+
+h := sha1.New()
+if _, err := io.Copy(h, f); err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("% x", h.Sum(nil))
+</pre> <h2 id="Sum">func <span>Sum</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Sum(data []byte) [Size]byte</pre> <p>Sum returns the SHA-1 checksum of the data. </p> <h4 id="example_Sum"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">data := []byte("This page intentionally left blank.")
+fmt.Printf("% x", sha1.Sum(data))
+</pre> <p>Output:</p> <pre class="output" data-language="go">af 06 49 23 bb f2 30 15 96 aa c4 c2 73 ba 32 17 8e bc 4a 96
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/sha1/" class="_attribution-link">http://golang.org/pkg/crypto/sha1/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fsha256%2Findex.html b/devdocs/go/crypto%2Fsha256%2Findex.html
new file mode 100644
index 00000000..a11414b2
--- /dev/null
+++ b/devdocs/go/crypto%2Fsha256%2Findex.html
@@ -0,0 +1,45 @@
+<h1> Package sha256 </h1> <ul id="short-nav">
+<li><code>import "crypto/sha256"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#New">func New() hash.Hash</a></li>
+<li><a href="#New224">func New224() hash.Hash</a></li>
+<li><a href="#Sum224">func Sum224(data []byte) [Size224]byte</a></li>
+<li><a href="#Sum256">func Sum256(data []byte) [Size]byte</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_New">New</a></dd> <dd><a class="exampleLink" href="#example_New_file">New (File)</a></dd> <dd><a class="exampleLink" href="#example_Sum256">Sum256</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>sha256.go</span> <span>sha256block.go</span> <span>sha256block_amd64.go</span> <span>sha256block_decl.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>The blocksize of SHA256 and SHA224 in bytes. </p>
+<pre data-language="go">const BlockSize = 64</pre> <p>The size of a SHA256 checksum in bytes. </p>
+<pre data-language="go">const Size = 32</pre> <p>The size of a SHA224 checksum in bytes. </p>
+<pre data-language="go">const Size224 = 28</pre> <h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New() hash.Hash</pre> <p>New returns a new hash.Hash computing the SHA256 checksum. The Hash also implements <span>encoding.BinaryMarshaler</span> and <span>encoding.BinaryUnmarshaler</span> to marshal and unmarshal the internal state of the hash. </p> <h4 id="example_New"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">h := sha256.New()
+h.Write([]byte("hello world\n"))
+fmt.Printf("%x", h.Sum(nil))
+</pre> <p>Output:</p> <pre class="output" data-language="go">a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447
+</pre> <h4 id="example_New_file"> <span class="text">Example (File)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+f, err := os.Open("file.txt")
+if err != nil {
+ log.Fatal(err)
+}
+defer f.Close()
+
+h := sha256.New()
+if _, err := io.Copy(h, f); err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%x", h.Sum(nil))
+</pre> <h2 id="New224">func <span>New224</span> </h2> <pre data-language="go">func New224() hash.Hash</pre> <p>New224 returns a new hash.Hash computing the SHA224 checksum. </p>
+<h2 id="Sum224">func <span>Sum224</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Sum224(data []byte) [Size224]byte</pre> <p>Sum224 returns the SHA224 checksum of the data. </p>
+<h2 id="Sum256">func <span>Sum256</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Sum256(data []byte) [Size]byte</pre> <p>Sum256 returns the SHA256 checksum of the data. </p> <h4 id="example_Sum256"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">sum := sha256.Sum256([]byte("hello world\n"))
+fmt.Printf("%x", sum)
+</pre> <p>Output:</p> <pre class="output" data-language="go">a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/sha256/" class="_attribution-link">http://golang.org/pkg/crypto/sha256/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fsha512%2Findex.html b/devdocs/go/crypto%2Fsha512%2Findex.html
new file mode 100644
index 00000000..8d8cd3d6
--- /dev/null
+++ b/devdocs/go/crypto%2Fsha512%2Findex.html
@@ -0,0 +1,44 @@
+<h1> Package sha512 </h1> <ul id="short-nav">
+<li><code>import "crypto/sha512"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package sha512 implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 hash algorithms as defined in FIPS 180-4. </p>
+<p>All the hash.Hash implementations returned by this package also implement encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to marshal and unmarshal the internal state of the hash. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#New">func New() hash.Hash</a></li>
+<li><a href="#New384">func New384() hash.Hash</a></li>
+<li><a href="#New512_224">func New512_224() hash.Hash</a></li>
+<li><a href="#New512_256">func New512_256() hash.Hash</a></li>
+<li><a href="#Sum384">func Sum384(data []byte) [Size384]byte</a></li>
+<li><a href="#Sum512">func Sum512(data []byte) [Size]byte</a></li>
+<li><a href="#Sum512_224">func Sum512_224(data []byte) [Size224]byte</a></li>
+<li><a href="#Sum512_256">func Sum512_256(data []byte) [Size256]byte</a></li>
+</ul> <h3>Package files</h3> <p> <span>sha512.go</span> <span>sha512block.go</span> <span>sha512block_amd64.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ // Size is the size, in bytes, of a SHA-512 checksum.
+ Size = 64
+
+ // Size224 is the size, in bytes, of a SHA-512/224 checksum.
+ Size224 = 28
+
+ // Size256 is the size, in bytes, of a SHA-512/256 checksum.
+ Size256 = 32
+
+ // Size384 is the size, in bytes, of a SHA-384 checksum.
+ Size384 = 48
+
+ // BlockSize is the block size, in bytes, of the SHA-512/224,
+ // SHA-512/256, SHA-384 and SHA-512 hash functions.
+ BlockSize = 128
+)</pre> <h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New() hash.Hash</pre> <p>New returns a new hash.Hash computing the SHA-512 checksum. </p>
+<h2 id="New384">func <span>New384</span> </h2> <pre data-language="go">func New384() hash.Hash</pre> <p>New384 returns a new hash.Hash computing the SHA-384 checksum. </p>
+<h2 id="New512_224">func <span>New512_224</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func New512_224() hash.Hash</pre> <p>New512_224 returns a new hash.Hash computing the SHA-512/224 checksum. </p>
+<h2 id="New512_256">func <span>New512_256</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func New512_256() hash.Hash</pre> <p>New512_256 returns a new hash.Hash computing the SHA-512/256 checksum. </p>
+<h2 id="Sum384">func <span>Sum384</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Sum384(data []byte) [Size384]byte</pre> <p>Sum384 returns the SHA384 checksum of the data. </p>
+<h2 id="Sum512">func <span>Sum512</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Sum512(data []byte) [Size]byte</pre> <p>Sum512 returns the SHA512 checksum of the data. </p>
+<h2 id="Sum512_224">func <span>Sum512_224</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Sum512_224(data []byte) [Size224]byte</pre> <p>Sum512_224 returns the Sum512/224 checksum of the data. </p>
+<h2 id="Sum512_256">func <span>Sum512_256</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Sum512_256(data []byte) [Size256]byte</pre> <p>Sum512_256 returns the Sum512/256 checksum of the data. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/sha512/" class="_attribution-link">http://golang.org/pkg/crypto/sha512/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fsubtle%2Findex.html b/devdocs/go/crypto%2Fsubtle%2Findex.html
new file mode 100644
index 00000000..505d1b0f
--- /dev/null
+++ b/devdocs/go/crypto%2Fsubtle%2Findex.html
@@ -0,0 +1,24 @@
+<h1> Package subtle </h1> <ul id="short-nav">
+<li><code>import "crypto/subtle"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package subtle implements functions that are often useful in cryptographic code but require careful thought to use correctly. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#ConstantTimeByteEq">func ConstantTimeByteEq(x, y uint8) int</a></li>
+<li><a href="#ConstantTimeCompare">func ConstantTimeCompare(x, y []byte) int</a></li>
+<li><a href="#ConstantTimeCopy">func ConstantTimeCopy(v int, x, y []byte)</a></li>
+<li><a href="#ConstantTimeEq">func ConstantTimeEq(x, y int32) int</a></li>
+<li><a href="#ConstantTimeLessOrEq">func ConstantTimeLessOrEq(x, y int) int</a></li>
+<li><a href="#ConstantTimeSelect">func ConstantTimeSelect(v, x, y int) int</a></li>
+<li><a href="#XORBytes">func XORBytes(dst, x, y []byte) int</a></li>
+</ul> <h3>Package files</h3> <p> <span>constant_time.go</span> <span>xor.go</span> <span>xor_amd64.go</span> </p> <h2 id="ConstantTimeByteEq">func <span>ConstantTimeByteEq</span> </h2> <pre data-language="go">func ConstantTimeByteEq(x, y uint8) int</pre> <p>ConstantTimeByteEq returns 1 if x == y and 0 otherwise. </p>
+<h2 id="ConstantTimeCompare">func <span>ConstantTimeCompare</span> </h2> <pre data-language="go">func ConstantTimeCompare(x, y []byte) int</pre> <p>ConstantTimeCompare returns 1 if the two slices, x and y, have equal contents and 0 otherwise. The time taken is a function of the length of the slices and is independent of the contents. If the lengths of x and y do not match it returns 0 immediately. </p>
+<h2 id="ConstantTimeCopy">func <span>ConstantTimeCopy</span> </h2> <pre data-language="go">func ConstantTimeCopy(v int, x, y []byte)</pre> <p>ConstantTimeCopy copies the contents of y into x (a slice of equal length) if v == 1. If v == 0, x is left unchanged. Its behavior is undefined if v takes any other value. </p>
+<h2 id="ConstantTimeEq">func <span>ConstantTimeEq</span> </h2> <pre data-language="go">func ConstantTimeEq(x, y int32) int</pre> <p>ConstantTimeEq returns 1 if x == y and 0 otherwise. </p>
+<h2 id="ConstantTimeLessOrEq">func <span>ConstantTimeLessOrEq</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func ConstantTimeLessOrEq(x, y int) int</pre> <p>ConstantTimeLessOrEq returns 1 if x &lt;= y and 0 otherwise. Its behavior is undefined if x or y are negative or &gt; 2**31 - 1. </p>
+<h2 id="ConstantTimeSelect">func <span>ConstantTimeSelect</span> </h2> <pre data-language="go">func ConstantTimeSelect(v, x, y int) int</pre> <p>ConstantTimeSelect returns x if v == 1 and y if v == 0. Its behavior is undefined if v takes any other value. </p>
+<h2 id="XORBytes">func <span>XORBytes</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func XORBytes(dst, x, y []byte) int</pre> <p>XORBytes sets dst[i] = x[i] ^ y[i] for all i &lt; n = min(len(x), len(y)), returning n, the number of bytes written to dst. If dst does not have length at least n, XORBytes panics without writing anything to dst. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/subtle/" class="_attribution-link">http://golang.org/pkg/crypto/subtle/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Ftls%2Ffipsonly%2Findex.html b/devdocs/go/crypto%2Ftls%2Ffipsonly%2Findex.html
new file mode 100644
index 00000000..7d3cb98e
--- /dev/null
+++ b/devdocs/go/crypto%2Ftls%2Ffipsonly%2Findex.html
@@ -0,0 +1,9 @@
+<h1> Command fipsonly </h1> <p>Package fipsonly restricts all TLS configuration to FIPS-approved settings. </p>
+<p>The effect is triggered by importing the package anywhere in a program, as in: </p>
+<pre data-language="go">import _ "crypto/tls/fipsonly"
+</pre> <p>This package only exists when using Go compiled with GOEXPERIMENT=boringcrypto. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/tls/fipsonly/" class="_attribution-link">http://golang.org/pkg/crypto/tls/fipsonly/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Ftls%2Findex.html b/devdocs/go/crypto%2Ftls%2Findex.html
new file mode 100644
index 00000000..ed0df528
--- /dev/null
+++ b/devdocs/go/crypto%2Ftls%2Findex.html
@@ -0,0 +1,1114 @@
+<h1> Package tls </h1> <ul id="short-nav">
+<li><code>import "crypto/tls"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#CipherSuiteName">func CipherSuiteName(id uint16) string</a></li>
+<li><a href="#Listen">func Listen(network, laddr string, config *Config) (net.Listener, error)</a></li>
+<li><a href="#NewListener">func NewListener(inner net.Listener, config *Config) net.Listener</a></li>
+<li><a href="#VersionName">func VersionName(version uint16) string</a></li>
+<li><a href="#AlertError">type AlertError</a></li>
+<li> <a href="#AlertError.Error">func (e AlertError) Error() string</a>
+</li>
+<li><a href="#Certificate">type Certificate</a></li>
+<li> <a href="#LoadX509KeyPair">func LoadX509KeyPair(certFile, keyFile string) (Certificate, error)</a>
+</li>
+<li> <a href="#X509KeyPair">func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error)</a>
+</li>
+<li><a href="#CertificateRequestInfo">type CertificateRequestInfo</a></li>
+<li> <a href="#CertificateRequestInfo.Context">func (c *CertificateRequestInfo) Context() context.Context</a>
+</li>
+<li> <a href="#CertificateRequestInfo.SupportsCertificate">func (cri *CertificateRequestInfo) SupportsCertificate(c *Certificate) error</a>
+</li>
+<li><a href="#CertificateVerificationError">type CertificateVerificationError</a></li>
+<li> <a href="#CertificateVerificationError.Error">func (e *CertificateVerificationError) Error() string</a>
+</li>
+<li> <a href="#CertificateVerificationError.Unwrap">func (e *CertificateVerificationError) Unwrap() error</a>
+</li>
+<li><a href="#CipherSuite">type CipherSuite</a></li>
+<li> <a href="#CipherSuites">func CipherSuites() []*CipherSuite</a>
+</li>
+<li> <a href="#InsecureCipherSuites">func InsecureCipherSuites() []*CipherSuite</a>
+</li>
+<li><a href="#ClientAuthType">type ClientAuthType</a></li>
+<li> <a href="#ClientAuthType.String">func (i ClientAuthType) String() string</a>
+</li>
+<li><a href="#ClientHelloInfo">type ClientHelloInfo</a></li>
+<li> <a href="#ClientHelloInfo.Context">func (c *ClientHelloInfo) Context() context.Context</a>
+</li>
+<li> <a href="#ClientHelloInfo.SupportsCertificate">func (chi *ClientHelloInfo) SupportsCertificate(c *Certificate) error</a>
+</li>
+<li><a href="#ClientSessionCache">type ClientSessionCache</a></li>
+<li> <a href="#NewLRUClientSessionCache">func NewLRUClientSessionCache(capacity int) ClientSessionCache</a>
+</li>
+<li><a href="#ClientSessionState">type ClientSessionState</a></li>
+<li> <a href="#NewResumptionState">func NewResumptionState(ticket []byte, state *SessionState) (*ClientSessionState, error)</a>
+</li>
+<li> <a href="#ClientSessionState.ResumptionState">func (cs *ClientSessionState) ResumptionState() (ticket []byte, state *SessionState, err error)</a>
+</li>
+<li><a href="#Config">type Config</a></li>
+<li> <a href="#Config.BuildNameToCertificate">func (c *Config) BuildNameToCertificate()</a>
+</li>
+<li> <a href="#Config.Clone">func (c *Config) Clone() *Config</a>
+</li>
+<li> <a href="#Config.DecryptTicket">func (c *Config) DecryptTicket(identity []byte, cs ConnectionState) (*SessionState, error)</a>
+</li>
+<li> <a href="#Config.EncryptTicket">func (c *Config) EncryptTicket(cs ConnectionState, ss *SessionState) ([]byte, error)</a>
+</li>
+<li> <a href="#Config.SetSessionTicketKeys">func (c *Config) SetSessionTicketKeys(keys [][32]byte)</a>
+</li>
+<li><a href="#Conn">type Conn</a></li>
+<li> <a href="#Client">func Client(conn net.Conn, config *Config) *Conn</a>
+</li>
+<li> <a href="#Dial">func Dial(network, addr string, config *Config) (*Conn, error)</a>
+</li>
+<li> <a href="#DialWithDialer">func DialWithDialer(dialer *net.Dialer, network, addr string, config *Config) (*Conn, error)</a>
+</li>
+<li> <a href="#Server">func Server(conn net.Conn, config *Config) *Conn</a>
+</li>
+<li> <a href="#Conn.Close">func (c *Conn) Close() error</a>
+</li>
+<li> <a href="#Conn.CloseWrite">func (c *Conn) CloseWrite() error</a>
+</li>
+<li> <a href="#Conn.ConnectionState">func (c *Conn) ConnectionState() ConnectionState</a>
+</li>
+<li> <a href="#Conn.Handshake">func (c *Conn) Handshake() error</a>
+</li>
+<li> <a href="#Conn.HandshakeContext">func (c *Conn) HandshakeContext(ctx context.Context) error</a>
+</li>
+<li> <a href="#Conn.LocalAddr">func (c *Conn) LocalAddr() net.Addr</a>
+</li>
+<li> <a href="#Conn.NetConn">func (c *Conn) NetConn() net.Conn</a>
+</li>
+<li> <a href="#Conn.OCSPResponse">func (c *Conn) OCSPResponse() []byte</a>
+</li>
+<li> <a href="#Conn.Read">func (c *Conn) Read(b []byte) (int, error)</a>
+</li>
+<li> <a href="#Conn.RemoteAddr">func (c *Conn) RemoteAddr() net.Addr</a>
+</li>
+<li> <a href="#Conn.SetDeadline">func (c *Conn) SetDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#Conn.SetReadDeadline">func (c *Conn) SetReadDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#Conn.SetWriteDeadline">func (c *Conn) SetWriteDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#Conn.VerifyHostname">func (c *Conn) VerifyHostname(host string) error</a>
+</li>
+<li> <a href="#Conn.Write">func (c *Conn) Write(b []byte) (int, error)</a>
+</li>
+<li><a href="#ConnectionState">type ConnectionState</a></li>
+<li> <a href="#ConnectionState.ExportKeyingMaterial">func (cs *ConnectionState) ExportKeyingMaterial(label string, context []byte, length int) ([]byte, error)</a>
+</li>
+<li><a href="#CurveID">type CurveID</a></li>
+<li> <a href="#CurveID.String">func (i CurveID) String() string</a>
+</li>
+<li><a href="#Dialer">type Dialer</a></li>
+<li> <a href="#Dialer.Dial">func (d *Dialer) Dial(network, addr string) (net.Conn, error)</a>
+</li>
+<li> <a href="#Dialer.DialContext">func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error)</a>
+</li>
+<li><a href="#QUICConfig">type QUICConfig</a></li>
+<li><a href="#QUICConn">type QUICConn</a></li>
+<li> <a href="#QUICClient">func QUICClient(config *QUICConfig) *QUICConn</a>
+</li>
+<li> <a href="#QUICServer">func QUICServer(config *QUICConfig) *QUICConn</a>
+</li>
+<li> <a href="#QUICConn.Close">func (q *QUICConn) Close() error</a>
+</li>
+<li> <a href="#QUICConn.ConnectionState">func (q *QUICConn) ConnectionState() ConnectionState</a>
+</li>
+<li> <a href="#QUICConn.HandleData">func (q *QUICConn) HandleData(level QUICEncryptionLevel, data []byte) error</a>
+</li>
+<li> <a href="#QUICConn.NextEvent">func (q *QUICConn) NextEvent() QUICEvent</a>
+</li>
+<li> <a href="#QUICConn.SendSessionTicket">func (q *QUICConn) SendSessionTicket(opts QUICSessionTicketOptions) error</a>
+</li>
+<li> <a href="#QUICConn.SetTransportParameters">func (q *QUICConn) SetTransportParameters(params []byte)</a>
+</li>
+<li> <a href="#QUICConn.Start">func (q *QUICConn) Start(ctx context.Context) error</a>
+</li>
+<li><a href="#QUICEncryptionLevel">type QUICEncryptionLevel</a></li>
+<li> <a href="#QUICEncryptionLevel.String">func (l QUICEncryptionLevel) String() string</a>
+</li>
+<li><a href="#QUICEvent">type QUICEvent</a></li>
+<li><a href="#QUICEventKind">type QUICEventKind</a></li>
+<li><a href="#QUICSessionTicketOptions">type QUICSessionTicketOptions</a></li>
+<li><a href="#RecordHeaderError">type RecordHeaderError</a></li>
+<li> <a href="#RecordHeaderError.Error">func (e RecordHeaderError) Error() string</a>
+</li>
+<li><a href="#RenegotiationSupport">type RenegotiationSupport</a></li>
+<li><a href="#SessionState">type SessionState</a></li>
+<li> <a href="#ParseSessionState">func ParseSessionState(data []byte) (*SessionState, error)</a>
+</li>
+<li> <a href="#SessionState.Bytes">func (s *SessionState) Bytes() ([]byte, error)</a>
+</li>
+<li><a href="#SignatureScheme">type SignatureScheme</a></li>
+<li> <a href="#SignatureScheme.String">func (i SignatureScheme) String() string</a>
+</li>
+<li><a href="#pkg-note-BUG">Bugs</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Config_keyLogWriter">Config (KeyLogWriter)</a></dd> <dd><a class="exampleLink" href="#example_Config_verifyConnection">Config (VerifyConnection)</a></dd> <dd><a class="exampleLink" href="#example_Dial">Dial</a></dd> <dd><a class="exampleLink" href="#example_LoadX509KeyPair">LoadX509KeyPair</a></dd> <dd><a class="exampleLink" href="#example_X509KeyPair">X509KeyPair</a></dd> <dd><a class="exampleLink" href="#example_X509KeyPair_httpServer">X509KeyPair (HttpServer)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>alert.go</span> <span>auth.go</span> <span>cache.go</span> <span>cipher_suites.go</span> <span>common.go</span> <span>common_string.go</span> <span>conn.go</span> <span>handshake_client.go</span> <span>handshake_client_tls13.go</span> <span>handshake_messages.go</span> <span>handshake_server.go</span> <span>handshake_server_tls13.go</span> <span>key_agreement.go</span> <span>key_schedule.go</span> <span>notboring.go</span> <span>prf.go</span> <span>quic.go</span> <span>ticket.go</span> <span>tls.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>A list of cipher suite IDs that are, or have been, implemented by this package. </p>
+<p>See <a href="https://www.iana.org/assignments/tls-parameters/tls-parameters.xml">https://www.iana.org/assignments/tls-parameters/tls-parameters.xml</a> </p>
+<pre data-language="go">const (
+ // TLS 1.0 - 1.2 cipher suites.
+ TLS_RSA_WITH_RC4_128_SHA uint16 = 0x0005
+ TLS_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x000a
+ TLS_RSA_WITH_AES_128_CBC_SHA uint16 = 0x002f
+ TLS_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0035
+ TLS_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x003c
+ TLS_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x009c
+ TLS_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x009d
+ TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16 = 0xc007
+ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xc009
+ TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xc00a
+ TLS_ECDHE_RSA_WITH_RC4_128_SHA uint16 = 0xc011
+ TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xc012
+ TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0xc013
+ TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0xc014
+ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 uint16 = 0xc023
+ TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0xc027
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02f
+ TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02b
+ TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xc030
+ TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xc02c
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xcca8
+ TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xcca9
+
+ // TLS 1.3 cipher suites.
+ TLS_AES_128_GCM_SHA256 uint16 = 0x1301
+ TLS_AES_256_GCM_SHA384 uint16 = 0x1302
+ TLS_CHACHA20_POLY1305_SHA256 uint16 = 0x1303
+
+ // TLS_FALLBACK_SCSV isn't a standard cipher suite but an indicator
+ // that the client is doing version fallback. See RFC 7507.
+ TLS_FALLBACK_SCSV uint16 = 0x5600
+
+ // Legacy names for the corresponding cipher suites with the correct _SHA256
+ // suffix, retained for backward compatibility.
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 = TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
+ TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 = TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
+)</pre> <pre data-language="go">const (
+ VersionTLS10 = 0x0301
+ VersionTLS11 = 0x0302
+ VersionTLS12 = 0x0303
+ VersionTLS13 = 0x0304
+
+ // Deprecated: SSLv3 is cryptographically broken, and is no longer
+ // supported by this package. See golang.org/issue/32716.
+ VersionSSL30 = 0x0300
+)</pre> <pre data-language="go">const (
+ QUICEncryptionLevelInitial = QUICEncryptionLevel(iota)
+ QUICEncryptionLevelEarly
+ QUICEncryptionLevelHandshake
+ QUICEncryptionLevelApplication
+)</pre> <h2 id="CipherSuiteName">func <span>CipherSuiteName</span> <span title="Added in Go 1.14">1.14</span> </h2> <pre data-language="go">func CipherSuiteName(id uint16) string</pre> <p>CipherSuiteName returns the standard name for the passed cipher suite ID (e.g. "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"), or a fallback representation of the ID value if the cipher suite is not implemented by this package. </p>
+<h2 id="Listen">func <span>Listen</span> </h2> <pre data-language="go">func Listen(network, laddr string, config *Config) (net.Listener, error)</pre> <p>Listen creates a TLS listener accepting connections on the given network address using net.Listen. The configuration config must be non-nil and must include at least one certificate or else set GetCertificate. </p>
+<h2 id="NewListener">func <span>NewListener</span> </h2> <pre data-language="go">func NewListener(inner net.Listener, config *Config) net.Listener</pre> <p>NewListener creates a Listener which accepts connections from an inner Listener and wraps each connection with <a href="#Server">Server</a>. The configuration config must be non-nil and must include at least one certificate or else set GetCertificate. </p>
+<h2 id="VersionName">func <span>VersionName</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func VersionName(version uint16) string</pre> <p>VersionName returns the name for the provided TLS version number (e.g. "TLS 1.3"), or a fallback representation of the value if the version is not implemented by this package. </p>
+<h2 id="AlertError">type <span>AlertError</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>An AlertError is a TLS alert. </p>
+<p>When using a QUIC transport, QUICConn methods will return an error which wraps AlertError rather than sending a TLS alert. </p>
+<pre data-language="go">type AlertError uint8</pre> <h3 id="AlertError.Error">func (AlertError) <span>Error</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (e AlertError) Error() string</pre> <h2 id="Certificate">type <span>Certificate</span> </h2> <p>A Certificate is a chain of one or more certificates, leaf first. </p>
+<pre data-language="go">type Certificate struct {
+ Certificate [][]byte
+ // PrivateKey contains the private key corresponding to the public key in
+ // Leaf. This must implement crypto.Signer with an RSA, ECDSA or Ed25519 PublicKey.
+ // For a server up to TLS 1.2, it can also implement crypto.Decrypter with
+ // an RSA PublicKey.
+ PrivateKey crypto.PrivateKey
+ // SupportedSignatureAlgorithms is an optional list restricting what
+ // signature algorithms the PrivateKey can be used for.
+ SupportedSignatureAlgorithms []SignatureScheme // Go 1.14
+ // OCSPStaple contains an optional OCSP response which will be served
+ // to clients that request it.
+ OCSPStaple []byte
+ // SignedCertificateTimestamps contains an optional list of Signed
+ // Certificate Timestamps which will be served to clients that request it.
+ SignedCertificateTimestamps [][]byte // Go 1.5
+ // Leaf is the parsed form of the leaf certificate, which may be initialized
+ // using x509.ParseCertificate to reduce per-handshake processing. If nil,
+ // the leaf certificate will be parsed as needed.
+ Leaf *x509.Certificate
+}
+</pre> <h3 id="LoadX509KeyPair">func <span>LoadX509KeyPair</span> </h3> <pre data-language="go">func LoadX509KeyPair(certFile, keyFile string) (Certificate, error)</pre> <p>LoadX509KeyPair reads and parses a public/private key pair from a pair of files. The files must contain PEM encoded data. The certificate file may contain intermediate certificates following the leaf certificate to form a certificate chain. On successful return, Certificate.Leaf will be nil because the parsed form of the certificate is not retained. </p> <h4 id="example_LoadX509KeyPair"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cert, err := tls.LoadX509KeyPair("testdata/example-cert.pem", "testdata/example-key.pem")
+if err != nil {
+ log.Fatal(err)
+}
+cfg := &amp;tls.Config{Certificates: []tls.Certificate{cert}}
+listener, err := tls.Listen("tcp", ":2000", cfg)
+if err != nil {
+ log.Fatal(err)
+}
+_ = listener
+</pre> <h3 id="X509KeyPair">func <span>X509KeyPair</span> </h3> <pre data-language="go">func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error)</pre> <p>X509KeyPair parses a public/private key pair from a pair of PEM encoded data. On successful return, Certificate.Leaf will be nil because the parsed form of the certificate is not retained. </p> <h4 id="example_X509KeyPair"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+certPem := []byte(`-----BEGIN CERTIFICATE-----
+MIIBhTCCASugAwIBAgIQIRi6zePL6mKjOipn+dNuaTAKBggqhkjOPQQDAjASMRAw
+DgYDVQQKEwdBY21lIENvMB4XDTE3MTAyMDE5NDMwNloXDTE4MTAyMDE5NDMwNlow
+EjEQMA4GA1UEChMHQWNtZSBDbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABD0d
+7VNhbWvZLWPuj/RtHFjvtJBEwOkhbN/BnnE8rnZR8+sbwnc/KhCk3FhnpHZnQz7B
+5aETbbIgmuvewdjvSBSjYzBhMA4GA1UdDwEB/wQEAwICpDATBgNVHSUEDDAKBggr
+BgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MCkGA1UdEQQiMCCCDmxvY2FsaG9zdDo1
+NDUzgg4xMjcuMC4wLjE6NTQ1MzAKBggqhkjOPQQDAgNIADBFAiEA2zpJEPQyz6/l
+Wf86aX6PepsntZv2GYlA5UpabfT2EZICICpJ5h/iI+i341gBmLiAFQOyTDT+/wQc
+6MF9+Yw1Yy0t
+-----END CERTIFICATE-----`)
+keyPem := []byte(`-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIIrYSSNQFaA2Hwf1duRSxKtLYX5CB04fSeQ6tF1aY/PuoAoGCCqGSM49
+AwEHoUQDQgAEPR3tU2Fta9ktY+6P9G0cWO+0kETA6SFs38GecTyudlHz6xvCdz8q
+EKTcWGekdmdDPsHloRNtsiCa697B2O9IFA==
+-----END EC PRIVATE KEY-----`)
+cert, err := tls.X509KeyPair(certPem, keyPem)
+if err != nil {
+ log.Fatal(err)
+}
+cfg := &amp;tls.Config{Certificates: []tls.Certificate{cert}}
+listener, err := tls.Listen("tcp", ":2000", cfg)
+if err != nil {
+ log.Fatal(err)
+}
+_ = listener
+</pre> <h4 id="example_X509KeyPair_httpServer"> <span class="text">Example (HttpServer)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+certPem := []byte(`-----BEGIN CERTIFICATE-----
+MIIBhTCCASugAwIBAgIQIRi6zePL6mKjOipn+dNuaTAKBggqhkjOPQQDAjASMRAw
+DgYDVQQKEwdBY21lIENvMB4XDTE3MTAyMDE5NDMwNloXDTE4MTAyMDE5NDMwNlow
+EjEQMA4GA1UEChMHQWNtZSBDbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABD0d
+7VNhbWvZLWPuj/RtHFjvtJBEwOkhbN/BnnE8rnZR8+sbwnc/KhCk3FhnpHZnQz7B
+5aETbbIgmuvewdjvSBSjYzBhMA4GA1UdDwEB/wQEAwICpDATBgNVHSUEDDAKBggr
+BgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MCkGA1UdEQQiMCCCDmxvY2FsaG9zdDo1
+NDUzgg4xMjcuMC4wLjE6NTQ1MzAKBggqhkjOPQQDAgNIADBFAiEA2zpJEPQyz6/l
+Wf86aX6PepsntZv2GYlA5UpabfT2EZICICpJ5h/iI+i341gBmLiAFQOyTDT+/wQc
+6MF9+Yw1Yy0t
+-----END CERTIFICATE-----`)
+keyPem := []byte(`-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIIrYSSNQFaA2Hwf1duRSxKtLYX5CB04fSeQ6tF1aY/PuoAoGCCqGSM49
+AwEHoUQDQgAEPR3tU2Fta9ktY+6P9G0cWO+0kETA6SFs38GecTyudlHz6xvCdz8q
+EKTcWGekdmdDPsHloRNtsiCa697B2O9IFA==
+-----END EC PRIVATE KEY-----`)
+cert, err := tls.X509KeyPair(certPem, keyPem)
+if err != nil {
+ log.Fatal(err)
+}
+cfg := &amp;tls.Config{Certificates: []tls.Certificate{cert}}
+srv := &amp;http.Server{
+ TLSConfig: cfg,
+ ReadTimeout: time.Minute,
+ WriteTimeout: time.Minute,
+}
+log.Fatal(srv.ListenAndServeTLS("", ""))
+</pre> <h2 id="CertificateRequestInfo">type <span>CertificateRequestInfo</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>CertificateRequestInfo contains information from a server's CertificateRequest message, which is used to demand a certificate and proof of control from a client. </p>
+<pre data-language="go">type CertificateRequestInfo struct {
+ // AcceptableCAs contains zero or more, DER-encoded, X.501
+ // Distinguished Names. These are the names of root or intermediate CAs
+ // that the server wishes the returned certificate to be signed by. An
+ // empty slice indicates that the server has no preference.
+ AcceptableCAs [][]byte
+
+ // SignatureSchemes lists the signature schemes that the server is
+ // willing to verify.
+ SignatureSchemes []SignatureScheme
+
+ // Version is the TLS version that was negotiated for this connection.
+ Version uint16 // Go 1.14
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="CertificateRequestInfo.Context">func (*CertificateRequestInfo) <span>Context</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (c *CertificateRequestInfo) Context() context.Context</pre> <p>Context returns the context of the handshake that is in progress. This context is a child of the context passed to HandshakeContext, if any, and is canceled when the handshake concludes. </p>
+<h3 id="CertificateRequestInfo.SupportsCertificate">func (*CertificateRequestInfo) <span>SupportsCertificate</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (cri *CertificateRequestInfo) SupportsCertificate(c *Certificate) error</pre> <p>SupportsCertificate returns nil if the provided certificate is supported by the server that sent the CertificateRequest. Otherwise, it returns an error describing the reason for the incompatibility. </p>
+<h2 id="CertificateVerificationError">type <span>CertificateVerificationError</span> <span title="Added in Go 1.20">1.20</span> </h2> <p>CertificateVerificationError is returned when certificate verification fails during the handshake. </p>
+<pre data-language="go">type CertificateVerificationError struct {
+ // UnverifiedCertificates and its contents should not be modified.
+ UnverifiedCertificates []*x509.Certificate
+ Err error
+}
+</pre> <h3 id="CertificateVerificationError.Error">func (*CertificateVerificationError) <span>Error</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (e *CertificateVerificationError) Error() string</pre> <h3 id="CertificateVerificationError.Unwrap">func (*CertificateVerificationError) <span>Unwrap</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (e *CertificateVerificationError) Unwrap() error</pre> <h2 id="CipherSuite">type <span>CipherSuite</span> <span title="Added in Go 1.14">1.14</span> </h2> <p>CipherSuite is a TLS cipher suite. Note that most functions in this package accept and expose cipher suite IDs instead of this type. </p>
+<pre data-language="go">type CipherSuite struct {
+ ID uint16
+ Name string
+
+ // Supported versions is the list of TLS protocol versions that can
+ // negotiate this cipher suite.
+ SupportedVersions []uint16
+
+ // Insecure is true if the cipher suite has known security issues
+ // due to its primitives, design, or implementation.
+ Insecure bool
+}
+</pre> <h3 id="CipherSuites">func <span>CipherSuites</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func CipherSuites() []*CipherSuite</pre> <p>CipherSuites returns a list of cipher suites currently implemented by this package, excluding those with security issues, which are returned by <a href="#InsecureCipherSuites">InsecureCipherSuites</a>. </p>
+<p>The list is sorted by ID. Note that the default cipher suites selected by this package might depend on logic that can't be captured by a static list, and might not match those returned by this function. </p>
+<h3 id="InsecureCipherSuites">func <span>InsecureCipherSuites</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func InsecureCipherSuites() []*CipherSuite</pre> <p>InsecureCipherSuites returns a list of cipher suites currently implemented by this package and which have security issues. </p>
+<p>Most applications should not use the cipher suites in this list, and should only use those returned by <a href="#CipherSuites">CipherSuites</a>. </p>
+<h2 id="ClientAuthType">type <span>ClientAuthType</span> </h2> <p>ClientAuthType declares the policy the server will follow for TLS Client Authentication. </p>
+<pre data-language="go">type ClientAuthType int</pre> <pre data-language="go">const (
+ // NoClientCert indicates that no client certificate should be requested
+ // during the handshake, and if any certificates are sent they will not
+ // be verified.
+ NoClientCert ClientAuthType = iota
+ // RequestClientCert indicates that a client certificate should be requested
+ // during the handshake, but does not require that the client send any
+ // certificates.
+ RequestClientCert
+ // RequireAnyClientCert indicates that a client certificate should be requested
+ // during the handshake, and that at least one certificate is required to be
+ // sent by the client, but that certificate is not required to be valid.
+ RequireAnyClientCert
+ // VerifyClientCertIfGiven indicates that a client certificate should be requested
+ // during the handshake, but does not require that the client sends a
+ // certificate. If the client does send a certificate it is required to be
+ // valid.
+ VerifyClientCertIfGiven
+ // RequireAndVerifyClientCert indicates that a client certificate should be requested
+ // during the handshake, and that at least one valid certificate is required
+ // to be sent by the client.
+ RequireAndVerifyClientCert
+)</pre> <h3 id="ClientAuthType.String">func (ClientAuthType) <span>String</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (i ClientAuthType) String() string</pre> <h2 id="ClientHelloInfo">type <span>ClientHelloInfo</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>ClientHelloInfo contains information from a ClientHello message in order to guide application logic in the GetCertificate and GetConfigForClient callbacks. </p>
+<pre data-language="go">type ClientHelloInfo struct {
+ // CipherSuites lists the CipherSuites supported by the client (e.g.
+ // TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256).
+ CipherSuites []uint16
+
+ // ServerName indicates the name of the server requested by the client
+ // in order to support virtual hosting. ServerName is only set if the
+ // client is using SNI (see RFC 4366, Section 3.1).
+ ServerName string
+
+ // SupportedCurves lists the elliptic curves supported by the client.
+ // SupportedCurves is set only if the Supported Elliptic Curves
+ // Extension is being used (see RFC 4492, Section 5.1.1).
+ SupportedCurves []CurveID
+
+ // SupportedPoints lists the point formats supported by the client.
+ // SupportedPoints is set only if the Supported Point Formats Extension
+ // is being used (see RFC 4492, Section 5.1.2).
+ SupportedPoints []uint8
+
+ // SignatureSchemes lists the signature and hash schemes that the client
+ // is willing to verify. SignatureSchemes is set only if the Signature
+ // Algorithms Extension is being used (see RFC 5246, Section 7.4.1.4.1).
+ SignatureSchemes []SignatureScheme // Go 1.8
+
+ // SupportedProtos lists the application protocols supported by the client.
+ // SupportedProtos is set only if the Application-Layer Protocol
+ // Negotiation Extension is being used (see RFC 7301, Section 3.1).
+ //
+ // Servers can select a protocol by setting Config.NextProtos in a
+ // GetConfigForClient return value.
+ SupportedProtos []string // Go 1.8
+
+ // SupportedVersions lists the TLS versions supported by the client.
+ // For TLS versions less than 1.3, this is extrapolated from the max
+ // version advertised by the client, so values other than the greatest
+ // might be rejected if used.
+ SupportedVersions []uint16 // Go 1.8
+
+ // Conn is the underlying net.Conn for the connection. Do not read
+ // from, or write to, this connection; that will cause the TLS
+ // connection to fail.
+ Conn net.Conn // Go 1.8
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ClientHelloInfo.Context">func (*ClientHelloInfo) <span>Context</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (c *ClientHelloInfo) Context() context.Context</pre> <p>Context returns the context of the handshake that is in progress. This context is a child of the context passed to HandshakeContext, if any, and is canceled when the handshake concludes. </p>
+<h3 id="ClientHelloInfo.SupportsCertificate">func (*ClientHelloInfo) <span>SupportsCertificate</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (chi *ClientHelloInfo) SupportsCertificate(c *Certificate) error</pre> <p>SupportsCertificate returns nil if the provided certificate is supported by the client that sent the ClientHello. Otherwise, it returns an error describing the reason for the incompatibility. </p>
+<p>If this <a href="#ClientHelloInfo">ClientHelloInfo</a> was passed to a GetConfigForClient or GetCertificate callback, this method will take into account the associated <a href="#Config">Config</a>. Note that if GetConfigForClient returns a different <a href="#Config">Config</a>, the change can't be accounted for by this method. </p>
+<p>This function will call x509.ParseCertificate unless c.Leaf is set, which can incur a significant performance cost. </p>
+<h2 id="ClientSessionCache">type <span>ClientSessionCache</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>ClientSessionCache is a cache of ClientSessionState objects that can be used by a client to resume a TLS session with a given server. ClientSessionCache implementations should expect to be called concurrently from different goroutines. Up to TLS 1.2, only ticket-based resumption is supported, not SessionID-based resumption. In TLS 1.3 they were merged into PSK modes, which are supported via this interface. </p>
+<pre data-language="go">type ClientSessionCache interface {
+ // Get searches for a ClientSessionState associated with the given key.
+ // On return, ok is true if one was found.
+ Get(sessionKey string) (session *ClientSessionState, ok bool)
+
+ // Put adds the ClientSessionState to the cache with the given key. It might
+ // get called multiple times in a connection if a TLS 1.3 server provides
+ // more than one session ticket. If called with a nil *ClientSessionState,
+ // it should remove the cache entry.
+ Put(sessionKey string, cs *ClientSessionState)
+}</pre> <h3 id="NewLRUClientSessionCache">func <span>NewLRUClientSessionCache</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func NewLRUClientSessionCache(capacity int) ClientSessionCache</pre> <p>NewLRUClientSessionCache returns a <a href="#ClientSessionCache">ClientSessionCache</a> with the given capacity that uses an LRU strategy. If capacity is &lt; 1, a default capacity is used instead. </p>
+<h2 id="ClientSessionState">type <span>ClientSessionState</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>ClientSessionState contains the state needed by a client to resume a previous TLS session. </p>
+<pre data-language="go">type ClientSessionState struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewResumptionState">func <span>NewResumptionState</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func NewResumptionState(ticket []byte, state *SessionState) (*ClientSessionState, error)</pre> <p>NewResumptionState returns a state value that can be returned by [ClientSessionCache.Get] to resume a previous session. </p>
+<p>state needs to be returned by <a href="#ParseSessionState">ParseSessionState</a>, and the ticket and session state must have been returned by <a href="#ClientSessionState.ResumptionState">ClientSessionState.ResumptionState</a>. </p>
+<h3 id="ClientSessionState.ResumptionState">func (*ClientSessionState) <span>ResumptionState</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (cs *ClientSessionState) ResumptionState() (ticket []byte, state *SessionState, err error)</pre> <p>ResumptionState returns the session ticket sent by the server (also known as the session's identity) and the state necessary to resume this session. </p>
+<p>It can be called by [ClientSessionCache.Put] to serialize (with <a href="#SessionState.Bytes">SessionState.Bytes</a>) and store the session. </p>
+<h2 id="Config">type <span>Config</span> </h2> <p>A Config structure is used to configure a TLS client or server. After one has been passed to a TLS function it must not be modified. A Config may be reused; the tls package will also not modify it. </p>
+<pre data-language="go">type Config struct {
+ // Rand provides the source of entropy for nonces and RSA blinding.
+ // If Rand is nil, TLS uses the cryptographic random reader in package
+ // crypto/rand.
+ // The Reader must be safe for use by multiple goroutines.
+ Rand io.Reader
+
+ // Time returns the current time as the number of seconds since the epoch.
+ // If Time is nil, TLS uses time.Now.
+ Time func() time.Time
+
+ // Certificates contains one or more certificate chains to present to the
+ // other side of the connection. The first certificate compatible with the
+ // peer's requirements is selected automatically.
+ //
+ // Server configurations must set one of Certificates, GetCertificate or
+ // GetConfigForClient. Clients doing client-authentication may set either
+ // Certificates or GetClientCertificate.
+ //
+ // Note: if there are multiple Certificates, and they don't have the
+ // optional field Leaf set, certificate selection will incur a significant
+ // per-handshake performance cost.
+ Certificates []Certificate
+
+ // NameToCertificate maps from a certificate name to an element of
+ // Certificates. Note that a certificate name can be of the form
+ // '*.example.com' and so doesn't have to be a domain name as such.
+ //
+ // Deprecated: NameToCertificate only allows associating a single
+ // certificate with a given name. Leave this field nil to let the library
+ // select the first compatible chain from Certificates.
+ NameToCertificate map[string]*Certificate
+
+ // GetCertificate returns a Certificate based on the given
+ // ClientHelloInfo. It will only be called if the client supplies SNI
+ // information or if Certificates is empty.
+ //
+ // If GetCertificate is nil or returns nil, then the certificate is
+ // retrieved from NameToCertificate. If NameToCertificate is nil, the
+ // best element of Certificates will be used.
+ //
+ // Once a Certificate is returned it should not be modified.
+ GetCertificate func(*ClientHelloInfo) (*Certificate, error) // Go 1.4
+
+ // GetClientCertificate, if not nil, is called when a server requests a
+ // certificate from a client. If set, the contents of Certificates will
+ // be ignored.
+ //
+ // If GetClientCertificate returns an error, the handshake will be
+ // aborted and that error will be returned. Otherwise
+ // GetClientCertificate must return a non-nil Certificate. If
+ // Certificate.Certificate is empty then no certificate will be sent to
+ // the server. If this is unacceptable to the server then it may abort
+ // the handshake.
+ //
+ // GetClientCertificate may be called multiple times for the same
+ // connection if renegotiation occurs or if TLS 1.3 is in use.
+ //
+ // Once a Certificate is returned it should not be modified.
+ GetClientCertificate func(*CertificateRequestInfo) (*Certificate, error) // Go 1.8
+
+ // GetConfigForClient, if not nil, is called after a ClientHello is
+ // received from a client. It may return a non-nil Config in order to
+ // change the Config that will be used to handle this connection. If
+ // the returned Config is nil, the original Config will be used. The
+ // Config returned by this callback may not be subsequently modified.
+ //
+ // If GetConfigForClient is nil, the Config passed to Server() will be
+ // used for all connections.
+ //
+ // If SessionTicketKey was explicitly set on the returned Config, or if
+ // SetSessionTicketKeys was called on the returned Config, those keys will
+ // be used. Otherwise, the original Config keys will be used (and possibly
+ // rotated if they are automatically managed).
+ GetConfigForClient func(*ClientHelloInfo) (*Config, error) // Go 1.8
+
+ // VerifyPeerCertificate, if not nil, is called after normal
+ // certificate verification by either a TLS client or server. It
+ // receives the raw ASN.1 certificates provided by the peer and also
+ // any verified chains that normal processing found. If it returns a
+ // non-nil error, the handshake is aborted and that error results.
+ //
+ // If normal verification fails then the handshake will abort before
+ // considering this callback. If normal verification is disabled (on the
+ // client when InsecureSkipVerify is set, or on a server when ClientAuth is
+ // RequestClientCert or RequireAnyClientCert), then this callback will be
+ // considered but the verifiedChains argument will always be nil. When
+ // ClientAuth is NoClientCert, this callback is not called on the server.
+ // rawCerts may be empty on the server if ClientAuth is RequestClientCert or
+ // VerifyClientCertIfGiven.
+ //
+ // This callback is not invoked on resumed connections, as certificates are
+ // not re-verified on resumption.
+ //
+ // verifiedChains and its contents should not be modified.
+ VerifyPeerCertificate func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error // Go 1.8
+
+ // VerifyConnection, if not nil, is called after normal certificate
+ // verification and after VerifyPeerCertificate by either a TLS client
+ // or server. If it returns a non-nil error, the handshake is aborted
+ // and that error results.
+ //
+ // If normal verification fails then the handshake will abort before
+ // considering this callback. This callback will run for all connections,
+ // including resumptions, regardless of InsecureSkipVerify or ClientAuth
+ // settings.
+ VerifyConnection func(ConnectionState) error // Go 1.15
+
+ // RootCAs defines the set of root certificate authorities
+ // that clients use when verifying server certificates.
+ // If RootCAs is nil, TLS uses the host's root CA set.
+ RootCAs *x509.CertPool
+
+ // NextProtos is a list of supported application level protocols, in
+ // order of preference. If both peers support ALPN, the selected
+ // protocol will be one from this list, and the connection will fail
+ // if there is no mutually supported protocol. If NextProtos is empty
+ // or the peer doesn't support ALPN, the connection will succeed and
+ // ConnectionState.NegotiatedProtocol will be empty.
+ NextProtos []string
+
+ // ServerName is used to verify the hostname on the returned
+ // certificates unless InsecureSkipVerify is given. It is also included
+ // in the client's handshake to support virtual hosting unless it is
+ // an IP address.
+ ServerName string
+
+ // ClientAuth determines the server's policy for
+ // TLS Client Authentication. The default is NoClientCert.
+ ClientAuth ClientAuthType
+
+ // ClientCAs defines the set of root certificate authorities
+ // that servers use if required to verify a client certificate
+ // by the policy in ClientAuth.
+ ClientCAs *x509.CertPool
+
+ // InsecureSkipVerify controls whether a client verifies the server's
+ // certificate chain and host name. If InsecureSkipVerify is true, crypto/tls
+ // accepts any certificate presented by the server and any host name in that
+ // certificate. In this mode, TLS is susceptible to machine-in-the-middle
+ // attacks unless custom verification is used. This should be used only for
+ // testing or in combination with VerifyConnection or VerifyPeerCertificate.
+ InsecureSkipVerify bool
+
+ // CipherSuites is a list of enabled TLS 1.0–1.2 cipher suites. The order of
+ // the list is ignored. Note that TLS 1.3 ciphersuites are not configurable.
+ //
+ // If CipherSuites is nil, a safe default list is used. The default cipher
+ // suites might change over time. In Go 1.22 RSA key exchange based cipher
+ // suites were removed from the default list, but can be re-added with the
+ // GODEBUG setting tlsrsakex=1.
+ CipherSuites []uint16
+
+ // PreferServerCipherSuites is a legacy field and has no effect.
+ //
+ // It used to control whether the server would follow the client's or the
+ // server's preference. Servers now select the best mutually supported
+ // cipher suite based on logic that takes into account inferred client
+ // hardware, server hardware, and security.
+ //
+ // Deprecated: PreferServerCipherSuites is ignored.
+ PreferServerCipherSuites bool // Go 1.1
+
+ // SessionTicketsDisabled may be set to true to disable session ticket and
+ // PSK (resumption) support. Note that on clients, session ticket support is
+ // also disabled if ClientSessionCache is nil.
+ SessionTicketsDisabled bool // Go 1.1
+
+ // SessionTicketKey is used by TLS servers to provide session resumption.
+ // See RFC 5077 and the PSK mode of RFC 8446. If zero, it will be filled
+ // with random data before the first server handshake.
+ //
+ // Deprecated: if this field is left at zero, session ticket keys will be
+ // automatically rotated every day and dropped after seven days. For
+ // customizing the rotation schedule or synchronizing servers that are
+ // terminating connections for the same host, use SetSessionTicketKeys.
+ SessionTicketKey [32]byte // Go 1.1
+
+ // ClientSessionCache is a cache of ClientSessionState entries for TLS
+ // session resumption. It is only used by clients.
+ ClientSessionCache ClientSessionCache // Go 1.3
+
+ // UnwrapSession is called on the server to turn a ticket/identity
+ // previously produced by [WrapSession] into a usable session.
+ //
+ // UnwrapSession will usually either decrypt a session state in the ticket
+ // (for example with [Config.EncryptTicket]), or use the ticket as a handle
+ // to recover a previously stored state. It must use [ParseSessionState] to
+ // deserialize the session state.
+ //
+ // If UnwrapSession returns an error, the connection is terminated. If it
+ // returns (nil, nil), the session is ignored. crypto/tls may still choose
+ // not to resume the returned session.
+ UnwrapSession func(identity []byte, cs ConnectionState) (*SessionState, error) // Go 1.21
+
+ // WrapSession is called on the server to produce a session ticket/identity.
+ //
+ // WrapSession must serialize the session state with [SessionState.Bytes].
+ // It may then encrypt the serialized state (for example with
+ // [Config.DecryptTicket]) and use it as the ticket, or store the state and
+ // return a handle for it.
+ //
+ // If WrapSession returns an error, the connection is terminated.
+ //
+ // Warning: the return value will be exposed on the wire and to clients in
+ // plaintext. The application is in charge of encrypting and authenticating
+ // it (and rotating keys) or returning high-entropy identifiers. Failing to
+ // do so correctly can compromise current, previous, and future connections
+ // depending on the protocol version.
+ WrapSession func(ConnectionState, *SessionState) ([]byte, error) // Go 1.21
+
+ // MinVersion contains the minimum TLS version that is acceptable.
+ //
+ // By default, TLS 1.2 is currently used as the minimum. TLS 1.0 is the
+ // minimum supported by this package.
+ //
+ // The server-side default can be reverted to TLS 1.0 by including the value
+ // "tls10server=1" in the GODEBUG environment variable.
+ MinVersion uint16 // Go 1.2
+
+ // MaxVersion contains the maximum TLS version that is acceptable.
+ //
+ // By default, the maximum version supported by this package is used,
+ // which is currently TLS 1.3.
+ MaxVersion uint16 // Go 1.2
+
+ // CurvePreferences contains the elliptic curves that will be used in
+ // an ECDHE handshake, in preference order. If empty, the default will
+ // be used. The client will use the first preference as the type for
+ // its key share in TLS 1.3. This may change in the future.
+ CurvePreferences []CurveID // Go 1.3
+
+ // DynamicRecordSizingDisabled disables adaptive sizing of TLS records.
+ // When true, the largest possible TLS record size is always used. When
+ // false, the size of TLS records may be adjusted in an attempt to
+ // improve latency.
+ DynamicRecordSizingDisabled bool // Go 1.7
+
+ // Renegotiation controls what types of renegotiation are supported.
+ // The default, none, is correct for the vast majority of applications.
+ Renegotiation RenegotiationSupport // Go 1.7
+
+ // KeyLogWriter optionally specifies a destination for TLS master secrets
+ // in NSS key log format that can be used to allow external programs
+ // such as Wireshark to decrypt TLS connections.
+ // See https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format.
+ // Use of KeyLogWriter compromises security and should only be
+ // used for debugging.
+ KeyLogWriter io.Writer // Go 1.8
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Config_keyLogWriter"> <span class="text">Example (KeyLogWriter)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Debugging TLS applications by decrypting a network traffic capture.
+
+// WARNING: Use of KeyLogWriter compromises security and should only be
+// used for debugging.
+
+// Dummy test HTTP server for the example with insecure random so output is
+// reproducible.
+server := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
+server.TLS = &amp;tls.Config{
+ Rand: zeroSource{}, // for example only; don't do this.
+}
+server.StartTLS()
+defer server.Close()
+
+// Typically the log would go to an open file:
+// w, err := os.OpenFile("tls-secrets.txt", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
+w := os.Stdout
+
+client := &amp;http.Client{
+ Transport: &amp;http.Transport{
+ TLSClientConfig: &amp;tls.Config{
+ KeyLogWriter: w,
+
+ Rand: zeroSource{}, // for reproducible output; don't do this.
+ InsecureSkipVerify: true, // test server certificate is not trusted.
+ },
+ },
+}
+resp, err := client.Get(server.URL)
+if err != nil {
+ log.Fatalf("Failed to get URL: %v", err)
+}
+resp.Body.Close()
+
+// The resulting file can be used with Wireshark to decrypt the TLS
+// connection by setting (Pre)-Master-Secret log filename in SSL Protocol
+// preferences.
+</pre> <h4 id="example_Config_verifyConnection"> <span class="text">Example (VerifyConnection)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// VerifyConnection can be used to replace and customize connection
+// verification. This example shows a VerifyConnection implementation that
+// will be approximately equivalent to what crypto/tls does normally to
+// verify the peer's certificate.
+
+// Client side configuration.
+_ = &amp;tls.Config{
+ // Set InsecureSkipVerify to skip the default validation we are
+ // replacing. This will not disable VerifyConnection.
+ InsecureSkipVerify: true,
+ VerifyConnection: func(cs tls.ConnectionState) error {
+ opts := x509.VerifyOptions{
+ DNSName: cs.ServerName,
+ Intermediates: x509.NewCertPool(),
+ }
+ for _, cert := range cs.PeerCertificates[1:] {
+ opts.Intermediates.AddCert(cert)
+ }
+ _, err := cs.PeerCertificates[0].Verify(opts)
+ return err
+ },
+}
+
+// Server side configuration.
+_ = &amp;tls.Config{
+ // Require client certificates (or VerifyConnection will run anyway and
+ // panic accessing cs.PeerCertificates[0]) but don't verify them with the
+ // default verifier. This will not disable VerifyConnection.
+ ClientAuth: tls.RequireAnyClientCert,
+ VerifyConnection: func(cs tls.ConnectionState) error {
+ opts := x509.VerifyOptions{
+ DNSName: cs.ServerName,
+ Intermediates: x509.NewCertPool(),
+ KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
+ }
+ for _, cert := range cs.PeerCertificates[1:] {
+ opts.Intermediates.AddCert(cert)
+ }
+ _, err := cs.PeerCertificates[0].Verify(opts)
+ return err
+ },
+}
+
+// Note that when certificates are not handled by the default verifier
+// ConnectionState.VerifiedChains will be nil.
+</pre> <h3 id="Config.BuildNameToCertificate">func (*Config) <span>BuildNameToCertificate</span> </h3> <pre data-language="go">func (c *Config) BuildNameToCertificate()</pre> <p>BuildNameToCertificate parses c.Certificates and builds c.NameToCertificate from the CommonName and SubjectAlternateName fields of each of the leaf certificates. </p>
+<p>Deprecated: NameToCertificate only allows associating a single certificate with a given name. Leave that field nil to let the library select the first compatible chain from Certificates. </p>
+<h3 id="Config.Clone">func (*Config) <span>Clone</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (c *Config) Clone() *Config</pre> <p>Clone returns a shallow clone of c or nil if c is nil. It is safe to clone a <a href="#Config">Config</a> that is being used concurrently by a TLS client or server. </p>
+<h3 id="Config.DecryptTicket">func (*Config) <span>DecryptTicket</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (c *Config) DecryptTicket(identity []byte, cs ConnectionState) (*SessionState, error)</pre> <p>DecryptTicket decrypts a ticket encrypted by <a href="#Config.EncryptTicket">Config.EncryptTicket</a>. It can be used as a [Config.UnwrapSession] implementation. </p>
+<p>If the ticket can't be decrypted or parsed, DecryptTicket returns (nil, nil). </p>
+<h3 id="Config.EncryptTicket">func (*Config) <span>EncryptTicket</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (c *Config) EncryptTicket(cs ConnectionState, ss *SessionState) ([]byte, error)</pre> <p>EncryptTicket encrypts a ticket with the <a href="#Config">Config</a>'s configured (or default) session ticket keys. It can be used as a [Config.WrapSession] implementation. </p>
+<h3 id="Config.SetSessionTicketKeys">func (*Config) <span>SetSessionTicketKeys</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (c *Config) SetSessionTicketKeys(keys [][32]byte)</pre> <p>SetSessionTicketKeys updates the session ticket keys for a server. </p>
+<p>The first key will be used when creating new tickets, while all keys can be used for decrypting tickets. It is safe to call this function while the server is running in order to rotate the session ticket keys. The function will panic if keys is empty. </p>
+<p>Calling this function will turn off automatic session ticket key rotation. </p>
+<p>If multiple servers are terminating connections for the same host they should all have the same session ticket keys. If the session ticket keys leaks, previously recorded and future TLS connections using those keys might be compromised. </p>
+<h2 id="Conn">type <span>Conn</span> </h2> <p>A Conn represents a secured connection. It implements the net.Conn interface. </p>
+<pre data-language="go">type Conn struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Client">func <span>Client</span> </h3> <pre data-language="go">func Client(conn net.Conn, config *Config) *Conn</pre> <p>Client returns a new TLS client side connection using conn as the underlying transport. The config cannot be nil: users must set either ServerName or InsecureSkipVerify in the config. </p>
+<h3 id="Dial">func <span>Dial</span> </h3> <pre data-language="go">func Dial(network, addr string, config *Config) (*Conn, error)</pre> <p>Dial connects to the given network address using net.Dial and then initiates a TLS handshake, returning the resulting TLS connection. Dial interprets a nil configuration as equivalent to the zero configuration; see the documentation of Config for the defaults. </p> <h4 id="example_Dial"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Connecting with a custom root-certificate set.
+
+const rootPEM = `
+-- GlobalSign Root R2, valid until Dec 15, 2021
+-----BEGIN CERTIFICATE-----
+MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G
+A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp
+Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1
+MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG
+A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL
+v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8
+eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq
+tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd
+C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa
+zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB
+mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH
+V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n
+bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG
+3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs
+J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO
+291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS
+ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd
+AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
+TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
+-----END CERTIFICATE-----`
+
+// First, create the set of root certificates. For this example we only
+// have one. It's also possible to omit this in order to use the
+// default root set of the current operating system.
+roots := x509.NewCertPool()
+ok := roots.AppendCertsFromPEM([]byte(rootPEM))
+if !ok {
+ panic("failed to parse root certificate")
+}
+
+conn, err := tls.Dial("tcp", "mail.google.com:443", &amp;tls.Config{
+ RootCAs: roots,
+})
+if err != nil {
+ panic("failed to connect: " + err.Error())
+}
+conn.Close()
+</pre> <h3 id="DialWithDialer">func <span>DialWithDialer</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func DialWithDialer(dialer *net.Dialer, network, addr string, config *Config) (*Conn, error)</pre> <p>DialWithDialer connects to the given network address using dialer.Dial and then initiates a TLS handshake, returning the resulting TLS connection. Any timeout or deadline given in the dialer apply to connection and TLS handshake as a whole. </p>
+<p>DialWithDialer interprets a nil configuration as equivalent to the zero configuration; see the documentation of <a href="#Config">Config</a> for the defaults. </p>
+<p>DialWithDialer uses context.Background internally; to specify the context, use <a href="#Dialer.DialContext">Dialer.DialContext</a> with NetDialer set to the desired dialer. </p>
+<h3 id="Server">func <span>Server</span> </h3> <pre data-language="go">func Server(conn net.Conn, config *Config) *Conn</pre> <p>Server returns a new TLS server side connection using conn as the underlying transport. The configuration config must be non-nil and must include at least one certificate or else set GetCertificate. </p>
+<h3 id="Conn.Close">func (*Conn) <span>Close</span> </h3> <pre data-language="go">func (c *Conn) Close() error</pre> <p>Close closes the connection. </p>
+<h3 id="Conn.CloseWrite">func (*Conn) <span>CloseWrite</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (c *Conn) CloseWrite() error</pre> <p>CloseWrite shuts down the writing side of the connection. It should only be called once the handshake has completed and does not call CloseWrite on the underlying connection. Most callers should just use <a href="#Conn.Close">Conn.Close</a>. </p>
+<h3 id="Conn.ConnectionState">func (*Conn) <span>ConnectionState</span> </h3> <pre data-language="go">func (c *Conn) ConnectionState() ConnectionState</pre> <p>ConnectionState returns basic TLS details about the connection. </p>
+<h3 id="Conn.Handshake">func (*Conn) <span>Handshake</span> </h3> <pre data-language="go">func (c *Conn) Handshake() error</pre> <p>Handshake runs the client or server handshake protocol if it has not yet been run. </p>
+<p>Most uses of this package need not call Handshake explicitly: the first <a href="#Conn.Read">Conn.Read</a> or <a href="#Conn.Write">Conn.Write</a> will call it automatically. </p>
+<p>For control over canceling or setting a timeout on a handshake, use <a href="#Conn.HandshakeContext">Conn.HandshakeContext</a> or the <a href="#Dialer">Dialer</a>'s DialContext method instead. </p>
+<p>In order to avoid denial of service attacks, the maximum RSA key size allowed in certificates sent by either the TLS server or client is limited to 8192 bits. This limit can be overridden by setting tlsmaxrsasize in the GODEBUG environment variable (e.g. GODEBUG=tlsmaxrsasize=4096). </p>
+<h3 id="Conn.HandshakeContext">func (*Conn) <span>HandshakeContext</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (c *Conn) HandshakeContext(ctx context.Context) error</pre> <p>HandshakeContext runs the client or server handshake protocol if it has not yet been run. </p>
+<p>The provided Context must be non-nil. If the context is canceled before the handshake is complete, the handshake is interrupted and an error is returned. Once the handshake has completed, cancellation of the context will not affect the connection. </p>
+<p>Most uses of this package need not call HandshakeContext explicitly: the first <a href="#Conn.Read">Conn.Read</a> or <a href="#Conn.Write">Conn.Write</a> will call it automatically. </p>
+<h3 id="Conn.LocalAddr">func (*Conn) <span>LocalAddr</span> </h3> <pre data-language="go">func (c *Conn) LocalAddr() net.Addr</pre> <p>LocalAddr returns the local network address. </p>
+<h3 id="Conn.NetConn">func (*Conn) <span>NetConn</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *Conn) NetConn() net.Conn</pre> <p>NetConn returns the underlying connection that is wrapped by c. Note that writing to or reading from this connection directly will corrupt the TLS session. </p>
+<h3 id="Conn.OCSPResponse">func (*Conn) <span>OCSPResponse</span> </h3> <pre data-language="go">func (c *Conn) OCSPResponse() []byte</pre> <p>OCSPResponse returns the stapled OCSP response from the TLS server, if any. (Only valid for client connections.) </p>
+<h3 id="Conn.Read">func (*Conn) <span>Read</span> </h3> <pre data-language="go">func (c *Conn) Read(b []byte) (int, error)</pre> <p>Read reads data from the connection. </p>
+<p>As Read calls <a href="#Conn.Handshake">Conn.Handshake</a>, in order to prevent indefinite blocking a deadline must be set for both Read and <a href="#Conn.Write">Conn.Write</a> before Read is called when the handshake has not yet completed. See <a href="#Conn.SetDeadline">Conn.SetDeadline</a>, <a href="#Conn.SetReadDeadline">Conn.SetReadDeadline</a>, and <a href="#Conn.SetWriteDeadline">Conn.SetWriteDeadline</a>. </p>
+<h3 id="Conn.RemoteAddr">func (*Conn) <span>RemoteAddr</span> </h3> <pre data-language="go">func (c *Conn) RemoteAddr() net.Addr</pre> <p>RemoteAddr returns the remote network address. </p>
+<h3 id="Conn.SetDeadline">func (*Conn) <span>SetDeadline</span> </h3> <pre data-language="go">func (c *Conn) SetDeadline(t time.Time) error</pre> <p>SetDeadline sets the read and write deadlines associated with the connection. A zero value for t means <a href="#Conn.Read">Conn.Read</a> and <a href="#Conn.Write">Conn.Write</a> will not time out. After a Write has timed out, the TLS state is corrupt and all future writes will return the same error. </p>
+<h3 id="Conn.SetReadDeadline">func (*Conn) <span>SetReadDeadline</span> </h3> <pre data-language="go">func (c *Conn) SetReadDeadline(t time.Time) error</pre> <p>SetReadDeadline sets the read deadline on the underlying connection. A zero value for t means <a href="#Conn.Read">Conn.Read</a> will not time out. </p>
+<h3 id="Conn.SetWriteDeadline">func (*Conn) <span>SetWriteDeadline</span> </h3> <pre data-language="go">func (c *Conn) SetWriteDeadline(t time.Time) error</pre> <p>SetWriteDeadline sets the write deadline on the underlying connection. A zero value for t means <a href="#Conn.Write">Conn.Write</a> will not time out. After a <a href="#Conn.Write">Conn.Write</a> has timed out, the TLS state is corrupt and all future writes will return the same error. </p>
+<h3 id="Conn.VerifyHostname">func (*Conn) <span>VerifyHostname</span> </h3> <pre data-language="go">func (c *Conn) VerifyHostname(host string) error</pre> <p>VerifyHostname checks that the peer certificate chain is valid for connecting to host. If so, it returns nil; if not, it returns an error describing the problem. </p>
+<h3 id="Conn.Write">func (*Conn) <span>Write</span> </h3> <pre data-language="go">func (c *Conn) Write(b []byte) (int, error)</pre> <p>Write writes data to the connection. </p>
+<p>As Write calls <a href="#Conn.Handshake">Conn.Handshake</a>, in order to prevent indefinite blocking a deadline must be set for both <a href="#Conn.Read">Conn.Read</a> and Write before Write is called when the handshake has not yet completed. See <a href="#Conn.SetDeadline">Conn.SetDeadline</a>, <a href="#Conn.SetReadDeadline">Conn.SetReadDeadline</a>, and <a href="#Conn.SetWriteDeadline">Conn.SetWriteDeadline</a>. </p>
+<h2 id="ConnectionState">type <span>ConnectionState</span> </h2> <p>ConnectionState records basic TLS details about the connection. </p>
+<pre data-language="go">type ConnectionState struct {
+ // Version is the TLS version used by the connection (e.g. VersionTLS12).
+ Version uint16 // Go 1.3
+
+ // HandshakeComplete is true if the handshake has concluded.
+ HandshakeComplete bool
+
+ // DidResume is true if this connection was successfully resumed from a
+ // previous session with a session ticket or similar mechanism.
+ DidResume bool // Go 1.1
+
+ // CipherSuite is the cipher suite negotiated for the connection (e.g.
+ // TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_AES_128_GCM_SHA256).
+ CipherSuite uint16
+
+ // NegotiatedProtocol is the application protocol negotiated with ALPN.
+ NegotiatedProtocol string
+
+ // NegotiatedProtocolIsMutual used to indicate a mutual NPN negotiation.
+ //
+ // Deprecated: this value is always true.
+ NegotiatedProtocolIsMutual bool
+
+ // ServerName is the value of the Server Name Indication extension sent by
+ // the client. It's available both on the server and on the client side.
+ ServerName string
+
+ // PeerCertificates are the parsed certificates sent by the peer, in the
+ // order in which they were sent. The first element is the leaf certificate
+ // that the connection is verified against.
+ //
+ // On the client side, it can't be empty. On the server side, it can be
+ // empty if Config.ClientAuth is not RequireAnyClientCert or
+ // RequireAndVerifyClientCert.
+ //
+ // PeerCertificates and its contents should not be modified.
+ PeerCertificates []*x509.Certificate
+
+ // VerifiedChains is a list of one or more chains where the first element is
+ // PeerCertificates[0] and the last element is from Config.RootCAs (on the
+ // client side) or Config.ClientCAs (on the server side).
+ //
+ // On the client side, it's set if Config.InsecureSkipVerify is false. On
+ // the server side, it's set if Config.ClientAuth is VerifyClientCertIfGiven
+ // (and the peer provided a certificate) or RequireAndVerifyClientCert.
+ //
+ // VerifiedChains and its contents should not be modified.
+ VerifiedChains [][]*x509.Certificate
+
+ // SignedCertificateTimestamps is a list of SCTs provided by the peer
+ // through the TLS handshake for the leaf certificate, if any.
+ SignedCertificateTimestamps [][]byte // Go 1.5
+
+ // OCSPResponse is a stapled Online Certificate Status Protocol (OCSP)
+ // response provided by the peer for the leaf certificate, if any.
+ OCSPResponse []byte // Go 1.5
+
+ // TLSUnique contains the "tls-unique" channel binding value (see RFC 5929,
+ // Section 3). This value will be nil for TLS 1.3 connections and for
+ // resumed connections that don't support Extended Master Secret (RFC 7627).
+ TLSUnique []byte // Go 1.4
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ConnectionState.ExportKeyingMaterial">func (*ConnectionState) <span>ExportKeyingMaterial</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (cs *ConnectionState) ExportKeyingMaterial(label string, context []byte, length int) ([]byte, error)</pre> <p>ExportKeyingMaterial returns length bytes of exported key material in a new slice as defined in RFC 5705. If context is nil, it is not used as part of the seed. If the connection was set to allow renegotiation via Config.Renegotiation, or if the connections supports neither TLS 1.3 nor Extended Master Secret, this function will return an error. </p>
+<p>Exporting key material without Extended Master Secret or TLS 1.3 was disabled in Go 1.22 due to security issues (see the Security Considerations sections of RFC 5705 and RFC 7627), but can be re-enabled with the GODEBUG setting tlsunsafeekm=1. </p>
+<h2 id="CurveID">type <span>CurveID</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>CurveID is the type of a TLS identifier for an elliptic curve. See <a href="https://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8">https://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8</a>. </p>
+<p>In TLS 1.3, this type is called NamedGroup, but at this time this library only supports Elliptic Curve based groups. See RFC 8446, Section 4.2.7. </p>
+<pre data-language="go">type CurveID uint16</pre> <pre data-language="go">const (
+ CurveP256 CurveID = 23
+ CurveP384 CurveID = 24
+ CurveP521 CurveID = 25
+ X25519 CurveID = 29
+)</pre> <h3 id="CurveID.String">func (CurveID) <span>String</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (i CurveID) String() string</pre> <h2 id="Dialer">type <span>Dialer</span> <span title="Added in Go 1.15">1.15</span> </h2> <p>Dialer dials TLS connections given a configuration and a Dialer for the underlying connection. </p>
+<pre data-language="go">type Dialer struct {
+ // NetDialer is the optional dialer to use for the TLS connections'
+ // underlying TCP connections.
+ // A nil NetDialer is equivalent to the net.Dialer zero value.
+ NetDialer *net.Dialer
+
+ // Config is the TLS configuration to use for new connections.
+ // A nil configuration is equivalent to the zero
+ // configuration; see the documentation of Config for the
+ // defaults.
+ Config *Config
+}
+</pre> <h3 id="Dialer.Dial">func (*Dialer) <span>Dial</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (d *Dialer) Dial(network, addr string) (net.Conn, error)</pre> <p>Dial connects to the given network address and initiates a TLS handshake, returning the resulting TLS connection. </p>
+<p>The returned <a href="#Conn">Conn</a>, if any, will always be of type *<a href="#Conn">Conn</a>. </p>
+<p>Dial uses context.Background internally; to specify the context, use <a href="#Dialer.DialContext">Dialer.DialContext</a>. </p>
+<h3 id="Dialer.DialContext">func (*Dialer) <span>DialContext</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error)</pre> <p>DialContext connects to the given network address and initiates a TLS handshake, returning the resulting TLS connection. </p>
+<p>The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context will not affect the connection. </p>
+<p>The returned <a href="#Conn">Conn</a>, if any, will always be of type *<a href="#Conn">Conn</a>. </p>
+<h2 id="QUICConfig">type <span>QUICConfig</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A QUICConfig configures a <a href="#QUICConn">QUICConn</a>. </p>
+<pre data-language="go">type QUICConfig struct {
+ TLSConfig *Config
+}
+</pre> <h2 id="QUICConn">type <span>QUICConn</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A QUICConn represents a connection which uses a QUIC implementation as the underlying transport as described in RFC 9001. </p>
+<p>Methods of QUICConn are not safe for concurrent use. </p>
+<pre data-language="go">type QUICConn struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="QUICClient">func <span>QUICClient</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func QUICClient(config *QUICConfig) *QUICConn</pre> <p>QUICClient returns a new TLS client side connection using QUICTransport as the underlying transport. The config cannot be nil. </p>
+<p>The config's MinVersion must be at least TLS 1.3. </p>
+<h3 id="QUICServer">func <span>QUICServer</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func QUICServer(config *QUICConfig) *QUICConn</pre> <p>QUICServer returns a new TLS server side connection using QUICTransport as the underlying transport. The config cannot be nil. </p>
+<p>The config's MinVersion must be at least TLS 1.3. </p>
+<h3 id="QUICConn.Close">func (*QUICConn) <span>Close</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (q *QUICConn) Close() error</pre> <p>Close closes the connection and stops any in-progress handshake. </p>
+<h3 id="QUICConn.ConnectionState">func (*QUICConn) <span>ConnectionState</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (q *QUICConn) ConnectionState() ConnectionState</pre> <p>ConnectionState returns basic TLS details about the connection. </p>
+<h3 id="QUICConn.HandleData">func (*QUICConn) <span>HandleData</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (q *QUICConn) HandleData(level QUICEncryptionLevel, data []byte) error</pre> <p>HandleData handles handshake bytes received from the peer. It may produce connection events, which may be read with <a href="#QUICConn.NextEvent">QUICConn.NextEvent</a>. </p>
+<h3 id="QUICConn.NextEvent">func (*QUICConn) <span>NextEvent</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (q *QUICConn) NextEvent() QUICEvent</pre> <p>NextEvent returns the next event occurring on the connection. It returns an event with a Kind of <a href="#QUICNoEvent">QUICNoEvent</a> when no events are available. </p>
+<h3 id="QUICConn.SendSessionTicket">func (*QUICConn) <span>SendSessionTicket</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (q *QUICConn) SendSessionTicket(opts QUICSessionTicketOptions) error</pre> <p>SendSessionTicket sends a session ticket to the client. It produces connection events, which may be read with <a href="#QUICConn.NextEvent">QUICConn.NextEvent</a>. Currently, it can only be called once. </p>
+<h3 id="QUICConn.SetTransportParameters">func (*QUICConn) <span>SetTransportParameters</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (q *QUICConn) SetTransportParameters(params []byte)</pre> <p>SetTransportParameters sets the transport parameters to send to the peer. </p>
+<p>Server connections may delay setting the transport parameters until after receiving the client's transport parameters. See <a href="#QUICTransportParametersRequired">QUICTransportParametersRequired</a>. </p>
+<h3 id="QUICConn.Start">func (*QUICConn) <span>Start</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (q *QUICConn) Start(ctx context.Context) error</pre> <p>Start starts the client or server handshake protocol. It may produce connection events, which may be read with <a href="#QUICConn.NextEvent">QUICConn.NextEvent</a>. </p>
+<p>Start must be called at most once. </p>
+<h2 id="QUICEncryptionLevel">type <span>QUICEncryptionLevel</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>QUICEncryptionLevel represents a QUIC encryption level used to transmit handshake messages. </p>
+<pre data-language="go">type QUICEncryptionLevel int</pre> <h3 id="QUICEncryptionLevel.String">func (QUICEncryptionLevel) <span>String</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l QUICEncryptionLevel) String() string</pre> <h2 id="QUICEvent">type <span>QUICEvent</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A QUICEvent is an event occurring on a QUIC connection. </p>
+<p>The type of event is specified by the Kind field. The contents of the other fields are kind-specific. </p>
+<pre data-language="go">type QUICEvent struct {
+ Kind QUICEventKind
+
+ // Set for QUICSetReadSecret, QUICSetWriteSecret, and QUICWriteData.
+ Level QUICEncryptionLevel
+
+ // Set for QUICTransportParameters, QUICSetReadSecret, QUICSetWriteSecret, and QUICWriteData.
+ // The contents are owned by crypto/tls, and are valid until the next NextEvent call.
+ Data []byte
+
+ // Set for QUICSetReadSecret and QUICSetWriteSecret.
+ Suite uint16
+}
+</pre> <h2 id="QUICEventKind">type <span>QUICEventKind</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A QUICEventKind is a type of operation on a QUIC connection. </p>
+<pre data-language="go">type QUICEventKind int</pre> <pre data-language="go">const (
+ // QUICNoEvent indicates that there are no events available.
+ QUICNoEvent QUICEventKind = iota
+
+ // QUICSetReadSecret and QUICSetWriteSecret provide the read and write
+ // secrets for a given encryption level.
+ // QUICEvent.Level, QUICEvent.Data, and QUICEvent.Suite are set.
+ //
+ // Secrets for the Initial encryption level are derived from the initial
+ // destination connection ID, and are not provided by the QUICConn.
+ QUICSetReadSecret
+ QUICSetWriteSecret
+
+ // QUICWriteData provides data to send to the peer in CRYPTO frames.
+ // QUICEvent.Data is set.
+ QUICWriteData
+
+ // QUICTransportParameters provides the peer's QUIC transport parameters.
+ // QUICEvent.Data is set.
+ QUICTransportParameters
+
+ // QUICTransportParametersRequired indicates that the caller must provide
+ // QUIC transport parameters to send to the peer. The caller should set
+ // the transport parameters with QUICConn.SetTransportParameters and call
+ // QUICConn.NextEvent again.
+ //
+ // If transport parameters are set before calling QUICConn.Start, the
+ // connection will never generate a QUICTransportParametersRequired event.
+ QUICTransportParametersRequired
+
+ // QUICRejectedEarlyData indicates that the server rejected 0-RTT data even
+ // if we offered it. It's returned before QUICEncryptionLevelApplication
+ // keys are returned.
+ QUICRejectedEarlyData
+
+ // QUICHandshakeDone indicates that the TLS handshake has completed.
+ QUICHandshakeDone
+)</pre> <h2 id="QUICSessionTicketOptions">type <span>QUICSessionTicketOptions</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">type QUICSessionTicketOptions struct {
+ // EarlyData specifies whether the ticket may be used for 0-RTT.
+ EarlyData bool
+}
+</pre> <h2 id="RecordHeaderError">type <span>RecordHeaderError</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>RecordHeaderError is returned when a TLS record header is invalid. </p>
+<pre data-language="go">type RecordHeaderError struct {
+ // Msg contains a human readable string that describes the error.
+ Msg string
+ // RecordHeader contains the five bytes of TLS record header that
+ // triggered the error.
+ RecordHeader [5]byte
+ // Conn provides the underlying net.Conn in the case that a client
+ // sent an initial handshake that didn't look like TLS.
+ // It is nil if there's already been a handshake or a TLS alert has
+ // been written to the connection.
+ Conn net.Conn // Go 1.12
+}
+</pre> <h3 id="RecordHeaderError.Error">func (RecordHeaderError) <span>Error</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (e RecordHeaderError) Error() string</pre> <h2 id="RenegotiationSupport">type <span>RenegotiationSupport</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>RenegotiationSupport enumerates the different levels of support for TLS renegotiation. TLS renegotiation is the act of performing subsequent handshakes on a connection after the first. This significantly complicates the state machine and has been the source of numerous, subtle security issues. Initiating a renegotiation is not supported, but support for accepting renegotiation requests may be enabled. </p>
+<p>Even when enabled, the server may not change its identity between handshakes (i.e. the leaf certificate must be the same). Additionally, concurrent handshake and application data flow is not permitted so renegotiation can only be used with protocols that synchronise with the renegotiation, such as HTTPS. </p>
+<p>Renegotiation is not defined in TLS 1.3. </p>
+<pre data-language="go">type RenegotiationSupport int</pre> <pre data-language="go">const (
+ // RenegotiateNever disables renegotiation.
+ RenegotiateNever RenegotiationSupport = iota
+
+ // RenegotiateOnceAsClient allows a remote server to request
+ // renegotiation once per connection.
+ RenegotiateOnceAsClient
+
+ // RenegotiateFreelyAsClient allows a remote server to repeatedly
+ // request renegotiation.
+ RenegotiateFreelyAsClient
+)</pre> <h2 id="SessionState">type <span>SessionState</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A SessionState is a resumable session. </p>
+<pre data-language="go">type SessionState struct {
+
+ // Extra is ignored by crypto/tls, but is encoded by [SessionState.Bytes]
+ // and parsed by [ParseSessionState].
+ //
+ // This allows [Config.UnwrapSession]/[Config.WrapSession] and
+ // [ClientSessionCache] implementations to store and retrieve additional
+ // data alongside this session.
+ //
+ // To allow different layers in a protocol stack to share this field,
+ // applications must only append to it, not replace it, and must use entries
+ // that can be recognized even if out of order (for example, by starting
+ // with an id and version prefix).
+ Extra [][]byte
+
+ // EarlyData indicates whether the ticket can be used for 0-RTT in a QUIC
+ // connection. The application may set this to false if it is true to
+ // decline to offer 0-RTT even if supported.
+ EarlyData bool
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ParseSessionState">func <span>ParseSessionState</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func ParseSessionState(data []byte) (*SessionState, error)</pre> <p>ParseSessionState parses a <a href="#SessionState">SessionState</a> encoded by <a href="#SessionState.Bytes">SessionState.Bytes</a>. </p>
+<h3 id="SessionState.Bytes">func (*SessionState) <span>Bytes</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (s *SessionState) Bytes() ([]byte, error)</pre> <p>Bytes encodes the session, including any private fields, so that it can be parsed by <a href="#ParseSessionState">ParseSessionState</a>. The encoding contains secret values critical to the security of future and possibly past sessions. </p>
+<p>The specific encoding should be considered opaque and may change incompatibly between Go versions. </p>
+<h2 id="SignatureScheme">type <span>SignatureScheme</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>SignatureScheme identifies a signature algorithm supported by TLS. See RFC 8446, Section 4.2.3. </p>
+<pre data-language="go">type SignatureScheme uint16</pre> <pre data-language="go">const (
+ // RSASSA-PKCS1-v1_5 algorithms.
+ PKCS1WithSHA256 SignatureScheme = 0x0401
+ PKCS1WithSHA384 SignatureScheme = 0x0501
+ PKCS1WithSHA512 SignatureScheme = 0x0601
+
+ // RSASSA-PSS algorithms with public key OID rsaEncryption.
+ PSSWithSHA256 SignatureScheme = 0x0804
+ PSSWithSHA384 SignatureScheme = 0x0805
+ PSSWithSHA512 SignatureScheme = 0x0806
+
+ // ECDSA algorithms. Only constrained to a specific curve in TLS 1.3.
+ ECDSAWithP256AndSHA256 SignatureScheme = 0x0403
+ ECDSAWithP384AndSHA384 SignatureScheme = 0x0503
+ ECDSAWithP521AndSHA512 SignatureScheme = 0x0603
+
+ // EdDSA algorithms.
+ Ed25519 SignatureScheme = 0x0807
+
+ // Legacy signature and hash algorithms for TLS 1.2.
+ PKCS1WithSHA1 SignatureScheme = 0x0201
+ ECDSAWithSHA1 SignatureScheme = 0x0203
+)</pre> <h3 id="SignatureScheme.String">func (SignatureScheme) <span>String</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (i SignatureScheme) String() string</pre> <h2 id="pkg-note-BUG">Bugs</h2> <ul> <li>☞ <p>The crypto/tls package only implements some countermeasures against Lucky13 attacks on CBC-mode encryption, and only on SHA1 variants. See <a href="http://www.isg.rhul.ac.uk/tls/TLStiming.pdf">http://www.isg.rhul.ac.uk/tls/TLStiming.pdf</a> and <a href="https://www.imperialviolet.org/2013/02/04/luckythirteen.html">https://www.imperialviolet.org/2013/02/04/luckythirteen.html</a>. </p>
+</li> </ul> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="fipsonly/index">fipsonly</a> </td> <td class="pkg-synopsis"> Package fipsonly restricts all TLS configuration to FIPS-approved settings. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/tls/" class="_attribution-link">http://golang.org/pkg/crypto/tls/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fx509%2Findex.html b/devdocs/go/crypto%2Fx509%2Findex.html
new file mode 100644
index 00000000..92829477
--- /dev/null
+++ b/devdocs/go/crypto%2Fx509%2Findex.html
@@ -0,0 +1,785 @@
+<h1> Package x509 </h1> <ul id="short-nav">
+<li><code>import "crypto/x509"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package x509 implements a subset of the X.509 standard. </p>
+<p>It allows parsing and generating certificates, certificate signing requests, certificate revocation lists, and encoded public and private keys. It provides a certificate verifier, complete with a chain builder. </p>
+<p>The package targets the X.509 technical profile defined by the IETF (RFC 2459/3280/5280), and as further restricted by the CA/Browser Forum Baseline Requirements. There is minimal support for features outside of these profiles, as the primary goal of the package is to provide compatibility with the publicly trusted TLS certificate ecosystem and its policies and constraints. </p>
+<p>On macOS and Windows, certificate verification is handled by system APIs, but the package aims to apply consistent validation rules across operating systems. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#CreateCertificate">func CreateCertificate(rand io.Reader, template, parent *Certificate, pub, priv any) ([]byte, error)</a></li>
+<li><a href="#CreateCertificateRequest">func CreateCertificateRequest(rand io.Reader, template *CertificateRequest, priv any) (csr []byte, err error)</a></li>
+<li><a href="#CreateRevocationList">func CreateRevocationList(rand io.Reader, template *RevocationList, issuer *Certificate, priv crypto.Signer) ([]byte, error)</a></li>
+<li><a href="#DecryptPEMBlock">func DecryptPEMBlock(b *pem.Block, password []byte) ([]byte, error)</a></li>
+<li><a href="#EncryptPEMBlock">func EncryptPEMBlock(rand io.Reader, blockType string, data, password []byte, alg PEMCipher) (*pem.Block, error)</a></li>
+<li><a href="#IsEncryptedPEMBlock">func IsEncryptedPEMBlock(b *pem.Block) bool</a></li>
+<li><a href="#MarshalECPrivateKey">func MarshalECPrivateKey(key *ecdsa.PrivateKey) ([]byte, error)</a></li>
+<li><a href="#MarshalPKCS1PrivateKey">func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte</a></li>
+<li><a href="#MarshalPKCS1PublicKey">func MarshalPKCS1PublicKey(key *rsa.PublicKey) []byte</a></li>
+<li><a href="#MarshalPKCS8PrivateKey">func MarshalPKCS8PrivateKey(key any) ([]byte, error)</a></li>
+<li><a href="#MarshalPKIXPublicKey">func MarshalPKIXPublicKey(pub any) ([]byte, error)</a></li>
+<li><a href="#ParseCRL">func ParseCRL(crlBytes []byte) (*pkix.CertificateList, error)</a></li>
+<li><a href="#ParseDERCRL">func ParseDERCRL(derBytes []byte) (*pkix.CertificateList, error)</a></li>
+<li><a href="#ParseECPrivateKey">func ParseECPrivateKey(der []byte) (*ecdsa.PrivateKey, error)</a></li>
+<li><a href="#ParsePKCS1PrivateKey">func ParsePKCS1PrivateKey(der []byte) (*rsa.PrivateKey, error)</a></li>
+<li><a href="#ParsePKCS1PublicKey">func ParsePKCS1PublicKey(der []byte) (*rsa.PublicKey, error)</a></li>
+<li><a href="#ParsePKCS8PrivateKey">func ParsePKCS8PrivateKey(der []byte) (key any, err error)</a></li>
+<li><a href="#ParsePKIXPublicKey">func ParsePKIXPublicKey(derBytes []byte) (pub any, err error)</a></li>
+<li><a href="#SetFallbackRoots">func SetFallbackRoots(roots *CertPool)</a></li>
+<li><a href="#CertPool">type CertPool</a></li>
+<li> <a href="#NewCertPool">func NewCertPool() *CertPool</a>
+</li>
+<li> <a href="#SystemCertPool">func SystemCertPool() (*CertPool, error)</a>
+</li>
+<li> <a href="#CertPool.AddCert">func (s *CertPool) AddCert(cert *Certificate)</a>
+</li>
+<li> <a href="#CertPool.AddCertWithConstraint">func (s *CertPool) AddCertWithConstraint(cert *Certificate, constraint func([]*Certificate) error)</a>
+</li>
+<li> <a href="#CertPool.AppendCertsFromPEM">func (s *CertPool) AppendCertsFromPEM(pemCerts []byte) (ok bool)</a>
+</li>
+<li> <a href="#CertPool.Clone">func (s *CertPool) Clone() *CertPool</a>
+</li>
+<li> <a href="#CertPool.Equal">func (s *CertPool) Equal(other *CertPool) bool</a>
+</li>
+<li> <a href="#CertPool.Subjects">func (s *CertPool) Subjects() [][]byte</a>
+</li>
+<li><a href="#Certificate">type Certificate</a></li>
+<li> <a href="#ParseCertificate">func ParseCertificate(der []byte) (*Certificate, error)</a>
+</li>
+<li> <a href="#ParseCertificates">func ParseCertificates(der []byte) ([]*Certificate, error)</a>
+</li>
+<li> <a href="#Certificate.CheckCRLSignature">func (c *Certificate) CheckCRLSignature(crl *pkix.CertificateList) error</a>
+</li>
+<li> <a href="#Certificate.CheckSignature">func (c *Certificate) CheckSignature(algo SignatureAlgorithm, signed, signature []byte) error</a>
+</li>
+<li> <a href="#Certificate.CheckSignatureFrom">func (c *Certificate) CheckSignatureFrom(parent *Certificate) error</a>
+</li>
+<li> <a href="#Certificate.CreateCRL">func (c *Certificate) CreateCRL(rand io.Reader, priv any, revokedCerts []pkix.RevokedCertificate, now, expiry time.Time) (crlBytes []byte, err error)</a>
+</li>
+<li> <a href="#Certificate.Equal">func (c *Certificate) Equal(other *Certificate) bool</a>
+</li>
+<li> <a href="#Certificate.Verify">func (c *Certificate) Verify(opts VerifyOptions) (chains [][]*Certificate, err error)</a>
+</li>
+<li> <a href="#Certificate.VerifyHostname">func (c *Certificate) VerifyHostname(h string) error</a>
+</li>
+<li><a href="#CertificateInvalidError">type CertificateInvalidError</a></li>
+<li> <a href="#CertificateInvalidError.Error">func (e CertificateInvalidError) Error() string</a>
+</li>
+<li><a href="#CertificateRequest">type CertificateRequest</a></li>
+<li> <a href="#ParseCertificateRequest">func ParseCertificateRequest(asn1Data []byte) (*CertificateRequest, error)</a>
+</li>
+<li> <a href="#CertificateRequest.CheckSignature">func (c *CertificateRequest) CheckSignature() error</a>
+</li>
+<li><a href="#ConstraintViolationError">type ConstraintViolationError</a></li>
+<li> <a href="#ConstraintViolationError.Error">func (ConstraintViolationError) Error() string</a>
+</li>
+<li><a href="#ExtKeyUsage">type ExtKeyUsage</a></li>
+<li><a href="#HostnameError">type HostnameError</a></li>
+<li> <a href="#HostnameError.Error">func (h HostnameError) Error() string</a>
+</li>
+<li><a href="#InsecureAlgorithmError">type InsecureAlgorithmError</a></li>
+<li> <a href="#InsecureAlgorithmError.Error">func (e InsecureAlgorithmError) Error() string</a>
+</li>
+<li><a href="#InvalidReason">type InvalidReason</a></li>
+<li><a href="#KeyUsage">type KeyUsage</a></li>
+<li><a href="#OID">type OID</a></li>
+<li> <a href="#OIDFromInts">func OIDFromInts(oid []uint64) (OID, error)</a>
+</li>
+<li> <a href="#OID.Equal">func (oid OID) Equal(other OID) bool</a>
+</li>
+<li> <a href="#OID.EqualASN1OID">func (oid OID) EqualASN1OID(other asn1.ObjectIdentifier) bool</a>
+</li>
+<li> <a href="#OID.String">func (oid OID) String() string</a>
+</li>
+<li><a href="#PEMCipher">type PEMCipher</a></li>
+<li><a href="#PublicKeyAlgorithm">type PublicKeyAlgorithm</a></li>
+<li> <a href="#PublicKeyAlgorithm.String">func (algo PublicKeyAlgorithm) String() string</a>
+</li>
+<li><a href="#RevocationList">type RevocationList</a></li>
+<li> <a href="#ParseRevocationList">func ParseRevocationList(der []byte) (*RevocationList, error)</a>
+</li>
+<li> <a href="#RevocationList.CheckSignatureFrom">func (rl *RevocationList) CheckSignatureFrom(parent *Certificate) error</a>
+</li>
+<li><a href="#RevocationListEntry">type RevocationListEntry</a></li>
+<li><a href="#SignatureAlgorithm">type SignatureAlgorithm</a></li>
+<li> <a href="#SignatureAlgorithm.String">func (algo SignatureAlgorithm) String() string</a>
+</li>
+<li><a href="#SystemRootsError">type SystemRootsError</a></li>
+<li> <a href="#SystemRootsError.Error">func (se SystemRootsError) Error() string</a>
+</li>
+<li> <a href="#SystemRootsError.Unwrap">func (se SystemRootsError) Unwrap() error</a>
+</li>
+<li><a href="#UnhandledCriticalExtension">type UnhandledCriticalExtension</a></li>
+<li> <a href="#UnhandledCriticalExtension.Error">func (h UnhandledCriticalExtension) Error() string</a>
+</li>
+<li><a href="#UnknownAuthorityError">type UnknownAuthorityError</a></li>
+<li> <a href="#UnknownAuthorityError.Error">func (e UnknownAuthorityError) Error() string</a>
+</li>
+<li><a href="#VerifyOptions">type VerifyOptions</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Certificate_Verify">Certificate.Verify</a></dd> <dd><a class="exampleLink" href="#example_ParsePKIXPublicKey">ParsePKIXPublicKey</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>cert_pool.go</span> <span>notboring.go</span> <span>oid.go</span> <span>parser.go</span> <span>pem_decrypt.go</span> <span>pkcs1.go</span> <span>pkcs8.go</span> <span>root.go</span> <span>root_linux.go</span> <span>root_unix.go</span> <span>sec1.go</span> <span>verify.go</span> <span>x509.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrUnsupportedAlgorithm results from attempting to perform an operation that involves algorithms that are not currently implemented. </p>
+<pre data-language="go">var ErrUnsupportedAlgorithm = errors.New("x509: cannot verify signature: algorithm unimplemented")</pre> <p>IncorrectPasswordError is returned when an incorrect password is detected. </p>
+<pre data-language="go">var IncorrectPasswordError = errors.New("x509: decryption password incorrect")</pre> <h2 id="CreateCertificate">func <span>CreateCertificate</span> </h2> <pre data-language="go">func CreateCertificate(rand io.Reader, template, parent *Certificate, pub, priv any) ([]byte, error)</pre> <p>CreateCertificate creates a new X.509 v3 certificate based on a template. The following members of template are currently used: </p>
+<ul> <li>AuthorityKeyId </li>
+<li>BasicConstraintsValid </li>
+<li>CRLDistributionPoints </li>
+<li>DNSNames </li>
+<li>EmailAddresses </li>
+<li>ExcludedDNSDomains </li>
+<li>ExcludedEmailAddresses </li>
+<li>ExcludedIPRanges </li>
+<li>ExcludedURIDomains </li>
+<li>ExtKeyUsage </li>
+<li>ExtraExtensions </li>
+<li>IPAddresses </li>
+<li>IsCA </li>
+<li>IssuingCertificateURL </li>
+<li>KeyUsage </li>
+<li>MaxPathLen </li>
+<li>MaxPathLenZero </li>
+<li>NotAfter </li>
+<li>NotBefore </li>
+<li>OCSPServer </li>
+<li>PermittedDNSDomains </li>
+<li>PermittedDNSDomainsCritical </li>
+<li>PermittedEmailAddresses </li>
+<li>PermittedIPRanges </li>
+<li>PermittedURIDomains </li>
+<li>PolicyIdentifiers (see note below) </li>
+<li>Policies (see note below) </li>
+<li>SerialNumber </li>
+<li>SignatureAlgorithm </li>
+<li>Subject </li>
+<li>SubjectKeyId </li>
+<li>URIs </li>
+<li>UnknownExtKeyUsage </li>
+</ul> <p>The certificate is signed by parent. If parent is equal to template then the certificate is self-signed. The parameter pub is the public key of the certificate to be generated and priv is the private key of the signer. </p>
+<p>The returned slice is the certificate in DER encoding. </p>
+<p>The currently supported key types are *rsa.PublicKey, *ecdsa.PublicKey and ed25519.PublicKey. pub must be a supported key type, and priv must be a crypto.Signer with a supported public key. </p>
+<p>The AuthorityKeyId will be taken from the SubjectKeyId of parent, if any, unless the resulting certificate is self-signed. Otherwise the value from template will be used. </p>
+<p>If SubjectKeyId from template is empty and the template is a CA, SubjectKeyId will be generated from the hash of the public key. </p>
+<p>The PolicyIdentifier and Policies fields are both used to marshal certificate policy OIDs. By default, only the PolicyIdentifier is marshaled, but if the GODEBUG setting "x509usepolicies" has the value "1", the Policies field will be marshalled instead of the PolicyIdentifier field. The Policies field can be used to marshal policy OIDs which have components that are larger than 31 bits. </p>
+<h2 id="CreateCertificateRequest">func <span>CreateCertificateRequest</span> <span title="Added in Go 1.3">1.3</span> </h2> <pre data-language="go">func CreateCertificateRequest(rand io.Reader, template *CertificateRequest, priv any) (csr []byte, err error)</pre> <p>CreateCertificateRequest creates a new certificate request based on a template. The following members of template are used: </p>
+<ul> <li>SignatureAlgorithm </li>
+<li>Subject </li>
+<li>DNSNames </li>
+<li>EmailAddresses </li>
+<li>IPAddresses </li>
+<li>URIs </li>
+<li>ExtraExtensions </li>
+<li>Attributes (deprecated) </li>
+</ul> <p>priv is the private key to sign the CSR with, and the corresponding public key will be included in the CSR. It must implement crypto.Signer and its Public() method must return a *rsa.PublicKey or a *ecdsa.PublicKey or a ed25519.PublicKey. (A *rsa.PrivateKey, *ecdsa.PrivateKey or ed25519.PrivateKey satisfies this.) </p>
+<p>The returned slice is the certificate request in DER encoding. </p>
+<h2 id="CreateRevocationList">func <span>CreateRevocationList</span> <span title="Added in Go 1.15">1.15</span> </h2> <pre data-language="go">func CreateRevocationList(rand io.Reader, template *RevocationList, issuer *Certificate, priv crypto.Signer) ([]byte, error)</pre> <p>CreateRevocationList creates a new X.509 v2 <a href="#Certificate">Certificate</a> Revocation List, according to RFC 5280, based on template. </p>
+<p>The CRL is signed by priv which should be the private key associated with the public key in the issuer certificate. </p>
+<p>The issuer may not be nil, and the crlSign bit must be set in <a href="#KeyUsage">KeyUsage</a> in order to use it as a CRL issuer. </p>
+<p>The issuer distinguished name CRL field and authority key identifier extension are populated using the issuer certificate. issuer must have SubjectKeyId set. </p>
+<h2 id="DecryptPEMBlock">func <span>DecryptPEMBlock</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func DecryptPEMBlock(b *pem.Block, password []byte) ([]byte, error)</pre> <p>DecryptPEMBlock takes a PEM block encrypted according to RFC 1423 and the password used to encrypt it and returns a slice of decrypted DER encoded bytes. It inspects the DEK-Info header to determine the algorithm used for decryption. If no DEK-Info header is present, an error is returned. If an incorrect password is detected an <a href="#IncorrectPasswordError">IncorrectPasswordError</a> is returned. Because of deficiencies in the format, it's not always possible to detect an incorrect password. In these cases no error will be returned but the decrypted DER bytes will be random noise. </p>
+<p>Deprecated: Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since it does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext. </p>
+<h2 id="EncryptPEMBlock">func <span>EncryptPEMBlock</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func EncryptPEMBlock(rand io.Reader, blockType string, data, password []byte, alg PEMCipher) (*pem.Block, error)</pre> <p>EncryptPEMBlock returns a PEM block of the specified type holding the given DER encoded data encrypted with the specified algorithm and password according to RFC 1423. </p>
+<p>Deprecated: Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since it does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext. </p>
+<h2 id="IsEncryptedPEMBlock">func <span>IsEncryptedPEMBlock</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func IsEncryptedPEMBlock(b *pem.Block) bool</pre> <p>IsEncryptedPEMBlock returns whether the PEM block is password encrypted according to RFC 1423. </p>
+<p>Deprecated: Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since it does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext. </p>
+<h2 id="MarshalECPrivateKey">func <span>MarshalECPrivateKey</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func MarshalECPrivateKey(key *ecdsa.PrivateKey) ([]byte, error)</pre> <p>MarshalECPrivateKey converts an EC private key to SEC 1, ASN.1 DER form. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "EC PRIVATE KEY". For a more flexible key format which is not EC specific, use <a href="#MarshalPKCS8PrivateKey">MarshalPKCS8PrivateKey</a>. </p>
+<h2 id="MarshalPKCS1PrivateKey">func <span>MarshalPKCS1PrivateKey</span> </h2> <pre data-language="go">func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte</pre> <p>MarshalPKCS1PrivateKey converts an <a href="#RSA">RSA</a> private key to PKCS #1, ASN.1 DER form. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "RSA PRIVATE KEY". For a more flexible key format which is not <a href="#RSA">RSA</a> specific, use <a href="#MarshalPKCS8PrivateKey">MarshalPKCS8PrivateKey</a>. </p>
+<h2 id="MarshalPKCS1PublicKey">func <span>MarshalPKCS1PublicKey</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func MarshalPKCS1PublicKey(key *rsa.PublicKey) []byte</pre> <p>MarshalPKCS1PublicKey converts an <a href="#RSA">RSA</a> public key to PKCS #1, ASN.1 DER form. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "RSA PUBLIC KEY". </p>
+<h2 id="MarshalPKCS8PrivateKey">func <span>MarshalPKCS8PrivateKey</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func MarshalPKCS8PrivateKey(key any) ([]byte, error)</pre> <p>MarshalPKCS8PrivateKey converts a private key to PKCS #8, ASN.1 DER form. </p>
+<p>The following key types are currently supported: *<span>rsa.PrivateKey</span>, *<span>ecdsa.PrivateKey</span>, <span>ed25519.PrivateKey</span> (not a pointer), and *<span>ecdh.PrivateKey</span>. Unsupported key types result in an error. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "PRIVATE KEY". </p>
+<h2 id="MarshalPKIXPublicKey">func <span>MarshalPKIXPublicKey</span> </h2> <pre data-language="go">func MarshalPKIXPublicKey(pub any) ([]byte, error)</pre> <p>MarshalPKIXPublicKey converts a public key to PKIX, ASN.1 DER form. The encoded public key is a SubjectPublicKeyInfo structure (see RFC 5280, Section 4.1). </p>
+<p>The following key types are currently supported: *<span>rsa.PublicKey</span>, *<span>ecdsa.PublicKey</span>, <span>ed25519.PublicKey</span> (not a pointer), and *<span>ecdh.PublicKey</span>. Unsupported key types result in an error. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY". </p>
+<h2 id="ParseCRL">func <span>ParseCRL</span> </h2> <pre data-language="go">func ParseCRL(crlBytes []byte) (*pkix.CertificateList, error)</pre> <p>ParseCRL parses a CRL from the given bytes. It's often the case that PEM encoded CRLs will appear where they should be DER encoded, so this function will transparently handle PEM encoding as long as there isn't any leading garbage. </p>
+<p>Deprecated: Use <a href="#ParseRevocationList">ParseRevocationList</a> instead. </p>
+<h2 id="ParseDERCRL">func <span>ParseDERCRL</span> </h2> <pre data-language="go">func ParseDERCRL(derBytes []byte) (*pkix.CertificateList, error)</pre> <p>ParseDERCRL parses a DER encoded CRL from the given bytes. </p>
+<p>Deprecated: Use <a href="#ParseRevocationList">ParseRevocationList</a> instead. </p>
+<h2 id="ParseECPrivateKey">func <span>ParseECPrivateKey</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func ParseECPrivateKey(der []byte) (*ecdsa.PrivateKey, error)</pre> <p>ParseECPrivateKey parses an EC private key in SEC 1, ASN.1 DER form. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "EC PRIVATE KEY". </p>
+<h2 id="ParsePKCS1PrivateKey">func <span>ParsePKCS1PrivateKey</span> </h2> <pre data-language="go">func ParsePKCS1PrivateKey(der []byte) (*rsa.PrivateKey, error)</pre> <p>ParsePKCS1PrivateKey parses an <a href="#RSA">RSA</a> private key in PKCS #1, ASN.1 DER form. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "RSA PRIVATE KEY". </p>
+<h2 id="ParsePKCS1PublicKey">func <span>ParsePKCS1PublicKey</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func ParsePKCS1PublicKey(der []byte) (*rsa.PublicKey, error)</pre> <p>ParsePKCS1PublicKey parses an <a href="#RSA">RSA</a> public key in PKCS #1, ASN.1 DER form. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "RSA PUBLIC KEY". </p>
+<h2 id="ParsePKCS8PrivateKey">func <span>ParsePKCS8PrivateKey</span> </h2> <pre data-language="go">func ParsePKCS8PrivateKey(der []byte) (key any, err error)</pre> <p>ParsePKCS8PrivateKey parses an unencrypted private key in PKCS #8, ASN.1 DER form. </p>
+<p>It returns a *<span>rsa.PrivateKey</span>, an *<span>ecdsa.PrivateKey</span>, an <span>ed25519.PrivateKey</span> (not a pointer), or an *<span>ecdh.PrivateKey</span> (for X25519). More types might be supported in the future. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "PRIVATE KEY". </p>
+<h2 id="ParsePKIXPublicKey">func <span>ParsePKIXPublicKey</span> </h2> <pre data-language="go">func ParsePKIXPublicKey(derBytes []byte) (pub any, err error)</pre> <p>ParsePKIXPublicKey parses a public key in PKIX, ASN.1 DER form. The encoded public key is a SubjectPublicKeyInfo structure (see RFC 5280, Section 4.1). </p>
+<p>It returns a *<span>rsa.PublicKey</span>, *<span>dsa.PublicKey</span>, *<span>ecdsa.PublicKey</span>, <span>ed25519.PublicKey</span> (not a pointer), or *<span>ecdh.PublicKey</span> (for X25519). More types might be supported in the future. </p>
+<p>This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY". </p> <h4 id="example_ParsePKIXPublicKey"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+const pubPEM = `
+-----BEGIN PUBLIC KEY-----
+MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlRuRnThUjU8/prwYxbty
+WPT9pURI3lbsKMiB6Fn/VHOKE13p4D8xgOCADpdRagdT6n4etr9atzDKUSvpMtR3
+CP5noNc97WiNCggBjVWhs7szEe8ugyqF23XwpHQ6uV1LKH50m92MbOWfCtjU9p/x
+qhNpQQ1AZhqNy5Gevap5k8XzRmjSldNAFZMY7Yv3Gi+nyCwGwpVtBUwhuLzgNFK/
+yDtw2WcWmUU7NuC8Q6MWvPebxVtCfVp/iQU6q60yyt6aGOBkhAX0LpKAEhKidixY
+nP9PNVBvxgu3XZ4P36gZV6+ummKdBVnc3NqwBLu5+CcdRdusmHPHd5pHf4/38Z3/
+6qU2a/fPvWzceVTEgZ47QjFMTCTmCwNt29cvi7zZeQzjtwQgn4ipN9NibRH/Ax/q
+TbIzHfrJ1xa2RteWSdFjwtxi9C20HUkjXSeI4YlzQMH0fPX6KCE7aVePTOnB69I/
+a9/q96DiXZajwlpq3wFctrs1oXqBp5DVrCIj8hU2wNgB7LtQ1mCtsYz//heai0K9
+PhE4X6hiE0YmeAZjR0uHl8M/5aW9xCoJ72+12kKpWAa0SFRWLy6FejNYCYpkupVJ
+yecLk/4L1W0l6jQQZnWErXZYe0PNFcmwGXy1Rep83kfBRNKRy5tvocalLlwXLdUk
+AIU+2GKjyT3iMuzZxxFxPFMCAwEAAQ==
+-----END PUBLIC KEY-----`
+
+block, _ := pem.Decode([]byte(pubPEM))
+if block == nil {
+ panic("failed to parse PEM block containing the public key")
+}
+
+pub, err := x509.ParsePKIXPublicKey(block.Bytes)
+if err != nil {
+ panic("failed to parse DER encoded public key: " + err.Error())
+}
+
+switch pub := pub.(type) {
+case *rsa.PublicKey:
+ fmt.Println("pub is of type RSA:", pub)
+case *dsa.PublicKey:
+ fmt.Println("pub is of type DSA:", pub)
+case *ecdsa.PublicKey:
+ fmt.Println("pub is of type ECDSA:", pub)
+case ed25519.PublicKey:
+ fmt.Println("pub is of type Ed25519:", pub)
+default:
+ panic("unknown type of public key")
+}
+</pre> <h2 id="SetFallbackRoots">func <span>SetFallbackRoots</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func SetFallbackRoots(roots *CertPool)</pre> <p>SetFallbackRoots sets the roots to use during certificate verification, if no custom roots are specified and a platform verifier or a system certificate pool is not available (for instance in a container which does not have a root certificate bundle). SetFallbackRoots will panic if roots is nil. </p>
+<p>SetFallbackRoots may only be called once, if called multiple times it will panic. </p>
+<p>The fallback behavior can be forced on all platforms, even when there is a system certificate pool, by setting GODEBUG=x509usefallbackroots=1 (note that on Windows and macOS this will disable usage of the platform verification APIs and cause the pure Go verifier to be used). Setting x509usefallbackroots=1 without calling SetFallbackRoots has no effect. </p>
+<h2 id="CertPool">type <span>CertPool</span> </h2> <p>CertPool is a set of certificates. </p>
+<pre data-language="go">type CertPool struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewCertPool">func <span>NewCertPool</span> </h3> <pre data-language="go">func NewCertPool() *CertPool</pre> <p>NewCertPool returns a new, empty CertPool. </p>
+<h3 id="SystemCertPool">func <span>SystemCertPool</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func SystemCertPool() (*CertPool, error)</pre> <p>SystemCertPool returns a copy of the system cert pool. </p>
+<p>On Unix systems other than macOS the environment variables SSL_CERT_FILE and SSL_CERT_DIR can be used to override the system default locations for the SSL certificate file and SSL certificate files directory, respectively. The latter can be a colon-separated list. </p>
+<p>Any mutations to the returned pool are not written to disk and do not affect any other pool returned by SystemCertPool. </p>
+<p>New changes in the system cert pool might not be reflected in subsequent calls. </p>
+<h3 id="CertPool.AddCert">func (*CertPool) <span>AddCert</span> </h3> <pre data-language="go">func (s *CertPool) AddCert(cert *Certificate)</pre> <p>AddCert adds a certificate to a pool. </p>
+<h3 id="CertPool.AddCertWithConstraint">func (*CertPool) <span>AddCertWithConstraint</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (s *CertPool) AddCertWithConstraint(cert *Certificate, constraint func([]*Certificate) error)</pre> <p>AddCertWithConstraint adds a certificate to the pool with the additional constraint. When Certificate.Verify builds a chain which is rooted by cert, it will additionally pass the whole chain to constraint to determine its validity. If constraint returns a non-nil error, the chain will be discarded. constraint may be called concurrently from multiple goroutines. </p>
+<h3 id="CertPool.AppendCertsFromPEM">func (*CertPool) <span>AppendCertsFromPEM</span> </h3> <pre data-language="go">func (s *CertPool) AppendCertsFromPEM(pemCerts []byte) (ok bool)</pre> <p>AppendCertsFromPEM attempts to parse a series of PEM encoded certificates. It appends any certificates found to s and reports whether any certificates were successfully parsed. </p>
+<p>On many Linux systems, /etc/ssl/cert.pem will contain the system wide set of root CAs in a format suitable for this function. </p>
+<h3 id="CertPool.Clone">func (*CertPool) <span>Clone</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (s *CertPool) Clone() *CertPool</pre> <p>Clone returns a copy of s. </p>
+<h3 id="CertPool.Equal">func (*CertPool) <span>Equal</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (s *CertPool) Equal(other *CertPool) bool</pre> <p>Equal reports whether s and other are equal. </p>
+<h3 id="CertPool.Subjects">func (*CertPool) <span>Subjects</span> </h3> <pre data-language="go">func (s *CertPool) Subjects() [][]byte</pre> <p>Subjects returns a list of the DER-encoded subjects of all of the certificates in the pool. </p>
+<p>Deprecated: if s was returned by <a href="#SystemCertPool">SystemCertPool</a>, Subjects will not include the system roots. </p>
+<h2 id="Certificate">type <span>Certificate</span> </h2> <p>A Certificate represents an X.509 certificate. </p>
+<pre data-language="go">type Certificate struct {
+ Raw []byte // Complete ASN.1 DER content (certificate, signature algorithm and signature).
+ RawTBSCertificate []byte // Certificate part of raw ASN.1 DER content.
+ RawSubjectPublicKeyInfo []byte // DER encoded SubjectPublicKeyInfo.
+ RawSubject []byte // DER encoded Subject
+ RawIssuer []byte // DER encoded Issuer
+
+ Signature []byte
+ SignatureAlgorithm SignatureAlgorithm
+
+ PublicKeyAlgorithm PublicKeyAlgorithm
+ PublicKey any
+
+ Version int
+ SerialNumber *big.Int
+ Issuer pkix.Name
+ Subject pkix.Name
+ NotBefore, NotAfter time.Time // Validity bounds.
+ KeyUsage KeyUsage
+
+ // Extensions contains raw X.509 extensions. When parsing certificates,
+ // this can be used to extract non-critical extensions that are not
+ // parsed by this package. When marshaling certificates, the Extensions
+ // field is ignored, see ExtraExtensions.
+ Extensions []pkix.Extension // Go 1.2
+
+ // ExtraExtensions contains extensions to be copied, raw, into any
+ // marshaled certificates. Values override any extensions that would
+ // otherwise be produced based on the other fields. The ExtraExtensions
+ // field is not populated when parsing certificates, see Extensions.
+ ExtraExtensions []pkix.Extension // Go 1.2
+
+ // UnhandledCriticalExtensions contains a list of extension IDs that
+ // were not (fully) processed when parsing. Verify will fail if this
+ // slice is non-empty, unless verification is delegated to an OS
+ // library which understands all the critical extensions.
+ //
+ // Users can access these extensions using Extensions and can remove
+ // elements from this slice if they believe that they have been
+ // handled.
+ UnhandledCriticalExtensions []asn1.ObjectIdentifier // Go 1.5
+
+ ExtKeyUsage []ExtKeyUsage // Sequence of extended key usages.
+ UnknownExtKeyUsage []asn1.ObjectIdentifier // Encountered extended key usages unknown to this package.
+
+ // BasicConstraintsValid indicates whether IsCA, MaxPathLen,
+ // and MaxPathLenZero are valid.
+ BasicConstraintsValid bool
+ IsCA bool
+
+ // MaxPathLen and MaxPathLenZero indicate the presence and
+ // value of the BasicConstraints' "pathLenConstraint".
+ //
+ // When parsing a certificate, a positive non-zero MaxPathLen
+ // means that the field was specified, -1 means it was unset,
+ // and MaxPathLenZero being true mean that the field was
+ // explicitly set to zero. The case of MaxPathLen==0 with MaxPathLenZero==false
+ // should be treated equivalent to -1 (unset).
+ //
+ // When generating a certificate, an unset pathLenConstraint
+ // can be requested with either MaxPathLen == -1 or using the
+ // zero value for both MaxPathLen and MaxPathLenZero.
+ MaxPathLen int
+ // MaxPathLenZero indicates that BasicConstraintsValid==true
+ // and MaxPathLen==0 should be interpreted as an actual
+ // maximum path length of zero. Otherwise, that combination is
+ // interpreted as MaxPathLen not being set.
+ MaxPathLenZero bool // Go 1.4
+
+ SubjectKeyId []byte
+ AuthorityKeyId []byte
+
+ // RFC 5280, 4.2.2.1 (Authority Information Access)
+ OCSPServer []string // Go 1.2
+ IssuingCertificateURL []string // Go 1.2
+
+ // Subject Alternate Name values. (Note that these values may not be valid
+ // if invalid values were contained within a parsed certificate. For
+ // example, an element of DNSNames may not be a valid DNS domain name.)
+ DNSNames []string
+ EmailAddresses []string
+ IPAddresses []net.IP // Go 1.1
+ URIs []*url.URL // Go 1.10
+
+ // Name constraints
+ PermittedDNSDomainsCritical bool // if true then the name constraints are marked critical.
+ PermittedDNSDomains []string
+ ExcludedDNSDomains []string // Go 1.9
+ PermittedIPRanges []*net.IPNet // Go 1.10
+ ExcludedIPRanges []*net.IPNet // Go 1.10
+ PermittedEmailAddresses []string // Go 1.10
+ ExcludedEmailAddresses []string // Go 1.10
+ PermittedURIDomains []string // Go 1.10
+ ExcludedURIDomains []string // Go 1.10
+
+ // CRL Distribution Points
+ CRLDistributionPoints []string // Go 1.2
+
+ // PolicyIdentifiers contains asn1.ObjectIdentifiers, the components
+ // of which are limited to int32. If a certificate contains a policy which
+ // cannot be represented by asn1.ObjectIdentifier, it will not be included in
+ // PolicyIdentifiers, but will be present in Policies, which contains all parsed
+ // policy OIDs.
+ PolicyIdentifiers []asn1.ObjectIdentifier
+
+ // Policies contains all policy identifiers included in the certificate.
+ Policies []OID // Go 1.22
+}
+</pre> <h3 id="ParseCertificate">func <span>ParseCertificate</span> </h3> <pre data-language="go">func ParseCertificate(der []byte) (*Certificate, error)</pre> <p>ParseCertificate parses a single certificate from the given ASN.1 DER data. </p>
+<h3 id="ParseCertificates">func <span>ParseCertificates</span> </h3> <pre data-language="go">func ParseCertificates(der []byte) ([]*Certificate, error)</pre> <p>ParseCertificates parses one or more certificates from the given ASN.1 DER data. The certificates must be concatenated with no intermediate padding. </p>
+<h3 id="Certificate.CheckCRLSignature">func (*Certificate) <span>CheckCRLSignature</span> </h3> <pre data-language="go">func (c *Certificate) CheckCRLSignature(crl *pkix.CertificateList) error</pre> <p>CheckCRLSignature checks that the signature in crl is from c. </p>
+<p>Deprecated: Use <a href="#RevocationList.CheckSignatureFrom">RevocationList.CheckSignatureFrom</a> instead. </p>
+<h3 id="Certificate.CheckSignature">func (*Certificate) <span>CheckSignature</span> </h3> <pre data-language="go">func (c *Certificate) CheckSignature(algo SignatureAlgorithm, signed, signature []byte) error</pre> <p>CheckSignature verifies that signature is a valid signature over signed from c's public key. </p>
+<p>This is a low-level API that performs no validity checks on the certificate. </p>
+<p><a href="#MD5WithRSA">MD5WithRSA</a> signatures are rejected, while <a href="#SHA1WithRSA">SHA1WithRSA</a> and <a href="#ECDSAWithSHA1">ECDSAWithSHA1</a> signatures are currently accepted. </p>
+<h3 id="Certificate.CheckSignatureFrom">func (*Certificate) <span>CheckSignatureFrom</span> </h3> <pre data-language="go">func (c *Certificate) CheckSignatureFrom(parent *Certificate) error</pre> <p>CheckSignatureFrom verifies that the signature on c is a valid signature from parent. </p>
+<p>This is a low-level API that performs very limited checks, and not a full path verifier. Most users should use <a href="#Certificate.Verify">Certificate.Verify</a> instead. </p>
+<h3 id="Certificate.CreateCRL">func (*Certificate) <span>CreateCRL</span> </h3> <pre data-language="go">func (c *Certificate) CreateCRL(rand io.Reader, priv any, revokedCerts []pkix.RevokedCertificate, now, expiry time.Time) (crlBytes []byte, err error)</pre> <p>CreateCRL returns a DER encoded CRL, signed by this Certificate, that contains the given list of revoked certificates. </p>
+<p>Deprecated: this method does not generate an RFC 5280 conformant X.509 v2 CRL. To generate a standards compliant CRL, use <a href="#CreateRevocationList">CreateRevocationList</a> instead. </p>
+<h3 id="Certificate.Equal">func (*Certificate) <span>Equal</span> </h3> <pre data-language="go">func (c *Certificate) Equal(other *Certificate) bool</pre> <h3 id="Certificate.Verify">func (*Certificate) <span>Verify</span> </h3> <pre data-language="go">func (c *Certificate) Verify(opts VerifyOptions) (chains [][]*Certificate, err error)</pre> <p>Verify attempts to verify c by building one or more chains from c to a certificate in opts.Roots, using certificates in opts.Intermediates if needed. If successful, it returns one or more chains where the first element of the chain is c and the last element is from opts.Roots. </p>
+<p>If opts.Roots is nil, the platform verifier might be used, and verification details might differ from what is described below. If system roots are unavailable the returned error will be of type SystemRootsError. </p>
+<p>Name constraints in the intermediates will be applied to all names claimed in the chain, not just opts.DNSName. Thus it is invalid for a leaf to claim example.com if an intermediate doesn't permit it, even if example.com is not the name being validated. Note that DirectoryName constraints are not supported. </p>
+<p>Name constraint validation follows the rules from RFC 5280, with the addition that DNS name constraints may use the leading period format defined for emails and URIs. When a constraint has a leading period it indicates that at least one additional label must be prepended to the constrained name to be considered valid. </p>
+<p>Extended Key Usage values are enforced nested down a chain, so an intermediate or root that enumerates EKUs prevents a leaf from asserting an EKU not in that list. (While this is not specified, it is common practice in order to limit the types of certificates a CA can issue.) </p>
+<p>Certificates that use SHA1WithRSA and ECDSAWithSHA1 signatures are not supported, and will not be used to build chains. </p>
+<p>Certificates other than c in the returned chains should not be modified. </p>
+<p>WARNING: this function doesn't do any revocation checking. </p> <h4 id="example_Certificate_Verify"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Verifying with a custom list of root certificates.
+
+const rootPEM = `
+-----BEGIN CERTIFICATE-----
+MIIEBDCCAuygAwIBAgIDAjppMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT
+MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
+YWwgQ0EwHhcNMTMwNDA1MTUxNTU1WhcNMTUwNDA0MTUxNTU1WjBJMQswCQYDVQQG
+EwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzElMCMGA1UEAxMcR29vZ2xlIEludGVy
+bmV0IEF1dGhvcml0eSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
+AJwqBHdc2FCROgajguDYUEi8iT/xGXAaiEZ+4I/F8YnOIe5a/mENtzJEiaB0C1NP
+VaTOgmKV7utZX8bhBYASxF6UP7xbSDj0U/ck5vuR6RXEz/RTDfRK/J9U3n2+oGtv
+h8DQUB8oMANA2ghzUWx//zo8pzcGjr1LEQTrfSTe5vn8MXH7lNVg8y5Kr0LSy+rE
+ahqyzFPdFUuLH8gZYR/Nnag+YyuENWllhMgZxUYi+FOVvuOAShDGKuy6lyARxzmZ
+EASg8GF6lSWMTlJ14rbtCMoU/M4iarNOz0YDl5cDfsCx3nuvRTPPuj5xt970JSXC
+DTWJnZ37DhF5iR43xa+OcmkCAwEAAaOB+zCB+DAfBgNVHSMEGDAWgBTAephojYn7
+qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1dvWBtrtiGrpagS8wEgYD
+VR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwOgYDVR0fBDMwMTAvoC2g
+K4YpaHR0cDovL2NybC5nZW90cnVzdC5jb20vY3Jscy9ndGdsb2JhbC5jcmwwPQYI
+KwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwOi8vZ3RnbG9iYWwtb2NzcC5n
+ZW90cnVzdC5jb20wFwYDVR0gBBAwDjAMBgorBgEEAdZ5AgUBMA0GCSqGSIb3DQEB
+BQUAA4IBAQA21waAESetKhSbOHezI6B1WLuxfoNCunLaHtiONgaX4PCVOzf9G0JY
+/iLIa704XtE7JW4S615ndkZAkNoUyHgN7ZVm2o6Gb4ChulYylYbc3GrKBIxbf/a/
+zG+FA1jDaFETzf3I93k9mTXwVqO94FntT0QJo544evZG0R0SnU++0ED8Vf4GXjza
+HFa9llF7b1cq26KqltyMdMKVvvBulRP/F/A8rLIQjcxz++iPAsbw+zOzlTvjwsto
+WHPbqCRiOwY1nQ2pM714A5AuTHhdUDqB1O6gyHA43LL5Z/qHQF1hwFGPa4NrzQU6
+yuGnBXj8ytqU0CwIPX4WecigUCAkVDNx
+-----END CERTIFICATE-----`
+
+const certPEM = `
+-----BEGIN CERTIFICATE-----
+MIIDujCCAqKgAwIBAgIIE31FZVaPXTUwDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE
+BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRl
+cm5ldCBBdXRob3JpdHkgRzIwHhcNMTQwMTI5MTMyNzQzWhcNMTQwNTI5MDAwMDAw
+WjBpMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwN
+TW91bnRhaW4gVmlldzETMBEGA1UECgwKR29vZ2xlIEluYzEYMBYGA1UEAwwPbWFp
+bC5nb29nbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEfRrObuSW5T7q
+5CnSEqefEmtH4CCv6+5EckuriNr1CjfVvqzwfAhopXkLrq45EQm8vkmf7W96XJhC
+7ZM0dYi1/qOCAU8wggFLMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAa
+BgNVHREEEzARgg9tYWlsLmdvb2dsZS5jb20wCwYDVR0PBAQDAgeAMGgGCCsGAQUF
+BwEBBFwwWjArBggrBgEFBQcwAoYfaHR0cDovL3BraS5nb29nbGUuY29tL0dJQUcy
+LmNydDArBggrBgEFBQcwAYYfaHR0cDovL2NsaWVudHMxLmdvb2dsZS5jb20vb2Nz
+cDAdBgNVHQ4EFgQUiJxtimAuTfwb+aUtBn5UYKreKvMwDAYDVR0TAQH/BAIwADAf
+BgNVHSMEGDAWgBRK3QYWG7z2aLV29YG2u2IaulqBLzAXBgNVHSAEEDAOMAwGCisG
+AQQB1nkCBQEwMAYDVR0fBCkwJzAloCOgIYYfaHR0cDovL3BraS5nb29nbGUuY29t
+L0dJQUcyLmNybDANBgkqhkiG9w0BAQUFAAOCAQEAH6RYHxHdcGpMpFE3oxDoFnP+
+gtuBCHan2yE2GRbJ2Cw8Lw0MmuKqHlf9RSeYfd3BXeKkj1qO6TVKwCh+0HdZk283
+TZZyzmEOyclm3UGFYe82P/iDFt+CeQ3NpmBg+GoaVCuWAARJN/KfglbLyyYygcQq
+0SgeDh8dRKUiaW3HQSoYvTvdTuqzwK4CXsr3b5/dAOY8uMuG/IAR3FgwTbZ1dtoW
+RvOTa8hYiU6A475WuZKyEHcwnGYe57u2I2KbMgcKjPniocj4QzgYsVAVKW3IwaOh
+yE+vPxsiUkvQHdO2fojCkY8jg70jxM+gu59tPDNbw3Uh/2Ij310FgTHsnGQMyA==
+-----END CERTIFICATE-----`
+
+// First, create the set of root certificates. For this example we only
+// have one. It's also possible to omit this in order to use the
+// default root set of the current operating system.
+roots := x509.NewCertPool()
+ok := roots.AppendCertsFromPEM([]byte(rootPEM))
+if !ok {
+ panic("failed to parse root certificate")
+}
+
+block, _ := pem.Decode([]byte(certPEM))
+if block == nil {
+ panic("failed to parse certificate PEM")
+}
+cert, err := x509.ParseCertificate(block.Bytes)
+if err != nil {
+ panic("failed to parse certificate: " + err.Error())
+}
+
+opts := x509.VerifyOptions{
+ DNSName: "mail.google.com",
+ Roots: roots,
+}
+
+if _, err := cert.Verify(opts); err != nil {
+ panic("failed to verify certificate: " + err.Error())
+}
+</pre> <h3 id="Certificate.VerifyHostname">func (*Certificate) <span>VerifyHostname</span> </h3> <pre data-language="go">func (c *Certificate) VerifyHostname(h string) error</pre> <p>VerifyHostname returns nil if c is a valid certificate for the named host. Otherwise it returns an error describing the mismatch. </p>
+<p>IP addresses can be optionally enclosed in square brackets and are checked against the IPAddresses field. Other names are checked case insensitively against the DNSNames field. If the names are valid hostnames, the certificate fields can have a wildcard as the complete left-most label (e.g. *.example.com). </p>
+<p>Note that the legacy Common Name field is ignored. </p>
+<h2 id="CertificateInvalidError">type <span>CertificateInvalidError</span> </h2> <p>CertificateInvalidError results when an odd error occurs. Users of this library probably want to handle all these errors uniformly. </p>
+<pre data-language="go">type CertificateInvalidError struct {
+ Cert *Certificate
+ Reason InvalidReason
+ Detail string // Go 1.10
+}
+</pre> <h3 id="CertificateInvalidError.Error">func (CertificateInvalidError) <span>Error</span> </h3> <pre data-language="go">func (e CertificateInvalidError) Error() string</pre> <h2 id="CertificateRequest">type <span>CertificateRequest</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>CertificateRequest represents a PKCS #10, certificate signature request. </p>
+<pre data-language="go">type CertificateRequest struct {
+ Raw []byte // Complete ASN.1 DER content (CSR, signature algorithm and signature).
+ RawTBSCertificateRequest []byte // Certificate request info part of raw ASN.1 DER content.
+ RawSubjectPublicKeyInfo []byte // DER encoded SubjectPublicKeyInfo.
+ RawSubject []byte // DER encoded Subject.
+
+ Version int
+ Signature []byte
+ SignatureAlgorithm SignatureAlgorithm
+
+ PublicKeyAlgorithm PublicKeyAlgorithm
+ PublicKey any
+
+ Subject pkix.Name
+
+ // Attributes contains the CSR attributes that can parse as
+ // pkix.AttributeTypeAndValueSET.
+ //
+ // Deprecated: Use Extensions and ExtraExtensions instead for parsing and
+ // generating the requestedExtensions attribute.
+ Attributes []pkix.AttributeTypeAndValueSET
+
+ // Extensions contains all requested extensions, in raw form. When parsing
+ // CSRs, this can be used to extract extensions that are not parsed by this
+ // package.
+ Extensions []pkix.Extension
+
+ // ExtraExtensions contains extensions to be copied, raw, into any CSR
+ // marshaled by CreateCertificateRequest. Values override any extensions
+ // that would otherwise be produced based on the other fields but are
+ // overridden by any extensions specified in Attributes.
+ //
+ // The ExtraExtensions field is not populated by ParseCertificateRequest,
+ // see Extensions instead.
+ ExtraExtensions []pkix.Extension
+
+ // Subject Alternate Name values.
+ DNSNames []string
+ EmailAddresses []string
+ IPAddresses []net.IP
+ URIs []*url.URL // Go 1.10
+}
+</pre> <h3 id="ParseCertificateRequest">func <span>ParseCertificateRequest</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func ParseCertificateRequest(asn1Data []byte) (*CertificateRequest, error)</pre> <p>ParseCertificateRequest parses a single certificate request from the given ASN.1 DER data. </p>
+<h3 id="CertificateRequest.CheckSignature">func (*CertificateRequest) <span>CheckSignature</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (c *CertificateRequest) CheckSignature() error</pre> <p>CheckSignature reports whether the signature on c is valid. </p>
+<h2 id="ConstraintViolationError">type <span>ConstraintViolationError</span> </h2> <p>ConstraintViolationError results when a requested usage is not permitted by a certificate. For example: checking a signature when the public key isn't a certificate signing key. </p>
+<pre data-language="go">type ConstraintViolationError struct{}
+</pre> <h3 id="ConstraintViolationError.Error">func (ConstraintViolationError) <span>Error</span> </h3> <pre data-language="go">func (ConstraintViolationError) Error() string</pre> <h2 id="ExtKeyUsage">type <span>ExtKeyUsage</span> </h2> <p>ExtKeyUsage represents an extended set of actions that are valid for a given key. Each of the ExtKeyUsage* constants define a unique action. </p>
+<pre data-language="go">type ExtKeyUsage int</pre> <pre data-language="go">const (
+ ExtKeyUsageAny ExtKeyUsage = iota
+ ExtKeyUsageServerAuth
+ ExtKeyUsageClientAuth
+ ExtKeyUsageCodeSigning
+ ExtKeyUsageEmailProtection
+ ExtKeyUsageIPSECEndSystem
+ ExtKeyUsageIPSECTunnel
+ ExtKeyUsageIPSECUser
+ ExtKeyUsageTimeStamping
+ ExtKeyUsageOCSPSigning
+ ExtKeyUsageMicrosoftServerGatedCrypto
+ ExtKeyUsageNetscapeServerGatedCrypto
+ ExtKeyUsageMicrosoftCommercialCodeSigning
+ ExtKeyUsageMicrosoftKernelCodeSigning
+)</pre> <h2 id="HostnameError">type <span>HostnameError</span> </h2> <p>HostnameError results when the set of authorized names doesn't match the requested name. </p>
+<pre data-language="go">type HostnameError struct {
+ Certificate *Certificate
+ Host string
+}
+</pre> <h3 id="HostnameError.Error">func (HostnameError) <span>Error</span> </h3> <pre data-language="go">func (h HostnameError) Error() string</pre> <h2 id="InsecureAlgorithmError">type <span>InsecureAlgorithmError</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>An InsecureAlgorithmError indicates that the <a href="#SignatureAlgorithm">SignatureAlgorithm</a> used to generate the signature is not secure, and the signature has been rejected. </p>
+<p>To temporarily restore support for SHA-1 signatures, include the value "x509sha1=1" in the GODEBUG environment variable. Note that this option will be removed in a future release. </p>
+<pre data-language="go">type InsecureAlgorithmError SignatureAlgorithm</pre> <h3 id="InsecureAlgorithmError.Error">func (InsecureAlgorithmError) <span>Error</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (e InsecureAlgorithmError) Error() string</pre> <h2 id="InvalidReason">type <span>InvalidReason</span> </h2> <pre data-language="go">type InvalidReason int</pre> <pre data-language="go">const (
+ // NotAuthorizedToSign results when a certificate is signed by another
+ // which isn't marked as a CA certificate.
+ NotAuthorizedToSign InvalidReason = iota
+ // Expired results when a certificate has expired, based on the time
+ // given in the VerifyOptions.
+ Expired
+ // CANotAuthorizedForThisName results when an intermediate or root
+ // certificate has a name constraint which doesn't permit a DNS or
+ // other name (including IP address) in the leaf certificate.
+ CANotAuthorizedForThisName
+ // TooManyIntermediates results when a path length constraint is
+ // violated.
+ TooManyIntermediates
+ // IncompatibleUsage results when the certificate's key usage indicates
+ // that it may only be used for a different purpose.
+ IncompatibleUsage
+ // NameMismatch results when the subject name of a parent certificate
+ // does not match the issuer name in the child.
+ NameMismatch
+ // NameConstraintsWithoutSANs is a legacy error and is no longer returned.
+ NameConstraintsWithoutSANs
+ // UnconstrainedName results when a CA certificate contains permitted
+ // name constraints, but leaf certificate contains a name of an
+ // unsupported or unconstrained type.
+ UnconstrainedName
+ // TooManyConstraints results when the number of comparison operations
+ // needed to check a certificate exceeds the limit set by
+ // VerifyOptions.MaxConstraintComparisions. This limit exists to
+ // prevent pathological certificates can consuming excessive amounts of
+ // CPU time to verify.
+ TooManyConstraints
+ // CANotAuthorizedForExtKeyUsage results when an intermediate or root
+ // certificate does not permit a requested extended key usage.
+ CANotAuthorizedForExtKeyUsage
+)</pre> <h2 id="KeyUsage">type <span>KeyUsage</span> </h2> <p>KeyUsage represents the set of actions that are valid for a given key. It's a bitmap of the KeyUsage* constants. </p>
+<pre data-language="go">type KeyUsage int</pre> <pre data-language="go">const (
+ KeyUsageDigitalSignature KeyUsage = 1 &lt;&lt; iota
+ KeyUsageContentCommitment
+ KeyUsageKeyEncipherment
+ KeyUsageDataEncipherment
+ KeyUsageKeyAgreement
+ KeyUsageCertSign
+ KeyUsageCRLSign
+ KeyUsageEncipherOnly
+ KeyUsageDecipherOnly
+)</pre> <h2 id="OID">type <span>OID</span> <span title="Added in Go 1.22">1.22</span> </h2> <p>An OID represents an ASN.1 OBJECT IDENTIFIER. </p>
+<pre data-language="go">type OID struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="OIDFromInts">func <span>OIDFromInts</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func OIDFromInts(oid []uint64) (OID, error)</pre> <p>OIDFromInts creates a new OID using ints, each integer is a separate component. </p>
+<h3 id="OID.Equal">func (OID) <span>Equal</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (oid OID) Equal(other OID) bool</pre> <p>Equal returns true when oid and other represents the same Object Identifier. </p>
+<h3 id="OID.EqualASN1OID">func (OID) <span>EqualASN1OID</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (oid OID) EqualASN1OID(other asn1.ObjectIdentifier) bool</pre> <p>EqualASN1OID returns whether an OID equals an asn1.ObjectIdentifier. If asn1.ObjectIdentifier cannot represent the OID specified by oid, because a component of OID requires more than 31 bits, it returns false. </p>
+<h3 id="OID.String">func (OID) <span>String</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (oid OID) String() string</pre> <p>Strings returns the string representation of the Object Identifier. </p>
+<h2 id="PEMCipher">type <span>PEMCipher</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">type PEMCipher int</pre> <p>Possible values for the EncryptPEMBlock encryption algorithm. </p>
+<pre data-language="go">const (
+ PEMCipherDES PEMCipher
+ PEMCipher3DES
+ PEMCipherAES128
+ PEMCipherAES192
+ PEMCipherAES256
+)</pre> <h2 id="PublicKeyAlgorithm">type <span>PublicKeyAlgorithm</span> </h2> <pre data-language="go">type PublicKeyAlgorithm int</pre> <pre data-language="go">const (
+ UnknownPublicKeyAlgorithm PublicKeyAlgorithm = iota
+ RSA
+ DSA // Only supported for parsing.
+ ECDSA
+ Ed25519
+)</pre> <h3 id="PublicKeyAlgorithm.String">func (PublicKeyAlgorithm) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (algo PublicKeyAlgorithm) String() string</pre> <h2 id="RevocationList">type <span>RevocationList</span> <span title="Added in Go 1.15">1.15</span> </h2> <p>RevocationList represents a <a href="#Certificate">Certificate</a> Revocation List (CRL) as specified by RFC 5280. </p>
+<pre data-language="go">type RevocationList struct {
+ // Raw contains the complete ASN.1 DER content of the CRL (tbsCertList,
+ // signatureAlgorithm, and signatureValue.)
+ Raw []byte // Go 1.19
+ // RawTBSRevocationList contains just the tbsCertList portion of the ASN.1
+ // DER.
+ RawTBSRevocationList []byte // Go 1.19
+ // RawIssuer contains the DER encoded Issuer.
+ RawIssuer []byte // Go 1.19
+
+ // Issuer contains the DN of the issuing certificate.
+ Issuer pkix.Name // Go 1.19
+ // AuthorityKeyId is used to identify the public key associated with the
+ // issuing certificate. It is populated from the authorityKeyIdentifier
+ // extension when parsing a CRL. It is ignored when creating a CRL; the
+ // extension is populated from the issuing certificate itself.
+ AuthorityKeyId []byte // Go 1.19
+
+ Signature []byte // Go 1.19
+ // SignatureAlgorithm is used to determine the signature algorithm to be
+ // used when signing the CRL. If 0 the default algorithm for the signing
+ // key will be used.
+ SignatureAlgorithm SignatureAlgorithm
+
+ // RevokedCertificateEntries represents the revokedCertificates sequence in
+ // the CRL. It is used when creating a CRL and also populated when parsing a
+ // CRL. When creating a CRL, it may be empty or nil, in which case the
+ // revokedCertificates ASN.1 sequence will be omitted from the CRL entirely.
+ RevokedCertificateEntries []RevocationListEntry // Go 1.21
+
+ // RevokedCertificates is used to populate the revokedCertificates
+ // sequence in the CRL if RevokedCertificateEntries is empty. It may be empty
+ // or nil, in which case an empty CRL will be created.
+ //
+ // Deprecated: Use RevokedCertificateEntries instead.
+ RevokedCertificates []pkix.RevokedCertificate
+
+ // Number is used to populate the X.509 v2 cRLNumber extension in the CRL,
+ // which should be a monotonically increasing sequence number for a given
+ // CRL scope and CRL issuer. It is also populated from the cRLNumber
+ // extension when parsing a CRL.
+ Number *big.Int
+
+ // ThisUpdate is used to populate the thisUpdate field in the CRL, which
+ // indicates the issuance date of the CRL.
+ ThisUpdate time.Time
+ // NextUpdate is used to populate the nextUpdate field in the CRL, which
+ // indicates the date by which the next CRL will be issued. NextUpdate
+ // must be greater than ThisUpdate.
+ NextUpdate time.Time
+
+ // Extensions contains raw X.509 extensions. When creating a CRL,
+ // the Extensions field is ignored, see ExtraExtensions.
+ Extensions []pkix.Extension // Go 1.19
+
+ // ExtraExtensions contains any additional extensions to add directly to
+ // the CRL.
+ ExtraExtensions []pkix.Extension
+}
+</pre> <h3 id="ParseRevocationList">func <span>ParseRevocationList</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func ParseRevocationList(der []byte) (*RevocationList, error)</pre> <p>ParseRevocationList parses a X509 v2 <a href="#Certificate">Certificate</a> Revocation List from the given ASN.1 DER data. </p>
+<h3 id="RevocationList.CheckSignatureFrom">func (*RevocationList) <span>CheckSignatureFrom</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (rl *RevocationList) CheckSignatureFrom(parent *Certificate) error</pre> <p>CheckSignatureFrom verifies that the signature on rl is a valid signature from issuer. </p>
+<h2 id="RevocationListEntry">type <span>RevocationListEntry</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>RevocationListEntry represents an entry in the revokedCertificates sequence of a CRL. </p>
+<pre data-language="go">type RevocationListEntry struct {
+ // Raw contains the raw bytes of the revokedCertificates entry. It is set when
+ // parsing a CRL; it is ignored when generating a CRL.
+ Raw []byte
+
+ // SerialNumber represents the serial number of a revoked certificate. It is
+ // both used when creating a CRL and populated when parsing a CRL. It must not
+ // be nil.
+ SerialNumber *big.Int
+ // RevocationTime represents the time at which the certificate was revoked. It
+ // is both used when creating a CRL and populated when parsing a CRL. It must
+ // not be the zero time.
+ RevocationTime time.Time
+ // ReasonCode represents the reason for revocation, using the integer enum
+ // values specified in RFC 5280 Section 5.3.1. When creating a CRL, the zero
+ // value will result in the reasonCode extension being omitted. When parsing a
+ // CRL, the zero value may represent either the reasonCode extension being
+ // absent (which implies the default revocation reason of 0/Unspecified), or
+ // it may represent the reasonCode extension being present and explicitly
+ // containing a value of 0/Unspecified (which should not happen according to
+ // the DER encoding rules, but can and does happen anyway).
+ ReasonCode int
+
+ // Extensions contains raw X.509 extensions. When parsing CRL entries,
+ // this can be used to extract non-critical extensions that are not
+ // parsed by this package. When marshaling CRL entries, the Extensions
+ // field is ignored, see ExtraExtensions.
+ Extensions []pkix.Extension
+ // ExtraExtensions contains extensions to be copied, raw, into any
+ // marshaled CRL entries. Values override any extensions that would
+ // otherwise be produced based on the other fields. The ExtraExtensions
+ // field is not populated when parsing CRL entries, see Extensions.
+ ExtraExtensions []pkix.Extension
+}
+</pre> <h2 id="SignatureAlgorithm">type <span>SignatureAlgorithm</span> </h2> <pre data-language="go">type SignatureAlgorithm int</pre> <pre data-language="go">const (
+ UnknownSignatureAlgorithm SignatureAlgorithm = iota
+
+ MD2WithRSA // Unsupported.
+ MD5WithRSA // Only supported for signing, not verification.
+ SHA1WithRSA // Only supported for signing, and verification of CRLs, CSRs, and OCSP responses.
+ SHA256WithRSA
+ SHA384WithRSA
+ SHA512WithRSA
+ DSAWithSHA1 // Unsupported.
+ DSAWithSHA256 // Unsupported.
+ ECDSAWithSHA1 // Only supported for signing, and verification of CRLs, CSRs, and OCSP responses.
+ ECDSAWithSHA256
+ ECDSAWithSHA384
+ ECDSAWithSHA512
+ SHA256WithRSAPSS
+ SHA384WithRSAPSS
+ SHA512WithRSAPSS
+ PureEd25519
+)</pre> <h3 id="SignatureAlgorithm.String">func (SignatureAlgorithm) <span>String</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (algo SignatureAlgorithm) String() string</pre> <h2 id="SystemRootsError">type <span>SystemRootsError</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>SystemRootsError results when we fail to load the system root certificates. </p>
+<pre data-language="go">type SystemRootsError struct {
+ Err error // Go 1.7
+}
+</pre> <h3 id="SystemRootsError.Error">func (SystemRootsError) <span>Error</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (se SystemRootsError) Error() string</pre> <h3 id="SystemRootsError.Unwrap">func (SystemRootsError) <span>Unwrap</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (se SystemRootsError) Unwrap() error</pre> <h2 id="UnhandledCriticalExtension">type <span>UnhandledCriticalExtension</span> </h2> <pre data-language="go">type UnhandledCriticalExtension struct{}
+</pre> <h3 id="UnhandledCriticalExtension.Error">func (UnhandledCriticalExtension) <span>Error</span> </h3> <pre data-language="go">func (h UnhandledCriticalExtension) Error() string</pre> <h2 id="UnknownAuthorityError">type <span>UnknownAuthorityError</span> </h2> <p>UnknownAuthorityError results when the certificate issuer is unknown </p>
+<pre data-language="go">type UnknownAuthorityError struct {
+ Cert *Certificate // Go 1.8
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="UnknownAuthorityError.Error">func (UnknownAuthorityError) <span>Error</span> </h3> <pre data-language="go">func (e UnknownAuthorityError) Error() string</pre> <h2 id="VerifyOptions">type <span>VerifyOptions</span> </h2> <p>VerifyOptions contains parameters for Certificate.Verify. </p>
+<pre data-language="go">type VerifyOptions struct {
+ // DNSName, if set, is checked against the leaf certificate with
+ // Certificate.VerifyHostname or the platform verifier.
+ DNSName string
+
+ // Intermediates is an optional pool of certificates that are not trust
+ // anchors, but can be used to form a chain from the leaf certificate to a
+ // root certificate.
+ Intermediates *CertPool
+ // Roots is the set of trusted root certificates the leaf certificate needs
+ // to chain up to. If nil, the system roots or the platform verifier are used.
+ Roots *CertPool
+
+ // CurrentTime is used to check the validity of all certificates in the
+ // chain. If zero, the current time is used.
+ CurrentTime time.Time
+
+ // KeyUsages specifies which Extended Key Usage values are acceptable. A
+ // chain is accepted if it allows any of the listed values. An empty list
+ // means ExtKeyUsageServerAuth. To accept any key usage, include ExtKeyUsageAny.
+ KeyUsages []ExtKeyUsage // Go 1.1
+
+ // MaxConstraintComparisions is the maximum number of comparisons to
+ // perform when checking a given certificate's name constraints. If
+ // zero, a sensible default is used. This limit prevents pathological
+ // certificates from consuming excessive amounts of CPU time when
+ // validating. It does not apply to the platform verifier.
+ MaxConstraintComparisions int // Go 1.10
+}
+</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="pkix/index">pkix</a> </td> <td class="pkg-synopsis"> Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/x509/" class="_attribution-link">http://golang.org/pkg/crypto/x509/</a>
+ </p>
+</div>
diff --git a/devdocs/go/crypto%2Fx509%2Fpkix%2Findex.html b/devdocs/go/crypto%2Fx509%2Fpkix%2Findex.html
new file mode 100644
index 00000000..4f255da5
--- /dev/null
+++ b/devdocs/go/crypto%2Fx509%2Fpkix%2Findex.html
@@ -0,0 +1,108 @@
+<h1> Package pkix </h1> <ul id="short-nav">
+<li><code>import "crypto/x509/pkix"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#AlgorithmIdentifier">type AlgorithmIdentifier</a></li>
+<li><a href="#AttributeTypeAndValue">type AttributeTypeAndValue</a></li>
+<li><a href="#AttributeTypeAndValueSET">type AttributeTypeAndValueSET</a></li>
+<li><a href="#CertificateList">type CertificateList</a></li>
+<li> <a href="#CertificateList.HasExpired">func (certList *CertificateList) HasExpired(now time.Time) bool</a>
+</li>
+<li><a href="#Extension">type Extension</a></li>
+<li><a href="#Name">type Name</a></li>
+<li> <a href="#Name.FillFromRDNSequence">func (n *Name) FillFromRDNSequence(rdns *RDNSequence)</a>
+</li>
+<li> <a href="#Name.String">func (n Name) String() string</a>
+</li>
+<li> <a href="#Name.ToRDNSequence">func (n Name) ToRDNSequence() (ret RDNSequence)</a>
+</li>
+<li><a href="#RDNSequence">type RDNSequence</a></li>
+<li> <a href="#RDNSequence.String">func (r RDNSequence) String() string</a>
+</li>
+<li><a href="#RelativeDistinguishedNameSET">type RelativeDistinguishedNameSET</a></li>
+<li><a href="#RevokedCertificate">type RevokedCertificate</a></li>
+<li><a href="#TBSCertificateList">type TBSCertificateList</a></li>
+</ul> <h3>Package files</h3> <p> <span>pkix.go</span> </p> <h2 id="AlgorithmIdentifier">type <span>AlgorithmIdentifier</span> </h2> <p>AlgorithmIdentifier represents the ASN.1 structure of the same name. See RFC 5280, section 4.1.1.2. </p>
+<pre data-language="go">type AlgorithmIdentifier struct {
+ Algorithm asn1.ObjectIdentifier
+ Parameters asn1.RawValue `asn1:"optional"`
+}
+</pre> <h2 id="AttributeTypeAndValue">type <span>AttributeTypeAndValue</span> </h2> <p>AttributeTypeAndValue mirrors the ASN.1 structure of the same name in RFC 5280, Section 4.1.2.4. </p>
+<pre data-language="go">type AttributeTypeAndValue struct {
+ Type asn1.ObjectIdentifier
+ Value any
+}
+</pre> <h2 id="AttributeTypeAndValueSET">type <span>AttributeTypeAndValueSET</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>AttributeTypeAndValueSET represents a set of ASN.1 sequences of <a href="#AttributeTypeAndValue">AttributeTypeAndValue</a> sequences from RFC 2986 (PKCS #10). </p>
+<pre data-language="go">type AttributeTypeAndValueSET struct {
+ Type asn1.ObjectIdentifier
+ Value [][]AttributeTypeAndValue `asn1:"set"`
+}
+</pre> <h2 id="CertificateList">type <span>CertificateList</span> </h2> <p>CertificateList represents the ASN.1 structure of the same name. See RFC 5280, section 5.1. Use Certificate.CheckCRLSignature to verify the signature. </p>
+<p>Deprecated: x509.RevocationList should be used instead. </p>
+<pre data-language="go">type CertificateList struct {
+ TBSCertList TBSCertificateList
+ SignatureAlgorithm AlgorithmIdentifier
+ SignatureValue asn1.BitString
+}
+</pre> <h3 id="CertificateList.HasExpired">func (*CertificateList) <span>HasExpired</span> </h3> <pre data-language="go">func (certList *CertificateList) HasExpired(now time.Time) bool</pre> <p>HasExpired reports whether certList should have been updated by now. </p>
+<h2 id="Extension">type <span>Extension</span> </h2> <p>Extension represents the ASN.1 structure of the same name. See RFC 5280, section 4.2. </p>
+<pre data-language="go">type Extension struct {
+ Id asn1.ObjectIdentifier
+ Critical bool `asn1:"optional"`
+ Value []byte
+}
+</pre> <h2 id="Name">type <span>Name</span> </h2> <p>Name represents an X.509 distinguished name. This only includes the common elements of a DN. Note that Name is only an approximation of the X.509 structure. If an accurate representation is needed, asn1.Unmarshal the raw subject or issuer as an <a href="#RDNSequence">RDNSequence</a>. </p>
+<pre data-language="go">type Name struct {
+ Country, Organization, OrganizationalUnit []string
+ Locality, Province []string
+ StreetAddress, PostalCode []string
+ SerialNumber, CommonName string
+
+ // Names contains all parsed attributes. When parsing distinguished names,
+ // this can be used to extract non-standard attributes that are not parsed
+ // by this package. When marshaling to RDNSequences, the Names field is
+ // ignored, see ExtraNames.
+ Names []AttributeTypeAndValue
+
+ // ExtraNames contains attributes to be copied, raw, into any marshaled
+ // distinguished names. Values override any attributes with the same OID.
+ // The ExtraNames field is not populated when parsing, see Names.
+ ExtraNames []AttributeTypeAndValue // Go 1.5
+}
+</pre> <h3 id="Name.FillFromRDNSequence">func (*Name) <span>FillFromRDNSequence</span> </h3> <pre data-language="go">func (n *Name) FillFromRDNSequence(rdns *RDNSequence)</pre> <p>FillFromRDNSequence populates n from the provided <a href="#RDNSequence">RDNSequence</a>. Multi-entry RDNs are flattened, all entries are added to the relevant n fields, and the grouping is not preserved. </p>
+<h3 id="Name.String">func (Name) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (n Name) String() string</pre> <p>String returns the string form of n, roughly following the RFC 2253 Distinguished Names syntax. </p>
+<h3 id="Name.ToRDNSequence">func (Name) <span>ToRDNSequence</span> </h3> <pre data-language="go">func (n Name) ToRDNSequence() (ret RDNSequence)</pre> <p>ToRDNSequence converts n into a single <a href="#RDNSequence">RDNSequence</a>. The following attributes are encoded as multi-value RDNs: </p>
+<ul> <li>Country </li>
+<li>Organization </li>
+<li>OrganizationalUnit </li>
+<li>Locality </li>
+<li>Province </li>
+<li>StreetAddress </li>
+<li>PostalCode </li>
+</ul> <p>Each ExtraNames entry is encoded as an individual RDN. </p>
+<h2 id="RDNSequence">type <span>RDNSequence</span> </h2> <pre data-language="go">type RDNSequence []RelativeDistinguishedNameSET</pre> <h3 id="RDNSequence.String">func (RDNSequence) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (r RDNSequence) String() string</pre> <p>String returns a string representation of the sequence r, roughly following the RFC 2253 Distinguished Names syntax. </p>
+<h2 id="RelativeDistinguishedNameSET">type <span>RelativeDistinguishedNameSET</span> </h2> <pre data-language="go">type RelativeDistinguishedNameSET []AttributeTypeAndValue</pre> <h2 id="RevokedCertificate">type <span>RevokedCertificate</span> </h2> <p>RevokedCertificate represents the ASN.1 structure of the same name. See RFC 5280, section 5.1. </p>
+<pre data-language="go">type RevokedCertificate struct {
+ SerialNumber *big.Int
+ RevocationTime time.Time
+ Extensions []Extension `asn1:"optional"`
+}
+</pre> <h2 id="TBSCertificateList">type <span>TBSCertificateList</span> </h2> <p>TBSCertificateList represents the ASN.1 structure of the same name. See RFC 5280, section 5.1. </p>
+<p>Deprecated: x509.RevocationList should be used instead. </p>
+<pre data-language="go">type TBSCertificateList struct {
+ Raw asn1.RawContent
+ Version int `asn1:"optional,default:0"`
+ Signature AlgorithmIdentifier
+ Issuer RDNSequence
+ ThisUpdate time.Time
+ NextUpdate time.Time `asn1:"optional"`
+ RevokedCertificates []RevokedCertificate `asn1:"optional"`
+ Extensions []Extension `asn1:"tag:0,optional,explicit"`
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/crypto/x509/pkix/" class="_attribution-link">http://golang.org/pkg/crypto/x509/pkix/</a>
+ </p>
+</div>
diff --git a/devdocs/go/database%2Fsql%2Fdriver%2Findex.html b/devdocs/go/database%2Fsql%2Fdriver%2Findex.html
new file mode 100644
index 00000000..3bbd892b
--- /dev/null
+++ b/devdocs/go/database%2Fsql%2Fdriver%2Findex.html
@@ -0,0 +1,403 @@
+<h1> Package driver </h1> <ul id="short-nav">
+<li><code>import "database/sql/driver"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package driver defines interfaces to be implemented by database drivers as used by package sql. </p>
+<p>Most code should use the <span>database/sql</span> package. </p>
+<p>The driver interface has evolved over time. Drivers should implement <a href="#Connector">Connector</a> and <a href="#DriverContext">DriverContext</a> interfaces. The Connector.Connect and Driver.Open methods should never return <a href="#ErrBadConn">ErrBadConn</a>. <a href="#ErrBadConn">ErrBadConn</a> should only be returned from <a href="#Validator">Validator</a>, <a href="#SessionResetter">SessionResetter</a>, or a query method if the connection is already in an invalid (e.g. closed) state. </p>
+<p>All <a href="#Conn">Conn</a> implementations should implement the following interfaces: <a href="#Pinger">Pinger</a>, <a href="#SessionResetter">SessionResetter</a>, and <a href="#Validator">Validator</a>. </p>
+<p>If named parameters or context are supported, the driver's <a href="#Conn">Conn</a> should implement: <a href="#ExecerContext">ExecerContext</a>, <a href="#QueryerContext">QueryerContext</a>, <a href="#ConnPrepareContext">ConnPrepareContext</a>, and <a href="#ConnBeginTx">ConnBeginTx</a>. </p>
+<p>To support custom data types, implement <a href="#NamedValueChecker">NamedValueChecker</a>. <a href="#NamedValueChecker">NamedValueChecker</a> also allows queries to accept per-query options as a parameter by returning <a href="#ErrRemoveArgument">ErrRemoveArgument</a> from CheckNamedValue. </p>
+<p>If multiple result sets are supported, <a href="#Rows">Rows</a> should implement <a href="#RowsNextResultSet">RowsNextResultSet</a>. If the driver knows how to describe the types present in the returned result it should implement the following interfaces: <a href="#RowsColumnTypeScanType">RowsColumnTypeScanType</a>, <a href="#RowsColumnTypeDatabaseTypeName">RowsColumnTypeDatabaseTypeName</a>, <a href="#RowsColumnTypeLength">RowsColumnTypeLength</a>, <a href="#RowsColumnTypeNullable">RowsColumnTypeNullable</a>, and <a href="#RowsColumnTypePrecisionScale">RowsColumnTypePrecisionScale</a>. A given row value may also return a <a href="#Rows">Rows</a> type, which may represent a database cursor value. </p>
+<p>If a <a href="#Conn">Conn</a> implements <a href="#Validator">Validator</a>, then the IsValid method is called before returning the connection to the connection pool. If an entry in the connection pool implements <a href="#SessionResetter">SessionResetter</a>, then ResetSession is called before reusing the connection for another query. If a connection is never returned to the connection pool but is immediately reused, then ResetSession is called prior to reuse but IsValid is not called. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#IsScanValue">func IsScanValue(v any) bool</a></li>
+<li><a href="#IsValue">func IsValue(v any) bool</a></li>
+<li><a href="#ColumnConverter">type ColumnConverter</a></li>
+<li><a href="#Conn">type Conn</a></li>
+<li><a href="#ConnBeginTx">type ConnBeginTx</a></li>
+<li><a href="#ConnPrepareContext">type ConnPrepareContext</a></li>
+<li><a href="#Connector">type Connector</a></li>
+<li><a href="#Driver">type Driver</a></li>
+<li><a href="#DriverContext">type DriverContext</a></li>
+<li><a href="#Execer">type Execer</a></li>
+<li><a href="#ExecerContext">type ExecerContext</a></li>
+<li><a href="#IsolationLevel">type IsolationLevel</a></li>
+<li><a href="#NamedValue">type NamedValue</a></li>
+<li><a href="#NamedValueChecker">type NamedValueChecker</a></li>
+<li><a href="#NotNull">type NotNull</a></li>
+<li> <a href="#NotNull.ConvertValue">func (n NotNull) ConvertValue(v any) (Value, error)</a>
+</li>
+<li><a href="#Null">type Null</a></li>
+<li> <a href="#Null.ConvertValue">func (n Null) ConvertValue(v any) (Value, error)</a>
+</li>
+<li><a href="#Pinger">type Pinger</a></li>
+<li><a href="#Queryer">type Queryer</a></li>
+<li><a href="#QueryerContext">type QueryerContext</a></li>
+<li><a href="#Result">type Result</a></li>
+<li><a href="#Rows">type Rows</a></li>
+<li><a href="#RowsAffected">type RowsAffected</a></li>
+<li> <a href="#RowsAffected.LastInsertId">func (RowsAffected) LastInsertId() (int64, error)</a>
+</li>
+<li> <a href="#RowsAffected.RowsAffected">func (v RowsAffected) RowsAffected() (int64, error)</a>
+</li>
+<li><a href="#RowsColumnTypeDatabaseTypeName">type RowsColumnTypeDatabaseTypeName</a></li>
+<li><a href="#RowsColumnTypeLength">type RowsColumnTypeLength</a></li>
+<li><a href="#RowsColumnTypeNullable">type RowsColumnTypeNullable</a></li>
+<li><a href="#RowsColumnTypePrecisionScale">type RowsColumnTypePrecisionScale</a></li>
+<li><a href="#RowsColumnTypeScanType">type RowsColumnTypeScanType</a></li>
+<li><a href="#RowsNextResultSet">type RowsNextResultSet</a></li>
+<li><a href="#SessionResetter">type SessionResetter</a></li>
+<li><a href="#Stmt">type Stmt</a></li>
+<li><a href="#StmtExecContext">type StmtExecContext</a></li>
+<li><a href="#StmtQueryContext">type StmtQueryContext</a></li>
+<li><a href="#Tx">type Tx</a></li>
+<li><a href="#TxOptions">type TxOptions</a></li>
+<li><a href="#Validator">type Validator</a></li>
+<li><a href="#Value">type Value</a></li>
+<li><a href="#ValueConverter">type ValueConverter</a></li>
+<li><a href="#Valuer">type Valuer</a></li>
+</ul> <h3>Package files</h3> <p> <span>driver.go</span> <span>types.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>Bool is a <a href="#ValueConverter">ValueConverter</a> that converts input values to bool. </p>
+<p>The conversion rules are: </p>
+<ul> <li>booleans are returned unchanged </li>
+<li>for integer types, 1 is true 0 is false, other integers are an error </li>
+<li>for strings and []byte, same rules as <span>strconv.ParseBool</span> </li>
+<li>all other types are an error </li>
+</ul> <pre data-language="go">var Bool boolType</pre> <p>DefaultParameterConverter is the default implementation of <a href="#ValueConverter">ValueConverter</a> that's used when a <a href="#Stmt">Stmt</a> doesn't implement <a href="#ColumnConverter">ColumnConverter</a>. </p>
+<p>DefaultParameterConverter returns its argument directly if IsValue(arg). Otherwise, if the argument implements <a href="#Valuer">Valuer</a>, its Value method is used to return a <a href="#Value">Value</a>. As a fallback, the provided argument's underlying type is used to convert it to a <a href="#Value">Value</a>: underlying integer types are converted to int64, floats to float64, bool, string, and []byte to themselves. If the argument is a nil pointer, defaultConverter.ConvertValue returns a nil <a href="#Value">Value</a>. If the argument is a non-nil pointer, it is dereferenced and defaultConverter.ConvertValue is called recursively. Other types are an error. </p>
+<pre data-language="go">var DefaultParameterConverter defaultConverter</pre> <p>ErrBadConn should be returned by a driver to signal to the <span>database/sql</span> package that a driver.<a href="#Conn">Conn</a> is in a bad state (such as the server having earlier closed the connection) and the <span>database/sql</span> package should retry on a new connection. </p>
+<p>To prevent duplicate operations, ErrBadConn should NOT be returned if there's a possibility that the database server might have performed the operation. Even if the server sends back an error, you shouldn't return ErrBadConn. </p>
+<p>Errors will be checked using <span>errors.Is</span>. An error may wrap ErrBadConn or implement the Is(error) bool method. </p>
+<pre data-language="go">var ErrBadConn = errors.New("driver: bad connection")</pre> <p>ErrRemoveArgument may be returned from <a href="#NamedValueChecker">NamedValueChecker</a> to instruct the <span>database/sql</span> package to not pass the argument to the driver query interface. Return when accepting query specific options or structures that aren't SQL query arguments. </p>
+<pre data-language="go">var ErrRemoveArgument = errors.New("driver: remove argument from query")</pre> <p>ErrSkip may be returned by some optional interfaces' methods to indicate at runtime that the fast path is unavailable and the sql package should continue as if the optional interface was not implemented. ErrSkip is only supported where explicitly documented. </p>
+<pre data-language="go">var ErrSkip = errors.New("driver: skip fast-path; continue as if unimplemented")</pre> <p>Int32 is a <a href="#ValueConverter">ValueConverter</a> that converts input values to int64, respecting the limits of an int32 value. </p>
+<pre data-language="go">var Int32 int32Type</pre> <p>ResultNoRows is a pre-defined <a href="#Result">Result</a> for drivers to return when a DDL command (such as a CREATE TABLE) succeeds. It returns an error for both LastInsertId and <a href="#RowsAffected">RowsAffected</a>. </p>
+<pre data-language="go">var ResultNoRows noRows</pre> <p>String is a <a href="#ValueConverter">ValueConverter</a> that converts its input to a string. If the value is already a string or []byte, it's unchanged. If the value is of another type, conversion to string is done with fmt.Sprintf("%v", v). </p>
+<pre data-language="go">var String stringType</pre> <h2 id="IsScanValue">func <span>IsScanValue</span> </h2> <pre data-language="go">func IsScanValue(v any) bool</pre> <p>IsScanValue is equivalent to <a href="#IsValue">IsValue</a>. It exists for compatibility. </p>
+<h2 id="IsValue">func <span>IsValue</span> </h2> <pre data-language="go">func IsValue(v any) bool</pre> <p>IsValue reports whether v is a valid <a href="#Value">Value</a> parameter type. </p>
+<h2 id="ColumnConverter">type <span>ColumnConverter</span> </h2> <p>ColumnConverter may be optionally implemented by <a href="#Stmt">Stmt</a> if the statement is aware of its own columns' types and can convert from any type to a driver <a href="#Value">Value</a>. </p>
+<p>Deprecated: Drivers should implement <a href="#NamedValueChecker">NamedValueChecker</a>. </p>
+<pre data-language="go">type ColumnConverter interface {
+ // ColumnConverter returns a ValueConverter for the provided
+ // column index. If the type of a specific column isn't known
+ // or shouldn't be handled specially, DefaultValueConverter
+ // can be returned.
+ ColumnConverter(idx int) ValueConverter
+}</pre> <h2 id="Conn">type <span>Conn</span> </h2> <p>Conn is a connection to a database. It is not used concurrently by multiple goroutines. </p>
+<p>Conn is assumed to be stateful. </p>
+<pre data-language="go">type Conn interface {
+ // Prepare returns a prepared statement, bound to this connection.
+ Prepare(query string) (Stmt, error)
+
+ // Close invalidates and potentially stops any current
+ // prepared statements and transactions, marking this
+ // connection as no longer in use.
+ //
+ // Because the sql package maintains a free pool of
+ // connections and only calls Close when there's a surplus of
+ // idle connections, it shouldn't be necessary for drivers to
+ // do their own connection caching.
+ //
+ // Drivers must ensure all network calls made by Close
+ // do not block indefinitely (e.g. apply a timeout).
+ Close() error
+
+ // Begin starts and returns a new transaction.
+ //
+ // Deprecated: Drivers should implement ConnBeginTx instead (or additionally).
+ Begin() (Tx, error)
+}</pre> <h2 id="ConnBeginTx">type <span>ConnBeginTx</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>ConnBeginTx enhances the <a href="#Conn">Conn</a> interface with context and <a href="#TxOptions">TxOptions</a>. </p>
+<pre data-language="go">type ConnBeginTx interface {
+ // BeginTx starts and returns a new transaction.
+ // If the context is canceled by the user the sql package will
+ // call Tx.Rollback before discarding and closing the connection.
+ //
+ // This must check opts.Isolation to determine if there is a set
+ // isolation level. If the driver does not support a non-default
+ // level and one is set or if there is a non-default isolation level
+ // that is not supported, an error must be returned.
+ //
+ // This must also check opts.ReadOnly to determine if the read-only
+ // value is true to either set the read-only transaction property if supported
+ // or return an error if it is not supported.
+ BeginTx(ctx context.Context, opts TxOptions) (Tx, error)
+}</pre> <h2 id="ConnPrepareContext">type <span>ConnPrepareContext</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>ConnPrepareContext enhances the <a href="#Conn">Conn</a> interface with context. </p>
+<pre data-language="go">type ConnPrepareContext interface {
+ // PrepareContext returns a prepared statement, bound to this connection.
+ // context is for the preparation of the statement,
+ // it must not store the context within the statement itself.
+ PrepareContext(ctx context.Context, query string) (Stmt, error)
+}</pre> <h2 id="Connector">type <span>Connector</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>A Connector represents a driver in a fixed configuration and can create any number of equivalent Conns for use by multiple goroutines. </p>
+<p>A Connector can be passed to <span>database/sql.OpenDB</span>, to allow drivers to implement their own <span>database/sql.DB</span> constructors, or returned by <a href="#DriverContext">DriverContext</a>'s OpenConnector method, to allow drivers access to context and to avoid repeated parsing of driver configuration. </p>
+<p>If a Connector implements <span>io.Closer</span>, the <span>database/sql.DB.Close</span> method will call the Close method and return error (if any). </p>
+<pre data-language="go">type Connector interface {
+ // Connect returns a connection to the database.
+ // Connect may return a cached connection (one previously
+ // closed), but doing so is unnecessary; the sql package
+ // maintains a pool of idle connections for efficient re-use.
+ //
+ // The provided context.Context is for dialing purposes only
+ // (see net.DialContext) and should not be stored or used for
+ // other purposes. A default timeout should still be used
+ // when dialing as a connection pool may call Connect
+ // asynchronously to any query.
+ //
+ // The returned connection is only used by one goroutine at a
+ // time.
+ Connect(context.Context) (Conn, error)
+
+ // Driver returns the underlying Driver of the Connector,
+ // mainly to maintain compatibility with the Driver method
+ // on sql.DB.
+ Driver() Driver
+}</pre> <h2 id="Driver">type <span>Driver</span> </h2> <p>Driver is the interface that must be implemented by a database driver. </p>
+<p>Database drivers may implement <a href="#DriverContext">DriverContext</a> for access to contexts and to parse the name only once for a pool of connections, instead of once per connection. </p>
+<pre data-language="go">type Driver interface {
+ // Open returns a new connection to the database.
+ // The name is a string in a driver-specific format.
+ //
+ // Open may return a cached connection (one previously
+ // closed), but doing so is unnecessary; the sql package
+ // maintains a pool of idle connections for efficient re-use.
+ //
+ // The returned connection is only used by one goroutine at a
+ // time.
+ Open(name string) (Conn, error)
+}</pre> <h2 id="DriverContext">type <span>DriverContext</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>If a <a href="#Driver">Driver</a> implements DriverContext, then <span>database/sql.DB</span> will call OpenConnector to obtain a <a href="#Connector">Connector</a> and then invoke that <a href="#Connector">Connector</a>'s Connect method to obtain each needed connection, instead of invoking the <a href="#Driver">Driver</a>'s Open method for each connection. The two-step sequence allows drivers to parse the name just once and also provides access to per-<a href="#Conn">Conn</a> contexts. </p>
+<pre data-language="go">type DriverContext interface {
+ // OpenConnector must parse the name in the same format that Driver.Open
+ // parses the name parameter.
+ OpenConnector(name string) (Connector, error)
+}</pre> <h2 id="Execer">type <span>Execer</span> </h2> <p>Execer is an optional interface that may be implemented by a <a href="#Conn">Conn</a>. </p>
+<p>If a <a href="#Conn">Conn</a> implements neither <a href="#ExecerContext">ExecerContext</a> nor <a href="#Execer">Execer</a>, the <span>database/sql.DB.Exec</span> will first prepare a query, execute the statement, and then close the statement. </p>
+<p>Exec may return <a href="#ErrSkip">ErrSkip</a>. </p>
+<p>Deprecated: Drivers should implement <a href="#ExecerContext">ExecerContext</a> instead. </p>
+<pre data-language="go">type Execer interface {
+ Exec(query string, args []Value) (Result, error)
+}</pre> <h2 id="ExecerContext">type <span>ExecerContext</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>ExecerContext is an optional interface that may be implemented by a <a href="#Conn">Conn</a>. </p>
+<p>If a <a href="#Conn">Conn</a> does not implement <a href="#ExecerContext">ExecerContext</a>, the <span>database/sql.DB.Exec</span> will fall back to <a href="#Execer">Execer</a>; if the Conn does not implement Execer either, <span>database/sql.DB.Exec</span> will first prepare a query, execute the statement, and then close the statement. </p>
+<p>ExecContext may return <a href="#ErrSkip">ErrSkip</a>. </p>
+<p>ExecContext must honor the context timeout and return when the context is canceled. </p>
+<pre data-language="go">type ExecerContext interface {
+ ExecContext(ctx context.Context, query string, args []NamedValue) (Result, error)
+}</pre> <h2 id="IsolationLevel">type <span>IsolationLevel</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>IsolationLevel is the transaction isolation level stored in <a href="#TxOptions">TxOptions</a>. </p>
+<p>This type should be considered identical to <span>database/sql.IsolationLevel</span> along with any values defined on it. </p>
+<pre data-language="go">type IsolationLevel int</pre> <h2 id="NamedValue">type <span>NamedValue</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>NamedValue holds both the value name and value. </p>
+<pre data-language="go">type NamedValue struct {
+ // If the Name is not empty it should be used for the parameter identifier and
+ // not the ordinal position.
+ //
+ // Name will not have a symbol prefix.
+ Name string
+
+ // Ordinal position of the parameter starting from one and is always set.
+ Ordinal int
+
+ // Value is the parameter value.
+ Value Value
+}
+</pre> <h2 id="NamedValueChecker">type <span>NamedValueChecker</span> <span title="Added in Go 1.9">1.9</span> </h2> <p>NamedValueChecker may be optionally implemented by <a href="#Conn">Conn</a> or <a href="#Stmt">Stmt</a>. It provides the driver more control to handle Go and database types beyond the default <a href="#Value">Value</a> types allowed. </p>
+<p>The <span>database/sql</span> package checks for value checkers in the following order, stopping at the first found match: Stmt.NamedValueChecker, Conn.NamedValueChecker, Stmt.ColumnConverter, <a href="#DefaultParameterConverter">DefaultParameterConverter</a>. </p>
+<p>If CheckNamedValue returns <a href="#ErrRemoveArgument">ErrRemoveArgument</a>, the <a href="#NamedValue">NamedValue</a> will not be included in the final query arguments. This may be used to pass special options to the query itself. </p>
+<p>If <a href="#ErrSkip">ErrSkip</a> is returned the column converter error checking path is used for the argument. Drivers may wish to return <a href="#ErrSkip">ErrSkip</a> after they have exhausted their own special cases. </p>
+<pre data-language="go">type NamedValueChecker interface {
+ // CheckNamedValue is called before passing arguments to the driver
+ // and is called in place of any ColumnConverter. CheckNamedValue must do type
+ // validation and conversion as appropriate for the driver.
+ CheckNamedValue(*NamedValue) error
+}</pre> <h2 id="NotNull">type <span>NotNull</span> </h2> <p>NotNull is a type that implements <a href="#ValueConverter">ValueConverter</a> by disallowing nil values but otherwise delegating to another <a href="#ValueConverter">ValueConverter</a>. </p>
+<pre data-language="go">type NotNull struct {
+ Converter ValueConverter
+}
+</pre> <h3 id="NotNull.ConvertValue">func (NotNull) <span>ConvertValue</span> </h3> <pre data-language="go">func (n NotNull) ConvertValue(v any) (Value, error)</pre> <h2 id="Null">type <span>Null</span> </h2> <p>Null is a type that implements <a href="#ValueConverter">ValueConverter</a> by allowing nil values but otherwise delegating to another <a href="#ValueConverter">ValueConverter</a>. </p>
+<pre data-language="go">type Null struct {
+ Converter ValueConverter
+}
+</pre> <h3 id="Null.ConvertValue">func (Null) <span>ConvertValue</span> </h3> <pre data-language="go">func (n Null) ConvertValue(v any) (Value, error)</pre> <h2 id="Pinger">type <span>Pinger</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>Pinger is an optional interface that may be implemented by a <a href="#Conn">Conn</a>. </p>
+<p>If a <a href="#Conn">Conn</a> does not implement Pinger, the <span>database/sql.DB.Ping</span> and <span>database/sql.DB.PingContext</span> will check if there is at least one <a href="#Conn">Conn</a> available. </p>
+<p>If Conn.Ping returns <a href="#ErrBadConn">ErrBadConn</a>, <span>database/sql.DB.Ping</span> and <span>database/sql.DB.PingContext</span> will remove the <a href="#Conn">Conn</a> from pool. </p>
+<pre data-language="go">type Pinger interface {
+ Ping(ctx context.Context) error
+}</pre> <h2 id="Queryer">type <span>Queryer</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>Queryer is an optional interface that may be implemented by a <a href="#Conn">Conn</a>. </p>
+<p>If a <a href="#Conn">Conn</a> implements neither <a href="#QueryerContext">QueryerContext</a> nor <a href="#Queryer">Queryer</a>, the <span>database/sql.DB.Query</span> will first prepare a query, execute the statement, and then close the statement. </p>
+<p>Query may return <a href="#ErrSkip">ErrSkip</a>. </p>
+<p>Deprecated: Drivers should implement <a href="#QueryerContext">QueryerContext</a> instead. </p>
+<pre data-language="go">type Queryer interface {
+ Query(query string, args []Value) (Rows, error)
+}</pre> <h2 id="QueryerContext">type <span>QueryerContext</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>QueryerContext is an optional interface that may be implemented by a <a href="#Conn">Conn</a>. </p>
+<p>If a <a href="#Conn">Conn</a> does not implement QueryerContext, the <span>database/sql.DB.Query</span> will fall back to <a href="#Queryer">Queryer</a>; if the <a href="#Conn">Conn</a> does not implement <a href="#Queryer">Queryer</a> either, <span>database/sql.DB.Query</span> will first prepare a query, execute the statement, and then close the statement. </p>
+<p>QueryContext may return <a href="#ErrSkip">ErrSkip</a>. </p>
+<p>QueryContext must honor the context timeout and return when the context is canceled. </p>
+<pre data-language="go">type QueryerContext interface {
+ QueryContext(ctx context.Context, query string, args []NamedValue) (Rows, error)
+}</pre> <h2 id="Result">type <span>Result</span> </h2> <p>Result is the result of a query execution. </p>
+<pre data-language="go">type Result interface {
+ // LastInsertId returns the database's auto-generated ID
+ // after, for example, an INSERT into a table with primary
+ // key.
+ LastInsertId() (int64, error)
+
+ // RowsAffected returns the number of rows affected by the
+ // query.
+ RowsAffected() (int64, error)
+}</pre> <h2 id="Rows">type <span>Rows</span> </h2> <p>Rows is an iterator over an executed query's results. </p>
+<pre data-language="go">type Rows interface {
+ // Columns returns the names of the columns. The number of
+ // columns of the result is inferred from the length of the
+ // slice. If a particular column name isn't known, an empty
+ // string should be returned for that entry.
+ Columns() []string
+
+ // Close closes the rows iterator.
+ Close() error
+
+ // Next is called to populate the next row of data into
+ // the provided slice. The provided slice will be the same
+ // size as the Columns() are wide.
+ //
+ // Next should return io.EOF when there are no more rows.
+ //
+ // The dest should not be written to outside of Next. Care
+ // should be taken when closing Rows not to modify
+ // a buffer held in dest.
+ Next(dest []Value) error
+}</pre> <h2 id="RowsAffected">type <span>RowsAffected</span> </h2> <p>RowsAffected implements <a href="#Result">Result</a> for an INSERT or UPDATE operation which mutates a number of rows. </p>
+<pre data-language="go">type RowsAffected int64</pre> <h3 id="RowsAffected.LastInsertId">func (RowsAffected) <span>LastInsertId</span> </h3> <pre data-language="go">func (RowsAffected) LastInsertId() (int64, error)</pre> <h3 id="RowsAffected.RowsAffected">func (RowsAffected) <span>RowsAffected</span> </h3> <pre data-language="go">func (v RowsAffected) RowsAffected() (int64, error)</pre> <h2 id="RowsColumnTypeDatabaseTypeName">type <span>RowsColumnTypeDatabaseTypeName</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>RowsColumnTypeDatabaseTypeName may be implemented by <a href="#Rows">Rows</a>. It should return the database system type name without the length. Type names should be uppercase. Examples of returned types: "VARCHAR", "NVARCHAR", "VARCHAR2", "CHAR", "TEXT", "DECIMAL", "SMALLINT", "INT", "BIGINT", "BOOL", "[]BIGINT", "JSONB", "XML", "TIMESTAMP". </p>
+<pre data-language="go">type RowsColumnTypeDatabaseTypeName interface {
+ Rows
+ ColumnTypeDatabaseTypeName(index int) string
+}</pre> <h2 id="RowsColumnTypeLength">type <span>RowsColumnTypeLength</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>RowsColumnTypeLength may be implemented by <a href="#Rows">Rows</a>. It should return the length of the column type if the column is a variable length type. If the column is not a variable length type ok should return false. If length is not limited other than system limits, it should return <span>math.MaxInt64</span>. The following are examples of returned values for various types: </p>
+<pre data-language="go">TEXT (math.MaxInt64, true)
+varchar(10) (10, true)
+nvarchar(10) (10, true)
+decimal (0, false)
+int (0, false)
+bytea(30) (30, true)
+</pre> <pre data-language="go">type RowsColumnTypeLength interface {
+ Rows
+ ColumnTypeLength(index int) (length int64, ok bool)
+}</pre> <h2 id="RowsColumnTypeNullable">type <span>RowsColumnTypeNullable</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>RowsColumnTypeNullable may be implemented by <a href="#Rows">Rows</a>. The nullable value should be true if it is known the column may be null, or false if the column is known to be not nullable. If the column nullability is unknown, ok should be false. </p>
+<pre data-language="go">type RowsColumnTypeNullable interface {
+ Rows
+ ColumnTypeNullable(index int) (nullable, ok bool)
+}</pre> <h2 id="RowsColumnTypePrecisionScale">type <span>RowsColumnTypePrecisionScale</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>RowsColumnTypePrecisionScale may be implemented by <a href="#Rows">Rows</a>. It should return the precision and scale for decimal types. If not applicable, ok should be false. The following are examples of returned values for various types: </p>
+<pre data-language="go">decimal(38, 4) (38, 4, true)
+int (0, 0, false)
+decimal (math.MaxInt64, math.MaxInt64, true)
+</pre> <pre data-language="go">type RowsColumnTypePrecisionScale interface {
+ Rows
+ ColumnTypePrecisionScale(index int) (precision, scale int64, ok bool)
+}</pre> <h2 id="RowsColumnTypeScanType">type <span>RowsColumnTypeScanType</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>RowsColumnTypeScanType may be implemented by <a href="#Rows">Rows</a>. It should return the value type that can be used to scan types into. For example, the database column type "bigint" this should return "<span>reflect.TypeOf</span>(int64(0))". </p>
+<pre data-language="go">type RowsColumnTypeScanType interface {
+ Rows
+ ColumnTypeScanType(index int) reflect.Type
+}</pre> <h2 id="RowsNextResultSet">type <span>RowsNextResultSet</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>RowsNextResultSet extends the <a href="#Rows">Rows</a> interface by providing a way to signal the driver to advance to the next result set. </p>
+<pre data-language="go">type RowsNextResultSet interface {
+ Rows
+
+ // HasNextResultSet is called at the end of the current result set and
+ // reports whether there is another result set after the current one.
+ HasNextResultSet() bool
+
+ // NextResultSet advances the driver to the next result set even
+ // if there are remaining rows in the current result set.
+ //
+ // NextResultSet should return io.EOF when there are no more result sets.
+ NextResultSet() error
+}</pre> <h2 id="SessionResetter">type <span>SessionResetter</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>SessionResetter may be implemented by <a href="#Conn">Conn</a> to allow drivers to reset the session state associated with the connection and to signal a bad connection. </p>
+<pre data-language="go">type SessionResetter interface {
+ // ResetSession is called prior to executing a query on the connection
+ // if the connection has been used before. If the driver returns ErrBadConn
+ // the connection is discarded.
+ ResetSession(ctx context.Context) error
+}</pre> <h2 id="Stmt">type <span>Stmt</span> </h2> <p>Stmt is a prepared statement. It is bound to a <a href="#Conn">Conn</a> and not used by multiple goroutines concurrently. </p>
+<pre data-language="go">type Stmt interface {
+ // Close closes the statement.
+ //
+ // As of Go 1.1, a Stmt will not be closed if it's in use
+ // by any queries.
+ //
+ // Drivers must ensure all network calls made by Close
+ // do not block indefinitely (e.g. apply a timeout).
+ Close() error
+
+ // NumInput returns the number of placeholder parameters.
+ //
+ // If NumInput returns &gt;= 0, the sql package will sanity check
+ // argument counts from callers and return errors to the caller
+ // before the statement's Exec or Query methods are called.
+ //
+ // NumInput may also return -1, if the driver doesn't know
+ // its number of placeholders. In that case, the sql package
+ // will not sanity check Exec or Query argument counts.
+ NumInput() int
+
+ // Exec executes a query that doesn't return rows, such
+ // as an INSERT or UPDATE.
+ //
+ // Deprecated: Drivers should implement StmtExecContext instead (or additionally).
+ Exec(args []Value) (Result, error)
+
+ // Query executes a query that may return rows, such as a
+ // SELECT.
+ //
+ // Deprecated: Drivers should implement StmtQueryContext instead (or additionally).
+ Query(args []Value) (Rows, error)
+}</pre> <h2 id="StmtExecContext">type <span>StmtExecContext</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>StmtExecContext enhances the <a href="#Stmt">Stmt</a> interface by providing Exec with context. </p>
+<pre data-language="go">type StmtExecContext interface {
+ // ExecContext executes a query that doesn't return rows, such
+ // as an INSERT or UPDATE.
+ //
+ // ExecContext must honor the context timeout and return when it is canceled.
+ ExecContext(ctx context.Context, args []NamedValue) (Result, error)
+}</pre> <h2 id="StmtQueryContext">type <span>StmtQueryContext</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>StmtQueryContext enhances the <a href="#Stmt">Stmt</a> interface by providing Query with context. </p>
+<pre data-language="go">type StmtQueryContext interface {
+ // QueryContext executes a query that may return rows, such as a
+ // SELECT.
+ //
+ // QueryContext must honor the context timeout and return when it is canceled.
+ QueryContext(ctx context.Context, args []NamedValue) (Rows, error)
+}</pre> <h2 id="Tx">type <span>Tx</span> </h2> <p>Tx is a transaction. </p>
+<pre data-language="go">type Tx interface {
+ Commit() error
+ Rollback() error
+}</pre> <h2 id="TxOptions">type <span>TxOptions</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>TxOptions holds the transaction options. </p>
+<p>This type should be considered identical to <span>database/sql.TxOptions</span>. </p>
+<pre data-language="go">type TxOptions struct {
+ Isolation IsolationLevel
+ ReadOnly bool
+}
+</pre> <h2 id="Validator">type <span>Validator</span> <span title="Added in Go 1.15">1.15</span> </h2> <p>Validator may be implemented by <a href="#Conn">Conn</a> to allow drivers to signal if a connection is valid or if it should be discarded. </p>
+<p>If implemented, drivers may return the underlying error from queries, even if the connection should be discarded by the connection pool. </p>
+<pre data-language="go">type Validator interface {
+ // IsValid is called prior to placing the connection into the
+ // connection pool. The connection will be discarded if false is returned.
+ IsValid() bool
+}</pre> <h2 id="Value">type <span>Value</span> </h2> <p>Value is a value that drivers must be able to handle. It is either nil, a type handled by a database driver's <a href="#NamedValueChecker">NamedValueChecker</a> interface, or an instance of one of these types: </p>
+<pre data-language="go">int64
+float64
+bool
+[]byte
+string
+time.Time
+</pre> <p>If the driver supports cursors, a returned Value may also implement the <a href="#Rows">Rows</a> interface in this package. This is used, for example, when a user selects a cursor such as "select cursor(select * from my_table) from dual". If the <a href="#Rows">Rows</a> from the select is closed, the cursor <a href="#Rows">Rows</a> will also be closed. </p>
+<pre data-language="go">type Value any</pre> <h2 id="ValueConverter">type <span>ValueConverter</span> </h2> <p>ValueConverter is the interface providing the ConvertValue method. </p>
+<p>Various implementations of ValueConverter are provided by the driver package to provide consistent implementations of conversions between drivers. The ValueConverters have several uses: </p>
+<ul> <li><p>converting from the <a href="#Value">Value</a> types as provided by the sql package into a database table's specific column type and making sure it fits, such as making sure a particular int64 fits in a table's uint16 column. </p></li>
+<li><p>converting a value as given from the database into one of the driver <a href="#Value">Value</a> types. </p></li>
+<li><p>by the <span>database/sql</span> package, for converting from a driver's <a href="#Value">Value</a> type to a user's type in a scan. </p></li>
+</ul> <pre data-language="go">type ValueConverter interface {
+ // ConvertValue converts a value to a driver Value.
+ ConvertValue(v any) (Value, error)
+}</pre> <h2 id="Valuer">type <span>Valuer</span> </h2> <p>Valuer is the interface providing the Value method. </p>
+<p>Types implementing Valuer interface are able to convert themselves to a driver <a href="#Value">Value</a>. </p>
+<pre data-language="go">type Valuer interface {
+ // Value returns a driver Value.
+ // Value must not panic.
+ Value() (Value, error)
+}</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/database/sql/driver/" class="_attribution-link">http://golang.org/pkg/database/sql/driver/</a>
+ </p>
+</div>
diff --git a/devdocs/go/database%2Fsql%2Findex.html b/devdocs/go/database%2Fsql%2Findex.html
new file mode 100644
index 00000000..cc424241
--- /dev/null
+++ b/devdocs/go/database%2Fsql%2Findex.html
@@ -0,0 +1,1151 @@
+<h1> Package sql </h1> <ul id="short-nav">
+<li><code>import "database/sql"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package sql provides a generic interface around SQL (or SQL-like) databases. </p>
+<p>The sql package must be used in conjunction with a database driver. See <a href="https://golang.org/s/sqldrivers">https://golang.org/s/sqldrivers</a> for a list of drivers. </p>
+<p>Drivers that do not support context cancellation will not return until after the query is completed. </p>
+<p>For usage examples, see the wiki page at <a href="https://golang.org/s/sqlwiki">https://golang.org/s/sqlwiki</a>. </p> <h4 id="example__openDBCLI"> <span class="text">Example (OpenDBCLI)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package sql_test
+
+import (
+ "context"
+ "database/sql"
+ "flag"
+ "log"
+ "os"
+ "os/signal"
+ "time"
+)
+
+var pool *sql.DB // Database connection pool.
+
+func Example_openDBCLI() {
+ id := flag.Int64("id", 0, "person ID to find")
+ dsn := flag.String("dsn", os.Getenv("DSN"), "connection data source name")
+ flag.Parse()
+
+ if len(*dsn) == 0 {
+ log.Fatal("missing dsn flag")
+ }
+ if *id == 0 {
+ log.Fatal("missing person ID")
+ }
+ var err error
+
+ // Opening a driver typically will not attempt to connect to the database.
+ pool, err = sql.Open("driver-name", *dsn)
+ if err != nil {
+ // This will not be a connection error, but a DSN parse error or
+ // another initialization error.
+ log.Fatal("unable to use data source name", err)
+ }
+ defer pool.Close()
+
+ pool.SetConnMaxLifetime(0)
+ pool.SetMaxIdleConns(3)
+ pool.SetMaxOpenConns(3)
+
+ ctx, stop := context.WithCancel(context.Background())
+ defer stop()
+
+ appSignal := make(chan os.Signal, 3)
+ signal.Notify(appSignal, os.Interrupt)
+
+ go func() {
+ &lt;-appSignal
+ stop()
+ }()
+
+ Ping(ctx)
+
+ Query(ctx, *id)
+}
+
+// Ping the database to verify DSN provided by the user is valid and the
+// server accessible. If the ping fails exit the program with an error.
+func Ping(ctx context.Context) {
+ ctx, cancel := context.WithTimeout(ctx, 1*time.Second)
+ defer cancel()
+
+ if err := pool.PingContext(ctx); err != nil {
+ log.Fatalf("unable to connect to database: %v", err)
+ }
+}
+
+// Query the database for the information requested and prints the results.
+// If the query fails exit the program with an error.
+func Query(ctx context.Context, id int64) {
+ ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
+ defer cancel()
+
+ var name string
+ err := pool.QueryRowContext(ctx, "select p.name from people as p where p.id = :id;", sql.Named("id", id)).Scan(&amp;name)
+ if err != nil {
+ log.Fatal("unable to execute search query", err)
+ }
+ log.Println("name=", name)
+}
+</pre> <h4 id="example__openDBService"> <span class="text">Example (OpenDBService)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package sql_test
+
+import (
+ "context"
+ "database/sql"
+ "encoding/json"
+ "fmt"
+ "io"
+ "log"
+ "net/http"
+ "time"
+)
+
+func Example_openDBService() {
+ // Opening a driver typically will not attempt to connect to the database.
+ db, err := sql.Open("driver-name", "database=test1")
+ if err != nil {
+ // This will not be a connection error, but a DSN parse error or
+ // another initialization error.
+ log.Fatal(err)
+ }
+ db.SetConnMaxLifetime(0)
+ db.SetMaxIdleConns(50)
+ db.SetMaxOpenConns(50)
+
+ s := &amp;Service{db: db}
+
+ http.ListenAndServe(":8080", s)
+}
+
+type Service struct {
+ db *sql.DB
+}
+
+func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ db := s.db
+ switch r.URL.Path {
+ default:
+ http.Error(w, "not found", http.StatusNotFound)
+ return
+ case "/healthz":
+ ctx, cancel := context.WithTimeout(r.Context(), 1*time.Second)
+ defer cancel()
+
+ err := s.db.PingContext(ctx)
+ if err != nil {
+ http.Error(w, fmt.Sprintf("db down: %v", err), http.StatusFailedDependency)
+ return
+ }
+ w.WriteHeader(http.StatusOK)
+ return
+ case "/quick-action":
+ // This is a short SELECT. Use the request context as the base of
+ // the context timeout.
+ ctx, cancel := context.WithTimeout(r.Context(), 3*time.Second)
+ defer cancel()
+
+ id := 5
+ org := 10
+ var name string
+ err := db.QueryRowContext(ctx, `
+select
+ p.name
+from
+ people as p
+ join organization as o on p.organization = o.id
+where
+ p.id = :id
+ and o.id = :org
+;`,
+ sql.Named("id", id),
+ sql.Named("org", org),
+ ).Scan(&amp;name)
+ if err != nil {
+ if err == sql.ErrNoRows {
+ http.Error(w, "not found", http.StatusNotFound)
+ return
+ }
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ io.WriteString(w, name)
+ return
+ case "/long-action":
+ // This is a long SELECT. Use the request context as the base of
+ // the context timeout, but give it some time to finish. If
+ // the client cancels before the query is done the query will also
+ // be canceled.
+ ctx, cancel := context.WithTimeout(r.Context(), 60*time.Second)
+ defer cancel()
+
+ var names []string
+ rows, err := db.QueryContext(ctx, "select p.name from people as p where p.active = true;")
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+
+ for rows.Next() {
+ var name string
+ err = rows.Scan(&amp;name)
+ if err != nil {
+ break
+ }
+ names = append(names, name)
+ }
+ // Check for errors during rows "Close".
+ // This may be more important if multiple statements are executed
+ // in a single batch and rows were written as well as read.
+ if closeErr := rows.Close(); closeErr != nil {
+ http.Error(w, closeErr.Error(), http.StatusInternalServerError)
+ return
+ }
+
+ // Check for row scan error.
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+
+ // Check for errors during row iteration.
+ if err = rows.Err(); err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+
+ json.NewEncoder(w).Encode(names)
+ return
+ case "/async-action":
+ // This action has side effects that we want to preserve
+ // even if the client cancels the HTTP request part way through.
+ // For this we do not use the http request context as a base for
+ // the timeout.
+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
+ defer cancel()
+
+ var orderRef = "ABC123"
+ tx, err := db.BeginTx(ctx, &amp;sql.TxOptions{Isolation: sql.LevelSerializable})
+ _, err = tx.ExecContext(ctx, "stored_proc_name", orderRef)
+
+ if err != nil {
+ tx.Rollback()
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ err = tx.Commit()
+ if err != nil {
+ http.Error(w, "action in unknown state, check state before attempting again", http.StatusInternalServerError)
+ return
+ }
+ w.WriteHeader(http.StatusOK)
+ return
+ }
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Drivers">func Drivers() []string</a></li>
+<li><a href="#Register">func Register(name string, driver driver.Driver)</a></li>
+<li><a href="#ColumnType">type ColumnType</a></li>
+<li> <a href="#ColumnType.DatabaseTypeName">func (ci *ColumnType) DatabaseTypeName() string</a>
+</li>
+<li> <a href="#ColumnType.DecimalSize">func (ci *ColumnType) DecimalSize() (precision, scale int64, ok bool)</a>
+</li>
+<li> <a href="#ColumnType.Length">func (ci *ColumnType) Length() (length int64, ok bool)</a>
+</li>
+<li> <a href="#ColumnType.Name">func (ci *ColumnType) Name() string</a>
+</li>
+<li> <a href="#ColumnType.Nullable">func (ci *ColumnType) Nullable() (nullable, ok bool)</a>
+</li>
+<li> <a href="#ColumnType.ScanType">func (ci *ColumnType) ScanType() reflect.Type</a>
+</li>
+<li><a href="#Conn">type Conn</a></li>
+<li> <a href="#Conn.BeginTx">func (c *Conn) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error)</a>
+</li>
+<li> <a href="#Conn.Close">func (c *Conn) Close() error</a>
+</li>
+<li> <a href="#Conn.ExecContext">func (c *Conn) ExecContext(ctx context.Context, query string, args ...any) (Result, error)</a>
+</li>
+<li> <a href="#Conn.PingContext">func (c *Conn) PingContext(ctx context.Context) error</a>
+</li>
+<li> <a href="#Conn.PrepareContext">func (c *Conn) PrepareContext(ctx context.Context, query string) (*Stmt, error)</a>
+</li>
+<li> <a href="#Conn.QueryContext">func (c *Conn) QueryContext(ctx context.Context, query string, args ...any) (*Rows, error)</a>
+</li>
+<li> <a href="#Conn.QueryRowContext">func (c *Conn) QueryRowContext(ctx context.Context, query string, args ...any) *Row</a>
+</li>
+<li> <a href="#Conn.Raw">func (c *Conn) Raw(f func(driverConn any) error) (err error)</a>
+</li>
+<li><a href="#DB">type DB</a></li>
+<li> <a href="#Open">func Open(driverName, dataSourceName string) (*DB, error)</a>
+</li>
+<li> <a href="#OpenDB">func OpenDB(c driver.Connector) *DB</a>
+</li>
+<li> <a href="#DB.Begin">func (db *DB) Begin() (*Tx, error)</a>
+</li>
+<li> <a href="#DB.BeginTx">func (db *DB) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error)</a>
+</li>
+<li> <a href="#DB.Close">func (db *DB) Close() error</a>
+</li>
+<li> <a href="#DB.Conn">func (db *DB) Conn(ctx context.Context) (*Conn, error)</a>
+</li>
+<li> <a href="#DB.Driver">func (db *DB) Driver() driver.Driver</a>
+</li>
+<li> <a href="#DB.Exec">func (db *DB) Exec(query string, args ...any) (Result, error)</a>
+</li>
+<li> <a href="#DB.ExecContext">func (db *DB) ExecContext(ctx context.Context, query string, args ...any) (Result, error)</a>
+</li>
+<li> <a href="#DB.Ping">func (db *DB) Ping() error</a>
+</li>
+<li> <a href="#DB.PingContext">func (db *DB) PingContext(ctx context.Context) error</a>
+</li>
+<li> <a href="#DB.Prepare">func (db *DB) Prepare(query string) (*Stmt, error)</a>
+</li>
+<li> <a href="#DB.PrepareContext">func (db *DB) PrepareContext(ctx context.Context, query string) (*Stmt, error)</a>
+</li>
+<li> <a href="#DB.Query">func (db *DB) Query(query string, args ...any) (*Rows, error)</a>
+</li>
+<li> <a href="#DB.QueryContext">func (db *DB) QueryContext(ctx context.Context, query string, args ...any) (*Rows, error)</a>
+</li>
+<li> <a href="#DB.QueryRow">func (db *DB) QueryRow(query string, args ...any) *Row</a>
+</li>
+<li> <a href="#DB.QueryRowContext">func (db *DB) QueryRowContext(ctx context.Context, query string, args ...any) *Row</a>
+</li>
+<li> <a href="#DB.SetConnMaxIdleTime">func (db *DB) SetConnMaxIdleTime(d time.Duration)</a>
+</li>
+<li> <a href="#DB.SetConnMaxLifetime">func (db *DB) SetConnMaxLifetime(d time.Duration)</a>
+</li>
+<li> <a href="#DB.SetMaxIdleConns">func (db *DB) SetMaxIdleConns(n int)</a>
+</li>
+<li> <a href="#DB.SetMaxOpenConns">func (db *DB) SetMaxOpenConns(n int)</a>
+</li>
+<li> <a href="#DB.Stats">func (db *DB) Stats() DBStats</a>
+</li>
+<li><a href="#DBStats">type DBStats</a></li>
+<li><a href="#IsolationLevel">type IsolationLevel</a></li>
+<li> <a href="#IsolationLevel.String">func (i IsolationLevel) String() string</a>
+</li>
+<li><a href="#NamedArg">type NamedArg</a></li>
+<li> <a href="#Named">func Named(name string, value any) NamedArg</a>
+</li>
+<li><a href="#Null">type Null</a></li>
+<li> <a href="#Null.Scan">func (n *Null[T]) Scan(value any) error</a>
+</li>
+<li> <a href="#Null.Value">func (n Null[T]) Value() (driver.Value, error)</a>
+</li>
+<li><a href="#NullBool">type NullBool</a></li>
+<li> <a href="#NullBool.Scan">func (n *NullBool) Scan(value any) error</a>
+</li>
+<li> <a href="#NullBool.Value">func (n NullBool) Value() (driver.Value, error)</a>
+</li>
+<li><a href="#NullByte">type NullByte</a></li>
+<li> <a href="#NullByte.Scan">func (n *NullByte) Scan(value any) error</a>
+</li>
+<li> <a href="#NullByte.Value">func (n NullByte) Value() (driver.Value, error)</a>
+</li>
+<li><a href="#NullFloat64">type NullFloat64</a></li>
+<li> <a href="#NullFloat64.Scan">func (n *NullFloat64) Scan(value any) error</a>
+</li>
+<li> <a href="#NullFloat64.Value">func (n NullFloat64) Value() (driver.Value, error)</a>
+</li>
+<li><a href="#NullInt16">type NullInt16</a></li>
+<li> <a href="#NullInt16.Scan">func (n *NullInt16) Scan(value any) error</a>
+</li>
+<li> <a href="#NullInt16.Value">func (n NullInt16) Value() (driver.Value, error)</a>
+</li>
+<li><a href="#NullInt32">type NullInt32</a></li>
+<li> <a href="#NullInt32.Scan">func (n *NullInt32) Scan(value any) error</a>
+</li>
+<li> <a href="#NullInt32.Value">func (n NullInt32) Value() (driver.Value, error)</a>
+</li>
+<li><a href="#NullInt64">type NullInt64</a></li>
+<li> <a href="#NullInt64.Scan">func (n *NullInt64) Scan(value any) error</a>
+</li>
+<li> <a href="#NullInt64.Value">func (n NullInt64) Value() (driver.Value, error)</a>
+</li>
+<li><a href="#NullString">type NullString</a></li>
+<li> <a href="#NullString.Scan">func (ns *NullString) Scan(value any) error</a>
+</li>
+<li> <a href="#NullString.Value">func (ns NullString) Value() (driver.Value, error)</a>
+</li>
+<li><a href="#NullTime">type NullTime</a></li>
+<li> <a href="#NullTime.Scan">func (n *NullTime) Scan(value any) error</a>
+</li>
+<li> <a href="#NullTime.Value">func (n NullTime) Value() (driver.Value, error)</a>
+</li>
+<li><a href="#Out">type Out</a></li>
+<li><a href="#RawBytes">type RawBytes</a></li>
+<li><a href="#Result">type Result</a></li>
+<li><a href="#Row">type Row</a></li>
+<li> <a href="#Row.Err">func (r *Row) Err() error</a>
+</li>
+<li> <a href="#Row.Scan">func (r *Row) Scan(dest ...any) error</a>
+</li>
+<li><a href="#Rows">type Rows</a></li>
+<li> <a href="#Rows.Close">func (rs *Rows) Close() error</a>
+</li>
+<li> <a href="#Rows.ColumnTypes">func (rs *Rows) ColumnTypes() ([]*ColumnType, error)</a>
+</li>
+<li> <a href="#Rows.Columns">func (rs *Rows) Columns() ([]string, error)</a>
+</li>
+<li> <a href="#Rows.Err">func (rs *Rows) Err() error</a>
+</li>
+<li> <a href="#Rows.Next">func (rs *Rows) Next() bool</a>
+</li>
+<li> <a href="#Rows.NextResultSet">func (rs *Rows) NextResultSet() bool</a>
+</li>
+<li> <a href="#Rows.Scan">func (rs *Rows) Scan(dest ...any) error</a>
+</li>
+<li><a href="#Scanner">type Scanner</a></li>
+<li><a href="#Stmt">type Stmt</a></li>
+<li> <a href="#Stmt.Close">func (s *Stmt) Close() error</a>
+</li>
+<li> <a href="#Stmt.Exec">func (s *Stmt) Exec(args ...any) (Result, error)</a>
+</li>
+<li> <a href="#Stmt.ExecContext">func (s *Stmt) ExecContext(ctx context.Context, args ...any) (Result, error)</a>
+</li>
+<li> <a href="#Stmt.Query">func (s *Stmt) Query(args ...any) (*Rows, error)</a>
+</li>
+<li> <a href="#Stmt.QueryContext">func (s *Stmt) QueryContext(ctx context.Context, args ...any) (*Rows, error)</a>
+</li>
+<li> <a href="#Stmt.QueryRow">func (s *Stmt) QueryRow(args ...any) *Row</a>
+</li>
+<li> <a href="#Stmt.QueryRowContext">func (s *Stmt) QueryRowContext(ctx context.Context, args ...any) *Row</a>
+</li>
+<li><a href="#Tx">type Tx</a></li>
+<li> <a href="#Tx.Commit">func (tx *Tx) Commit() error</a>
+</li>
+<li> <a href="#Tx.Exec">func (tx *Tx) Exec(query string, args ...any) (Result, error)</a>
+</li>
+<li> <a href="#Tx.ExecContext">func (tx *Tx) ExecContext(ctx context.Context, query string, args ...any) (Result, error)</a>
+</li>
+<li> <a href="#Tx.Prepare">func (tx *Tx) Prepare(query string) (*Stmt, error)</a>
+</li>
+<li> <a href="#Tx.PrepareContext">func (tx *Tx) PrepareContext(ctx context.Context, query string) (*Stmt, error)</a>
+</li>
+<li> <a href="#Tx.Query">func (tx *Tx) Query(query string, args ...any) (*Rows, error)</a>
+</li>
+<li> <a href="#Tx.QueryContext">func (tx *Tx) QueryContext(ctx context.Context, query string, args ...any) (*Rows, error)</a>
+</li>
+<li> <a href="#Tx.QueryRow">func (tx *Tx) QueryRow(query string, args ...any) *Row</a>
+</li>
+<li> <a href="#Tx.QueryRowContext">func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...any) *Row</a>
+</li>
+<li> <a href="#Tx.Rollback">func (tx *Tx) Rollback() error</a>
+</li>
+<li> <a href="#Tx.Stmt">func (tx *Tx) Stmt(stmt *Stmt) *Stmt</a>
+</li>
+<li> <a href="#Tx.StmtContext">func (tx *Tx) StmtContext(ctx context.Context, stmt *Stmt) *Stmt</a>
+</li>
+<li><a href="#TxOptions">type TxOptions</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Conn_ExecContext">Conn.ExecContext</a></dd> <dd><a class="exampleLink" href="#example_DB_BeginTx">DB.BeginTx</a></dd> <dd><a class="exampleLink" href="#example_DB_ExecContext">DB.ExecContext</a></dd> <dd><a class="exampleLink" href="#example_DB_PingContext">DB.PingContext</a></dd> <dd><a class="exampleLink" href="#example_DB_Prepare">DB.Prepare</a></dd> <dd><a class="exampleLink" href="#example_DB_QueryContext">DB.QueryContext</a></dd> <dd><a class="exampleLink" href="#example_DB_QueryRowContext">DB.QueryRowContext</a></dd> <dd><a class="exampleLink" href="#example_DB_Query_multipleResultSets">DB.Query (MultipleResultSets)</a></dd> <dd><a class="exampleLink" href="#example_Rows">Rows</a></dd> <dd><a class="exampleLink" href="#example_Stmt">Stmt</a></dd> <dd><a class="exampleLink" href="#example_Stmt_QueryRowContext">Stmt.QueryRowContext</a></dd> <dd><a class="exampleLink" href="#example_Tx_ExecContext">Tx.ExecContext</a></dd> <dd><a class="exampleLink" href="#example_Tx_Prepare">Tx.Prepare</a></dd> <dd><a class="exampleLink" href="#example_Tx_Rollback">Tx.Rollback</a></dd> <dd><a class="exampleLink" href="#example__openDBCLI">Package (OpenDBCLI)</a></dd> <dd><a class="exampleLink" href="#example__openDBService">Package (OpenDBService)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>convert.go</span> <span>ctxutil.go</span> <span>sql.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrConnDone is returned by any operation that is performed on a connection that has already been returned to the connection pool. </p>
+<pre data-language="go">var ErrConnDone = errors.New("sql: connection is already closed")</pre> <p>ErrNoRows is returned by <a href="#Row.Scan">Row.Scan</a> when <a href="#DB.QueryRow">DB.QueryRow</a> doesn't return a row. In such a case, QueryRow returns a placeholder <a href="#Row">*Row</a> value that defers this error until a Scan. </p>
+<pre data-language="go">var ErrNoRows = errors.New("sql: no rows in result set")</pre> <p>ErrTxDone is returned by any operation that is performed on a transaction that has already been committed or rolled back. </p>
+<pre data-language="go">var ErrTxDone = errors.New("sql: transaction has already been committed or rolled back")</pre> <h2 id="Drivers">func <span>Drivers</span> <span title="Added in Go 1.4">1.4</span> </h2> <pre data-language="go">func Drivers() []string</pre> <p>Drivers returns a sorted list of the names of the registered drivers. </p>
+<h2 id="Register">func <span>Register</span> </h2> <pre data-language="go">func Register(name string, driver driver.Driver)</pre> <p>Register makes a database driver available by the provided name. If Register is called twice with the same name or if driver is nil, it panics. </p>
+<h2 id="ColumnType">type <span>ColumnType</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>ColumnType contains the name and type of a column. </p>
+<pre data-language="go">type ColumnType struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ColumnType.DatabaseTypeName">func (*ColumnType) <span>DatabaseTypeName</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (ci *ColumnType) DatabaseTypeName() string</pre> <p>DatabaseTypeName returns the database system name of the column type. If an empty string is returned, then the driver type name is not supported. Consult your driver documentation for a list of driver data types. <a href="#ColumnType.Length">ColumnType.Length</a> specifiers are not included. Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", "INT", and "BIGINT". </p>
+<h3 id="ColumnType.DecimalSize">func (*ColumnType) <span>DecimalSize</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (ci *ColumnType) DecimalSize() (precision, scale int64, ok bool)</pre> <p>DecimalSize returns the scale and precision of a decimal type. If not applicable or if not supported ok is false. </p>
+<h3 id="ColumnType.Length">func (*ColumnType) <span>Length</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (ci *ColumnType) Length() (length int64, ok bool)</pre> <p>Length returns the column type length for variable length column types such as text and binary field types. If the type length is unbounded the value will be <span>math.MaxInt64</span> (any database limits will still apply). If the column type is not variable length, such as an int, or if not supported by the driver ok is false. </p>
+<h3 id="ColumnType.Name">func (*ColumnType) <span>Name</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (ci *ColumnType) Name() string</pre> <p>Name returns the name or alias of the column. </p>
+<h3 id="ColumnType.Nullable">func (*ColumnType) <span>Nullable</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (ci *ColumnType) Nullable() (nullable, ok bool)</pre> <p>Nullable reports whether the column may be null. If a driver does not support this property ok will be false. </p>
+<h3 id="ColumnType.ScanType">func (*ColumnType) <span>ScanType</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (ci *ColumnType) ScanType() reflect.Type</pre> <p>ScanType returns a Go type suitable for scanning into using <a href="#Rows.Scan">Rows.Scan</a>. If a driver does not support this property ScanType will return the type of an empty interface. </p>
+<h2 id="Conn">type <span>Conn</span> <span title="Added in Go 1.9">1.9</span> </h2> <p>Conn represents a single database connection rather than a pool of database connections. Prefer running queries from <a href="#DB">DB</a> unless there is a specific need for a continuous single database connection. </p>
+<p>A Conn must call <a href="#Conn.Close">Conn.Close</a> to return the connection to the database pool and may do so concurrently with a running query. </p>
+<p>After a call to <a href="#Conn.Close">Conn.Close</a>, all operations on the connection fail with <a href="#ErrConnDone">ErrConnDone</a>. </p>
+<pre data-language="go">type Conn struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Conn.BeginTx">func (*Conn) <span>BeginTx</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *Conn) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error)</pre> <p>BeginTx starts a transaction. </p>
+<p>The provided context is used until the transaction is committed or rolled back. If the context is canceled, the sql package will roll back the transaction. <a href="#Tx.Commit">Tx.Commit</a> will return an error if the context provided to BeginTx is canceled. </p>
+<p>The provided <a href="#TxOptions">TxOptions</a> is optional and may be nil if defaults should be used. If a non-default isolation level is used that the driver doesn't support, an error will be returned. </p>
+<h3 id="Conn.Close">func (*Conn) <span>Close</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *Conn) Close() error</pre> <p>Close returns the connection to the connection pool. All operations after a Close will return with <a href="#ErrConnDone">ErrConnDone</a>. Close is safe to call concurrently with other operations and will block until all other operations finish. It may be useful to first cancel any used context and then call close directly after. </p>
+<h3 id="Conn.ExecContext">func (*Conn) <span>ExecContext</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *Conn) ExecContext(ctx context.Context, query string, args ...any) (Result, error)</pre> <p>ExecContext executes a query without returning any rows. The args are for any placeholder parameters in the query. </p> <h4 id="example_Conn_ExecContext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// A *DB is a pool of connections. Call Conn to reserve a connection for
+// exclusive use.
+conn, err := db.Conn(ctx)
+if err != nil {
+ log.Fatal(err)
+}
+defer conn.Close() // Return the connection to the pool.
+id := 41
+result, err := conn.ExecContext(ctx, `UPDATE balances SET balance = balance + 10 WHERE user_id = ?;`, id)
+if err != nil {
+ log.Fatal(err)
+}
+rows, err := result.RowsAffected()
+if err != nil {
+ log.Fatal(err)
+}
+if rows != 1 {
+ log.Fatalf("expected single row affected, got %d rows affected", rows)
+}
+</pre> <h3 id="Conn.PingContext">func (*Conn) <span>PingContext</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *Conn) PingContext(ctx context.Context) error</pre> <p>PingContext verifies the connection to the database is still alive. </p>
+<h3 id="Conn.PrepareContext">func (*Conn) <span>PrepareContext</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *Conn) PrepareContext(ctx context.Context, query string) (*Stmt, error)</pre> <p>PrepareContext creates a prepared statement for later queries or executions. Multiple queries or executions may be run concurrently from the returned statement. The caller must call the statement's <a href="#Stmt.Close">*Stmt.Close</a> method when the statement is no longer needed. </p>
+<p>The provided context is used for the preparation of the statement, not for the execution of the statement. </p>
+<h3 id="Conn.QueryContext">func (*Conn) <span>QueryContext</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *Conn) QueryContext(ctx context.Context, query string, args ...any) (*Rows, error)</pre> <p>QueryContext executes a query that returns rows, typically a SELECT. The args are for any placeholder parameters in the query. </p>
+<h3 id="Conn.QueryRowContext">func (*Conn) <span>QueryRowContext</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *Conn) QueryRowContext(ctx context.Context, query string, args ...any) *Row</pre> <p>QueryRowContext executes a query that is expected to return at most one row. QueryRowContext always returns a non-nil value. Errors are deferred until the <a href="#Row.Scan">*Row.Scan</a> method is called. If the query selects no rows, the <a href="#Row.Scan">*Row.Scan</a> will return <a href="#ErrNoRows">ErrNoRows</a>. Otherwise, the <a href="#Row.Scan">*Row.Scan</a> scans the first selected row and discards the rest. </p>
+<h3 id="Conn.Raw">func (*Conn) <span>Raw</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (c *Conn) Raw(f func(driverConn any) error) (err error)</pre> <p>Raw executes f exposing the underlying driver connection for the duration of f. The driverConn must not be used outside of f. </p>
+<p>Once f returns and err is not <span>driver.ErrBadConn</span>, the <a href="#Conn">Conn</a> will continue to be usable until <a href="#Conn.Close">Conn.Close</a> is called. </p>
+<h2 id="DB">type <span>DB</span> </h2> <p>DB is a database handle representing a pool of zero or more underlying connections. It's safe for concurrent use by multiple goroutines. </p>
+<p>The sql package creates and frees connections automatically; it also maintains a free pool of idle connections. If the database has a concept of per-connection state, such state can be reliably observed within a transaction (<a href="#Tx">Tx</a>) or connection (<a href="#Conn">Conn</a>). Once <a href="#DB.Begin">DB.Begin</a> is called, the returned <a href="#Tx">Tx</a> is bound to a single connection. Once <a href="#Tx.Commit">Tx.Commit</a> or <a href="#Tx.Rollback">Tx.Rollback</a> is called on the transaction, that transaction's connection is returned to <a href="#DB">DB</a>'s idle connection pool. The pool size can be controlled with <a href="#DB.SetMaxIdleConns">DB.SetMaxIdleConns</a>. </p>
+<pre data-language="go">type DB struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Open">func <span>Open</span> </h3> <pre data-language="go">func Open(driverName, dataSourceName string) (*DB, error)</pre> <p>Open opens a database specified by its database driver name and a driver-specific data source name, usually consisting of at least a database name and connection information. </p>
+<p>Most users will open a database via a driver-specific connection helper function that returns a <a href="#DB">*DB</a>. No database drivers are included in the Go standard library. See <a href="https://golang.org/s/sqldrivers">https://golang.org/s/sqldrivers</a> for a list of third-party drivers. </p>
+<p>Open may just validate its arguments without creating a connection to the database. To verify that the data source name is valid, call <a href="#DB.Ping">DB.Ping</a>. </p>
+<p>The returned <a href="#DB">DB</a> is safe for concurrent use by multiple goroutines and maintains its own pool of idle connections. Thus, the Open function should be called just once. It is rarely necessary to close a <a href="#DB">DB</a>. </p>
+<h3 id="OpenDB">func <span>OpenDB</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func OpenDB(c driver.Connector) *DB</pre> <p>OpenDB opens a database using a <span>driver.Connector</span>, allowing drivers to bypass a string based data source name. </p>
+<p>Most users will open a database via a driver-specific connection helper function that returns a <a href="#DB">*DB</a>. No database drivers are included in the Go standard library. See <a href="https://golang.org/s/sqldrivers">https://golang.org/s/sqldrivers</a> for a list of third-party drivers. </p>
+<p>OpenDB may just validate its arguments without creating a connection to the database. To verify that the data source name is valid, call <a href="#DB.Ping">DB.Ping</a>. </p>
+<p>The returned <a href="#DB">DB</a> is safe for concurrent use by multiple goroutines and maintains its own pool of idle connections. Thus, the OpenDB function should be called just once. It is rarely necessary to close a <a href="#DB">DB</a>. </p>
+<h3 id="DB.Begin">func (*DB) <span>Begin</span> </h3> <pre data-language="go">func (db *DB) Begin() (*Tx, error)</pre> <p>Begin starts a transaction. The default isolation level is dependent on the driver. </p>
+<p>Begin uses <span>context.Background</span> internally; to specify the context, use <a href="#DB.BeginTx">DB.BeginTx</a>. </p>
+<h3 id="DB.BeginTx">func (*DB) <span>BeginTx</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (db *DB) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error)</pre> <p>BeginTx starts a transaction. </p>
+<p>The provided context is used until the transaction is committed or rolled back. If the context is canceled, the sql package will roll back the transaction. <a href="#Tx.Commit">Tx.Commit</a> will return an error if the context provided to BeginTx is canceled. </p>
+<p>The provided <a href="#TxOptions">TxOptions</a> is optional and may be nil if defaults should be used. If a non-default isolation level is used that the driver doesn't support, an error will be returned. </p> <h4 id="example_DB_BeginTx"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+tx, err := db.BeginTx(ctx, &amp;sql.TxOptions{Isolation: sql.LevelSerializable})
+if err != nil {
+ log.Fatal(err)
+}
+id := 37
+_, execErr := tx.Exec(`UPDATE users SET status = ? WHERE id = ?`, "paid", id)
+if execErr != nil {
+ _ = tx.Rollback()
+ log.Fatal(execErr)
+}
+if err := tx.Commit(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="DB.Close">func (*DB) <span>Close</span> </h3> <pre data-language="go">func (db *DB) Close() error</pre> <p>Close closes the database and prevents new queries from starting. Close then waits for all queries that have started processing on the server to finish. </p>
+<p>It is rare to Close a <a href="#DB">DB</a>, as the <a href="#DB">DB</a> handle is meant to be long-lived and shared between many goroutines. </p>
+<h3 id="DB.Conn">func (*DB) <span>Conn</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (db *DB) Conn(ctx context.Context) (*Conn, error)</pre> <p>Conn returns a single connection by either opening a new connection or returning an existing connection from the connection pool. Conn will block until either a connection is returned or ctx is canceled. Queries run on the same Conn will be run in the same database session. </p>
+<p>Every Conn must be returned to the database pool after use by calling <a href="#Conn.Close">Conn.Close</a>. </p>
+<h3 id="DB.Driver">func (*DB) <span>Driver</span> </h3> <pre data-language="go">func (db *DB) Driver() driver.Driver</pre> <p>Driver returns the database's underlying driver. </p>
+<h3 id="DB.Exec">func (*DB) <span>Exec</span> </h3> <pre data-language="go">func (db *DB) Exec(query string, args ...any) (Result, error)</pre> <p>Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. </p>
+<p>Exec uses <span>context.Background</span> internally; to specify the context, use <a href="#DB.ExecContext">DB.ExecContext</a>. </p>
+<h3 id="DB.ExecContext">func (*DB) <span>ExecContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (db *DB) ExecContext(ctx context.Context, query string, args ...any) (Result, error)</pre> <p>ExecContext executes a query without returning any rows. The args are for any placeholder parameters in the query. </p> <h4 id="example_DB_ExecContext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+id := 47
+result, err := db.ExecContext(ctx, "UPDATE balances SET balance = balance + 10 WHERE user_id = ?", id)
+if err != nil {
+ log.Fatal(err)
+}
+rows, err := result.RowsAffected()
+if err != nil {
+ log.Fatal(err)
+}
+if rows != 1 {
+ log.Fatalf("expected to affect 1 row, affected %d", rows)
+}
+</pre> <h3 id="DB.Ping">func (*DB) <span>Ping</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (db *DB) Ping() error</pre> <p>Ping verifies a connection to the database is still alive, establishing a connection if necessary. </p>
+<p>Ping uses <span>context.Background</span> internally; to specify the context, use <a href="#DB.PingContext">DB.PingContext</a>. </p>
+<h3 id="DB.PingContext">func (*DB) <span>PingContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (db *DB) PingContext(ctx context.Context) error</pre> <p>PingContext verifies a connection to the database is still alive, establishing a connection if necessary. </p> <h4 id="example_DB_PingContext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Ping and PingContext may be used to determine if communication with
+// the database server is still possible.
+//
+// When used in a command line application Ping may be used to establish
+// that further queries are possible; that the provided DSN is valid.
+//
+// When used in long running service Ping may be part of the health
+// checking system.
+
+ctx, cancel := context.WithTimeout(ctx, 1*time.Second)
+defer cancel()
+
+status := "up"
+if err := db.PingContext(ctx); err != nil {
+ status = "down"
+}
+log.Println(status)
+</pre> <h3 id="DB.Prepare">func (*DB) <span>Prepare</span> </h3> <pre data-language="go">func (db *DB) Prepare(query string) (*Stmt, error)</pre> <p>Prepare creates a prepared statement for later queries or executions. Multiple queries or executions may be run concurrently from the returned statement. The caller must call the statement's <a href="#Stmt.Close">*Stmt.Close</a> method when the statement is no longer needed. </p>
+<p>Prepare uses <span>context.Background</span> internally; to specify the context, use <a href="#DB.PrepareContext">DB.PrepareContext</a>. </p> <h4 id="example_DB_Prepare"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+projects := []struct {
+ mascot string
+ release int
+}{
+ {"tux", 1991},
+ {"duke", 1996},
+ {"gopher", 2009},
+ {"moby dock", 2013},
+}
+
+stmt, err := db.Prepare("INSERT INTO projects(id, mascot, release, category) VALUES( ?, ?, ?, ? )")
+if err != nil {
+ log.Fatal(err)
+}
+defer stmt.Close() // Prepared statements take up server resources and should be closed after use.
+
+for id, project := range projects {
+ if _, err := stmt.Exec(id+1, project.mascot, project.release, "open source"); err != nil {
+ log.Fatal(err)
+ }
+}
+</pre> <h3 id="DB.PrepareContext">func (*DB) <span>PrepareContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (db *DB) PrepareContext(ctx context.Context, query string) (*Stmt, error)</pre> <p>PrepareContext creates a prepared statement for later queries or executions. Multiple queries or executions may be run concurrently from the returned statement. The caller must call the statement's <a href="#Stmt.Close">*Stmt.Close</a> method when the statement is no longer needed. </p>
+<p>The provided context is used for the preparation of the statement, not for the execution of the statement. </p>
+<h3 id="DB.Query">func (*DB) <span>Query</span> </h3> <pre data-language="go">func (db *DB) Query(query string, args ...any) (*Rows, error)</pre> <p>Query executes a query that returns rows, typically a SELECT. The args are for any placeholder parameters in the query. </p>
+<p>Query uses <span>context.Background</span> internally; to specify the context, use <a href="#DB.QueryContext">DB.QueryContext</a>. </p> <h4 id="example_DB_Query_multipleResultSets"> <span class="text">Example (MultipleResultSets)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+age := 27
+q := `
+create temp table uid (id bigint); -- Create temp table for queries.
+insert into uid
+select id from users where age &lt; ?; -- Populate temp table.
+
+-- First result set.
+select
+ users.id, name
+from
+ users
+ join uid on users.id = uid.id
+;
+
+-- Second result set.
+select
+ ur.user, ur.role
+from
+ user_roles as ur
+ join uid on uid.id = ur.user
+;
+ `
+rows, err := db.Query(q, age)
+if err != nil {
+ log.Fatal(err)
+}
+defer rows.Close()
+
+for rows.Next() {
+ var (
+ id int64
+ name string
+ )
+ if err := rows.Scan(&amp;id, &amp;name); err != nil {
+ log.Fatal(err)
+ }
+ log.Printf("id %d name is %s\n", id, name)
+}
+if !rows.NextResultSet() {
+ log.Fatalf("expected more result sets: %v", rows.Err())
+}
+var roleMap = map[int64]string{
+ 1: "user",
+ 2: "admin",
+ 3: "gopher",
+}
+for rows.Next() {
+ var (
+ id int64
+ role int64
+ )
+ if err := rows.Scan(&amp;id, &amp;role); err != nil {
+ log.Fatal(err)
+ }
+ log.Printf("id %d has role %s\n", id, roleMap[role])
+}
+if err := rows.Err(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="DB.QueryContext">func (*DB) <span>QueryContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (db *DB) QueryContext(ctx context.Context, query string, args ...any) (*Rows, error)</pre> <p>QueryContext executes a query that returns rows, typically a SELECT. The args are for any placeholder parameters in the query. </p> <h4 id="example_DB_QueryContext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+age := 27
+rows, err := db.QueryContext(ctx, "SELECT name FROM users WHERE age=?", age)
+if err != nil {
+ log.Fatal(err)
+}
+defer rows.Close()
+names := make([]string, 0)
+
+for rows.Next() {
+ var name string
+ if err := rows.Scan(&amp;name); err != nil {
+ // Check for a scan error.
+ // Query rows will be closed with defer.
+ log.Fatal(err)
+ }
+ names = append(names, name)
+}
+// If the database is being written to ensure to check for Close
+// errors that may be returned from the driver. The query may
+// encounter an auto-commit error and be forced to rollback changes.
+rerr := rows.Close()
+if rerr != nil {
+ log.Fatal(rerr)
+}
+
+// Rows.Err will report the last error encountered by Rows.Scan.
+if err := rows.Err(); err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s are %d years old", strings.Join(names, ", "), age)
+</pre> <h3 id="DB.QueryRow">func (*DB) <span>QueryRow</span> </h3> <pre data-language="go">func (db *DB) QueryRow(query string, args ...any) *Row</pre> <p>QueryRow executes a query that is expected to return at most one row. QueryRow always returns a non-nil value. Errors are deferred until <a href="#Row">Row</a>'s Scan method is called. If the query selects no rows, the <a href="#Row.Scan">*Row.Scan</a> will return <a href="#ErrNoRows">ErrNoRows</a>. Otherwise, <a href="#Row.Scan">*Row.Scan</a> scans the first selected row and discards the rest. </p>
+<p>QueryRow uses <span>context.Background</span> internally; to specify the context, use <a href="#DB.QueryRowContext">DB.QueryRowContext</a>. </p>
+<h3 id="DB.QueryRowContext">func (*DB) <span>QueryRowContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (db *DB) QueryRowContext(ctx context.Context, query string, args ...any) *Row</pre> <p>QueryRowContext executes a query that is expected to return at most one row. QueryRowContext always returns a non-nil value. Errors are deferred until <a href="#Row">Row</a>'s Scan method is called. If the query selects no rows, the <a href="#Row.Scan">*Row.Scan</a> will return <a href="#ErrNoRows">ErrNoRows</a>. Otherwise, <a href="#Row.Scan">*Row.Scan</a> scans the first selected row and discards the rest. </p> <h4 id="example_DB_QueryRowContext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+id := 123
+var username string
+var created time.Time
+err := db.QueryRowContext(ctx, "SELECT username, created_at FROM users WHERE id=?", id).Scan(&amp;username, &amp;created)
+switch {
+case err == sql.ErrNoRows:
+ log.Printf("no user with id %d\n", id)
+case err != nil:
+ log.Fatalf("query error: %v\n", err)
+default:
+ log.Printf("username is %q, account created on %s\n", username, created)
+}
+</pre> <h3 id="DB.SetConnMaxIdleTime">func (*DB) <span>SetConnMaxIdleTime</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (db *DB) SetConnMaxIdleTime(d time.Duration)</pre> <p>SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. </p>
+<p>Expired connections may be closed lazily before reuse. </p>
+<p>If d &lt;= 0, connections are not closed due to a connection's idle time. </p>
+<h3 id="DB.SetConnMaxLifetime">func (*DB) <span>SetConnMaxLifetime</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (db *DB) SetConnMaxLifetime(d time.Duration)</pre> <p>SetConnMaxLifetime sets the maximum amount of time a connection may be reused. </p>
+<p>Expired connections may be closed lazily before reuse. </p>
+<p>If d &lt;= 0, connections are not closed due to a connection's age. </p>
+<h3 id="DB.SetMaxIdleConns">func (*DB) <span>SetMaxIdleConns</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (db *DB) SetMaxIdleConns(n int)</pre> <p>SetMaxIdleConns sets the maximum number of connections in the idle connection pool. </p>
+<p>If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. </p>
+<p>If n &lt;= 0, no idle connections are retained. </p>
+<p>The default max idle connections is currently 2. This may change in a future release. </p>
+<h3 id="DB.SetMaxOpenConns">func (*DB) <span>SetMaxOpenConns</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (db *DB) SetMaxOpenConns(n int)</pre> <p>SetMaxOpenConns sets the maximum number of open connections to the database. </p>
+<p>If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than MaxIdleConns, then MaxIdleConns will be reduced to match the new MaxOpenConns limit. </p>
+<p>If n &lt;= 0, then there is no limit on the number of open connections. The default is 0 (unlimited). </p>
+<h3 id="DB.Stats">func (*DB) <span>Stats</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (db *DB) Stats() DBStats</pre> <p>Stats returns database statistics. </p>
+<h2 id="DBStats">type <span>DBStats</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>DBStats contains database statistics. </p>
+<pre data-language="go">type DBStats struct {
+ MaxOpenConnections int // Maximum number of open connections to the database; added in Go 1.11
+
+ // Pool Status
+ OpenConnections int // The number of established connections both in use and idle.
+ InUse int // The number of connections currently in use; added in Go 1.11
+ Idle int // The number of idle connections; added in Go 1.11
+
+ // Counters
+ WaitCount int64 // The total number of connections waited for; added in Go 1.11
+ WaitDuration time.Duration // The total time blocked waiting for a new connection; added in Go 1.11
+ MaxIdleClosed int64 // The total number of connections closed due to SetMaxIdleConns; added in Go 1.11
+ MaxIdleTimeClosed int64 // The total number of connections closed due to SetConnMaxIdleTime; added in Go 1.15
+ MaxLifetimeClosed int64 // The total number of connections closed due to SetConnMaxLifetime; added in Go 1.11
+}
+</pre> <h2 id="IsolationLevel">type <span>IsolationLevel</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>IsolationLevel is the transaction isolation level used in <a href="#TxOptions">TxOptions</a>. </p>
+<pre data-language="go">type IsolationLevel int</pre> <p>Various isolation levels that drivers may support in <a href="#DB.BeginTx">DB.BeginTx</a>. If a driver does not support a given isolation level an error may be returned. </p>
+<p>See <a href="https://en.wikipedia.org/wiki/Isolation_(database_systems)#Isolation_levels">https://en.wikipedia.org/wiki/Isolation_(database_systems)#Isolation_levels</a>. </p>
+<pre data-language="go">const (
+ LevelDefault IsolationLevel = iota
+ LevelReadUncommitted
+ LevelReadCommitted
+ LevelWriteCommitted
+ LevelRepeatableRead
+ LevelSnapshot
+ LevelSerializable
+ LevelLinearizable
+)</pre> <h3 id="IsolationLevel.String">func (IsolationLevel) <span>String</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (i IsolationLevel) String() string</pre> <p>String returns the name of the transaction isolation level. </p>
+<h2 id="NamedArg">type <span>NamedArg</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>A NamedArg is a named argument. NamedArg values may be used as arguments to <a href="#DB.Query">DB.Query</a> or <a href="#DB.Exec">DB.Exec</a> and bind to the corresponding named parameter in the SQL statement. </p>
+<p>For a more concise way to create NamedArg values, see the <a href="#Named">Named</a> function. </p>
+<pre data-language="go">type NamedArg struct {
+
+ // Name is the name of the parameter placeholder.
+ //
+ // If empty, the ordinal position in the argument list will be
+ // used.
+ //
+ // Name must omit any symbol prefix.
+ Name string
+
+ // Value is the value of the parameter.
+ // It may be assigned the same value types as the query
+ // arguments.
+ Value any
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Named">func <span>Named</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func Named(name string, value any) NamedArg</pre> <p>Named provides a more concise way to create <a href="#NamedArg">NamedArg</a> values. </p>
+<p>Example usage: </p>
+<pre data-language="go">db.ExecContext(ctx, `
+ delete from Invoice
+ where
+ TimeCreated &lt; @end
+ and TimeCreated &gt;= @start;`,
+ sql.Named("start", startTime),
+ sql.Named("end", endTime),
+)
+</pre> <h2 id="Null">type <span>Null</span> </h2> <p>Null represents a value that may be null. Null implements the <a href="#Scanner">Scanner</a> interface so it can be used as a scan destination: </p>
+<pre data-language="go">var s Null[string]
+err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&amp;s)
+...
+if s.Valid {
+ // use s.V
+} else {
+ // NULL value
+}
+</pre> <pre data-language="go">type Null[T any] struct {
+ V T
+ Valid bool
+}
+</pre> <h3 id="Null.Scan">func (*Null[T]) <span>Scan</span> </h3> <pre data-language="go">func (n *Null[T]) Scan(value any) error</pre> <h3 id="Null.Value">func (Null[T]) <span>Value</span> </h3> <pre data-language="go">func (n Null[T]) Value() (driver.Value, error)</pre> <h2 id="NullBool">type <span>NullBool</span> </h2> <p>NullBool represents a bool that may be null. NullBool implements the <a href="#Scanner">Scanner</a> interface so it can be used as a scan destination, similar to <a href="#NullString">NullString</a>. </p>
+<pre data-language="go">type NullBool struct {
+ Bool bool
+ Valid bool // Valid is true if Bool is not NULL
+}
+</pre> <h3 id="NullBool.Scan">func (*NullBool) <span>Scan</span> </h3> <pre data-language="go">func (n *NullBool) Scan(value any) error</pre> <p>Scan implements the <a href="#Scanner">Scanner</a> interface. </p>
+<h3 id="NullBool.Value">func (NullBool) <span>Value</span> </h3> <pre data-language="go">func (n NullBool) Value() (driver.Value, error)</pre> <p>Value implements the <span>driver.Valuer</span> interface. </p>
+<h2 id="NullByte">type <span>NullByte</span> <span title="Added in Go 1.17">1.17</span> </h2> <p>NullByte represents a byte that may be null. NullByte implements the <a href="#Scanner">Scanner</a> interface so it can be used as a scan destination, similar to <a href="#NullString">NullString</a>. </p>
+<pre data-language="go">type NullByte struct {
+ Byte byte
+ Valid bool // Valid is true if Byte is not NULL
+}
+</pre> <h3 id="NullByte.Scan">func (*NullByte) <span>Scan</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (n *NullByte) Scan(value any) error</pre> <p>Scan implements the <a href="#Scanner">Scanner</a> interface. </p>
+<h3 id="NullByte.Value">func (NullByte) <span>Value</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (n NullByte) Value() (driver.Value, error)</pre> <p>Value implements the <span>driver.Valuer</span> interface. </p>
+<h2 id="NullFloat64">type <span>NullFloat64</span> </h2> <p>NullFloat64 represents a float64 that may be null. NullFloat64 implements the <a href="#Scanner">Scanner</a> interface so it can be used as a scan destination, similar to <a href="#NullString">NullString</a>. </p>
+<pre data-language="go">type NullFloat64 struct {
+ Float64 float64
+ Valid bool // Valid is true if Float64 is not NULL
+}
+</pre> <h3 id="NullFloat64.Scan">func (*NullFloat64) <span>Scan</span> </h3> <pre data-language="go">func (n *NullFloat64) Scan(value any) error</pre> <p>Scan implements the <a href="#Scanner">Scanner</a> interface. </p>
+<h3 id="NullFloat64.Value">func (NullFloat64) <span>Value</span> </h3> <pre data-language="go">func (n NullFloat64) Value() (driver.Value, error)</pre> <p>Value implements the <span>driver.Valuer</span> interface. </p>
+<h2 id="NullInt16">type <span>NullInt16</span> <span title="Added in Go 1.17">1.17</span> </h2> <p>NullInt16 represents an int16 that may be null. NullInt16 implements the <a href="#Scanner">Scanner</a> interface so it can be used as a scan destination, similar to <a href="#NullString">NullString</a>. </p>
+<pre data-language="go">type NullInt16 struct {
+ Int16 int16
+ Valid bool // Valid is true if Int16 is not NULL
+}
+</pre> <h3 id="NullInt16.Scan">func (*NullInt16) <span>Scan</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (n *NullInt16) Scan(value any) error</pre> <p>Scan implements the <a href="#Scanner">Scanner</a> interface. </p>
+<h3 id="NullInt16.Value">func (NullInt16) <span>Value</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (n NullInt16) Value() (driver.Value, error)</pre> <p>Value implements the <span>driver.Valuer</span> interface. </p>
+<h2 id="NullInt32">type <span>NullInt32</span> <span title="Added in Go 1.13">1.13</span> </h2> <p>NullInt32 represents an int32 that may be null. NullInt32 implements the <a href="#Scanner">Scanner</a> interface so it can be used as a scan destination, similar to <a href="#NullString">NullString</a>. </p>
+<pre data-language="go">type NullInt32 struct {
+ Int32 int32
+ Valid bool // Valid is true if Int32 is not NULL
+}
+</pre> <h3 id="NullInt32.Scan">func (*NullInt32) <span>Scan</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (n *NullInt32) Scan(value any) error</pre> <p>Scan implements the <a href="#Scanner">Scanner</a> interface. </p>
+<h3 id="NullInt32.Value">func (NullInt32) <span>Value</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (n NullInt32) Value() (driver.Value, error)</pre> <p>Value implements the <span>driver.Valuer</span> interface. </p>
+<h2 id="NullInt64">type <span>NullInt64</span> </h2> <p>NullInt64 represents an int64 that may be null. NullInt64 implements the <a href="#Scanner">Scanner</a> interface so it can be used as a scan destination, similar to <a href="#NullString">NullString</a>. </p>
+<pre data-language="go">type NullInt64 struct {
+ Int64 int64
+ Valid bool // Valid is true if Int64 is not NULL
+}
+</pre> <h3 id="NullInt64.Scan">func (*NullInt64) <span>Scan</span> </h3> <pre data-language="go">func (n *NullInt64) Scan(value any) error</pre> <p>Scan implements the <a href="#Scanner">Scanner</a> interface. </p>
+<h3 id="NullInt64.Value">func (NullInt64) <span>Value</span> </h3> <pre data-language="go">func (n NullInt64) Value() (driver.Value, error)</pre> <p>Value implements the <span>driver.Valuer</span> interface. </p>
+<h2 id="NullString">type <span>NullString</span> </h2> <p>NullString represents a string that may be null. NullString implements the <a href="#Scanner">Scanner</a> interface so it can be used as a scan destination: </p>
+<pre data-language="go">var s NullString
+err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&amp;s)
+...
+if s.Valid {
+ // use s.String
+} else {
+ // NULL value
+}
+</pre> <pre data-language="go">type NullString struct {
+ String string
+ Valid bool // Valid is true if String is not NULL
+}
+</pre> <h3 id="NullString.Scan">func (*NullString) <span>Scan</span> </h3> <pre data-language="go">func (ns *NullString) Scan(value any) error</pre> <p>Scan implements the <a href="#Scanner">Scanner</a> interface. </p>
+<h3 id="NullString.Value">func (NullString) <span>Value</span> </h3> <pre data-language="go">func (ns NullString) Value() (driver.Value, error)</pre> <p>Value implements the <span>driver.Valuer</span> interface. </p>
+<h2 id="NullTime">type <span>NullTime</span> <span title="Added in Go 1.13">1.13</span> </h2> <p>NullTime represents a <span>time.Time</span> that may be null. NullTime implements the <a href="#Scanner">Scanner</a> interface so it can be used as a scan destination, similar to <a href="#NullString">NullString</a>. </p>
+<pre data-language="go">type NullTime struct {
+ Time time.Time
+ Valid bool // Valid is true if Time is not NULL
+}
+</pre> <h3 id="NullTime.Scan">func (*NullTime) <span>Scan</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (n *NullTime) Scan(value any) error</pre> <p>Scan implements the <a href="#Scanner">Scanner</a> interface. </p>
+<h3 id="NullTime.Value">func (NullTime) <span>Value</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (n NullTime) Value() (driver.Value, error)</pre> <p>Value implements the <span>driver.Valuer</span> interface. </p>
+<h2 id="Out">type <span>Out</span> <span title="Added in Go 1.9">1.9</span> </h2> <p>Out may be used to retrieve OUTPUT value parameters from stored procedures. </p>
+<p>Not all drivers and databases support OUTPUT value parameters. </p>
+<p>Example usage: </p>
+<pre data-language="go">var outArg string
+_, err := db.ExecContext(ctx, "ProcName", sql.Named("Arg1", sql.Out{Dest: &amp;outArg}))
+</pre> <pre data-language="go">type Out struct {
+
+ // Dest is a pointer to the value that will be set to the result of the
+ // stored procedure's OUTPUT parameter.
+ Dest any
+
+ // In is whether the parameter is an INOUT parameter. If so, the input value to the stored
+ // procedure is the dereferenced value of Dest's pointer, which is then replaced with
+ // the output value.
+ In bool
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="RawBytes">type <span>RawBytes</span> </h2> <p>RawBytes is a byte slice that holds a reference to memory owned by the database itself. After a <a href="#Rows.Scan">Rows.Scan</a> into a RawBytes, the slice is only valid until the next call to <a href="#Rows.Next">Rows.Next</a>, <a href="#Rows.Scan">Rows.Scan</a>, or <a href="#Rows.Close">Rows.Close</a>. </p>
+<pre data-language="go">type RawBytes []byte</pre> <h2 id="Result">type <span>Result</span> </h2> <p>A Result summarizes an executed SQL command. </p>
+<pre data-language="go">type Result interface {
+ // LastInsertId returns the integer generated by the database
+ // in response to a command. Typically this will be from an
+ // "auto increment" column when inserting a new row. Not all
+ // databases support this feature, and the syntax of such
+ // statements varies.
+ LastInsertId() (int64, error)
+
+ // RowsAffected returns the number of rows affected by an
+ // update, insert, or delete. Not every database or database
+ // driver may support this.
+ RowsAffected() (int64, error)
+}</pre> <h2 id="Row">type <span>Row</span> </h2> <p>Row is the result of calling <a href="#DB.QueryRow">DB.QueryRow</a> to select a single row. </p>
+<pre data-language="go">type Row struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Row.Err">func (*Row) <span>Err</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (r *Row) Err() error</pre> <p>Err provides a way for wrapping packages to check for query errors without calling <a href="#Row.Scan">Row.Scan</a>. Err returns the error, if any, that was encountered while running the query. If this error is not nil, this error will also be returned from <a href="#Row.Scan">Row.Scan</a>. </p>
+<h3 id="Row.Scan">func (*Row) <span>Scan</span> </h3> <pre data-language="go">func (r *Row) Scan(dest ...any) error</pre> <p>Scan copies the columns from the matched row into the values pointed at by dest. See the documentation on <a href="#Rows.Scan">Rows.Scan</a> for details. If more than one row matches the query, Scan uses the first row and discards the rest. If no row matches the query, Scan returns <a href="#ErrNoRows">ErrNoRows</a>. </p>
+<h2 id="Rows">type <span>Rows</span> </h2> <p>Rows is the result of a query. Its cursor starts before the first row of the result set. Use <a href="#Rows.Next">Rows.Next</a> to advance from row to row. </p>
+<pre data-language="go">type Rows struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Rows"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+age := 27
+rows, err := db.QueryContext(ctx, "SELECT name FROM users WHERE age=?", age)
+if err != nil {
+ log.Fatal(err)
+}
+defer rows.Close()
+
+names := make([]string, 0)
+for rows.Next() {
+ var name string
+ if err := rows.Scan(&amp;name); err != nil {
+ log.Fatal(err)
+ }
+ names = append(names, name)
+}
+// Check for errors from iterating over rows.
+if err := rows.Err(); err != nil {
+ log.Fatal(err)
+}
+log.Printf("%s are %d years old", strings.Join(names, ", "), age)
+</pre> <h3 id="Rows.Close">func (*Rows) <span>Close</span> </h3> <pre data-language="go">func (rs *Rows) Close() error</pre> <p>Close closes the <a href="#Rows">Rows</a>, preventing further enumeration. If <a href="#Rows.Next">Rows.Next</a> is called and returns false and there are no further result sets, the <a href="#Rows">Rows</a> are closed automatically and it will suffice to check the result of <a href="#Rows.Err">Rows.Err</a>. Close is idempotent and does not affect the result of <a href="#Rows.Err">Rows.Err</a>. </p>
+<h3 id="Rows.ColumnTypes">func (*Rows) <span>ColumnTypes</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (rs *Rows) ColumnTypes() ([]*ColumnType, error)</pre> <p>ColumnTypes returns column information such as column type, length, and nullable. Some information may not be available from some drivers. </p>
+<h3 id="Rows.Columns">func (*Rows) <span>Columns</span> </h3> <pre data-language="go">func (rs *Rows) Columns() ([]string, error)</pre> <p>Columns returns the column names. Columns returns an error if the rows are closed. </p>
+<h3 id="Rows.Err">func (*Rows) <span>Err</span> </h3> <pre data-language="go">func (rs *Rows) Err() error</pre> <p>Err returns the error, if any, that was encountered during iteration. Err may be called after an explicit or implicit <a href="#Rows.Close">Rows.Close</a>. </p>
+<h3 id="Rows.Next">func (*Rows) <span>Next</span> </h3> <pre data-language="go">func (rs *Rows) Next() bool</pre> <p>Next prepares the next result row for reading with the <a href="#Rows.Scan">Rows.Scan</a> method. It returns true on success, or false if there is no next result row or an error happened while preparing it. <a href="#Rows.Err">Rows.Err</a> should be consulted to distinguish between the two cases. </p>
+<p>Every call to <a href="#Rows.Scan">Rows.Scan</a>, even the first one, must be preceded by a call to <a href="#Rows.Next">Rows.Next</a>. </p>
+<h3 id="Rows.NextResultSet">func (*Rows) <span>NextResultSet</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (rs *Rows) NextResultSet() bool</pre> <p>NextResultSet prepares the next result set for reading. It reports whether there is further result sets, or false if there is no further result set or if there is an error advancing to it. The <a href="#Rows.Err">Rows.Err</a> method should be consulted to distinguish between the two cases. </p>
+<p>After calling NextResultSet, the <a href="#Rows.Next">Rows.Next</a> method should always be called before scanning. If there are further result sets they may not have rows in the result set. </p>
+<h3 id="Rows.Scan">func (*Rows) <span>Scan</span> </h3> <pre data-language="go">func (rs *Rows) Scan(dest ...any) error</pre> <p>Scan copies the columns in the current row into the values pointed at by dest. The number of values in dest must be the same as the number of columns in <a href="#Rows">Rows</a>. </p>
+<p>Scan converts columns read from the database into the following common Go types and special types provided by the sql package: </p>
+<pre data-language="go">*string
+*[]byte
+*int, *int8, *int16, *int32, *int64
+*uint, *uint8, *uint16, *uint32, *uint64
+*bool
+*float32, *float64
+*interface{}
+*RawBytes
+*Rows (cursor value)
+any type implementing Scanner (see Scanner docs)
+</pre> <p>In the most simple case, if the type of the value from the source column is an integer, bool or string type T and dest is of type *T, Scan simply assigns the value through the pointer. </p>
+<p>Scan also converts between string and numeric types, as long as no information would be lost. While Scan stringifies all numbers scanned from numeric database columns into *string, scans into numeric types are checked for overflow. For example, a float64 with value 300 or a string with value "300" can scan into a uint16, but not into a uint8, though float64(255) or "255" can scan into a uint8. One exception is that scans of some float64 numbers to strings may lose information when stringifying. In general, scan floating point columns into *float64. </p>
+<p>If a dest argument has type *[]byte, Scan saves in that argument a copy of the corresponding data. The copy is owned by the caller and can be modified and held indefinitely. The copy can be avoided by using an argument of type <a href="#RawBytes">*RawBytes</a> instead; see the documentation for <a href="#RawBytes">RawBytes</a> for restrictions on its use. </p>
+<p>If an argument has type *interface{}, Scan copies the value provided by the underlying driver without conversion. When scanning from a source value of type []byte to *interface{}, a copy of the slice is made and the caller owns the result. </p>
+<p>Source values of type <span>time.Time</span> may be scanned into values of type *time.Time, *interface{}, *string, or *[]byte. When converting to the latter two, <span>time.RFC3339Nano</span> is used. </p>
+<p>Source values of type bool may be scanned into types *bool, *interface{}, *string, *[]byte, or <a href="#RawBytes">*RawBytes</a>. </p>
+<p>For scanning into *bool, the source may be true, false, 1, 0, or string inputs parseable by <span>strconv.ParseBool</span>. </p>
+<p>Scan can also convert a cursor returned from a query, such as "select cursor(select * from my_table) from dual", into a <a href="#Rows">*Rows</a> value that can itself be scanned from. The parent select query will close any cursor <a href="#Rows">*Rows</a> if the parent <a href="#Rows">*Rows</a> is closed. </p>
+<p>If any of the first arguments implementing <a href="#Scanner">Scanner</a> returns an error, that error will be wrapped in the returned error. </p>
+<h2 id="Scanner">type <span>Scanner</span> </h2> <p>Scanner is an interface used by <a href="#Rows.Scan">Rows.Scan</a>. </p>
+<pre data-language="go">type Scanner interface {
+ // Scan assigns a value from a database driver.
+ //
+ // The src value will be of one of the following types:
+ //
+ // int64
+ // float64
+ // bool
+ // []byte
+ // string
+ // time.Time
+ // nil - for NULL values
+ //
+ // An error should be returned if the value cannot be stored
+ // without loss of information.
+ //
+ // Reference types such as []byte are only valid until the next call to Scan
+ // and should not be retained. Their underlying memory is owned by the driver.
+ // If retention is necessary, copy their values before the next call to Scan.
+ Scan(src any) error
+}</pre> <h2 id="Stmt">type <span>Stmt</span> </h2> <p>Stmt is a prepared statement. A Stmt is safe for concurrent use by multiple goroutines. </p>
+<p>If a Stmt is prepared on a <a href="#Tx">Tx</a> or <a href="#Conn">Conn</a>, it will be bound to a single underlying connection forever. If the <a href="#Tx">Tx</a> or <a href="#Conn">Conn</a> closes, the Stmt will become unusable and all operations will return an error. If a Stmt is prepared on a <a href="#DB">DB</a>, it will remain usable for the lifetime of the <a href="#DB">DB</a>. When the Stmt needs to execute on a new underlying connection, it will prepare itself on the new connection automatically. </p>
+<pre data-language="go">type Stmt struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Stmt"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// In normal use, create one Stmt when your process starts.
+stmt, err := db.PrepareContext(ctx, "SELECT username FROM users WHERE id = ?")
+if err != nil {
+ log.Fatal(err)
+}
+defer stmt.Close()
+
+// Then reuse it each time you need to issue the query.
+id := 43
+var username string
+err = stmt.QueryRowContext(ctx, id).Scan(&amp;username)
+switch {
+case err == sql.ErrNoRows:
+ log.Fatalf("no user with id %d", id)
+case err != nil:
+ log.Fatal(err)
+default:
+ log.Printf("username is %s\n", username)
+}
+</pre> <h3 id="Stmt.Close">func (*Stmt) <span>Close</span> </h3> <pre data-language="go">func (s *Stmt) Close() error</pre> <p>Close closes the statement. </p>
+<h3 id="Stmt.Exec">func (*Stmt) <span>Exec</span> </h3> <pre data-language="go">func (s *Stmt) Exec(args ...any) (Result, error)</pre> <p>Exec executes a prepared statement with the given arguments and returns a <a href="#Result">Result</a> summarizing the effect of the statement. </p>
+<p>Exec uses <span>context.Background</span> internally; to specify the context, use <a href="#Stmt.ExecContext">Stmt.ExecContext</a>. </p>
+<h3 id="Stmt.ExecContext">func (*Stmt) <span>ExecContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (s *Stmt) ExecContext(ctx context.Context, args ...any) (Result, error)</pre> <p>ExecContext executes a prepared statement with the given arguments and returns a <a href="#Result">Result</a> summarizing the effect of the statement. </p>
+<h3 id="Stmt.Query">func (*Stmt) <span>Query</span> </h3> <pre data-language="go">func (s *Stmt) Query(args ...any) (*Rows, error)</pre> <p>Query executes a prepared query statement with the given arguments and returns the query results as a *Rows. </p>
+<p>Query uses <span>context.Background</span> internally; to specify the context, use <a href="#Stmt.QueryContext">Stmt.QueryContext</a>. </p>
+<h3 id="Stmt.QueryContext">func (*Stmt) <span>QueryContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (s *Stmt) QueryContext(ctx context.Context, args ...any) (*Rows, error)</pre> <p>QueryContext executes a prepared query statement with the given arguments and returns the query results as a <a href="#Rows">*Rows</a>. </p>
+<h3 id="Stmt.QueryRow">func (*Stmt) <span>QueryRow</span> </h3> <pre data-language="go">func (s *Stmt) QueryRow(args ...any) *Row</pre> <p>QueryRow executes a prepared query statement with the given arguments. If an error occurs during the execution of the statement, that error will be returned by a call to Scan on the returned <a href="#Row">*Row</a>, which is always non-nil. If the query selects no rows, the <a href="#Row.Scan">*Row.Scan</a> will return <a href="#ErrNoRows">ErrNoRows</a>. Otherwise, the <a href="#Row.Scan">*Row.Scan</a> scans the first selected row and discards the rest. </p>
+<p>Example usage: </p>
+<pre data-language="go">var name string
+err := nameByUseridStmt.QueryRow(id).Scan(&amp;name)
+</pre> <p>QueryRow uses <span>context.Background</span> internally; to specify the context, use <a href="#Stmt.QueryRowContext">Stmt.QueryRowContext</a>. </p>
+<h3 id="Stmt.QueryRowContext">func (*Stmt) <span>QueryRowContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (s *Stmt) QueryRowContext(ctx context.Context, args ...any) *Row</pre> <p>QueryRowContext executes a prepared query statement with the given arguments. If an error occurs during the execution of the statement, that error will be returned by a call to Scan on the returned <a href="#Row">*Row</a>, which is always non-nil. If the query selects no rows, the <a href="#Row.Scan">*Row.Scan</a> will return <a href="#ErrNoRows">ErrNoRows</a>. Otherwise, the <a href="#Row.Scan">*Row.Scan</a> scans the first selected row and discards the rest. </p> <h4 id="example_Stmt_QueryRowContext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// In normal use, create one Stmt when your process starts.
+stmt, err := db.PrepareContext(ctx, "SELECT username FROM users WHERE id = ?")
+if err != nil {
+ log.Fatal(err)
+}
+defer stmt.Close()
+
+// Then reuse it each time you need to issue the query.
+id := 43
+var username string
+err = stmt.QueryRowContext(ctx, id).Scan(&amp;username)
+switch {
+case err == sql.ErrNoRows:
+ log.Fatalf("no user with id %d", id)
+case err != nil:
+ log.Fatal(err)
+default:
+ log.Printf("username is %s\n", username)
+}
+</pre> <h2 id="Tx">type <span>Tx</span> </h2> <p>Tx is an in-progress database transaction. </p>
+<p>A transaction must end with a call to <a href="#Tx.Commit">Tx.Commit</a> or <a href="#Tx.Rollback">Tx.Rollback</a>. </p>
+<p>After a call to <a href="#Tx.Commit">Tx.Commit</a> or <a href="#Tx.Rollback">Tx.Rollback</a>, all operations on the transaction fail with <a href="#ErrTxDone">ErrTxDone</a>. </p>
+<p>The statements prepared for a transaction by calling the transaction's <a href="#Tx.Prepare">Tx.Prepare</a> or <a href="#Tx.Stmt">Tx.Stmt</a> methods are closed by the call to <a href="#Tx.Commit">Tx.Commit</a> or <a href="#Tx.Rollback">Tx.Rollback</a>. </p>
+<pre data-language="go">type Tx struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Tx.Commit">func (*Tx) <span>Commit</span> </h3> <pre data-language="go">func (tx *Tx) Commit() error</pre> <p>Commit commits the transaction. </p>
+<h3 id="Tx.Exec">func (*Tx) <span>Exec</span> </h3> <pre data-language="go">func (tx *Tx) Exec(query string, args ...any) (Result, error)</pre> <p>Exec executes a query that doesn't return rows. For example: an INSERT and UPDATE. </p>
+<p>Exec uses <span>context.Background</span> internally; to specify the context, use <a href="#Tx.ExecContext">Tx.ExecContext</a>. </p>
+<h3 id="Tx.ExecContext">func (*Tx) <span>ExecContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (tx *Tx) ExecContext(ctx context.Context, query string, args ...any) (Result, error)</pre> <p>ExecContext executes a query that doesn't return rows. For example: an INSERT and UPDATE. </p> <h4 id="example_Tx_ExecContext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+tx, err := db.BeginTx(ctx, &amp;sql.TxOptions{Isolation: sql.LevelSerializable})
+if err != nil {
+ log.Fatal(err)
+}
+id := 37
+_, execErr := tx.ExecContext(ctx, "UPDATE users SET status = ? WHERE id = ?", "paid", id)
+if execErr != nil {
+ if rollbackErr := tx.Rollback(); rollbackErr != nil {
+ log.Fatalf("update failed: %v, unable to rollback: %v\n", execErr, rollbackErr)
+ }
+ log.Fatalf("update failed: %v", execErr)
+}
+if err := tx.Commit(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="Tx.Prepare">func (*Tx) <span>Prepare</span> </h3> <pre data-language="go">func (tx *Tx) Prepare(query string) (*Stmt, error)</pre> <p>Prepare creates a prepared statement for use within a transaction. </p>
+<p>The returned statement operates within the transaction and will be closed when the transaction has been committed or rolled back. </p>
+<p>To use an existing prepared statement on this transaction, see <a href="#Tx.Stmt">Tx.Stmt</a>. </p>
+<p>Prepare uses <span>context.Background</span> internally; to specify the context, use <a href="#Tx.PrepareContext">Tx.PrepareContext</a>. </p> <h4 id="example_Tx_Prepare"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+projects := []struct {
+ mascot string
+ release int
+}{
+ {"tux", 1991},
+ {"duke", 1996},
+ {"gopher", 2009},
+ {"moby dock", 2013},
+}
+
+tx, err := db.Begin()
+if err != nil {
+ log.Fatal(err)
+}
+defer tx.Rollback() // The rollback will be ignored if the tx has been committed later in the function.
+
+stmt, err := tx.Prepare("INSERT INTO projects(id, mascot, release, category) VALUES( ?, ?, ?, ? )")
+if err != nil {
+ log.Fatal(err)
+}
+defer stmt.Close() // Prepared statements take up server resources and should be closed after use.
+
+for id, project := range projects {
+ if _, err := stmt.Exec(id+1, project.mascot, project.release, "open source"); err != nil {
+ log.Fatal(err)
+ }
+}
+if err := tx.Commit(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="Tx.PrepareContext">func (*Tx) <span>PrepareContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (tx *Tx) PrepareContext(ctx context.Context, query string) (*Stmt, error)</pre> <p>PrepareContext creates a prepared statement for use within a transaction. </p>
+<p>The returned statement operates within the transaction and will be closed when the transaction has been committed or rolled back. </p>
+<p>To use an existing prepared statement on this transaction, see <a href="#Tx.Stmt">Tx.Stmt</a>. </p>
+<p>The provided context will be used for the preparation of the context, not for the execution of the returned statement. The returned statement will run in the transaction context. </p>
+<h3 id="Tx.Query">func (*Tx) <span>Query</span> </h3> <pre data-language="go">func (tx *Tx) Query(query string, args ...any) (*Rows, error)</pre> <p>Query executes a query that returns rows, typically a SELECT. </p>
+<p>Query uses <span>context.Background</span> internally; to specify the context, use <a href="#Tx.QueryContext">Tx.QueryContext</a>. </p>
+<h3 id="Tx.QueryContext">func (*Tx) <span>QueryContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (tx *Tx) QueryContext(ctx context.Context, query string, args ...any) (*Rows, error)</pre> <p>QueryContext executes a query that returns rows, typically a SELECT. </p>
+<h3 id="Tx.QueryRow">func (*Tx) <span>QueryRow</span> </h3> <pre data-language="go">func (tx *Tx) QueryRow(query string, args ...any) *Row</pre> <p>QueryRow executes a query that is expected to return at most one row. QueryRow always returns a non-nil value. Errors are deferred until <a href="#Row">Row</a>'s Scan method is called. If the query selects no rows, the <a href="#Row.Scan">*Row.Scan</a> will return <a href="#ErrNoRows">ErrNoRows</a>. Otherwise, the <a href="#Row.Scan">*Row.Scan</a> scans the first selected row and discards the rest. </p>
+<p>QueryRow uses <span>context.Background</span> internally; to specify the context, use <a href="#Tx.QueryRowContext">Tx.QueryRowContext</a>. </p>
+<h3 id="Tx.QueryRowContext">func (*Tx) <span>QueryRowContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...any) *Row</pre> <p>QueryRowContext executes a query that is expected to return at most one row. QueryRowContext always returns a non-nil value. Errors are deferred until <a href="#Row">Row</a>'s Scan method is called. If the query selects no rows, the <a href="#Row.Scan">*Row.Scan</a> will return <a href="#ErrNoRows">ErrNoRows</a>. Otherwise, the <a href="#Row.Scan">*Row.Scan</a> scans the first selected row and discards the rest. </p>
+<h3 id="Tx.Rollback">func (*Tx) <span>Rollback</span> </h3> <pre data-language="go">func (tx *Tx) Rollback() error</pre> <p>Rollback aborts the transaction. </p> <h4 id="example_Tx_Rollback"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+tx, err := db.BeginTx(ctx, &amp;sql.TxOptions{Isolation: sql.LevelSerializable})
+if err != nil {
+ log.Fatal(err)
+}
+id := 53
+_, err = tx.ExecContext(ctx, "UPDATE drivers SET status = ? WHERE id = ?;", "assigned", id)
+if err != nil {
+ if rollbackErr := tx.Rollback(); rollbackErr != nil {
+ log.Fatalf("update drivers: unable to rollback: %v", rollbackErr)
+ }
+ log.Fatal(err)
+}
+_, err = tx.ExecContext(ctx, "UPDATE pickups SET driver_id = $1;", id)
+if err != nil {
+ if rollbackErr := tx.Rollback(); rollbackErr != nil {
+ log.Fatalf("update failed: %v, unable to back: %v", err, rollbackErr)
+ }
+ log.Fatal(err)
+}
+if err := tx.Commit(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="Tx.Stmt">func (*Tx) <span>Stmt</span> </h3> <pre data-language="go">func (tx *Tx) Stmt(stmt *Stmt) *Stmt</pre> <p>Stmt returns a transaction-specific prepared statement from an existing statement. </p>
+<p>Example: </p>
+<pre data-language="go">updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?")
+...
+tx, err := db.Begin()
+...
+res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203)
+</pre> <p>The returned statement operates within the transaction and will be closed when the transaction has been committed or rolled back. </p>
+<p>Stmt uses <span>context.Background</span> internally; to specify the context, use <a href="#Tx.StmtContext">Tx.StmtContext</a>. </p>
+<h3 id="Tx.StmtContext">func (*Tx) <span>StmtContext</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (tx *Tx) StmtContext(ctx context.Context, stmt *Stmt) *Stmt</pre> <p>StmtContext returns a transaction-specific prepared statement from an existing statement. </p>
+<p>Example: </p>
+<pre data-language="go">updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?")
+...
+tx, err := db.Begin()
+...
+res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203)
+</pre> <p>The provided context is used for the preparation of the statement, not for the execution of the statement. </p>
+<p>The returned statement operates within the transaction and will be closed when the transaction has been committed or rolled back. </p>
+<h2 id="TxOptions">type <span>TxOptions</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>TxOptions holds the transaction options to be used in <a href="#DB.BeginTx">DB.BeginTx</a>. </p>
+<pre data-language="go">type TxOptions struct {
+ // Isolation is the transaction isolation level.
+ // If zero, the driver or database's default level is used.
+ Isolation IsolationLevel
+ ReadOnly bool
+}
+</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="driver/index">driver</a> </td> <td class="pkg-synopsis"> Package driver defines interfaces to be implemented by database drivers as used by package sql. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/database/sql/" class="_attribution-link">http://golang.org/pkg/database/sql/</a>
+ </p>
+</div>
diff --git a/devdocs/go/debug%2Fbuildinfo%2Findex.html b/devdocs/go/debug%2Fbuildinfo%2Findex.html
new file mode 100644
index 00000000..beb6cce0
--- /dev/null
+++ b/devdocs/go/debug%2Fbuildinfo%2Findex.html
@@ -0,0 +1,19 @@
+<h1> Package buildinfo </h1> <ul id="short-nav">
+<li><code>import "debug/buildinfo"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package buildinfo provides access to information embedded in a Go binary about how it was built. This includes the Go toolchain version, and the set of modules used (for binaries built in module mode). </p>
+<p>Build information is available for the currently running binary in runtime/debug.ReadBuildInfo. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#BuildInfo">type BuildInfo</a></li>
+<li> <a href="#Read">func Read(r io.ReaderAt) (*BuildInfo, error)</a>
+</li>
+<li> <a href="#ReadFile">func ReadFile(name string) (info *BuildInfo, err error)</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>buildinfo.go</span> </p> <h2 id="BuildInfo">type <span>BuildInfo</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>Type alias for build info. We cannot move the types here, since runtime/debug would need to import this package, which would make it a much larger dependency. </p>
+<pre data-language="go">type BuildInfo = debug.BuildInfo</pre> <h3 id="Read">func <span>Read</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func Read(r io.ReaderAt) (*BuildInfo, error)</pre> <p>Read returns build information embedded in a Go binary file accessed through the given ReaderAt. Most information is only available for binaries built with module support. </p>
+<h3 id="ReadFile">func <span>ReadFile</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func ReadFile(name string) (info *BuildInfo, err error)</pre> <p>ReadFile returns build information embedded in a Go binary file at the given path. Most information is only available for binaries built with module support. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/debug/buildinfo/" class="_attribution-link">http://golang.org/pkg/debug/buildinfo/</a>
+ </p>
+</div>
diff --git a/devdocs/go/debug%2Fdwarf%2Findex.html b/devdocs/go/debug%2Fdwarf%2Findex.html
new file mode 100644
index 00000000..312f3c19
--- /dev/null
+++ b/devdocs/go/debug%2Fdwarf%2Findex.html
@@ -0,0 +1,754 @@
+<h1> Package dwarf </h1> <ul id="short-nav">
+<li><code>import "debug/dwarf"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package dwarf provides access to DWARF debugging information loaded from executable files, as defined in the DWARF 2.0 Standard at <a href="http://dwarfstd.org/doc/dwarf-2.0.0.pdf">http://dwarfstd.org/doc/dwarf-2.0.0.pdf</a>. </p>
+<h3 id="hdr-Security">Security</h3> <p>This package is not designed to be hardened against adversarial inputs, and is outside the scope of <a href="https://go.dev/security/policy">https://go.dev/security/policy</a>. In particular, only basic validation is done when parsing object files. As such, care should be taken when parsing untrusted inputs, as parsing malformed files may consume significant resources, or cause panics. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#AddrType">type AddrType</a></li>
+<li><a href="#ArrayType">type ArrayType</a></li>
+<li> <a href="#ArrayType.Size">func (t *ArrayType) Size() int64</a>
+</li>
+<li> <a href="#ArrayType.String">func (t *ArrayType) String() string</a>
+</li>
+<li><a href="#Attr">type Attr</a></li>
+<li> <a href="#Attr.GoString">func (a Attr) GoString() string</a>
+</li>
+<li> <a href="#Attr.String">func (i Attr) String() string</a>
+</li>
+<li><a href="#BasicType">type BasicType</a></li>
+<li> <a href="#BasicType.Basic">func (b *BasicType) Basic() *BasicType</a>
+</li>
+<li> <a href="#BasicType.String">func (t *BasicType) String() string</a>
+</li>
+<li><a href="#BoolType">type BoolType</a></li>
+<li><a href="#CharType">type CharType</a></li>
+<li><a href="#Class">type Class</a></li>
+<li> <a href="#Class.GoString">func (i Class) GoString() string</a>
+</li>
+<li> <a href="#Class.String">func (i Class) String() string</a>
+</li>
+<li><a href="#CommonType">type CommonType</a></li>
+<li> <a href="#CommonType.Common">func (c *CommonType) Common() *CommonType</a>
+</li>
+<li> <a href="#CommonType.Size">func (c *CommonType) Size() int64</a>
+</li>
+<li><a href="#ComplexType">type ComplexType</a></li>
+<li><a href="#Data">type Data</a></li>
+<li> <a href="#New">func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Data, error)</a>
+</li>
+<li> <a href="#Data.AddSection">func (d *Data) AddSection(name string, contents []byte) error</a>
+</li>
+<li> <a href="#Data.AddTypes">func (d *Data) AddTypes(name string, types []byte) error</a>
+</li>
+<li> <a href="#Data.LineReader">func (d *Data) LineReader(cu *Entry) (*LineReader, error)</a>
+</li>
+<li> <a href="#Data.Ranges">func (d *Data) Ranges(e *Entry) ([][2]uint64, error)</a>
+</li>
+<li> <a href="#Data.Reader">func (d *Data) Reader() *Reader</a>
+</li>
+<li> <a href="#Data.Type">func (d *Data) Type(off Offset) (Type, error)</a>
+</li>
+<li><a href="#DecodeError">type DecodeError</a></li>
+<li> <a href="#DecodeError.Error">func (e DecodeError) Error() string</a>
+</li>
+<li><a href="#DotDotDotType">type DotDotDotType</a></li>
+<li> <a href="#DotDotDotType.String">func (t *DotDotDotType) String() string</a>
+</li>
+<li><a href="#Entry">type Entry</a></li>
+<li> <a href="#Entry.AttrField">func (e *Entry) AttrField(a Attr) *Field</a>
+</li>
+<li> <a href="#Entry.Val">func (e *Entry) Val(a Attr) any</a>
+</li>
+<li><a href="#EnumType">type EnumType</a></li>
+<li> <a href="#EnumType.String">func (t *EnumType) String() string</a>
+</li>
+<li><a href="#EnumValue">type EnumValue</a></li>
+<li><a href="#Field">type Field</a></li>
+<li><a href="#FloatType">type FloatType</a></li>
+<li><a href="#FuncType">type FuncType</a></li>
+<li> <a href="#FuncType.String">func (t *FuncType) String() string</a>
+</li>
+<li><a href="#IntType">type IntType</a></li>
+<li><a href="#LineEntry">type LineEntry</a></li>
+<li><a href="#LineFile">type LineFile</a></li>
+<li><a href="#LineReader">type LineReader</a></li>
+<li> <a href="#LineReader.Files">func (r *LineReader) Files() []*LineFile</a>
+</li>
+<li> <a href="#LineReader.Next">func (r *LineReader) Next(entry *LineEntry) error</a>
+</li>
+<li> <a href="#LineReader.Reset">func (r *LineReader) Reset()</a>
+</li>
+<li> <a href="#LineReader.Seek">func (r *LineReader) Seek(pos LineReaderPos)</a>
+</li>
+<li> <a href="#LineReader.SeekPC">func (r *LineReader) SeekPC(pc uint64, entry *LineEntry) error</a>
+</li>
+<li> <a href="#LineReader.Tell">func (r *LineReader) Tell() LineReaderPos</a>
+</li>
+<li><a href="#LineReaderPos">type LineReaderPos</a></li>
+<li><a href="#Offset">type Offset</a></li>
+<li><a href="#PtrType">type PtrType</a></li>
+<li> <a href="#PtrType.String">func (t *PtrType) String() string</a>
+</li>
+<li><a href="#QualType">type QualType</a></li>
+<li> <a href="#QualType.Size">func (t *QualType) Size() int64</a>
+</li>
+<li> <a href="#QualType.String">func (t *QualType) String() string</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#Reader.AddressSize">func (r *Reader) AddressSize() int</a>
+</li>
+<li> <a href="#Reader.ByteOrder">func (r *Reader) ByteOrder() binary.ByteOrder</a>
+</li>
+<li> <a href="#Reader.Next">func (r *Reader) Next() (*Entry, error)</a>
+</li>
+<li> <a href="#Reader.Seek">func (r *Reader) Seek(off Offset)</a>
+</li>
+<li> <a href="#Reader.SeekPC">func (r *Reader) SeekPC(pc uint64) (*Entry, error)</a>
+</li>
+<li> <a href="#Reader.SkipChildren">func (r *Reader) SkipChildren()</a>
+</li>
+<li><a href="#StructField">type StructField</a></li>
+<li><a href="#StructType">type StructType</a></li>
+<li> <a href="#StructType.Defn">func (t *StructType) Defn() string</a>
+</li>
+<li> <a href="#StructType.String">func (t *StructType) String() string</a>
+</li>
+<li><a href="#Tag">type Tag</a></li>
+<li> <a href="#Tag.GoString">func (t Tag) GoString() string</a>
+</li>
+<li> <a href="#Tag.String">func (i Tag) String() string</a>
+</li>
+<li><a href="#Type">type Type</a></li>
+<li><a href="#TypedefType">type TypedefType</a></li>
+<li> <a href="#TypedefType.Size">func (t *TypedefType) Size() int64</a>
+</li>
+<li> <a href="#TypedefType.String">func (t *TypedefType) String() string</a>
+</li>
+<li><a href="#UcharType">type UcharType</a></li>
+<li><a href="#UintType">type UintType</a></li>
+<li><a href="#UnspecifiedType">type UnspecifiedType</a></li>
+<li><a href="#UnsupportedType">type UnsupportedType</a></li>
+<li> <a href="#UnsupportedType.String">func (t *UnsupportedType) String() string</a>
+</li>
+<li><a href="#VoidType">type VoidType</a></li>
+<li> <a href="#VoidType.String">func (t *VoidType) String() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>attr_string.go</span> <span>buf.go</span> <span>class_string.go</span> <span>const.go</span> <span>entry.go</span> <span>line.go</span> <span>open.go</span> <span>tag_string.go</span> <span>type.go</span> <span>typeunit.go</span> <span>unit.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrUnknownPC is the error returned by LineReader.ScanPC when the seek PC is not covered by any entry in the line table. </p>
+<pre data-language="go">var ErrUnknownPC = errors.New("ErrUnknownPC")</pre> <h2 id="AddrType">type <span>AddrType</span> </h2> <p>An AddrType represents a machine address type. </p>
+<pre data-language="go">type AddrType struct {
+ BasicType
+}
+</pre> <h2 id="ArrayType">type <span>ArrayType</span> </h2> <p>An ArrayType represents a fixed size array type. </p>
+<pre data-language="go">type ArrayType struct {
+ CommonType
+ Type Type
+ StrideBitSize int64 // if &gt; 0, number of bits to hold each element
+ Count int64 // if == -1, an incomplete array, like char x[].
+}
+</pre> <h3 id="ArrayType.Size">func (*ArrayType) <span>Size</span> </h3> <pre data-language="go">func (t *ArrayType) Size() int64</pre> <h3 id="ArrayType.String">func (*ArrayType) <span>String</span> </h3> <pre data-language="go">func (t *ArrayType) String() string</pre> <h2 id="Attr">type <span>Attr</span> </h2> <p>An Attr identifies the attribute type in a DWARF [Entry.Field]. </p>
+<pre data-language="go">type Attr uint32</pre> <pre data-language="go">const (
+ AttrSibling Attr = 0x01
+ AttrLocation Attr = 0x02
+ AttrName Attr = 0x03
+ AttrOrdering Attr = 0x09
+ AttrByteSize Attr = 0x0B
+ AttrBitOffset Attr = 0x0C
+ AttrBitSize Attr = 0x0D
+ AttrStmtList Attr = 0x10
+ AttrLowpc Attr = 0x11
+ AttrHighpc Attr = 0x12
+ AttrLanguage Attr = 0x13
+ AttrDiscr Attr = 0x15
+ AttrDiscrValue Attr = 0x16
+ AttrVisibility Attr = 0x17
+ AttrImport Attr = 0x18
+ AttrStringLength Attr = 0x19
+ AttrCommonRef Attr = 0x1A
+ AttrCompDir Attr = 0x1B
+ AttrConstValue Attr = 0x1C
+ AttrContainingType Attr = 0x1D
+ AttrDefaultValue Attr = 0x1E
+ AttrInline Attr = 0x20
+ AttrIsOptional Attr = 0x21
+ AttrLowerBound Attr = 0x22
+ AttrProducer Attr = 0x25
+ AttrPrototyped Attr = 0x27
+ AttrReturnAddr Attr = 0x2A
+ AttrStartScope Attr = 0x2C
+ AttrStrideSize Attr = 0x2E
+ AttrUpperBound Attr = 0x2F
+ AttrAbstractOrigin Attr = 0x31
+ AttrAccessibility Attr = 0x32
+ AttrAddrClass Attr = 0x33
+ AttrArtificial Attr = 0x34
+ AttrBaseTypes Attr = 0x35
+ AttrCalling Attr = 0x36
+ AttrCount Attr = 0x37
+ AttrDataMemberLoc Attr = 0x38
+ AttrDeclColumn Attr = 0x39
+ AttrDeclFile Attr = 0x3A
+ AttrDeclLine Attr = 0x3B
+ AttrDeclaration Attr = 0x3C
+ AttrDiscrList Attr = 0x3D
+ AttrEncoding Attr = 0x3E
+ AttrExternal Attr = 0x3F
+ AttrFrameBase Attr = 0x40
+ AttrFriend Attr = 0x41
+ AttrIdentifierCase Attr = 0x42
+ AttrMacroInfo Attr = 0x43
+ AttrNamelistItem Attr = 0x44
+ AttrPriority Attr = 0x45
+ AttrSegment Attr = 0x46
+ AttrSpecification Attr = 0x47
+ AttrStaticLink Attr = 0x48
+ AttrType Attr = 0x49
+ AttrUseLocation Attr = 0x4A
+ AttrVarParam Attr = 0x4B
+ AttrVirtuality Attr = 0x4C
+ AttrVtableElemLoc Attr = 0x4D
+ // The following are new in DWARF 3.
+ AttrAllocated Attr = 0x4E
+ AttrAssociated Attr = 0x4F
+ AttrDataLocation Attr = 0x50
+ AttrStride Attr = 0x51
+ AttrEntrypc Attr = 0x52
+ AttrUseUTF8 Attr = 0x53
+ AttrExtension Attr = 0x54
+ AttrRanges Attr = 0x55
+ AttrTrampoline Attr = 0x56
+ AttrCallColumn Attr = 0x57
+ AttrCallFile Attr = 0x58
+ AttrCallLine Attr = 0x59
+ AttrDescription Attr = 0x5A
+ AttrBinaryScale Attr = 0x5B
+ AttrDecimalScale Attr = 0x5C
+ AttrSmall Attr = 0x5D
+ AttrDecimalSign Attr = 0x5E
+ AttrDigitCount Attr = 0x5F
+ AttrPictureString Attr = 0x60
+ AttrMutable Attr = 0x61
+ AttrThreadsScaled Attr = 0x62
+ AttrExplicit Attr = 0x63
+ AttrObjectPointer Attr = 0x64
+ AttrEndianity Attr = 0x65
+ AttrElemental Attr = 0x66
+ AttrPure Attr = 0x67
+ AttrRecursive Attr = 0x68
+ // The following are new in DWARF 4.
+ AttrSignature Attr = 0x69
+ AttrMainSubprogram Attr = 0x6A
+ AttrDataBitOffset Attr = 0x6B
+ AttrConstExpr Attr = 0x6C
+ AttrEnumClass Attr = 0x6D
+ AttrLinkageName Attr = 0x6E
+ // The following are new in DWARF 5.
+ AttrStringLengthBitSize Attr = 0x6F
+ AttrStringLengthByteSize Attr = 0x70
+ AttrRank Attr = 0x71
+ AttrStrOffsetsBase Attr = 0x72
+ AttrAddrBase Attr = 0x73
+ AttrRnglistsBase Attr = 0x74
+ AttrDwoName Attr = 0x76
+ AttrReference Attr = 0x77
+ AttrRvalueReference Attr = 0x78
+ AttrMacros Attr = 0x79
+ AttrCallAllCalls Attr = 0x7A
+ AttrCallAllSourceCalls Attr = 0x7B
+ AttrCallAllTailCalls Attr = 0x7C
+ AttrCallReturnPC Attr = 0x7D
+ AttrCallValue Attr = 0x7E
+ AttrCallOrigin Attr = 0x7F
+ AttrCallParameter Attr = 0x80
+ AttrCallPC Attr = 0x81
+ AttrCallTailCall Attr = 0x82
+ AttrCallTarget Attr = 0x83
+ AttrCallTargetClobbered Attr = 0x84
+ AttrCallDataLocation Attr = 0x85
+ AttrCallDataValue Attr = 0x86
+ AttrNoreturn Attr = 0x87
+ AttrAlignment Attr = 0x88
+ AttrExportSymbols Attr = 0x89
+ AttrDeleted Attr = 0x8A
+ AttrDefaulted Attr = 0x8B
+ AttrLoclistsBase Attr = 0x8C
+)</pre> <h3 id="Attr.GoString">func (Attr) <span>GoString</span> </h3> <pre data-language="go">func (a Attr) GoString() string</pre> <h3 id="Attr.String">func (Attr) <span>String</span> </h3> <pre data-language="go">func (i Attr) String() string</pre> <h2 id="BasicType">type <span>BasicType</span> </h2> <p>A BasicType holds fields common to all basic types. </p>
+<p>See the documentation for <a href="#StructField">StructField</a> for more info on the interpretation of the BitSize/BitOffset/DataBitOffset fields. </p>
+<pre data-language="go">type BasicType struct {
+ CommonType
+ BitSize int64
+ BitOffset int64
+ DataBitOffset int64 // Go 1.18
+}
+</pre> <h3 id="BasicType.Basic">func (*BasicType) <span>Basic</span> </h3> <pre data-language="go">func (b *BasicType) Basic() *BasicType</pre> <h3 id="BasicType.String">func (*BasicType) <span>String</span> </h3> <pre data-language="go">func (t *BasicType) String() string</pre> <h2 id="BoolType">type <span>BoolType</span> </h2> <p>A BoolType represents a boolean type. </p>
+<pre data-language="go">type BoolType struct {
+ BasicType
+}
+</pre> <h2 id="CharType">type <span>CharType</span> </h2> <p>A CharType represents a signed character type. </p>
+<pre data-language="go">type CharType struct {
+ BasicType
+}
+</pre> <h2 id="Class">type <span>Class</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Class is the DWARF 4 class of an attribute value. </p>
+<p>In general, a given attribute's value may take on one of several possible classes defined by DWARF, each of which leads to a slightly different interpretation of the attribute. </p>
+<p>DWARF version 4 distinguishes attribute value classes more finely than previous versions of DWARF. The reader will disambiguate coarser classes from earlier versions of DWARF into the appropriate DWARF 4 class. For example, DWARF 2 uses "constant" for constants as well as all types of section offsets, but the reader will canonicalize attributes in DWARF 2 files that refer to section offsets to one of the Class*Ptr classes, even though these classes were only defined in DWARF 3. </p>
+<pre data-language="go">type Class int</pre> <pre data-language="go">const (
+ // ClassUnknown represents values of unknown DWARF class.
+ ClassUnknown Class = iota
+
+ // ClassAddress represents values of type uint64 that are
+ // addresses on the target machine.
+ ClassAddress
+
+ // ClassBlock represents values of type []byte whose
+ // interpretation depends on the attribute.
+ ClassBlock
+
+ // ClassConstant represents values of type int64 that are
+ // constants. The interpretation of this constant depends on
+ // the attribute.
+ ClassConstant
+
+ // ClassExprLoc represents values of type []byte that contain
+ // an encoded DWARF expression or location description.
+ ClassExprLoc
+
+ // ClassFlag represents values of type bool.
+ ClassFlag
+
+ // ClassLinePtr represents values that are an int64 offset
+ // into the "line" section.
+ ClassLinePtr
+
+ // ClassLocListPtr represents values that are an int64 offset
+ // into the "loclist" section.
+ ClassLocListPtr
+
+ // ClassMacPtr represents values that are an int64 offset into
+ // the "mac" section.
+ ClassMacPtr
+
+ // ClassRangeListPtr represents values that are an int64 offset into
+ // the "rangelist" section.
+ ClassRangeListPtr
+
+ // ClassReference represents values that are an Offset offset
+ // of an Entry in the info section (for use with Reader.Seek).
+ // The DWARF specification combines ClassReference and
+ // ClassReferenceSig into class "reference".
+ ClassReference
+
+ // ClassReferenceSig represents values that are a uint64 type
+ // signature referencing a type Entry.
+ ClassReferenceSig
+
+ // ClassString represents values that are strings. If the
+ // compilation unit specifies the AttrUseUTF8 flag (strongly
+ // recommended), the string value will be encoded in UTF-8.
+ // Otherwise, the encoding is unspecified.
+ ClassString
+
+ // ClassReferenceAlt represents values of type int64 that are
+ // an offset into the DWARF "info" section of an alternate
+ // object file.
+ ClassReferenceAlt
+
+ // ClassStringAlt represents values of type int64 that are an
+ // offset into the DWARF string section of an alternate object
+ // file.
+ ClassStringAlt
+
+ // ClassAddrPtr represents values that are an int64 offset
+ // into the "addr" section.
+ ClassAddrPtr
+
+ // ClassLocList represents values that are an int64 offset
+ // into the "loclists" section.
+ ClassLocList
+
+ // ClassRngList represents values that are a uint64 offset
+ // from the base of the "rnglists" section.
+ ClassRngList
+
+ // ClassRngListsPtr represents values that are an int64 offset
+ // into the "rnglists" section. These are used as the base for
+ // ClassRngList values.
+ ClassRngListsPtr
+
+ // ClassStrOffsetsPtr represents values that are an int64
+ // offset into the "str_offsets" section.
+ ClassStrOffsetsPtr
+)</pre> <h3 id="Class.GoString">func (Class) <span>GoString</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (i Class) GoString() string</pre> <h3 id="Class.String">func (Class) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (i Class) String() string</pre> <h2 id="CommonType">type <span>CommonType</span> </h2> <p>A CommonType holds fields common to multiple types. If a field is not known or not applicable for a given type, the zero value is used. </p>
+<pre data-language="go">type CommonType struct {
+ ByteSize int64 // size of value of this type, in bytes
+ Name string // name that can be used to refer to type
+}
+</pre> <h3 id="CommonType.Common">func (*CommonType) <span>Common</span> </h3> <pre data-language="go">func (c *CommonType) Common() *CommonType</pre> <h3 id="CommonType.Size">func (*CommonType) <span>Size</span> </h3> <pre data-language="go">func (c *CommonType) Size() int64</pre> <h2 id="ComplexType">type <span>ComplexType</span> </h2> <p>A ComplexType represents a complex floating point type. </p>
+<pre data-language="go">type ComplexType struct {
+ BasicType
+}
+</pre> <h2 id="Data">type <span>Data</span> </h2> <p>Data represents the DWARF debugging information loaded from an executable file (for example, an ELF or Mach-O executable). </p>
+<pre data-language="go">type Data struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Data, error)</pre> <p>New returns a new <a href="#Data">Data</a> object initialized from the given parameters. Rather than calling this function directly, clients should typically use the DWARF method of the File type of the appropriate package <span>debug/elf</span>, <span>debug/macho</span>, or <span>debug/pe</span>. </p>
+<p>The []byte arguments are the data from the corresponding debug section in the object file; for example, for an ELF object, abbrev is the contents of the ".debug_abbrev" section. </p>
+<h3 id="Data.AddSection">func (*Data) <span>AddSection</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (d *Data) AddSection(name string, contents []byte) error</pre> <p>AddSection adds another DWARF section by name. The name should be a DWARF section name such as ".debug_addr", ".debug_str_offsets", and so forth. This approach is used for new DWARF sections added in DWARF 5 and later. </p>
+<h3 id="Data.AddTypes">func (*Data) <span>AddTypes</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (d *Data) AddTypes(name string, types []byte) error</pre> <p>AddTypes will add one .debug_types section to the DWARF data. A typical object with DWARF version 4 debug info will have multiple .debug_types sections. The name is used for error reporting only, and serves to distinguish one .debug_types section from another. </p>
+<h3 id="Data.LineReader">func (*Data) <span>LineReader</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (d *Data) LineReader(cu *Entry) (*LineReader, error)</pre> <p>LineReader returns a new reader for the line table of compilation unit cu, which must be an <a href="#Entry">Entry</a> with tag <a href="#TagCompileUnit">TagCompileUnit</a>. </p>
+<p>If this compilation unit has no line table, it returns nil, nil. </p>
+<h3 id="Data.Ranges">func (*Data) <span>Ranges</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (d *Data) Ranges(e *Entry) ([][2]uint64, error)</pre> <p>Ranges returns the PC ranges covered by e, a slice of [low,high) pairs. Only some entry types, such as <a href="#TagCompileUnit">TagCompileUnit</a> or <a href="#TagSubprogram">TagSubprogram</a>, have PC ranges; for others, this will return nil with no error. </p>
+<h3 id="Data.Reader">func (*Data) <span>Reader</span> </h3> <pre data-language="go">func (d *Data) Reader() *Reader</pre> <p>Reader returns a new Reader for <a href="#Data">Data</a>. The reader is positioned at byte offset 0 in the DWARF “info” section. </p>
+<h3 id="Data.Type">func (*Data) <span>Type</span> </h3> <pre data-language="go">func (d *Data) Type(off Offset) (Type, error)</pre> <p>Type reads the type at off in the DWARF “info” section. </p>
+<h2 id="DecodeError">type <span>DecodeError</span> </h2> <pre data-language="go">type DecodeError struct {
+ Name string
+ Offset Offset
+ Err string
+}
+</pre> <h3 id="DecodeError.Error">func (DecodeError) <span>Error</span> </h3> <pre data-language="go">func (e DecodeError) Error() string</pre> <h2 id="DotDotDotType">type <span>DotDotDotType</span> </h2> <p>A DotDotDotType represents the variadic ... function parameter. </p>
+<pre data-language="go">type DotDotDotType struct {
+ CommonType
+}
+</pre> <h3 id="DotDotDotType.String">func (*DotDotDotType) <span>String</span> </h3> <pre data-language="go">func (t *DotDotDotType) String() string</pre> <h2 id="Entry">type <span>Entry</span> </h2> <p>An entry is a sequence of attribute/value pairs. </p>
+<pre data-language="go">type Entry struct {
+ Offset Offset // offset of Entry in DWARF info
+ Tag Tag // tag (kind of Entry)
+ Children bool // whether Entry is followed by children
+ Field []Field
+}
+</pre> <h3 id="Entry.AttrField">func (*Entry) <span>AttrField</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (e *Entry) AttrField(a Attr) *Field</pre> <p>AttrField returns the <a href="#Field">Field</a> associated with attribute <a href="#Attr">Attr</a> in <a href="#Entry">Entry</a>, or nil if there is no such attribute. </p>
+<h3 id="Entry.Val">func (*Entry) <span>Val</span> </h3> <pre data-language="go">func (e *Entry) Val(a Attr) any</pre> <p>Val returns the value associated with attribute <a href="#Attr">Attr</a> in <a href="#Entry">Entry</a>, or nil if there is no such attribute. </p>
+<p>A common idiom is to merge the check for nil return with the check that the value has the expected dynamic type, as in: </p>
+<pre data-language="go">v, ok := e.Val(AttrSibling).(int64)
+</pre> <h2 id="EnumType">type <span>EnumType</span> </h2> <p>An EnumType represents an enumerated type. The only indication of its native integer type is its ByteSize (inside <a href="#CommonType">CommonType</a>). </p>
+<pre data-language="go">type EnumType struct {
+ CommonType
+ EnumName string
+ Val []*EnumValue
+}
+</pre> <h3 id="EnumType.String">func (*EnumType) <span>String</span> </h3> <pre data-language="go">func (t *EnumType) String() string</pre> <h2 id="EnumValue">type <span>EnumValue</span> </h2> <p>An EnumValue represents a single enumeration value. </p>
+<pre data-language="go">type EnumValue struct {
+ Name string
+ Val int64
+}
+</pre> <h2 id="Field">type <span>Field</span> </h2> <p>A Field is a single attribute/value pair in an <a href="#Entry">Entry</a>. </p>
+<p>A value can be one of several "attribute classes" defined by DWARF. The Go types corresponding to each class are: </p>
+<pre data-language="go">DWARF class Go type Class
+----------- ------- -----
+address uint64 ClassAddress
+block []byte ClassBlock
+constant int64 ClassConstant
+flag bool ClassFlag
+reference
+ to info dwarf.Offset ClassReference
+ to type unit uint64 ClassReferenceSig
+string string ClassString
+exprloc []byte ClassExprLoc
+lineptr int64 ClassLinePtr
+loclistptr int64 ClassLocListPtr
+macptr int64 ClassMacPtr
+rangelistptr int64 ClassRangeListPtr
+</pre> <p>For unrecognized or vendor-defined attributes, <a href="#Class">Class</a> may be <a href="#ClassUnknown">ClassUnknown</a>. </p>
+<pre data-language="go">type Field struct {
+ Attr Attr
+ Val any
+ Class Class // Go 1.5
+}
+</pre> <h2 id="FloatType">type <span>FloatType</span> </h2> <p>A FloatType represents a floating point type. </p>
+<pre data-language="go">type FloatType struct {
+ BasicType
+}
+</pre> <h2 id="FuncType">type <span>FuncType</span> </h2> <p>A FuncType represents a function type. </p>
+<pre data-language="go">type FuncType struct {
+ CommonType
+ ReturnType Type
+ ParamType []Type
+}
+</pre> <h3 id="FuncType.String">func (*FuncType) <span>String</span> </h3> <pre data-language="go">func (t *FuncType) String() string</pre> <h2 id="IntType">type <span>IntType</span> </h2> <p>An IntType represents a signed integer type. </p>
+<pre data-language="go">type IntType struct {
+ BasicType
+}
+</pre> <h2 id="LineEntry">type <span>LineEntry</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A LineEntry is a row in a DWARF line table. </p>
+<pre data-language="go">type LineEntry struct {
+ // Address is the program-counter value of a machine
+ // instruction generated by the compiler. This LineEntry
+ // applies to each instruction from Address to just before the
+ // Address of the next LineEntry.
+ Address uint64
+
+ // OpIndex is the index of an operation within a VLIW
+ // instruction. The index of the first operation is 0. For
+ // non-VLIW architectures, it will always be 0. Address and
+ // OpIndex together form an operation pointer that can
+ // reference any individual operation within the instruction
+ // stream.
+ OpIndex int
+
+ // File is the source file corresponding to these
+ // instructions.
+ File *LineFile
+
+ // Line is the source code line number corresponding to these
+ // instructions. Lines are numbered beginning at 1. It may be
+ // 0 if these instructions cannot be attributed to any source
+ // line.
+ Line int
+
+ // Column is the column number within the source line of these
+ // instructions. Columns are numbered beginning at 1. It may
+ // be 0 to indicate the "left edge" of the line.
+ Column int
+
+ // IsStmt indicates that Address is a recommended breakpoint
+ // location, such as the beginning of a line, statement, or a
+ // distinct subpart of a statement.
+ IsStmt bool
+
+ // BasicBlock indicates that Address is the beginning of a
+ // basic block.
+ BasicBlock bool
+
+ // PrologueEnd indicates that Address is one (of possibly
+ // many) PCs where execution should be suspended for a
+ // breakpoint on entry to the containing function.
+ //
+ // Added in DWARF 3.
+ PrologueEnd bool
+
+ // EpilogueBegin indicates that Address is one (of possibly
+ // many) PCs where execution should be suspended for a
+ // breakpoint on exit from this function.
+ //
+ // Added in DWARF 3.
+ EpilogueBegin bool
+
+ // ISA is the instruction set architecture for these
+ // instructions. Possible ISA values should be defined by the
+ // applicable ABI specification.
+ //
+ // Added in DWARF 3.
+ ISA int
+
+ // Discriminator is an arbitrary integer indicating the block
+ // to which these instructions belong. It serves to
+ // distinguish among multiple blocks that may all have with
+ // the same source file, line, and column. Where only one
+ // block exists for a given source position, it should be 0.
+ //
+ // Added in DWARF 3.
+ Discriminator int
+
+ // EndSequence indicates that Address is the first byte after
+ // the end of a sequence of target machine instructions. If it
+ // is set, only this and the Address field are meaningful. A
+ // line number table may contain information for multiple
+ // potentially disjoint instruction sequences. The last entry
+ // in a line table should always have EndSequence set.
+ EndSequence bool
+}
+</pre> <h2 id="LineFile">type <span>LineFile</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A LineFile is a source file referenced by a DWARF line table entry. </p>
+<pre data-language="go">type LineFile struct {
+ Name string
+ Mtime uint64 // Implementation defined modification time, or 0 if unknown
+ Length int // File length, or 0 if unknown
+}
+</pre> <h2 id="LineReader">type <span>LineReader</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A LineReader reads a sequence of <a href="#LineEntry">LineEntry</a> structures from a DWARF "line" section for a single compilation unit. LineEntries occur in order of increasing PC and each <a href="#LineEntry">LineEntry</a> gives metadata for the instructions from that <a href="#LineEntry">LineEntry</a>'s PC to just before the next <a href="#LineEntry">LineEntry</a>'s PC. The last entry will have the [LineEntry.EndSequence] field set. </p>
+<pre data-language="go">type LineReader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="LineReader.Files">func (*LineReader) <span>Files</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (r *LineReader) Files() []*LineFile</pre> <p>Files returns the file name table of this compilation unit as of the current position in the line table. The file name table may be referenced from attributes in this compilation unit such as <a href="#AttrDeclFile">AttrDeclFile</a>. </p>
+<p>Entry 0 is always nil, since file index 0 represents "no file". </p>
+<p>The file name table of a compilation unit is not fixed. Files returns the file table as of the current position in the line table. This may contain more entries than the file table at an earlier position in the line table, though existing entries never change. </p>
+<h3 id="LineReader.Next">func (*LineReader) <span>Next</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r *LineReader) Next(entry *LineEntry) error</pre> <p>Next sets *entry to the next row in this line table and moves to the next row. If there are no more entries and the line table is properly terminated, it returns <span>io.EOF</span>. </p>
+<p>Rows are always in order of increasing entry.Address, but entry.Line may go forward or backward. </p>
+<h3 id="LineReader.Reset">func (*LineReader) <span>Reset</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r *LineReader) Reset()</pre> <p>Reset repositions the line table reader at the beginning of the line table. </p>
+<h3 id="LineReader.Seek">func (*LineReader) <span>Seek</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r *LineReader) Seek(pos LineReaderPos)</pre> <p>Seek restores the line table reader to a position returned by <a href="#LineReader.Tell">LineReader.Tell</a>. </p>
+<p>The argument pos must have been returned by a call to <a href="#LineReader.Tell">LineReader.Tell</a> on this line table. </p>
+<h3 id="LineReader.SeekPC">func (*LineReader) <span>SeekPC</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r *LineReader) SeekPC(pc uint64, entry *LineEntry) error</pre> <p>SeekPC sets *entry to the <a href="#LineEntry">LineEntry</a> that includes pc and positions the reader on the next entry in the line table. If necessary, this will seek backwards to find pc. </p>
+<p>If pc is not covered by any entry in this line table, SeekPC returns <a href="#ErrUnknownPC">ErrUnknownPC</a>. In this case, *entry and the final seek position are unspecified. </p>
+<p>Note that DWARF line tables only permit sequential, forward scans. Hence, in the worst case, this takes time linear in the size of the line table. If the caller wishes to do repeated fast PC lookups, it should build an appropriate index of the line table. </p>
+<h3 id="LineReader.Tell">func (*LineReader) <span>Tell</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r *LineReader) Tell() LineReaderPos</pre> <p>Tell returns the current position in the line table. </p>
+<h2 id="LineReaderPos">type <span>LineReaderPos</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A LineReaderPos represents a position in a line table. </p>
+<pre data-language="go">type LineReaderPos struct {
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="Offset">type <span>Offset</span> </h2> <p>An Offset represents the location of an <a href="#Entry">Entry</a> within the DWARF info. (See <a href="#Reader.Seek">Reader.Seek</a>.) </p>
+<pre data-language="go">type Offset uint32</pre> <h2 id="PtrType">type <span>PtrType</span> </h2> <p>A PtrType represents a pointer type. </p>
+<pre data-language="go">type PtrType struct {
+ CommonType
+ Type Type
+}
+</pre> <h3 id="PtrType.String">func (*PtrType) <span>String</span> </h3> <pre data-language="go">func (t *PtrType) String() string</pre> <h2 id="QualType">type <span>QualType</span> </h2> <p>A QualType represents a type that has the C/C++ "const", "restrict", or "volatile" qualifier. </p>
+<pre data-language="go">type QualType struct {
+ CommonType
+ Qual string
+ Type Type
+}
+</pre> <h3 id="QualType.Size">func (*QualType) <span>Size</span> </h3> <pre data-language="go">func (t *QualType) Size() int64</pre> <h3 id="QualType.String">func (*QualType) <span>String</span> </h3> <pre data-language="go">func (t *QualType) String() string</pre> <h2 id="Reader">type <span>Reader</span> </h2> <p>A Reader allows reading <a href="#Entry">Entry</a> structures from a DWARF “info” section. The <a href="#Entry">Entry</a> structures are arranged in a tree. The <a href="#Reader.Next">Reader.Next</a> function return successive entries from a pre-order traversal of the tree. If an entry has children, its Children field will be true, and the children follow, terminated by an <a href="#Entry">Entry</a> with <a href="#Tag">Tag</a> 0. </p>
+<pre data-language="go">type Reader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Reader.AddressSize">func (*Reader) <span>AddressSize</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r *Reader) AddressSize() int</pre> <p>AddressSize returns the size in bytes of addresses in the current compilation unit. </p>
+<h3 id="Reader.ByteOrder">func (*Reader) <span>ByteOrder</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (r *Reader) ByteOrder() binary.ByteOrder</pre> <p>ByteOrder returns the byte order in the current compilation unit. </p>
+<h3 id="Reader.Next">func (*Reader) <span>Next</span> </h3> <pre data-language="go">func (r *Reader) Next() (*Entry, error)</pre> <p>Next reads the next entry from the encoded entry stream. It returns nil, nil when it reaches the end of the section. It returns an error if the current offset is invalid or the data at the offset cannot be decoded as a valid <a href="#Entry">Entry</a>. </p>
+<h3 id="Reader.Seek">func (*Reader) <span>Seek</span> </h3> <pre data-language="go">func (r *Reader) Seek(off Offset)</pre> <p>Seek positions the <a href="#Reader">Reader</a> at offset off in the encoded entry stream. Offset 0 can be used to denote the first entry. </p>
+<h3 id="Reader.SeekPC">func (*Reader) <span>SeekPC</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (r *Reader) SeekPC(pc uint64) (*Entry, error)</pre> <p>SeekPC returns the <a href="#Entry">Entry</a> for the compilation unit that includes pc, and positions the reader to read the children of that unit. If pc is not covered by any unit, SeekPC returns <a href="#ErrUnknownPC">ErrUnknownPC</a> and the position of the reader is undefined. </p>
+<p>Because compilation units can describe multiple regions of the executable, in the worst case SeekPC must search through all the ranges in all the compilation units. Each call to SeekPC starts the search at the compilation unit of the last call, so in general looking up a series of PCs will be faster if they are sorted. If the caller wishes to do repeated fast PC lookups, it should build an appropriate index using the Ranges method. </p>
+<h3 id="Reader.SkipChildren">func (*Reader) <span>SkipChildren</span> </h3> <pre data-language="go">func (r *Reader) SkipChildren()</pre> <p>SkipChildren skips over the child entries associated with the last <a href="#Entry">Entry</a> returned by <a href="#Reader.Next">Reader.Next</a>. If that <a href="#Entry">Entry</a> did not have children or <a href="#Reader.Next">Reader.Next</a> has not been called, SkipChildren is a no-op. </p>
+<h2 id="StructField">type <span>StructField</span> </h2> <p>A StructField represents a field in a struct, union, or C++ class type. </p>
+<h3 id="hdr-Bit_Fields">Bit Fields</h3> <p>The BitSize, BitOffset, and DataBitOffset fields describe the bit size and offset of data members declared as bit fields in C/C++ struct/union/class types. </p>
+<p>BitSize is the number of bits in the bit field. </p>
+<p>DataBitOffset, if non-zero, is the number of bits from the start of the enclosing entity (e.g. containing struct/class/union) to the start of the bit field. This corresponds to the DW_AT_data_bit_offset DWARF attribute that was introduced in DWARF 4. </p>
+<p>BitOffset, if non-zero, is the number of bits between the most significant bit of the storage unit holding the bit field to the most significant bit of the bit field. Here "storage unit" is the type name before the bit field (for a field "unsigned x:17", the storage unit is "unsigned"). BitOffset values can vary depending on the endianness of the system. BitOffset corresponds to the DW_AT_bit_offset DWARF attribute that was deprecated in DWARF 4 and removed in DWARF 5. </p>
+<p>At most one of DataBitOffset and BitOffset will be non-zero; DataBitOffset/BitOffset will only be non-zero if BitSize is non-zero. Whether a C compiler uses one or the other will depend on compiler vintage and command line options. </p>
+<p>Here is an example of C/C++ bit field use, along with what to expect in terms of DWARF bit offset info. Consider this code: </p>
+<pre data-language="go">struct S {
+ int q;
+ int j:5;
+ int k:6;
+ int m:5;
+ int n:8;
+} s;
+</pre> <p>For the code above, one would expect to see the following for DW_AT_bit_offset values (using GCC 8): </p>
+<pre data-language="go"> Little | Big
+ Endian | Endian
+ |
+"j": 27 | 0
+"k": 21 | 5
+"m": 16 | 11
+"n": 8 | 16
+</pre> <p>Note that in the above the offsets are purely with respect to the containing storage unit for j/k/m/n -- these values won't vary based on the size of prior data members in the containing struct. </p>
+<p>If the compiler emits DW_AT_data_bit_offset, the expected values would be: </p>
+<pre data-language="go">"j": 32
+"k": 37
+"m": 43
+"n": 48
+</pre> <p>Here the value 32 for "j" reflects the fact that the bit field is preceded by other data members (recall that DW_AT_data_bit_offset values are relative to the start of the containing struct). Hence DW_AT_data_bit_offset values can be quite large for structs with many fields. </p>
+<p>DWARF also allow for the possibility of base types that have non-zero bit size and bit offset, so this information is also captured for base types, but it is worth noting that it is not possible to trigger this behavior using mainstream languages. </p>
+<pre data-language="go">type StructField struct {
+ Name string
+ Type Type
+ ByteOffset int64
+ ByteSize int64 // usually zero; use Type.Size() for normal fields
+ BitOffset int64
+ DataBitOffset int64 // Go 1.18
+ BitSize int64 // zero if not a bit field
+}
+</pre> <h2 id="StructType">type <span>StructType</span> </h2> <p>A StructType represents a struct, union, or C++ class type. </p>
+<pre data-language="go">type StructType struct {
+ CommonType
+ StructName string
+ Kind string // "struct", "union", or "class".
+ Field []*StructField
+ Incomplete bool // if true, struct, union, class is declared but not defined
+}
+</pre> <h3 id="StructType.Defn">func (*StructType) <span>Defn</span> </h3> <pre data-language="go">func (t *StructType) Defn() string</pre> <h3 id="StructType.String">func (*StructType) <span>String</span> </h3> <pre data-language="go">func (t *StructType) String() string</pre> <h2 id="Tag">type <span>Tag</span> </h2> <p>A Tag is the classification (the type) of an <a href="#Entry">Entry</a>. </p>
+<pre data-language="go">type Tag uint32</pre> <pre data-language="go">const (
+ TagArrayType Tag = 0x01
+ TagClassType Tag = 0x02
+ TagEntryPoint Tag = 0x03
+ TagEnumerationType Tag = 0x04
+ TagFormalParameter Tag = 0x05
+ TagImportedDeclaration Tag = 0x08
+ TagLabel Tag = 0x0A
+ TagLexDwarfBlock Tag = 0x0B
+ TagMember Tag = 0x0D
+ TagPointerType Tag = 0x0F
+ TagReferenceType Tag = 0x10
+ TagCompileUnit Tag = 0x11
+ TagStringType Tag = 0x12
+ TagStructType Tag = 0x13
+ TagSubroutineType Tag = 0x15
+ TagTypedef Tag = 0x16
+ TagUnionType Tag = 0x17
+ TagUnspecifiedParameters Tag = 0x18
+ TagVariant Tag = 0x19
+ TagCommonDwarfBlock Tag = 0x1A
+ TagCommonInclusion Tag = 0x1B
+ TagInheritance Tag = 0x1C
+ TagInlinedSubroutine Tag = 0x1D
+ TagModule Tag = 0x1E
+ TagPtrToMemberType Tag = 0x1F
+ TagSetType Tag = 0x20
+ TagSubrangeType Tag = 0x21
+ TagWithStmt Tag = 0x22
+ TagAccessDeclaration Tag = 0x23
+ TagBaseType Tag = 0x24
+ TagCatchDwarfBlock Tag = 0x25
+ TagConstType Tag = 0x26
+ TagConstant Tag = 0x27
+ TagEnumerator Tag = 0x28
+ TagFileType Tag = 0x29
+ TagFriend Tag = 0x2A
+ TagNamelist Tag = 0x2B
+ TagNamelistItem Tag = 0x2C
+ TagPackedType Tag = 0x2D
+ TagSubprogram Tag = 0x2E
+ TagTemplateTypeParameter Tag = 0x2F
+ TagTemplateValueParameter Tag = 0x30
+ TagThrownType Tag = 0x31
+ TagTryDwarfBlock Tag = 0x32
+ TagVariantPart Tag = 0x33
+ TagVariable Tag = 0x34
+ TagVolatileType Tag = 0x35
+ // The following are new in DWARF 3.
+ TagDwarfProcedure Tag = 0x36
+ TagRestrictType Tag = 0x37
+ TagInterfaceType Tag = 0x38
+ TagNamespace Tag = 0x39
+ TagImportedModule Tag = 0x3A
+ TagUnspecifiedType Tag = 0x3B
+ TagPartialUnit Tag = 0x3C
+ TagImportedUnit Tag = 0x3D
+ TagMutableType Tag = 0x3E // Later removed from DWARF.
+ TagCondition Tag = 0x3F
+ TagSharedType Tag = 0x40
+ // The following are new in DWARF 4.
+ TagTypeUnit Tag = 0x41
+ TagRvalueReferenceType Tag = 0x42
+ TagTemplateAlias Tag = 0x43
+ // The following are new in DWARF 5.
+ TagCoarrayType Tag = 0x44
+ TagGenericSubrange Tag = 0x45
+ TagDynamicType Tag = 0x46
+ TagAtomicType Tag = 0x47
+ TagCallSite Tag = 0x48
+ TagCallSiteParameter Tag = 0x49
+ TagSkeletonUnit Tag = 0x4A
+ TagImmutableType Tag = 0x4B
+)</pre> <h3 id="Tag.GoString">func (Tag) <span>GoString</span> </h3> <pre data-language="go">func (t Tag) GoString() string</pre> <h3 id="Tag.String">func (Tag) <span>String</span> </h3> <pre data-language="go">func (i Tag) String() string</pre> <h2 id="Type">type <span>Type</span> </h2> <p>A Type conventionally represents a pointer to any of the specific Type structures (<a href="#CharType">CharType</a>, <a href="#StructType">StructType</a>, etc.). </p>
+<pre data-language="go">type Type interface {
+ Common() *CommonType
+ String() string
+ Size() int64
+}</pre> <h2 id="TypedefType">type <span>TypedefType</span> </h2> <p>A TypedefType represents a named type. </p>
+<pre data-language="go">type TypedefType struct {
+ CommonType
+ Type Type
+}
+</pre> <h3 id="TypedefType.Size">func (*TypedefType) <span>Size</span> </h3> <pre data-language="go">func (t *TypedefType) Size() int64</pre> <h3 id="TypedefType.String">func (*TypedefType) <span>String</span> </h3> <pre data-language="go">func (t *TypedefType) String() string</pre> <h2 id="UcharType">type <span>UcharType</span> </h2> <p>A UcharType represents an unsigned character type. </p>
+<pre data-language="go">type UcharType struct {
+ BasicType
+}
+</pre> <h2 id="UintType">type <span>UintType</span> </h2> <p>A UintType represents an unsigned integer type. </p>
+<pre data-language="go">type UintType struct {
+ BasicType
+}
+</pre> <h2 id="UnspecifiedType">type <span>UnspecifiedType</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>An UnspecifiedType represents an implicit, unknown, ambiguous or nonexistent type. </p>
+<pre data-language="go">type UnspecifiedType struct {
+ BasicType
+}
+</pre> <h2 id="UnsupportedType">type <span>UnsupportedType</span> <span title="Added in Go 1.13">1.13</span> </h2> <p>An UnsupportedType is a placeholder returned in situations where we encounter a type that isn't supported. </p>
+<pre data-language="go">type UnsupportedType struct {
+ CommonType
+ Tag Tag
+}
+</pre> <h3 id="UnsupportedType.String">func (*UnsupportedType) <span>String</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (t *UnsupportedType) String() string</pre> <h2 id="VoidType">type <span>VoidType</span> </h2> <p>A VoidType represents the C void type. </p>
+<pre data-language="go">type VoidType struct {
+ CommonType
+}
+</pre> <h3 id="VoidType.String">func (*VoidType) <span>String</span> </h3> <pre data-language="go">func (t *VoidType) String() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/debug/dwarf/" class="_attribution-link">http://golang.org/pkg/debug/dwarf/</a>
+ </p>
+</div>
diff --git a/devdocs/go/debug%2Felf%2Findex.html b/devdocs/go/debug%2Felf%2Findex.html
new file mode 100644
index 00000000..657f7738
--- /dev/null
+++ b/devdocs/go/debug%2Felf%2Findex.html
@@ -0,0 +1,2116 @@
+<h1> Package elf </h1> <ul id="short-nav">
+<li><code>import "debug/elf"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package elf implements access to ELF object files. </p>
+<h3 id="hdr-Security">Security</h3> <p>This package is not designed to be hardened against adversarial inputs, and is outside the scope of <a href="https://go.dev/security/policy">https://go.dev/security/policy</a>. In particular, only basic validation is done when parsing object files. As such, care should be taken when parsing untrusted inputs, as parsing malformed files may consume significant resources, or cause panics. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#R_INFO">func R_INFO(sym, typ uint32) uint64</a></li>
+<li><a href="#R_INFO32">func R_INFO32(sym, typ uint32) uint32</a></li>
+<li><a href="#R_SYM32">func R_SYM32(info uint32) uint32</a></li>
+<li><a href="#R_SYM64">func R_SYM64(info uint64) uint32</a></li>
+<li><a href="#R_TYPE32">func R_TYPE32(info uint32) uint32</a></li>
+<li><a href="#R_TYPE64">func R_TYPE64(info uint64) uint32</a></li>
+<li><a href="#ST_INFO">func ST_INFO(bind SymBind, typ SymType) uint8</a></li>
+<li><a href="#Chdr32">type Chdr32</a></li>
+<li><a href="#Chdr64">type Chdr64</a></li>
+<li><a href="#Class">type Class</a></li>
+<li> <a href="#Class.GoString">func (i Class) GoString() string</a>
+</li>
+<li> <a href="#Class.String">func (i Class) String() string</a>
+</li>
+<li><a href="#CompressionType">type CompressionType</a></li>
+<li> <a href="#CompressionType.GoString">func (i CompressionType) GoString() string</a>
+</li>
+<li> <a href="#CompressionType.String">func (i CompressionType) String() string</a>
+</li>
+<li><a href="#Data">type Data</a></li>
+<li> <a href="#Data.GoString">func (i Data) GoString() string</a>
+</li>
+<li> <a href="#Data.String">func (i Data) String() string</a>
+</li>
+<li><a href="#Dyn32">type Dyn32</a></li>
+<li><a href="#Dyn64">type Dyn64</a></li>
+<li><a href="#DynFlag">type DynFlag</a></li>
+<li> <a href="#DynFlag.GoString">func (i DynFlag) GoString() string</a>
+</li>
+<li> <a href="#DynFlag.String">func (i DynFlag) String() string</a>
+</li>
+<li><a href="#DynFlag1">type DynFlag1</a></li>
+<li> <a href="#DynFlag1.GoString">func (i DynFlag1) GoString() string</a>
+</li>
+<li> <a href="#DynFlag1.String">func (i DynFlag1) String() string</a>
+</li>
+<li><a href="#DynTag">type DynTag</a></li>
+<li> <a href="#DynTag.GoString">func (i DynTag) GoString() string</a>
+</li>
+<li> <a href="#DynTag.String">func (i DynTag) String() string</a>
+</li>
+<li><a href="#File">type File</a></li>
+<li> <a href="#NewFile">func NewFile(r io.ReaderAt) (*File, error)</a>
+</li>
+<li> <a href="#Open">func Open(name string) (*File, error)</a>
+</li>
+<li> <a href="#File.Close">func (f *File) Close() error</a>
+</li>
+<li> <a href="#File.DWARF">func (f *File) DWARF() (*dwarf.Data, error)</a>
+</li>
+<li> <a href="#File.DynString">func (f *File) DynString(tag DynTag) ([]string, error)</a>
+</li>
+<li> <a href="#File.DynValue">func (f *File) DynValue(tag DynTag) ([]uint64, error)</a>
+</li>
+<li> <a href="#File.DynamicSymbols">func (f *File) DynamicSymbols() ([]Symbol, error)</a>
+</li>
+<li> <a href="#File.ImportedLibraries">func (f *File) ImportedLibraries() ([]string, error)</a>
+</li>
+<li> <a href="#File.ImportedSymbols">func (f *File) ImportedSymbols() ([]ImportedSymbol, error)</a>
+</li>
+<li> <a href="#File.Section">func (f *File) Section(name string) *Section</a>
+</li>
+<li> <a href="#File.SectionByType">func (f *File) SectionByType(typ SectionType) *Section</a>
+</li>
+<li> <a href="#File.Symbols">func (f *File) Symbols() ([]Symbol, error)</a>
+</li>
+<li><a href="#FileHeader">type FileHeader</a></li>
+<li><a href="#FormatError">type FormatError</a></li>
+<li> <a href="#FormatError.Error">func (e *FormatError) Error() string</a>
+</li>
+<li><a href="#Header32">type Header32</a></li>
+<li><a href="#Header64">type Header64</a></li>
+<li><a href="#ImportedSymbol">type ImportedSymbol</a></li>
+<li><a href="#Machine">type Machine</a></li>
+<li> <a href="#Machine.GoString">func (i Machine) GoString() string</a>
+</li>
+<li> <a href="#Machine.String">func (i Machine) String() string</a>
+</li>
+<li><a href="#NType">type NType</a></li>
+<li> <a href="#NType.GoString">func (i NType) GoString() string</a>
+</li>
+<li> <a href="#NType.String">func (i NType) String() string</a>
+</li>
+<li><a href="#OSABI">type OSABI</a></li>
+<li> <a href="#OSABI.GoString">func (i OSABI) GoString() string</a>
+</li>
+<li> <a href="#OSABI.String">func (i OSABI) String() string</a>
+</li>
+<li><a href="#Prog">type Prog</a></li>
+<li> <a href="#Prog.Open">func (p *Prog) Open() io.ReadSeeker</a>
+</li>
+<li><a href="#Prog32">type Prog32</a></li>
+<li><a href="#Prog64">type Prog64</a></li>
+<li><a href="#ProgFlag">type ProgFlag</a></li>
+<li> <a href="#ProgFlag.GoString">func (i ProgFlag) GoString() string</a>
+</li>
+<li> <a href="#ProgFlag.String">func (i ProgFlag) String() string</a>
+</li>
+<li><a href="#ProgHeader">type ProgHeader</a></li>
+<li><a href="#ProgType">type ProgType</a></li>
+<li> <a href="#ProgType.GoString">func (i ProgType) GoString() string</a>
+</li>
+<li> <a href="#ProgType.String">func (i ProgType) String() string</a>
+</li>
+<li><a href="#R_386">type R_386</a></li>
+<li> <a href="#R_386.GoString">func (i R_386) GoString() string</a>
+</li>
+<li> <a href="#R_386.String">func (i R_386) String() string</a>
+</li>
+<li><a href="#R_390">type R_390</a></li>
+<li> <a href="#R_390.GoString">func (i R_390) GoString() string</a>
+</li>
+<li> <a href="#R_390.String">func (i R_390) String() string</a>
+</li>
+<li><a href="#R_AARCH64">type R_AARCH64</a></li>
+<li> <a href="#R_AARCH64.GoString">func (i R_AARCH64) GoString() string</a>
+</li>
+<li> <a href="#R_AARCH64.String">func (i R_AARCH64) String() string</a>
+</li>
+<li><a href="#R_ALPHA">type R_ALPHA</a></li>
+<li> <a href="#R_ALPHA.GoString">func (i R_ALPHA) GoString() string</a>
+</li>
+<li> <a href="#R_ALPHA.String">func (i R_ALPHA) String() string</a>
+</li>
+<li><a href="#R_ARM">type R_ARM</a></li>
+<li> <a href="#R_ARM.GoString">func (i R_ARM) GoString() string</a>
+</li>
+<li> <a href="#R_ARM.String">func (i R_ARM) String() string</a>
+</li>
+<li><a href="#R_LARCH">type R_LARCH</a></li>
+<li> <a href="#R_LARCH.GoString">func (i R_LARCH) GoString() string</a>
+</li>
+<li> <a href="#R_LARCH.String">func (i R_LARCH) String() string</a>
+</li>
+<li><a href="#R_MIPS">type R_MIPS</a></li>
+<li> <a href="#R_MIPS.GoString">func (i R_MIPS) GoString() string</a>
+</li>
+<li> <a href="#R_MIPS.String">func (i R_MIPS) String() string</a>
+</li>
+<li><a href="#R_PPC">type R_PPC</a></li>
+<li> <a href="#R_PPC.GoString">func (i R_PPC) GoString() string</a>
+</li>
+<li> <a href="#R_PPC.String">func (i R_PPC) String() string</a>
+</li>
+<li><a href="#R_PPC64">type R_PPC64</a></li>
+<li> <a href="#R_PPC64.GoString">func (i R_PPC64) GoString() string</a>
+</li>
+<li> <a href="#R_PPC64.String">func (i R_PPC64) String() string</a>
+</li>
+<li><a href="#R_RISCV">type R_RISCV</a></li>
+<li> <a href="#R_RISCV.GoString">func (i R_RISCV) GoString() string</a>
+</li>
+<li> <a href="#R_RISCV.String">func (i R_RISCV) String() string</a>
+</li>
+<li><a href="#R_SPARC">type R_SPARC</a></li>
+<li> <a href="#R_SPARC.GoString">func (i R_SPARC) GoString() string</a>
+</li>
+<li> <a href="#R_SPARC.String">func (i R_SPARC) String() string</a>
+</li>
+<li><a href="#R_X86_64">type R_X86_64</a></li>
+<li> <a href="#R_X86_64.GoString">func (i R_X86_64) GoString() string</a>
+</li>
+<li> <a href="#R_X86_64.String">func (i R_X86_64) String() string</a>
+</li>
+<li><a href="#Rel32">type Rel32</a></li>
+<li><a href="#Rel64">type Rel64</a></li>
+<li><a href="#Rela32">type Rela32</a></li>
+<li><a href="#Rela64">type Rela64</a></li>
+<li><a href="#Section">type Section</a></li>
+<li> <a href="#Section.Data">func (s *Section) Data() ([]byte, error)</a>
+</li>
+<li> <a href="#Section.Open">func (s *Section) Open() io.ReadSeeker</a>
+</li>
+<li><a href="#Section32">type Section32</a></li>
+<li><a href="#Section64">type Section64</a></li>
+<li><a href="#SectionFlag">type SectionFlag</a></li>
+<li> <a href="#SectionFlag.GoString">func (i SectionFlag) GoString() string</a>
+</li>
+<li> <a href="#SectionFlag.String">func (i SectionFlag) String() string</a>
+</li>
+<li><a href="#SectionHeader">type SectionHeader</a></li>
+<li><a href="#SectionIndex">type SectionIndex</a></li>
+<li> <a href="#SectionIndex.GoString">func (i SectionIndex) GoString() string</a>
+</li>
+<li> <a href="#SectionIndex.String">func (i SectionIndex) String() string</a>
+</li>
+<li><a href="#SectionType">type SectionType</a></li>
+<li> <a href="#SectionType.GoString">func (i SectionType) GoString() string</a>
+</li>
+<li> <a href="#SectionType.String">func (i SectionType) String() string</a>
+</li>
+<li><a href="#Sym32">type Sym32</a></li>
+<li><a href="#Sym64">type Sym64</a></li>
+<li><a href="#SymBind">type SymBind</a></li>
+<li> <a href="#ST_BIND">func ST_BIND(info uint8) SymBind</a>
+</li>
+<li> <a href="#SymBind.GoString">func (i SymBind) GoString() string</a>
+</li>
+<li> <a href="#SymBind.String">func (i SymBind) String() string</a>
+</li>
+<li><a href="#SymType">type SymType</a></li>
+<li> <a href="#ST_TYPE">func ST_TYPE(info uint8) SymType</a>
+</li>
+<li> <a href="#SymType.GoString">func (i SymType) GoString() string</a>
+</li>
+<li> <a href="#SymType.String">func (i SymType) String() string</a>
+</li>
+<li><a href="#SymVis">type SymVis</a></li>
+<li> <a href="#ST_VISIBILITY">func ST_VISIBILITY(other uint8) SymVis</a>
+</li>
+<li> <a href="#SymVis.GoString">func (i SymVis) GoString() string</a>
+</li>
+<li> <a href="#SymVis.String">func (i SymVis) String() string</a>
+</li>
+<li><a href="#Symbol">type Symbol</a></li>
+<li><a href="#Type">type Type</a></li>
+<li> <a href="#Type.GoString">func (i Type) GoString() string</a>
+</li>
+<li> <a href="#Type.String">func (i Type) String() string</a>
+</li>
+<li><a href="#Version">type Version</a></li>
+<li> <a href="#Version.GoString">func (i Version) GoString() string</a>
+</li>
+<li> <a href="#Version.String">func (i Version) String() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>elf.go</span> <span>file.go</span> <span>reader.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Indexes into the Header.Ident array. </p>
+<pre data-language="go">const (
+ EI_CLASS = 4 /* Class of machine. */
+ EI_DATA = 5 /* Data format. */
+ EI_VERSION = 6 /* ELF format version. */
+ EI_OSABI = 7 /* Operating system / ABI identification */
+ EI_ABIVERSION = 8 /* ABI version */
+ EI_PAD = 9 /* Start of padding (per SVR4 ABI). */
+ EI_NIDENT = 16 /* Size of e_ident array. */
+)</pre> <p>Magic number for the elf trampoline, chosen wisely to be an immediate value. </p>
+<pre data-language="go">const ARM_MAGIC_TRAMP_NUMBER = 0x5c000003</pre> <p>Initial magic number for ELF files. </p>
+<pre data-language="go">const ELFMAG = "\177ELF"</pre> <pre data-language="go">const Sym32Size = 16</pre> <pre data-language="go">const Sym64Size = 24</pre> <h2 id="pkg-variables">Variables</h2> <p>ErrNoSymbols is returned by <a href="#File.Symbols">File.Symbols</a> and <a href="#File.DynamicSymbols">File.DynamicSymbols</a> if there is no such section in the File. </p>
+<pre data-language="go">var ErrNoSymbols = errors.New("no symbol section")</pre> <h2 id="R_INFO">func <span>R_INFO</span> </h2> <pre data-language="go">func R_INFO(sym, typ uint32) uint64</pre> <h2 id="R_INFO32">func <span>R_INFO32</span> </h2> <pre data-language="go">func R_INFO32(sym, typ uint32) uint32</pre> <h2 id="R_SYM32">func <span>R_SYM32</span> </h2> <pre data-language="go">func R_SYM32(info uint32) uint32</pre> <h2 id="R_SYM64">func <span>R_SYM64</span> </h2> <pre data-language="go">func R_SYM64(info uint64) uint32</pre> <h2 id="R_TYPE32">func <span>R_TYPE32</span> </h2> <pre data-language="go">func R_TYPE32(info uint32) uint32</pre> <h2 id="R_TYPE64">func <span>R_TYPE64</span> </h2> <pre data-language="go">func R_TYPE64(info uint64) uint32</pre> <h2 id="ST_INFO">func <span>ST_INFO</span> </h2> <pre data-language="go">func ST_INFO(bind SymBind, typ SymType) uint8</pre> <h2 id="Chdr32">type <span>Chdr32</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>ELF32 Compression header. </p>
+<pre data-language="go">type Chdr32 struct {
+ Type uint32
+ Size uint32
+ Addralign uint32
+}
+</pre> <h2 id="Chdr64">type <span>Chdr64</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>ELF64 Compression header. </p>
+<pre data-language="go">type Chdr64 struct {
+ Type uint32
+
+ Size uint64
+ Addralign uint64
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="Class">type <span>Class</span> </h2> <p>Class is found in Header.Ident[EI_CLASS] and Header.Class. </p>
+<pre data-language="go">type Class byte</pre> <pre data-language="go">const (
+ ELFCLASSNONE Class = 0 /* Unknown class. */
+ ELFCLASS32 Class = 1 /* 32-bit architecture. */
+ ELFCLASS64 Class = 2 /* 64-bit architecture. */
+)</pre> <h3 id="Class.GoString">func (Class) <span>GoString</span> </h3> <pre data-language="go">func (i Class) GoString() string</pre> <h3 id="Class.String">func (Class) <span>String</span> </h3> <pre data-language="go">func (i Class) String() string</pre> <h2 id="CompressionType">type <span>CompressionType</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>Section compression type. </p>
+<pre data-language="go">type CompressionType int</pre> <pre data-language="go">const (
+ COMPRESS_ZLIB CompressionType = 1 /* ZLIB compression. */
+ COMPRESS_ZSTD CompressionType = 2 /* ZSTD compression. */
+ COMPRESS_LOOS CompressionType = 0x60000000 /* First OS-specific. */
+ COMPRESS_HIOS CompressionType = 0x6fffffff /* Last OS-specific. */
+ COMPRESS_LOPROC CompressionType = 0x70000000 /* First processor-specific type. */
+ COMPRESS_HIPROC CompressionType = 0x7fffffff /* Last processor-specific type. */
+)</pre> <h3 id="CompressionType.GoString">func (CompressionType) <span>GoString</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (i CompressionType) GoString() string</pre> <h3 id="CompressionType.String">func (CompressionType) <span>String</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (i CompressionType) String() string</pre> <h2 id="Data">type <span>Data</span> </h2> <p>Data is found in Header.Ident[EI_DATA] and Header.Data. </p>
+<pre data-language="go">type Data byte</pre> <pre data-language="go">const (
+ ELFDATANONE Data = 0 /* Unknown data format. */
+ ELFDATA2LSB Data = 1 /* 2's complement little-endian. */
+ ELFDATA2MSB Data = 2 /* 2's complement big-endian. */
+)</pre> <h3 id="Data.GoString">func (Data) <span>GoString</span> </h3> <pre data-language="go">func (i Data) GoString() string</pre> <h3 id="Data.String">func (Data) <span>String</span> </h3> <pre data-language="go">func (i Data) String() string</pre> <h2 id="Dyn32">type <span>Dyn32</span> </h2> <p>ELF32 Dynamic structure. The ".dynamic" section contains an array of them. </p>
+<pre data-language="go">type Dyn32 struct {
+ Tag int32 /* Entry type. */
+ Val uint32 /* Integer/Address value. */
+}
+</pre> <h2 id="Dyn64">type <span>Dyn64</span> </h2> <p>ELF64 Dynamic structure. The ".dynamic" section contains an array of them. </p>
+<pre data-language="go">type Dyn64 struct {
+ Tag int64 /* Entry type. */
+ Val uint64 /* Integer/address value */
+}
+</pre> <h2 id="DynFlag">type <span>DynFlag</span> </h2> <p>DT_FLAGS values. </p>
+<pre data-language="go">type DynFlag int</pre> <pre data-language="go">const (
+ DF_ORIGIN DynFlag = 0x0001 /* Indicates that the object being loaded may
+ make reference to the
+ $ORIGIN substitution string */
+ DF_SYMBOLIC DynFlag = 0x0002 /* Indicates "symbolic" linking. */
+ DF_TEXTREL DynFlag = 0x0004 /* Indicates there may be relocations in non-writable segments. */
+ DF_BIND_NOW DynFlag = 0x0008 /* Indicates that the dynamic linker should
+ process all relocations for the object
+ containing this entry before transferring
+ control to the program. */
+ DF_STATIC_TLS DynFlag = 0x0010 /* Indicates that the shared object or
+ executable contains code using a static
+ thread-local storage scheme. */
+)</pre> <h3 id="DynFlag.GoString">func (DynFlag) <span>GoString</span> </h3> <pre data-language="go">func (i DynFlag) GoString() string</pre> <h3 id="DynFlag.String">func (DynFlag) <span>String</span> </h3> <pre data-language="go">func (i DynFlag) String() string</pre> <h2 id="DynFlag1">type <span>DynFlag1</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>DT_FLAGS_1 values. </p>
+<pre data-language="go">type DynFlag1 uint32</pre> <pre data-language="go">const (
+ // Indicates that all relocations for this object must be processed before
+ // returning control to the program.
+ DF_1_NOW DynFlag1 = 0x00000001
+ // Unused.
+ DF_1_GLOBAL DynFlag1 = 0x00000002
+ // Indicates that the object is a member of a group.
+ DF_1_GROUP DynFlag1 = 0x00000004
+ // Indicates that the object cannot be deleted from a process.
+ DF_1_NODELETE DynFlag1 = 0x00000008
+ // Meaningful only for filters. Indicates that all associated filtees be
+ // processed immediately.
+ DF_1_LOADFLTR DynFlag1 = 0x00000010
+ // Indicates that this object's initialization section be run before any other
+ // objects loaded.
+ DF_1_INITFIRST DynFlag1 = 0x00000020
+ // Indicates that the object cannot be added to a running process with dlopen.
+ DF_1_NOOPEN DynFlag1 = 0x00000040
+ // Indicates the object requires $ORIGIN processing.
+ DF_1_ORIGIN DynFlag1 = 0x00000080
+ // Indicates that the object should use direct binding information.
+ DF_1_DIRECT DynFlag1 = 0x00000100
+ // Unused.
+ DF_1_TRANS DynFlag1 = 0x00000200
+ // Indicates that the objects symbol table is to interpose before all symbols
+ // except the primary load object, which is typically the executable.
+ DF_1_INTERPOSE DynFlag1 = 0x00000400
+ // Indicates that the search for dependencies of this object ignores any
+ // default library search paths.
+ DF_1_NODEFLIB DynFlag1 = 0x00000800
+ // Indicates that this object is not dumped by dldump. Candidates are objects
+ // with no relocations that might get included when generating alternative
+ // objects using.
+ DF_1_NODUMP DynFlag1 = 0x00001000
+ // Identifies this object as a configuration alternative object generated by
+ // crle. Triggers the runtime linker to search for a configuration file $ORIGIN/ld.config.app-name.
+ DF_1_CONFALT DynFlag1 = 0x00002000
+ // Meaningful only for filtees. Terminates a filters search for any
+ // further filtees.
+ DF_1_ENDFILTEE DynFlag1 = 0x00004000
+ // Indicates that this object has displacement relocations applied.
+ DF_1_DISPRELDNE DynFlag1 = 0x00008000
+ // Indicates that this object has displacement relocations pending.
+ DF_1_DISPRELPND DynFlag1 = 0x00010000
+ // Indicates that this object contains symbols that cannot be directly
+ // bound to.
+ DF_1_NODIRECT DynFlag1 = 0x00020000
+ // Reserved for internal use by the kernel runtime-linker.
+ DF_1_IGNMULDEF DynFlag1 = 0x00040000
+ // Reserved for internal use by the kernel runtime-linker.
+ DF_1_NOKSYMS DynFlag1 = 0x00080000
+ // Reserved for internal use by the kernel runtime-linker.
+ DF_1_NOHDR DynFlag1 = 0x00100000
+ // Indicates that this object has been edited or has been modified since the
+ // objects original construction by the link-editor.
+ DF_1_EDITED DynFlag1 = 0x00200000
+ // Reserved for internal use by the kernel runtime-linker.
+ DF_1_NORELOC DynFlag1 = 0x00400000
+ // Indicates that the object contains individual symbols that should interpose
+ // before all symbols except the primary load object, which is typically the
+ // executable.
+ DF_1_SYMINTPOSE DynFlag1 = 0x00800000
+ // Indicates that the executable requires global auditing.
+ DF_1_GLOBAUDIT DynFlag1 = 0x01000000
+ // Indicates that the object defines, or makes reference to singleton symbols.
+ DF_1_SINGLETON DynFlag1 = 0x02000000
+ // Indicates that the object is a stub.
+ DF_1_STUB DynFlag1 = 0x04000000
+ // Indicates that the object is a position-independent executable.
+ DF_1_PIE DynFlag1 = 0x08000000
+ // Indicates that the object is a kernel module.
+ DF_1_KMOD DynFlag1 = 0x10000000
+ // Indicates that the object is a weak standard filter.
+ DF_1_WEAKFILTER DynFlag1 = 0x20000000
+ // Unused.
+ DF_1_NOCOMMON DynFlag1 = 0x40000000
+)</pre> <h3 id="DynFlag1.GoString">func (DynFlag1) <span>GoString</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (i DynFlag1) GoString() string</pre> <h3 id="DynFlag1.String">func (DynFlag1) <span>String</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (i DynFlag1) String() string</pre> <h2 id="DynTag">type <span>DynTag</span> </h2> <p>Dyn.Tag </p>
+<pre data-language="go">type DynTag int</pre> <pre data-language="go">const (
+ DT_NULL DynTag = 0 /* Terminating entry. */
+ DT_NEEDED DynTag = 1 /* String table offset of a needed shared library. */
+ DT_PLTRELSZ DynTag = 2 /* Total size in bytes of PLT relocations. */
+ DT_PLTGOT DynTag = 3 /* Processor-dependent address. */
+ DT_HASH DynTag = 4 /* Address of symbol hash table. */
+ DT_STRTAB DynTag = 5 /* Address of string table. */
+ DT_SYMTAB DynTag = 6 /* Address of symbol table. */
+ DT_RELA DynTag = 7 /* Address of ElfNN_Rela relocations. */
+ DT_RELASZ DynTag = 8 /* Total size of ElfNN_Rela relocations. */
+ DT_RELAENT DynTag = 9 /* Size of each ElfNN_Rela relocation entry. */
+ DT_STRSZ DynTag = 10 /* Size of string table. */
+ DT_SYMENT DynTag = 11 /* Size of each symbol table entry. */
+ DT_INIT DynTag = 12 /* Address of initialization function. */
+ DT_FINI DynTag = 13 /* Address of finalization function. */
+ DT_SONAME DynTag = 14 /* String table offset of shared object name. */
+ DT_RPATH DynTag = 15 /* String table offset of library path. [sup] */
+ DT_SYMBOLIC DynTag = 16 /* Indicates "symbolic" linking. [sup] */
+ DT_REL DynTag = 17 /* Address of ElfNN_Rel relocations. */
+ DT_RELSZ DynTag = 18 /* Total size of ElfNN_Rel relocations. */
+ DT_RELENT DynTag = 19 /* Size of each ElfNN_Rel relocation. */
+ DT_PLTREL DynTag = 20 /* Type of relocation used for PLT. */
+ DT_DEBUG DynTag = 21 /* Reserved (not used). */
+ DT_TEXTREL DynTag = 22 /* Indicates there may be relocations in non-writable segments. [sup] */
+ DT_JMPREL DynTag = 23 /* Address of PLT relocations. */
+ DT_BIND_NOW DynTag = 24 /* [sup] */
+ DT_INIT_ARRAY DynTag = 25 /* Address of the array of pointers to initialization functions */
+ DT_FINI_ARRAY DynTag = 26 /* Address of the array of pointers to termination functions */
+ DT_INIT_ARRAYSZ DynTag = 27 /* Size in bytes of the array of initialization functions. */
+ DT_FINI_ARRAYSZ DynTag = 28 /* Size in bytes of the array of termination functions. */
+ DT_RUNPATH DynTag = 29 /* String table offset of a null-terminated library search path string. */
+ DT_FLAGS DynTag = 30 /* Object specific flag values. */
+ DT_ENCODING DynTag = 32 /* Values greater than or equal to DT_ENCODING
+ and less than DT_LOOS follow the rules for
+ the interpretation of the d_un union
+ as follows: even == 'd_ptr', even == 'd_val'
+ or none */
+ DT_PREINIT_ARRAY DynTag = 32 /* Address of the array of pointers to pre-initialization functions. */
+ DT_PREINIT_ARRAYSZ DynTag = 33 /* Size in bytes of the array of pre-initialization functions. */
+ DT_SYMTAB_SHNDX DynTag = 34 /* Address of SHT_SYMTAB_SHNDX section. */
+
+ DT_LOOS DynTag = 0x6000000d /* First OS-specific */
+ DT_HIOS DynTag = 0x6ffff000 /* Last OS-specific */
+
+ DT_VALRNGLO DynTag = 0x6ffffd00
+ DT_GNU_PRELINKED DynTag = 0x6ffffdf5
+ DT_GNU_CONFLICTSZ DynTag = 0x6ffffdf6
+ DT_GNU_LIBLISTSZ DynTag = 0x6ffffdf7
+ DT_CHECKSUM DynTag = 0x6ffffdf8
+ DT_PLTPADSZ DynTag = 0x6ffffdf9
+ DT_MOVEENT DynTag = 0x6ffffdfa
+ DT_MOVESZ DynTag = 0x6ffffdfb
+ DT_FEATURE DynTag = 0x6ffffdfc
+ DT_POSFLAG_1 DynTag = 0x6ffffdfd
+ DT_SYMINSZ DynTag = 0x6ffffdfe
+ DT_SYMINENT DynTag = 0x6ffffdff
+ DT_VALRNGHI DynTag = 0x6ffffdff
+
+ DT_ADDRRNGLO DynTag = 0x6ffffe00
+ DT_GNU_HASH DynTag = 0x6ffffef5
+ DT_TLSDESC_PLT DynTag = 0x6ffffef6
+ DT_TLSDESC_GOT DynTag = 0x6ffffef7
+ DT_GNU_CONFLICT DynTag = 0x6ffffef8
+ DT_GNU_LIBLIST DynTag = 0x6ffffef9
+ DT_CONFIG DynTag = 0x6ffffefa
+ DT_DEPAUDIT DynTag = 0x6ffffefb
+ DT_AUDIT DynTag = 0x6ffffefc
+ DT_PLTPAD DynTag = 0x6ffffefd
+ DT_MOVETAB DynTag = 0x6ffffefe
+ DT_SYMINFO DynTag = 0x6ffffeff
+ DT_ADDRRNGHI DynTag = 0x6ffffeff
+
+ DT_VERSYM DynTag = 0x6ffffff0
+ DT_RELACOUNT DynTag = 0x6ffffff9
+ DT_RELCOUNT DynTag = 0x6ffffffa
+ DT_FLAGS_1 DynTag = 0x6ffffffb
+ DT_VERDEF DynTag = 0x6ffffffc
+ DT_VERDEFNUM DynTag = 0x6ffffffd
+ DT_VERNEED DynTag = 0x6ffffffe
+ DT_VERNEEDNUM DynTag = 0x6fffffff
+
+ DT_LOPROC DynTag = 0x70000000 /* First processor-specific type. */
+
+ DT_MIPS_RLD_VERSION DynTag = 0x70000001
+ DT_MIPS_TIME_STAMP DynTag = 0x70000002
+ DT_MIPS_ICHECKSUM DynTag = 0x70000003
+ DT_MIPS_IVERSION DynTag = 0x70000004
+ DT_MIPS_FLAGS DynTag = 0x70000005
+ DT_MIPS_BASE_ADDRESS DynTag = 0x70000006
+ DT_MIPS_MSYM DynTag = 0x70000007
+ DT_MIPS_CONFLICT DynTag = 0x70000008
+ DT_MIPS_LIBLIST DynTag = 0x70000009
+ DT_MIPS_LOCAL_GOTNO DynTag = 0x7000000a
+ DT_MIPS_CONFLICTNO DynTag = 0x7000000b
+ DT_MIPS_LIBLISTNO DynTag = 0x70000010
+ DT_MIPS_SYMTABNO DynTag = 0x70000011
+ DT_MIPS_UNREFEXTNO DynTag = 0x70000012
+ DT_MIPS_GOTSYM DynTag = 0x70000013
+ DT_MIPS_HIPAGENO DynTag = 0x70000014
+ DT_MIPS_RLD_MAP DynTag = 0x70000016
+ DT_MIPS_DELTA_CLASS DynTag = 0x70000017
+ DT_MIPS_DELTA_CLASS_NO DynTag = 0x70000018
+ DT_MIPS_DELTA_INSTANCE DynTag = 0x70000019
+ DT_MIPS_DELTA_INSTANCE_NO DynTag = 0x7000001a
+ DT_MIPS_DELTA_RELOC DynTag = 0x7000001b
+ DT_MIPS_DELTA_RELOC_NO DynTag = 0x7000001c
+ DT_MIPS_DELTA_SYM DynTag = 0x7000001d
+ DT_MIPS_DELTA_SYM_NO DynTag = 0x7000001e
+ DT_MIPS_DELTA_CLASSSYM DynTag = 0x70000020
+ DT_MIPS_DELTA_CLASSSYM_NO DynTag = 0x70000021
+ DT_MIPS_CXX_FLAGS DynTag = 0x70000022
+ DT_MIPS_PIXIE_INIT DynTag = 0x70000023
+ DT_MIPS_SYMBOL_LIB DynTag = 0x70000024
+ DT_MIPS_LOCALPAGE_GOTIDX DynTag = 0x70000025
+ DT_MIPS_LOCAL_GOTIDX DynTag = 0x70000026
+ DT_MIPS_HIDDEN_GOTIDX DynTag = 0x70000027
+ DT_MIPS_PROTECTED_GOTIDX DynTag = 0x70000028
+ DT_MIPS_OPTIONS DynTag = 0x70000029
+ DT_MIPS_INTERFACE DynTag = 0x7000002a
+ DT_MIPS_DYNSTR_ALIGN DynTag = 0x7000002b
+ DT_MIPS_INTERFACE_SIZE DynTag = 0x7000002c
+ DT_MIPS_RLD_TEXT_RESOLVE_ADDR DynTag = 0x7000002d
+ DT_MIPS_PERF_SUFFIX DynTag = 0x7000002e
+ DT_MIPS_COMPACT_SIZE DynTag = 0x7000002f
+ DT_MIPS_GP_VALUE DynTag = 0x70000030
+ DT_MIPS_AUX_DYNAMIC DynTag = 0x70000031
+ DT_MIPS_PLTGOT DynTag = 0x70000032
+ DT_MIPS_RWPLT DynTag = 0x70000034
+ DT_MIPS_RLD_MAP_REL DynTag = 0x70000035
+
+ DT_PPC_GOT DynTag = 0x70000000
+ DT_PPC_OPT DynTag = 0x70000001
+
+ DT_PPC64_GLINK DynTag = 0x70000000
+ DT_PPC64_OPD DynTag = 0x70000001
+ DT_PPC64_OPDSZ DynTag = 0x70000002
+ DT_PPC64_OPT DynTag = 0x70000003
+
+ DT_SPARC_REGISTER DynTag = 0x70000001
+
+ DT_AUXILIARY DynTag = 0x7ffffffd
+ DT_USED DynTag = 0x7ffffffe
+ DT_FILTER DynTag = 0x7fffffff
+
+ DT_HIPROC DynTag = 0x7fffffff /* Last processor-specific type. */
+)</pre> <h3 id="DynTag.GoString">func (DynTag) <span>GoString</span> </h3> <pre data-language="go">func (i DynTag) GoString() string</pre> <h3 id="DynTag.String">func (DynTag) <span>String</span> </h3> <pre data-language="go">func (i DynTag) String() string</pre> <h2 id="File">type <span>File</span> </h2> <p>A File represents an open ELF file. </p>
+<pre data-language="go">type File struct {
+ FileHeader
+ Sections []*Section
+ Progs []*Prog
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFile">func <span>NewFile</span> </h3> <pre data-language="go">func NewFile(r io.ReaderAt) (*File, error)</pre> <p>NewFile creates a new <a href="#File">File</a> for accessing an ELF binary in an underlying reader. The ELF binary is expected to start at position 0 in the ReaderAt. </p>
+<h3 id="Open">func <span>Open</span> </h3> <pre data-language="go">func Open(name string) (*File, error)</pre> <p>Open opens the named file using <span>os.Open</span> and prepares it for use as an ELF binary. </p>
+<h3 id="File.Close">func (*File) <span>Close</span> </h3> <pre data-language="go">func (f *File) Close() error</pre> <p>Close closes the <a href="#File">File</a>. If the <a href="#File">File</a> was created using <a href="#NewFile">NewFile</a> directly instead of <a href="#Open">Open</a>, Close has no effect. </p>
+<h3 id="File.DWARF">func (*File) <span>DWARF</span> </h3> <pre data-language="go">func (f *File) DWARF() (*dwarf.Data, error)</pre> <h3 id="File.DynString">func (*File) <span>DynString</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (f *File) DynString(tag DynTag) ([]string, error)</pre> <p>DynString returns the strings listed for the given tag in the file's dynamic section. </p>
+<p>The tag must be one that takes string values: <a href="#DT_NEEDED">DT_NEEDED</a>, <a href="#DT_SONAME">DT_SONAME</a>, <a href="#DT_RPATH">DT_RPATH</a>, or <a href="#DT_RUNPATH">DT_RUNPATH</a>. </p>
+<h3 id="File.DynValue">func (*File) <span>DynValue</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (f *File) DynValue(tag DynTag) ([]uint64, error)</pre> <p>DynValue returns the values listed for the given tag in the file's dynamic section. </p>
+<h3 id="File.DynamicSymbols">func (*File) <span>DynamicSymbols</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (f *File) DynamicSymbols() ([]Symbol, error)</pre> <p>DynamicSymbols returns the dynamic symbol table for f. The symbols will be listed in the order they appear in f. </p>
+<p>If f has a symbol version table, the returned <a href="#File.Symbols">File.Symbols</a> will have initialized <a href="#Version">Version</a> and Library fields. </p>
+<p>For compatibility with <a href="#File.Symbols">File.Symbols</a>, <a href="#File.DynamicSymbols">File.DynamicSymbols</a> omits the null symbol at index 0. After retrieving the symbols as symtab, an externally supplied index x corresponds to symtab[x-1], not symtab[x]. </p>
+<h3 id="File.ImportedLibraries">func (*File) <span>ImportedLibraries</span> </h3> <pre data-language="go">func (f *File) ImportedLibraries() ([]string, error)</pre> <p>ImportedLibraries returns the names of all libraries referred to by the binary f that are expected to be linked with the binary at dynamic link time. </p>
+<h3 id="File.ImportedSymbols">func (*File) <span>ImportedSymbols</span> </h3> <pre data-language="go">func (f *File) ImportedSymbols() ([]ImportedSymbol, error)</pre> <p>ImportedSymbols returns the names of all symbols referred to by the binary f that are expected to be satisfied by other libraries at dynamic load time. It does not return weak symbols. </p>
+<h3 id="File.Section">func (*File) <span>Section</span> </h3> <pre data-language="go">func (f *File) Section(name string) *Section</pre> <p>Section returns a section with the given name, or nil if no such section exists. </p>
+<h3 id="File.SectionByType">func (*File) <span>SectionByType</span> </h3> <pre data-language="go">func (f *File) SectionByType(typ SectionType) *Section</pre> <p>SectionByType returns the first section in f with the given type, or nil if there is no such section. </p>
+<h3 id="File.Symbols">func (*File) <span>Symbols</span> </h3> <pre data-language="go">func (f *File) Symbols() ([]Symbol, error)</pre> <p>Symbols returns the symbol table for f. The symbols will be listed in the order they appear in f. </p>
+<p>For compatibility with Go 1.0, Symbols omits the null symbol at index 0. After retrieving the symbols as symtab, an externally supplied index x corresponds to symtab[x-1], not symtab[x]. </p>
+<h2 id="FileHeader">type <span>FileHeader</span> </h2> <p>A FileHeader represents an ELF file header. </p>
+<pre data-language="go">type FileHeader struct {
+ Class Class
+ Data Data
+ Version Version
+ OSABI OSABI
+ ABIVersion uint8
+ ByteOrder binary.ByteOrder
+ Type Type
+ Machine Machine
+ Entry uint64 // Go 1.1
+}
+</pre> <h2 id="FormatError">type <span>FormatError</span> </h2> <pre data-language="go">type FormatError struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="FormatError.Error">func (*FormatError) <span>Error</span> </h3> <pre data-language="go">func (e *FormatError) Error() string</pre> <h2 id="Header32">type <span>Header32</span> </h2> <p>ELF32 File header. </p>
+<pre data-language="go">type Header32 struct {
+ Ident [EI_NIDENT]byte /* File identification. */
+ Type uint16 /* File type. */
+ Machine uint16 /* Machine architecture. */
+ Version uint32 /* ELF format version. */
+ Entry uint32 /* Entry point. */
+ Phoff uint32 /* Program header file offset. */
+ Shoff uint32 /* Section header file offset. */
+ Flags uint32 /* Architecture-specific flags. */
+ Ehsize uint16 /* Size of ELF header in bytes. */
+ Phentsize uint16 /* Size of program header entry. */
+ Phnum uint16 /* Number of program header entries. */
+ Shentsize uint16 /* Size of section header entry. */
+ Shnum uint16 /* Number of section header entries. */
+ Shstrndx uint16 /* Section name strings section. */
+}
+</pre> <h2 id="Header64">type <span>Header64</span> </h2> <p>ELF64 file header. </p>
+<pre data-language="go">type Header64 struct {
+ Ident [EI_NIDENT]byte /* File identification. */
+ Type uint16 /* File type. */
+ Machine uint16 /* Machine architecture. */
+ Version uint32 /* ELF format version. */
+ Entry uint64 /* Entry point. */
+ Phoff uint64 /* Program header file offset. */
+ Shoff uint64 /* Section header file offset. */
+ Flags uint32 /* Architecture-specific flags. */
+ Ehsize uint16 /* Size of ELF header in bytes. */
+ Phentsize uint16 /* Size of program header entry. */
+ Phnum uint16 /* Number of program header entries. */
+ Shentsize uint16 /* Size of section header entry. */
+ Shnum uint16 /* Number of section header entries. */
+ Shstrndx uint16 /* Section name strings section. */
+}
+</pre> <h2 id="ImportedSymbol">type <span>ImportedSymbol</span> </h2> <pre data-language="go">type ImportedSymbol struct {
+ Name string
+ Version string
+ Library string
+}
+</pre> <h2 id="Machine">type <span>Machine</span> </h2> <p>Machine is found in Header.Machine. </p>
+<pre data-language="go">type Machine uint16</pre> <pre data-language="go">const (
+ EM_NONE Machine = 0 /* Unknown machine. */
+ EM_M32 Machine = 1 /* AT&amp;T WE32100. */
+ EM_SPARC Machine = 2 /* Sun SPARC. */
+ EM_386 Machine = 3 /* Intel i386. */
+ EM_68K Machine = 4 /* Motorola 68000. */
+ EM_88K Machine = 5 /* Motorola 88000. */
+ EM_860 Machine = 7 /* Intel i860. */
+ EM_MIPS Machine = 8 /* MIPS R3000 Big-Endian only. */
+ EM_S370 Machine = 9 /* IBM System/370. */
+ EM_MIPS_RS3_LE Machine = 10 /* MIPS R3000 Little-Endian. */
+ EM_PARISC Machine = 15 /* HP PA-RISC. */
+ EM_VPP500 Machine = 17 /* Fujitsu VPP500. */
+ EM_SPARC32PLUS Machine = 18 /* SPARC v8plus. */
+ EM_960 Machine = 19 /* Intel 80960. */
+ EM_PPC Machine = 20 /* PowerPC 32-bit. */
+ EM_PPC64 Machine = 21 /* PowerPC 64-bit. */
+ EM_S390 Machine = 22 /* IBM System/390. */
+ EM_V800 Machine = 36 /* NEC V800. */
+ EM_FR20 Machine = 37 /* Fujitsu FR20. */
+ EM_RH32 Machine = 38 /* TRW RH-32. */
+ EM_RCE Machine = 39 /* Motorola RCE. */
+ EM_ARM Machine = 40 /* ARM. */
+ EM_SH Machine = 42 /* Hitachi SH. */
+ EM_SPARCV9 Machine = 43 /* SPARC v9 64-bit. */
+ EM_TRICORE Machine = 44 /* Siemens TriCore embedded processor. */
+ EM_ARC Machine = 45 /* Argonaut RISC Core. */
+ EM_H8_300 Machine = 46 /* Hitachi H8/300. */
+ EM_H8_300H Machine = 47 /* Hitachi H8/300H. */
+ EM_H8S Machine = 48 /* Hitachi H8S. */
+ EM_H8_500 Machine = 49 /* Hitachi H8/500. */
+ EM_IA_64 Machine = 50 /* Intel IA-64 Processor. */
+ EM_MIPS_X Machine = 51 /* Stanford MIPS-X. */
+ EM_COLDFIRE Machine = 52 /* Motorola ColdFire. */
+ EM_68HC12 Machine = 53 /* Motorola M68HC12. */
+ EM_MMA Machine = 54 /* Fujitsu MMA. */
+ EM_PCP Machine = 55 /* Siemens PCP. */
+ EM_NCPU Machine = 56 /* Sony nCPU. */
+ EM_NDR1 Machine = 57 /* Denso NDR1 microprocessor. */
+ EM_STARCORE Machine = 58 /* Motorola Star*Core processor. */
+ EM_ME16 Machine = 59 /* Toyota ME16 processor. */
+ EM_ST100 Machine = 60 /* STMicroelectronics ST100 processor. */
+ EM_TINYJ Machine = 61 /* Advanced Logic Corp. TinyJ processor. */
+ EM_X86_64 Machine = 62 /* Advanced Micro Devices x86-64 */
+ EM_PDSP Machine = 63 /* Sony DSP Processor */
+ EM_PDP10 Machine = 64 /* Digital Equipment Corp. PDP-10 */
+ EM_PDP11 Machine = 65 /* Digital Equipment Corp. PDP-11 */
+ EM_FX66 Machine = 66 /* Siemens FX66 microcontroller */
+ EM_ST9PLUS Machine = 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */
+ EM_ST7 Machine = 68 /* STMicroelectronics ST7 8-bit microcontroller */
+ EM_68HC16 Machine = 69 /* Motorola MC68HC16 Microcontroller */
+ EM_68HC11 Machine = 70 /* Motorola MC68HC11 Microcontroller */
+ EM_68HC08 Machine = 71 /* Motorola MC68HC08 Microcontroller */
+ EM_68HC05 Machine = 72 /* Motorola MC68HC05 Microcontroller */
+ EM_SVX Machine = 73 /* Silicon Graphics SVx */
+ EM_ST19 Machine = 74 /* STMicroelectronics ST19 8-bit microcontroller */
+ EM_VAX Machine = 75 /* Digital VAX */
+ EM_CRIS Machine = 76 /* Axis Communications 32-bit embedded processor */
+ EM_JAVELIN Machine = 77 /* Infineon Technologies 32-bit embedded processor */
+ EM_FIREPATH Machine = 78 /* Element 14 64-bit DSP Processor */
+ EM_ZSP Machine = 79 /* LSI Logic 16-bit DSP Processor */
+ EM_MMIX Machine = 80 /* Donald Knuth's educational 64-bit processor */
+ EM_HUANY Machine = 81 /* Harvard University machine-independent object files */
+ EM_PRISM Machine = 82 /* SiTera Prism */
+ EM_AVR Machine = 83 /* Atmel AVR 8-bit microcontroller */
+ EM_FR30 Machine = 84 /* Fujitsu FR30 */
+ EM_D10V Machine = 85 /* Mitsubishi D10V */
+ EM_D30V Machine = 86 /* Mitsubishi D30V */
+ EM_V850 Machine = 87 /* NEC v850 */
+ EM_M32R Machine = 88 /* Mitsubishi M32R */
+ EM_MN10300 Machine = 89 /* Matsushita MN10300 */
+ EM_MN10200 Machine = 90 /* Matsushita MN10200 */
+ EM_PJ Machine = 91 /* picoJava */
+ EM_OPENRISC Machine = 92 /* OpenRISC 32-bit embedded processor */
+ EM_ARC_COMPACT Machine = 93 /* ARC International ARCompact processor (old spelling/synonym: EM_ARC_A5) */
+ EM_XTENSA Machine = 94 /* Tensilica Xtensa Architecture */
+ EM_VIDEOCORE Machine = 95 /* Alphamosaic VideoCore processor */
+ EM_TMM_GPP Machine = 96 /* Thompson Multimedia General Purpose Processor */
+ EM_NS32K Machine = 97 /* National Semiconductor 32000 series */
+ EM_TPC Machine = 98 /* Tenor Network TPC processor */
+ EM_SNP1K Machine = 99 /* Trebia SNP 1000 processor */
+ EM_ST200 Machine = 100 /* STMicroelectronics (www.st.com) ST200 microcontroller */
+ EM_IP2K Machine = 101 /* Ubicom IP2xxx microcontroller family */
+ EM_MAX Machine = 102 /* MAX Processor */
+ EM_CR Machine = 103 /* National Semiconductor CompactRISC microprocessor */
+ EM_F2MC16 Machine = 104 /* Fujitsu F2MC16 */
+ EM_MSP430 Machine = 105 /* Texas Instruments embedded microcontroller msp430 */
+ EM_BLACKFIN Machine = 106 /* Analog Devices Blackfin (DSP) processor */
+ EM_SE_C33 Machine = 107 /* S1C33 Family of Seiko Epson processors */
+ EM_SEP Machine = 108 /* Sharp embedded microprocessor */
+ EM_ARCA Machine = 109 /* Arca RISC Microprocessor */
+ EM_UNICORE Machine = 110 /* Microprocessor series from PKU-Unity Ltd. and MPRC of Peking University */
+ EM_EXCESS Machine = 111 /* eXcess: 16/32/64-bit configurable embedded CPU */
+ EM_DXP Machine = 112 /* Icera Semiconductor Inc. Deep Execution Processor */
+ EM_ALTERA_NIOS2 Machine = 113 /* Altera Nios II soft-core processor */
+ EM_CRX Machine = 114 /* National Semiconductor CompactRISC CRX microprocessor */
+ EM_XGATE Machine = 115 /* Motorola XGATE embedded processor */
+ EM_C166 Machine = 116 /* Infineon C16x/XC16x processor */
+ EM_M16C Machine = 117 /* Renesas M16C series microprocessors */
+ EM_DSPIC30F Machine = 118 /* Microchip Technology dsPIC30F Digital Signal Controller */
+ EM_CE Machine = 119 /* Freescale Communication Engine RISC core */
+ EM_M32C Machine = 120 /* Renesas M32C series microprocessors */
+ EM_TSK3000 Machine = 131 /* Altium TSK3000 core */
+ EM_RS08 Machine = 132 /* Freescale RS08 embedded processor */
+ EM_SHARC Machine = 133 /* Analog Devices SHARC family of 32-bit DSP processors */
+ EM_ECOG2 Machine = 134 /* Cyan Technology eCOG2 microprocessor */
+ EM_SCORE7 Machine = 135 /* Sunplus S+core7 RISC processor */
+ EM_DSP24 Machine = 136 /* New Japan Radio (NJR) 24-bit DSP Processor */
+ EM_VIDEOCORE3 Machine = 137 /* Broadcom VideoCore III processor */
+ EM_LATTICEMICO32 Machine = 138 /* RISC processor for Lattice FPGA architecture */
+ EM_SE_C17 Machine = 139 /* Seiko Epson C17 family */
+ EM_TI_C6000 Machine = 140 /* The Texas Instruments TMS320C6000 DSP family */
+ EM_TI_C2000 Machine = 141 /* The Texas Instruments TMS320C2000 DSP family */
+ EM_TI_C5500 Machine = 142 /* The Texas Instruments TMS320C55x DSP family */
+ EM_TI_ARP32 Machine = 143 /* Texas Instruments Application Specific RISC Processor, 32bit fetch */
+ EM_TI_PRU Machine = 144 /* Texas Instruments Programmable Realtime Unit */
+ EM_MMDSP_PLUS Machine = 160 /* STMicroelectronics 64bit VLIW Data Signal Processor */
+ EM_CYPRESS_M8C Machine = 161 /* Cypress M8C microprocessor */
+ EM_R32C Machine = 162 /* Renesas R32C series microprocessors */
+ EM_TRIMEDIA Machine = 163 /* NXP Semiconductors TriMedia architecture family */
+ EM_QDSP6 Machine = 164 /* QUALCOMM DSP6 Processor */
+ EM_8051 Machine = 165 /* Intel 8051 and variants */
+ EM_STXP7X Machine = 166 /* STMicroelectronics STxP7x family of configurable and extensible RISC processors */
+ EM_NDS32 Machine = 167 /* Andes Technology compact code size embedded RISC processor family */
+ EM_ECOG1 Machine = 168 /* Cyan Technology eCOG1X family */
+ EM_ECOG1X Machine = 168 /* Cyan Technology eCOG1X family */
+ EM_MAXQ30 Machine = 169 /* Dallas Semiconductor MAXQ30 Core Micro-controllers */
+ EM_XIMO16 Machine = 170 /* New Japan Radio (NJR) 16-bit DSP Processor */
+ EM_MANIK Machine = 171 /* M2000 Reconfigurable RISC Microprocessor */
+ EM_CRAYNV2 Machine = 172 /* Cray Inc. NV2 vector architecture */
+ EM_RX Machine = 173 /* Renesas RX family */
+ EM_METAG Machine = 174 /* Imagination Technologies META processor architecture */
+ EM_MCST_ELBRUS Machine = 175 /* MCST Elbrus general purpose hardware architecture */
+ EM_ECOG16 Machine = 176 /* Cyan Technology eCOG16 family */
+ EM_CR16 Machine = 177 /* National Semiconductor CompactRISC CR16 16-bit microprocessor */
+ EM_ETPU Machine = 178 /* Freescale Extended Time Processing Unit */
+ EM_SLE9X Machine = 179 /* Infineon Technologies SLE9X core */
+ EM_L10M Machine = 180 /* Intel L10M */
+ EM_K10M Machine = 181 /* Intel K10M */
+ EM_AARCH64 Machine = 183 /* ARM 64-bit Architecture (AArch64) */
+ EM_AVR32 Machine = 185 /* Atmel Corporation 32-bit microprocessor family */
+ EM_STM8 Machine = 186 /* STMicroeletronics STM8 8-bit microcontroller */
+ EM_TILE64 Machine = 187 /* Tilera TILE64 multicore architecture family */
+ EM_TILEPRO Machine = 188 /* Tilera TILEPro multicore architecture family */
+ EM_MICROBLAZE Machine = 189 /* Xilinx MicroBlaze 32-bit RISC soft processor core */
+ EM_CUDA Machine = 190 /* NVIDIA CUDA architecture */
+ EM_TILEGX Machine = 191 /* Tilera TILE-Gx multicore architecture family */
+ EM_CLOUDSHIELD Machine = 192 /* CloudShield architecture family */
+ EM_COREA_1ST Machine = 193 /* KIPO-KAIST Core-A 1st generation processor family */
+ EM_COREA_2ND Machine = 194 /* KIPO-KAIST Core-A 2nd generation processor family */
+ EM_ARC_COMPACT2 Machine = 195 /* Synopsys ARCompact V2 */
+ EM_OPEN8 Machine = 196 /* Open8 8-bit RISC soft processor core */
+ EM_RL78 Machine = 197 /* Renesas RL78 family */
+ EM_VIDEOCORE5 Machine = 198 /* Broadcom VideoCore V processor */
+ EM_78KOR Machine = 199 /* Renesas 78KOR family */
+ EM_56800EX Machine = 200 /* Freescale 56800EX Digital Signal Controller (DSC) */
+ EM_BA1 Machine = 201 /* Beyond BA1 CPU architecture */
+ EM_BA2 Machine = 202 /* Beyond BA2 CPU architecture */
+ EM_XCORE Machine = 203 /* XMOS xCORE processor family */
+ EM_MCHP_PIC Machine = 204 /* Microchip 8-bit PIC(r) family */
+ EM_INTEL205 Machine = 205 /* Reserved by Intel */
+ EM_INTEL206 Machine = 206 /* Reserved by Intel */
+ EM_INTEL207 Machine = 207 /* Reserved by Intel */
+ EM_INTEL208 Machine = 208 /* Reserved by Intel */
+ EM_INTEL209 Machine = 209 /* Reserved by Intel */
+ EM_KM32 Machine = 210 /* KM211 KM32 32-bit processor */
+ EM_KMX32 Machine = 211 /* KM211 KMX32 32-bit processor */
+ EM_KMX16 Machine = 212 /* KM211 KMX16 16-bit processor */
+ EM_KMX8 Machine = 213 /* KM211 KMX8 8-bit processor */
+ EM_KVARC Machine = 214 /* KM211 KVARC processor */
+ EM_CDP Machine = 215 /* Paneve CDP architecture family */
+ EM_COGE Machine = 216 /* Cognitive Smart Memory Processor */
+ EM_COOL Machine = 217 /* Bluechip Systems CoolEngine */
+ EM_NORC Machine = 218 /* Nanoradio Optimized RISC */
+ EM_CSR_KALIMBA Machine = 219 /* CSR Kalimba architecture family */
+ EM_Z80 Machine = 220 /* Zilog Z80 */
+ EM_VISIUM Machine = 221 /* Controls and Data Services VISIUMcore processor */
+ EM_FT32 Machine = 222 /* FTDI Chip FT32 high performance 32-bit RISC architecture */
+ EM_MOXIE Machine = 223 /* Moxie processor family */
+ EM_AMDGPU Machine = 224 /* AMD GPU architecture */
+ EM_RISCV Machine = 243 /* RISC-V */
+ EM_LANAI Machine = 244 /* Lanai 32-bit processor */
+ EM_BPF Machine = 247 /* Linux BPF – in-kernel virtual machine */
+ EM_LOONGARCH Machine = 258 /* LoongArch */
+
+ /* Non-standard or deprecated. */
+ EM_486 Machine = 6 /* Intel i486. */
+ EM_MIPS_RS4_BE Machine = 10 /* MIPS R4000 Big-Endian */
+ EM_ALPHA_STD Machine = 41 /* Digital Alpha (standard value). */
+ EM_ALPHA Machine = 0x9026 /* Alpha (written in the absence of an ABI) */
+)</pre> <h3 id="Machine.GoString">func (Machine) <span>GoString</span> </h3> <pre data-language="go">func (i Machine) GoString() string</pre> <h3 id="Machine.String">func (Machine) <span>String</span> </h3> <pre data-language="go">func (i Machine) String() string</pre> <h2 id="NType">type <span>NType</span> </h2> <p>NType values; used in core files. </p>
+<pre data-language="go">type NType int</pre> <pre data-language="go">const (
+ NT_PRSTATUS NType = 1 /* Process status. */
+ NT_FPREGSET NType = 2 /* Floating point registers. */
+ NT_PRPSINFO NType = 3 /* Process state info. */
+)</pre> <h3 id="NType.GoString">func (NType) <span>GoString</span> </h3> <pre data-language="go">func (i NType) GoString() string</pre> <h3 id="NType.String">func (NType) <span>String</span> </h3> <pre data-language="go">func (i NType) String() string</pre> <h2 id="OSABI">type <span>OSABI</span> </h2> <p>OSABI is found in Header.Ident[EI_OSABI] and Header.OSABI. </p>
+<pre data-language="go">type OSABI byte</pre> <pre data-language="go">const (
+ ELFOSABI_NONE OSABI = 0 /* UNIX System V ABI */
+ ELFOSABI_HPUX OSABI = 1 /* HP-UX operating system */
+ ELFOSABI_NETBSD OSABI = 2 /* NetBSD */
+ ELFOSABI_LINUX OSABI = 3 /* Linux */
+ ELFOSABI_HURD OSABI = 4 /* Hurd */
+ ELFOSABI_86OPEN OSABI = 5 /* 86Open common IA32 ABI */
+ ELFOSABI_SOLARIS OSABI = 6 /* Solaris */
+ ELFOSABI_AIX OSABI = 7 /* AIX */
+ ELFOSABI_IRIX OSABI = 8 /* IRIX */
+ ELFOSABI_FREEBSD OSABI = 9 /* FreeBSD */
+ ELFOSABI_TRU64 OSABI = 10 /* TRU64 UNIX */
+ ELFOSABI_MODESTO OSABI = 11 /* Novell Modesto */
+ ELFOSABI_OPENBSD OSABI = 12 /* OpenBSD */
+ ELFOSABI_OPENVMS OSABI = 13 /* Open VMS */
+ ELFOSABI_NSK OSABI = 14 /* HP Non-Stop Kernel */
+ ELFOSABI_AROS OSABI = 15 /* Amiga Research OS */
+ ELFOSABI_FENIXOS OSABI = 16 /* The FenixOS highly scalable multi-core OS */
+ ELFOSABI_CLOUDABI OSABI = 17 /* Nuxi CloudABI */
+ ELFOSABI_ARM OSABI = 97 /* ARM */
+ ELFOSABI_STANDALONE OSABI = 255 /* Standalone (embedded) application */
+)</pre> <h3 id="OSABI.GoString">func (OSABI) <span>GoString</span> </h3> <pre data-language="go">func (i OSABI) GoString() string</pre> <h3 id="OSABI.String">func (OSABI) <span>String</span> </h3> <pre data-language="go">func (i OSABI) String() string</pre> <h2 id="Prog">type <span>Prog</span> </h2> <p>A Prog represents a single ELF program header in an ELF binary. </p>
+<pre data-language="go">type Prog struct {
+ ProgHeader
+
+ // Embed ReaderAt for ReadAt method.
+ // Do not embed SectionReader directly
+ // to avoid having Read and Seek.
+ // If a client wants Read and Seek it must use
+ // Open() to avoid fighting over the seek offset
+ // with other clients.
+ io.ReaderAt
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Prog.Open">func (*Prog) <span>Open</span> </h3> <pre data-language="go">func (p *Prog) Open() io.ReadSeeker</pre> <p>Open returns a new ReadSeeker reading the ELF program body. </p>
+<h2 id="Prog32">type <span>Prog32</span> </h2> <p>ELF32 Program header. </p>
+<pre data-language="go">type Prog32 struct {
+ Type uint32 /* Entry type. */
+ Off uint32 /* File offset of contents. */
+ Vaddr uint32 /* Virtual address in memory image. */
+ Paddr uint32 /* Physical address (not used). */
+ Filesz uint32 /* Size of contents in file. */
+ Memsz uint32 /* Size of contents in memory. */
+ Flags uint32 /* Access permission flags. */
+ Align uint32 /* Alignment in memory and file. */
+}
+</pre> <h2 id="Prog64">type <span>Prog64</span> </h2> <p>ELF64 Program header. </p>
+<pre data-language="go">type Prog64 struct {
+ Type uint32 /* Entry type. */
+ Flags uint32 /* Access permission flags. */
+ Off uint64 /* File offset of contents. */
+ Vaddr uint64 /* Virtual address in memory image. */
+ Paddr uint64 /* Physical address (not used). */
+ Filesz uint64 /* Size of contents in file. */
+ Memsz uint64 /* Size of contents in memory. */
+ Align uint64 /* Alignment in memory and file. */
+}
+</pre> <h2 id="ProgFlag">type <span>ProgFlag</span> </h2> <p>Prog.Flag </p>
+<pre data-language="go">type ProgFlag uint32</pre> <pre data-language="go">const (
+ PF_X ProgFlag = 0x1 /* Executable. */
+ PF_W ProgFlag = 0x2 /* Writable. */
+ PF_R ProgFlag = 0x4 /* Readable. */
+ PF_MASKOS ProgFlag = 0x0ff00000 /* Operating system-specific. */
+ PF_MASKPROC ProgFlag = 0xf0000000 /* Processor-specific. */
+)</pre> <h3 id="ProgFlag.GoString">func (ProgFlag) <span>GoString</span> </h3> <pre data-language="go">func (i ProgFlag) GoString() string</pre> <h3 id="ProgFlag.String">func (ProgFlag) <span>String</span> </h3> <pre data-language="go">func (i ProgFlag) String() string</pre> <h2 id="ProgHeader">type <span>ProgHeader</span> </h2> <p>A ProgHeader represents a single ELF program header. </p>
+<pre data-language="go">type ProgHeader struct {
+ Type ProgType
+ Flags ProgFlag
+ Off uint64
+ Vaddr uint64
+ Paddr uint64
+ Filesz uint64
+ Memsz uint64
+ Align uint64
+}
+</pre> <h2 id="ProgType">type <span>ProgType</span> </h2> <p>Prog.Type </p>
+<pre data-language="go">type ProgType int</pre> <pre data-language="go">const (
+ PT_NULL ProgType = 0 /* Unused entry. */
+ PT_LOAD ProgType = 1 /* Loadable segment. */
+ PT_DYNAMIC ProgType = 2 /* Dynamic linking information segment. */
+ PT_INTERP ProgType = 3 /* Pathname of interpreter. */
+ PT_NOTE ProgType = 4 /* Auxiliary information. */
+ PT_SHLIB ProgType = 5 /* Reserved (not used). */
+ PT_PHDR ProgType = 6 /* Location of program header itself. */
+ PT_TLS ProgType = 7 /* Thread local storage segment */
+
+ PT_LOOS ProgType = 0x60000000 /* First OS-specific. */
+
+ PT_GNU_EH_FRAME ProgType = 0x6474e550 /* Frame unwind information */
+ PT_GNU_STACK ProgType = 0x6474e551 /* Stack flags */
+ PT_GNU_RELRO ProgType = 0x6474e552 /* Read only after relocs */
+ PT_GNU_PROPERTY ProgType = 0x6474e553 /* GNU property */
+ PT_GNU_MBIND_LO ProgType = 0x6474e555 /* Mbind segments start */
+ PT_GNU_MBIND_HI ProgType = 0x6474f554 /* Mbind segments finish */
+
+ PT_PAX_FLAGS ProgType = 0x65041580 /* PAX flags */
+
+ PT_OPENBSD_RANDOMIZE ProgType = 0x65a3dbe6 /* Random data */
+ PT_OPENBSD_WXNEEDED ProgType = 0x65a3dbe7 /* W^X violations */
+ PT_OPENBSD_BOOTDATA ProgType = 0x65a41be6 /* Boot arguments */
+
+ PT_SUNW_EH_FRAME ProgType = 0x6474e550 /* Frame unwind information */
+ PT_SUNWSTACK ProgType = 0x6ffffffb /* Stack segment */
+
+ PT_HIOS ProgType = 0x6fffffff /* Last OS-specific. */
+
+ PT_LOPROC ProgType = 0x70000000 /* First processor-specific type. */
+
+ PT_ARM_ARCHEXT ProgType = 0x70000000 /* Architecture compatibility */
+ PT_ARM_EXIDX ProgType = 0x70000001 /* Exception unwind tables */
+
+ PT_AARCH64_ARCHEXT ProgType = 0x70000000 /* Architecture compatibility */
+ PT_AARCH64_UNWIND ProgType = 0x70000001 /* Exception unwind tables */
+
+ PT_MIPS_REGINFO ProgType = 0x70000000 /* Register usage */
+ PT_MIPS_RTPROC ProgType = 0x70000001 /* Runtime procedures */
+ PT_MIPS_OPTIONS ProgType = 0x70000002 /* Options */
+ PT_MIPS_ABIFLAGS ProgType = 0x70000003 /* ABI flags */
+
+ PT_S390_PGSTE ProgType = 0x70000000 /* 4k page table size */
+
+ PT_HIPROC ProgType = 0x7fffffff /* Last processor-specific type. */
+)</pre> <h3 id="ProgType.GoString">func (ProgType) <span>GoString</span> </h3> <pre data-language="go">func (i ProgType) GoString() string</pre> <h3 id="ProgType.String">func (ProgType) <span>String</span> </h3> <pre data-language="go">func (i ProgType) String() string</pre> <h2 id="R_386">type <span>R_386</span> </h2> <p>Relocation types for 386. </p>
+<pre data-language="go">type R_386 int</pre> <pre data-language="go">const (
+ R_386_NONE R_386 = 0 /* No relocation. */
+ R_386_32 R_386 = 1 /* Add symbol value. */
+ R_386_PC32 R_386 = 2 /* Add PC-relative symbol value. */
+ R_386_GOT32 R_386 = 3 /* Add PC-relative GOT offset. */
+ R_386_PLT32 R_386 = 4 /* Add PC-relative PLT offset. */
+ R_386_COPY R_386 = 5 /* Copy data from shared object. */
+ R_386_GLOB_DAT R_386 = 6 /* Set GOT entry to data address. */
+ R_386_JMP_SLOT R_386 = 7 /* Set GOT entry to code address. */
+ R_386_RELATIVE R_386 = 8 /* Add load address of shared object. */
+ R_386_GOTOFF R_386 = 9 /* Add GOT-relative symbol address. */
+ R_386_GOTPC R_386 = 10 /* Add PC-relative GOT table address. */
+ R_386_32PLT R_386 = 11
+ R_386_TLS_TPOFF R_386 = 14 /* Negative offset in static TLS block */
+ R_386_TLS_IE R_386 = 15 /* Absolute address of GOT for -ve static TLS */
+ R_386_TLS_GOTIE R_386 = 16 /* GOT entry for negative static TLS block */
+ R_386_TLS_LE R_386 = 17 /* Negative offset relative to static TLS */
+ R_386_TLS_GD R_386 = 18 /* 32 bit offset to GOT (index,off) pair */
+ R_386_TLS_LDM R_386 = 19 /* 32 bit offset to GOT (index,zero) pair */
+ R_386_16 R_386 = 20
+ R_386_PC16 R_386 = 21
+ R_386_8 R_386 = 22
+ R_386_PC8 R_386 = 23
+ R_386_TLS_GD_32 R_386 = 24 /* 32 bit offset to GOT (index,off) pair */
+ R_386_TLS_GD_PUSH R_386 = 25 /* pushl instruction for Sun ABI GD sequence */
+ R_386_TLS_GD_CALL R_386 = 26 /* call instruction for Sun ABI GD sequence */
+ R_386_TLS_GD_POP R_386 = 27 /* popl instruction for Sun ABI GD sequence */
+ R_386_TLS_LDM_32 R_386 = 28 /* 32 bit offset to GOT (index,zero) pair */
+ R_386_TLS_LDM_PUSH R_386 = 29 /* pushl instruction for Sun ABI LD sequence */
+ R_386_TLS_LDM_CALL R_386 = 30 /* call instruction for Sun ABI LD sequence */
+ R_386_TLS_LDM_POP R_386 = 31 /* popl instruction for Sun ABI LD sequence */
+ R_386_TLS_LDO_32 R_386 = 32 /* 32 bit offset from start of TLS block */
+ R_386_TLS_IE_32 R_386 = 33 /* 32 bit offset to GOT static TLS offset entry */
+ R_386_TLS_LE_32 R_386 = 34 /* 32 bit offset within static TLS block */
+ R_386_TLS_DTPMOD32 R_386 = 35 /* GOT entry containing TLS index */
+ R_386_TLS_DTPOFF32 R_386 = 36 /* GOT entry containing TLS offset */
+ R_386_TLS_TPOFF32 R_386 = 37 /* GOT entry of -ve static TLS offset */
+ R_386_SIZE32 R_386 = 38
+ R_386_TLS_GOTDESC R_386 = 39
+ R_386_TLS_DESC_CALL R_386 = 40
+ R_386_TLS_DESC R_386 = 41
+ R_386_IRELATIVE R_386 = 42
+ R_386_GOT32X R_386 = 43
+)</pre> <h3 id="R_386.GoString">func (R_386) <span>GoString</span> </h3> <pre data-language="go">func (i R_386) GoString() string</pre> <h3 id="R_386.String">func (R_386) <span>String</span> </h3> <pre data-language="go">func (i R_386) String() string</pre> <h2 id="R_390">type <span>R_390</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>Relocation types for s390x processors. </p>
+<pre data-language="go">type R_390 int</pre> <pre data-language="go">const (
+ R_390_NONE R_390 = 0
+ R_390_8 R_390 = 1
+ R_390_12 R_390 = 2
+ R_390_16 R_390 = 3
+ R_390_32 R_390 = 4
+ R_390_PC32 R_390 = 5
+ R_390_GOT12 R_390 = 6
+ R_390_GOT32 R_390 = 7
+ R_390_PLT32 R_390 = 8
+ R_390_COPY R_390 = 9
+ R_390_GLOB_DAT R_390 = 10
+ R_390_JMP_SLOT R_390 = 11
+ R_390_RELATIVE R_390 = 12
+ R_390_GOTOFF R_390 = 13
+ R_390_GOTPC R_390 = 14
+ R_390_GOT16 R_390 = 15
+ R_390_PC16 R_390 = 16
+ R_390_PC16DBL R_390 = 17
+ R_390_PLT16DBL R_390 = 18
+ R_390_PC32DBL R_390 = 19
+ R_390_PLT32DBL R_390 = 20
+ R_390_GOTPCDBL R_390 = 21
+ R_390_64 R_390 = 22
+ R_390_PC64 R_390 = 23
+ R_390_GOT64 R_390 = 24
+ R_390_PLT64 R_390 = 25
+ R_390_GOTENT R_390 = 26
+ R_390_GOTOFF16 R_390 = 27
+ R_390_GOTOFF64 R_390 = 28
+ R_390_GOTPLT12 R_390 = 29
+ R_390_GOTPLT16 R_390 = 30
+ R_390_GOTPLT32 R_390 = 31
+ R_390_GOTPLT64 R_390 = 32
+ R_390_GOTPLTENT R_390 = 33
+ R_390_GOTPLTOFF16 R_390 = 34
+ R_390_GOTPLTOFF32 R_390 = 35
+ R_390_GOTPLTOFF64 R_390 = 36
+ R_390_TLS_LOAD R_390 = 37
+ R_390_TLS_GDCALL R_390 = 38
+ R_390_TLS_LDCALL R_390 = 39
+ R_390_TLS_GD32 R_390 = 40
+ R_390_TLS_GD64 R_390 = 41
+ R_390_TLS_GOTIE12 R_390 = 42
+ R_390_TLS_GOTIE32 R_390 = 43
+ R_390_TLS_GOTIE64 R_390 = 44
+ R_390_TLS_LDM32 R_390 = 45
+ R_390_TLS_LDM64 R_390 = 46
+ R_390_TLS_IE32 R_390 = 47
+ R_390_TLS_IE64 R_390 = 48
+ R_390_TLS_IEENT R_390 = 49
+ R_390_TLS_LE32 R_390 = 50
+ R_390_TLS_LE64 R_390 = 51
+ R_390_TLS_LDO32 R_390 = 52
+ R_390_TLS_LDO64 R_390 = 53
+ R_390_TLS_DTPMOD R_390 = 54
+ R_390_TLS_DTPOFF R_390 = 55
+ R_390_TLS_TPOFF R_390 = 56
+ R_390_20 R_390 = 57
+ R_390_GOT20 R_390 = 58
+ R_390_GOTPLT20 R_390 = 59
+ R_390_TLS_GOTIE20 R_390 = 60
+)</pre> <h3 id="R_390.GoString">func (R_390) <span>GoString</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (i R_390) GoString() string</pre> <h3 id="R_390.String">func (R_390) <span>String</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (i R_390) String() string</pre> <h2 id="R_AARCH64">type <span>R_AARCH64</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>Relocation types for AArch64 (aka arm64) </p>
+<pre data-language="go">type R_AARCH64 int</pre> <pre data-language="go">const (
+ R_AARCH64_NONE R_AARCH64 = 0
+ R_AARCH64_P32_ABS32 R_AARCH64 = 1
+ R_AARCH64_P32_ABS16 R_AARCH64 = 2
+ R_AARCH64_P32_PREL32 R_AARCH64 = 3
+ R_AARCH64_P32_PREL16 R_AARCH64 = 4
+ R_AARCH64_P32_MOVW_UABS_G0 R_AARCH64 = 5
+ R_AARCH64_P32_MOVW_UABS_G0_NC R_AARCH64 = 6
+ R_AARCH64_P32_MOVW_UABS_G1 R_AARCH64 = 7
+ R_AARCH64_P32_MOVW_SABS_G0 R_AARCH64 = 8
+ R_AARCH64_P32_LD_PREL_LO19 R_AARCH64 = 9
+ R_AARCH64_P32_ADR_PREL_LO21 R_AARCH64 = 10
+ R_AARCH64_P32_ADR_PREL_PG_HI21 R_AARCH64 = 11
+ R_AARCH64_P32_ADD_ABS_LO12_NC R_AARCH64 = 12
+ R_AARCH64_P32_LDST8_ABS_LO12_NC R_AARCH64 = 13
+ R_AARCH64_P32_LDST16_ABS_LO12_NC R_AARCH64 = 14
+ R_AARCH64_P32_LDST32_ABS_LO12_NC R_AARCH64 = 15
+ R_AARCH64_P32_LDST64_ABS_LO12_NC R_AARCH64 = 16
+ R_AARCH64_P32_LDST128_ABS_LO12_NC R_AARCH64 = 17
+ R_AARCH64_P32_TSTBR14 R_AARCH64 = 18
+ R_AARCH64_P32_CONDBR19 R_AARCH64 = 19
+ R_AARCH64_P32_JUMP26 R_AARCH64 = 20
+ R_AARCH64_P32_CALL26 R_AARCH64 = 21
+ R_AARCH64_P32_GOT_LD_PREL19 R_AARCH64 = 25
+ R_AARCH64_P32_ADR_GOT_PAGE R_AARCH64 = 26
+ R_AARCH64_P32_LD32_GOT_LO12_NC R_AARCH64 = 27
+ R_AARCH64_P32_TLSGD_ADR_PAGE21 R_AARCH64 = 81
+ R_AARCH64_P32_TLSGD_ADD_LO12_NC R_AARCH64 = 82
+ R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64 = 103
+ R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC R_AARCH64 = 104
+ R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64 = 105
+ R_AARCH64_P32_TLSLE_MOVW_TPREL_G1 R_AARCH64 = 106
+ R_AARCH64_P32_TLSLE_MOVW_TPREL_G0 R_AARCH64 = 107
+ R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC R_AARCH64 = 108
+ R_AARCH64_P32_TLSLE_ADD_TPREL_HI12 R_AARCH64 = 109
+ R_AARCH64_P32_TLSLE_ADD_TPREL_LO12 R_AARCH64 = 110
+ R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC R_AARCH64 = 111
+ R_AARCH64_P32_TLSDESC_LD_PREL19 R_AARCH64 = 122
+ R_AARCH64_P32_TLSDESC_ADR_PREL21 R_AARCH64 = 123
+ R_AARCH64_P32_TLSDESC_ADR_PAGE21 R_AARCH64 = 124
+ R_AARCH64_P32_TLSDESC_LD32_LO12_NC R_AARCH64 = 125
+ R_AARCH64_P32_TLSDESC_ADD_LO12_NC R_AARCH64 = 126
+ R_AARCH64_P32_TLSDESC_CALL R_AARCH64 = 127
+ R_AARCH64_P32_COPY R_AARCH64 = 180
+ R_AARCH64_P32_GLOB_DAT R_AARCH64 = 181
+ R_AARCH64_P32_JUMP_SLOT R_AARCH64 = 182
+ R_AARCH64_P32_RELATIVE R_AARCH64 = 183
+ R_AARCH64_P32_TLS_DTPMOD R_AARCH64 = 184
+ R_AARCH64_P32_TLS_DTPREL R_AARCH64 = 185
+ R_AARCH64_P32_TLS_TPREL R_AARCH64 = 186
+ R_AARCH64_P32_TLSDESC R_AARCH64 = 187
+ R_AARCH64_P32_IRELATIVE R_AARCH64 = 188
+ R_AARCH64_NULL R_AARCH64 = 256
+ R_AARCH64_ABS64 R_AARCH64 = 257
+ R_AARCH64_ABS32 R_AARCH64 = 258
+ R_AARCH64_ABS16 R_AARCH64 = 259
+ R_AARCH64_PREL64 R_AARCH64 = 260
+ R_AARCH64_PREL32 R_AARCH64 = 261
+ R_AARCH64_PREL16 R_AARCH64 = 262
+ R_AARCH64_MOVW_UABS_G0 R_AARCH64 = 263
+ R_AARCH64_MOVW_UABS_G0_NC R_AARCH64 = 264
+ R_AARCH64_MOVW_UABS_G1 R_AARCH64 = 265
+ R_AARCH64_MOVW_UABS_G1_NC R_AARCH64 = 266
+ R_AARCH64_MOVW_UABS_G2 R_AARCH64 = 267
+ R_AARCH64_MOVW_UABS_G2_NC R_AARCH64 = 268
+ R_AARCH64_MOVW_UABS_G3 R_AARCH64 = 269
+ R_AARCH64_MOVW_SABS_G0 R_AARCH64 = 270
+ R_AARCH64_MOVW_SABS_G1 R_AARCH64 = 271
+ R_AARCH64_MOVW_SABS_G2 R_AARCH64 = 272
+ R_AARCH64_LD_PREL_LO19 R_AARCH64 = 273
+ R_AARCH64_ADR_PREL_LO21 R_AARCH64 = 274
+ R_AARCH64_ADR_PREL_PG_HI21 R_AARCH64 = 275
+ R_AARCH64_ADR_PREL_PG_HI21_NC R_AARCH64 = 276
+ R_AARCH64_ADD_ABS_LO12_NC R_AARCH64 = 277
+ R_AARCH64_LDST8_ABS_LO12_NC R_AARCH64 = 278
+ R_AARCH64_TSTBR14 R_AARCH64 = 279
+ R_AARCH64_CONDBR19 R_AARCH64 = 280
+ R_AARCH64_JUMP26 R_AARCH64 = 282
+ R_AARCH64_CALL26 R_AARCH64 = 283
+ R_AARCH64_LDST16_ABS_LO12_NC R_AARCH64 = 284
+ R_AARCH64_LDST32_ABS_LO12_NC R_AARCH64 = 285
+ R_AARCH64_LDST64_ABS_LO12_NC R_AARCH64 = 286
+ R_AARCH64_LDST128_ABS_LO12_NC R_AARCH64 = 299
+ R_AARCH64_GOT_LD_PREL19 R_AARCH64 = 309
+ R_AARCH64_LD64_GOTOFF_LO15 R_AARCH64 = 310
+ R_AARCH64_ADR_GOT_PAGE R_AARCH64 = 311
+ R_AARCH64_LD64_GOT_LO12_NC R_AARCH64 = 312
+ R_AARCH64_LD64_GOTPAGE_LO15 R_AARCH64 = 313
+ R_AARCH64_TLSGD_ADR_PREL21 R_AARCH64 = 512
+ R_AARCH64_TLSGD_ADR_PAGE21 R_AARCH64 = 513
+ R_AARCH64_TLSGD_ADD_LO12_NC R_AARCH64 = 514
+ R_AARCH64_TLSGD_MOVW_G1 R_AARCH64 = 515
+ R_AARCH64_TLSGD_MOVW_G0_NC R_AARCH64 = 516
+ R_AARCH64_TLSLD_ADR_PREL21 R_AARCH64 = 517
+ R_AARCH64_TLSLD_ADR_PAGE21 R_AARCH64 = 518
+ R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 R_AARCH64 = 539
+ R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC R_AARCH64 = 540
+ R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64 = 541
+ R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC R_AARCH64 = 542
+ R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64 = 543
+ R_AARCH64_TLSLE_MOVW_TPREL_G2 R_AARCH64 = 544
+ R_AARCH64_TLSLE_MOVW_TPREL_G1 R_AARCH64 = 545
+ R_AARCH64_TLSLE_MOVW_TPREL_G1_NC R_AARCH64 = 546
+ R_AARCH64_TLSLE_MOVW_TPREL_G0 R_AARCH64 = 547
+ R_AARCH64_TLSLE_MOVW_TPREL_G0_NC R_AARCH64 = 548
+ R_AARCH64_TLSLE_ADD_TPREL_HI12 R_AARCH64 = 549
+ R_AARCH64_TLSLE_ADD_TPREL_LO12 R_AARCH64 = 550
+ R_AARCH64_TLSLE_ADD_TPREL_LO12_NC R_AARCH64 = 551
+ R_AARCH64_TLSDESC_LD_PREL19 R_AARCH64 = 560
+ R_AARCH64_TLSDESC_ADR_PREL21 R_AARCH64 = 561
+ R_AARCH64_TLSDESC_ADR_PAGE21 R_AARCH64 = 562
+ R_AARCH64_TLSDESC_LD64_LO12_NC R_AARCH64 = 563
+ R_AARCH64_TLSDESC_ADD_LO12_NC R_AARCH64 = 564
+ R_AARCH64_TLSDESC_OFF_G1 R_AARCH64 = 565
+ R_AARCH64_TLSDESC_OFF_G0_NC R_AARCH64 = 566
+ R_AARCH64_TLSDESC_LDR R_AARCH64 = 567
+ R_AARCH64_TLSDESC_ADD R_AARCH64 = 568
+ R_AARCH64_TLSDESC_CALL R_AARCH64 = 569
+ R_AARCH64_TLSLE_LDST128_TPREL_LO12 R_AARCH64 = 570
+ R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC R_AARCH64 = 571
+ R_AARCH64_TLSLD_LDST128_DTPREL_LO12 R_AARCH64 = 572
+ R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC R_AARCH64 = 573
+ R_AARCH64_COPY R_AARCH64 = 1024
+ R_AARCH64_GLOB_DAT R_AARCH64 = 1025
+ R_AARCH64_JUMP_SLOT R_AARCH64 = 1026
+ R_AARCH64_RELATIVE R_AARCH64 = 1027
+ R_AARCH64_TLS_DTPMOD64 R_AARCH64 = 1028
+ R_AARCH64_TLS_DTPREL64 R_AARCH64 = 1029
+ R_AARCH64_TLS_TPREL64 R_AARCH64 = 1030
+ R_AARCH64_TLSDESC R_AARCH64 = 1031
+ R_AARCH64_IRELATIVE R_AARCH64 = 1032
+)</pre> <h3 id="R_AARCH64.GoString">func (R_AARCH64) <span>GoString</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (i R_AARCH64) GoString() string</pre> <h3 id="R_AARCH64.String">func (R_AARCH64) <span>String</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (i R_AARCH64) String() string</pre> <h2 id="R_ALPHA">type <span>R_ALPHA</span> </h2> <p>Relocation types for Alpha. </p>
+<pre data-language="go">type R_ALPHA int</pre> <pre data-language="go">const (
+ R_ALPHA_NONE R_ALPHA = 0 /* No reloc */
+ R_ALPHA_REFLONG R_ALPHA = 1 /* Direct 32 bit */
+ R_ALPHA_REFQUAD R_ALPHA = 2 /* Direct 64 bit */
+ R_ALPHA_GPREL32 R_ALPHA = 3 /* GP relative 32 bit */
+ R_ALPHA_LITERAL R_ALPHA = 4 /* GP relative 16 bit w/optimization */
+ R_ALPHA_LITUSE R_ALPHA = 5 /* Optimization hint for LITERAL */
+ R_ALPHA_GPDISP R_ALPHA = 6 /* Add displacement to GP */
+ R_ALPHA_BRADDR R_ALPHA = 7 /* PC+4 relative 23 bit shifted */
+ R_ALPHA_HINT R_ALPHA = 8 /* PC+4 relative 16 bit shifted */
+ R_ALPHA_SREL16 R_ALPHA = 9 /* PC relative 16 bit */
+ R_ALPHA_SREL32 R_ALPHA = 10 /* PC relative 32 bit */
+ R_ALPHA_SREL64 R_ALPHA = 11 /* PC relative 64 bit */
+ R_ALPHA_OP_PUSH R_ALPHA = 12 /* OP stack push */
+ R_ALPHA_OP_STORE R_ALPHA = 13 /* OP stack pop and store */
+ R_ALPHA_OP_PSUB R_ALPHA = 14 /* OP stack subtract */
+ R_ALPHA_OP_PRSHIFT R_ALPHA = 15 /* OP stack right shift */
+ R_ALPHA_GPVALUE R_ALPHA = 16
+ R_ALPHA_GPRELHIGH R_ALPHA = 17
+ R_ALPHA_GPRELLOW R_ALPHA = 18
+ R_ALPHA_IMMED_GP_16 R_ALPHA = 19
+ R_ALPHA_IMMED_GP_HI32 R_ALPHA = 20
+ R_ALPHA_IMMED_SCN_HI32 R_ALPHA = 21
+ R_ALPHA_IMMED_BR_HI32 R_ALPHA = 22
+ R_ALPHA_IMMED_LO32 R_ALPHA = 23
+ R_ALPHA_COPY R_ALPHA = 24 /* Copy symbol at runtime */
+ R_ALPHA_GLOB_DAT R_ALPHA = 25 /* Create GOT entry */
+ R_ALPHA_JMP_SLOT R_ALPHA = 26 /* Create PLT entry */
+ R_ALPHA_RELATIVE R_ALPHA = 27 /* Adjust by program base */
+)</pre> <h3 id="R_ALPHA.GoString">func (R_ALPHA) <span>GoString</span> </h3> <pre data-language="go">func (i R_ALPHA) GoString() string</pre> <h3 id="R_ALPHA.String">func (R_ALPHA) <span>String</span> </h3> <pre data-language="go">func (i R_ALPHA) String() string</pre> <h2 id="R_ARM">type <span>R_ARM</span> </h2> <p>Relocation types for ARM. </p>
+<pre data-language="go">type R_ARM int</pre> <pre data-language="go">const (
+ R_ARM_NONE R_ARM = 0 /* No relocation. */
+ R_ARM_PC24 R_ARM = 1
+ R_ARM_ABS32 R_ARM = 2
+ R_ARM_REL32 R_ARM = 3
+ R_ARM_PC13 R_ARM = 4
+ R_ARM_ABS16 R_ARM = 5
+ R_ARM_ABS12 R_ARM = 6
+ R_ARM_THM_ABS5 R_ARM = 7
+ R_ARM_ABS8 R_ARM = 8
+ R_ARM_SBREL32 R_ARM = 9
+ R_ARM_THM_PC22 R_ARM = 10
+ R_ARM_THM_PC8 R_ARM = 11
+ R_ARM_AMP_VCALL9 R_ARM = 12
+ R_ARM_SWI24 R_ARM = 13
+ R_ARM_THM_SWI8 R_ARM = 14
+ R_ARM_XPC25 R_ARM = 15
+ R_ARM_THM_XPC22 R_ARM = 16
+ R_ARM_TLS_DTPMOD32 R_ARM = 17
+ R_ARM_TLS_DTPOFF32 R_ARM = 18
+ R_ARM_TLS_TPOFF32 R_ARM = 19
+ R_ARM_COPY R_ARM = 20 /* Copy data from shared object. */
+ R_ARM_GLOB_DAT R_ARM = 21 /* Set GOT entry to data address. */
+ R_ARM_JUMP_SLOT R_ARM = 22 /* Set GOT entry to code address. */
+ R_ARM_RELATIVE R_ARM = 23 /* Add load address of shared object. */
+ R_ARM_GOTOFF R_ARM = 24 /* Add GOT-relative symbol address. */
+ R_ARM_GOTPC R_ARM = 25 /* Add PC-relative GOT table address. */
+ R_ARM_GOT32 R_ARM = 26 /* Add PC-relative GOT offset. */
+ R_ARM_PLT32 R_ARM = 27 /* Add PC-relative PLT offset. */
+ R_ARM_CALL R_ARM = 28
+ R_ARM_JUMP24 R_ARM = 29
+ R_ARM_THM_JUMP24 R_ARM = 30
+ R_ARM_BASE_ABS R_ARM = 31
+ R_ARM_ALU_PCREL_7_0 R_ARM = 32
+ R_ARM_ALU_PCREL_15_8 R_ARM = 33
+ R_ARM_ALU_PCREL_23_15 R_ARM = 34
+ R_ARM_LDR_SBREL_11_10_NC R_ARM = 35
+ R_ARM_ALU_SBREL_19_12_NC R_ARM = 36
+ R_ARM_ALU_SBREL_27_20_CK R_ARM = 37
+ R_ARM_TARGET1 R_ARM = 38
+ R_ARM_SBREL31 R_ARM = 39
+ R_ARM_V4BX R_ARM = 40
+ R_ARM_TARGET2 R_ARM = 41
+ R_ARM_PREL31 R_ARM = 42
+ R_ARM_MOVW_ABS_NC R_ARM = 43
+ R_ARM_MOVT_ABS R_ARM = 44
+ R_ARM_MOVW_PREL_NC R_ARM = 45
+ R_ARM_MOVT_PREL R_ARM = 46
+ R_ARM_THM_MOVW_ABS_NC R_ARM = 47
+ R_ARM_THM_MOVT_ABS R_ARM = 48
+ R_ARM_THM_MOVW_PREL_NC R_ARM = 49
+ R_ARM_THM_MOVT_PREL R_ARM = 50
+ R_ARM_THM_JUMP19 R_ARM = 51
+ R_ARM_THM_JUMP6 R_ARM = 52
+ R_ARM_THM_ALU_PREL_11_0 R_ARM = 53
+ R_ARM_THM_PC12 R_ARM = 54
+ R_ARM_ABS32_NOI R_ARM = 55
+ R_ARM_REL32_NOI R_ARM = 56
+ R_ARM_ALU_PC_G0_NC R_ARM = 57
+ R_ARM_ALU_PC_G0 R_ARM = 58
+ R_ARM_ALU_PC_G1_NC R_ARM = 59
+ R_ARM_ALU_PC_G1 R_ARM = 60
+ R_ARM_ALU_PC_G2 R_ARM = 61
+ R_ARM_LDR_PC_G1 R_ARM = 62
+ R_ARM_LDR_PC_G2 R_ARM = 63
+ R_ARM_LDRS_PC_G0 R_ARM = 64
+ R_ARM_LDRS_PC_G1 R_ARM = 65
+ R_ARM_LDRS_PC_G2 R_ARM = 66
+ R_ARM_LDC_PC_G0 R_ARM = 67
+ R_ARM_LDC_PC_G1 R_ARM = 68
+ R_ARM_LDC_PC_G2 R_ARM = 69
+ R_ARM_ALU_SB_G0_NC R_ARM = 70
+ R_ARM_ALU_SB_G0 R_ARM = 71
+ R_ARM_ALU_SB_G1_NC R_ARM = 72
+ R_ARM_ALU_SB_G1 R_ARM = 73
+ R_ARM_ALU_SB_G2 R_ARM = 74
+ R_ARM_LDR_SB_G0 R_ARM = 75
+ R_ARM_LDR_SB_G1 R_ARM = 76
+ R_ARM_LDR_SB_G2 R_ARM = 77
+ R_ARM_LDRS_SB_G0 R_ARM = 78
+ R_ARM_LDRS_SB_G1 R_ARM = 79
+ R_ARM_LDRS_SB_G2 R_ARM = 80
+ R_ARM_LDC_SB_G0 R_ARM = 81
+ R_ARM_LDC_SB_G1 R_ARM = 82
+ R_ARM_LDC_SB_G2 R_ARM = 83
+ R_ARM_MOVW_BREL_NC R_ARM = 84
+ R_ARM_MOVT_BREL R_ARM = 85
+ R_ARM_MOVW_BREL R_ARM = 86
+ R_ARM_THM_MOVW_BREL_NC R_ARM = 87
+ R_ARM_THM_MOVT_BREL R_ARM = 88
+ R_ARM_THM_MOVW_BREL R_ARM = 89
+ R_ARM_TLS_GOTDESC R_ARM = 90
+ R_ARM_TLS_CALL R_ARM = 91
+ R_ARM_TLS_DESCSEQ R_ARM = 92
+ R_ARM_THM_TLS_CALL R_ARM = 93
+ R_ARM_PLT32_ABS R_ARM = 94
+ R_ARM_GOT_ABS R_ARM = 95
+ R_ARM_GOT_PREL R_ARM = 96
+ R_ARM_GOT_BREL12 R_ARM = 97
+ R_ARM_GOTOFF12 R_ARM = 98
+ R_ARM_GOTRELAX R_ARM = 99
+ R_ARM_GNU_VTENTRY R_ARM = 100
+ R_ARM_GNU_VTINHERIT R_ARM = 101
+ R_ARM_THM_JUMP11 R_ARM = 102
+ R_ARM_THM_JUMP8 R_ARM = 103
+ R_ARM_TLS_GD32 R_ARM = 104
+ R_ARM_TLS_LDM32 R_ARM = 105
+ R_ARM_TLS_LDO32 R_ARM = 106
+ R_ARM_TLS_IE32 R_ARM = 107
+ R_ARM_TLS_LE32 R_ARM = 108
+ R_ARM_TLS_LDO12 R_ARM = 109
+ R_ARM_TLS_LE12 R_ARM = 110
+ R_ARM_TLS_IE12GP R_ARM = 111
+ R_ARM_PRIVATE_0 R_ARM = 112
+ R_ARM_PRIVATE_1 R_ARM = 113
+ R_ARM_PRIVATE_2 R_ARM = 114
+ R_ARM_PRIVATE_3 R_ARM = 115
+ R_ARM_PRIVATE_4 R_ARM = 116
+ R_ARM_PRIVATE_5 R_ARM = 117
+ R_ARM_PRIVATE_6 R_ARM = 118
+ R_ARM_PRIVATE_7 R_ARM = 119
+ R_ARM_PRIVATE_8 R_ARM = 120
+ R_ARM_PRIVATE_9 R_ARM = 121
+ R_ARM_PRIVATE_10 R_ARM = 122
+ R_ARM_PRIVATE_11 R_ARM = 123
+ R_ARM_PRIVATE_12 R_ARM = 124
+ R_ARM_PRIVATE_13 R_ARM = 125
+ R_ARM_PRIVATE_14 R_ARM = 126
+ R_ARM_PRIVATE_15 R_ARM = 127
+ R_ARM_ME_TOO R_ARM = 128
+ R_ARM_THM_TLS_DESCSEQ16 R_ARM = 129
+ R_ARM_THM_TLS_DESCSEQ32 R_ARM = 130
+ R_ARM_THM_GOT_BREL12 R_ARM = 131
+ R_ARM_THM_ALU_ABS_G0_NC R_ARM = 132
+ R_ARM_THM_ALU_ABS_G1_NC R_ARM = 133
+ R_ARM_THM_ALU_ABS_G2_NC R_ARM = 134
+ R_ARM_THM_ALU_ABS_G3 R_ARM = 135
+ R_ARM_IRELATIVE R_ARM = 160
+ R_ARM_RXPC25 R_ARM = 249
+ R_ARM_RSBREL32 R_ARM = 250
+ R_ARM_THM_RPC22 R_ARM = 251
+ R_ARM_RREL32 R_ARM = 252
+ R_ARM_RABS32 R_ARM = 253
+ R_ARM_RPC24 R_ARM = 254
+ R_ARM_RBASE R_ARM = 255
+)</pre> <h3 id="R_ARM.GoString">func (R_ARM) <span>GoString</span> </h3> <pre data-language="go">func (i R_ARM) GoString() string</pre> <h3 id="R_ARM.String">func (R_ARM) <span>String</span> </h3> <pre data-language="go">func (i R_ARM) String() string</pre> <h2 id="R_LARCH">type <span>R_LARCH</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>Relocation types for LoongArch. </p>
+<pre data-language="go">type R_LARCH int</pre> <pre data-language="go">const (
+ R_LARCH_NONE R_LARCH = 0
+ R_LARCH_32 R_LARCH = 1
+ R_LARCH_64 R_LARCH = 2
+ R_LARCH_RELATIVE R_LARCH = 3
+ R_LARCH_COPY R_LARCH = 4
+ R_LARCH_JUMP_SLOT R_LARCH = 5
+ R_LARCH_TLS_DTPMOD32 R_LARCH = 6
+ R_LARCH_TLS_DTPMOD64 R_LARCH = 7
+ R_LARCH_TLS_DTPREL32 R_LARCH = 8
+ R_LARCH_TLS_DTPREL64 R_LARCH = 9
+ R_LARCH_TLS_TPREL32 R_LARCH = 10
+ R_LARCH_TLS_TPREL64 R_LARCH = 11
+ R_LARCH_IRELATIVE R_LARCH = 12
+ R_LARCH_MARK_LA R_LARCH = 20
+ R_LARCH_MARK_PCREL R_LARCH = 21
+ R_LARCH_SOP_PUSH_PCREL R_LARCH = 22
+ R_LARCH_SOP_PUSH_ABSOLUTE R_LARCH = 23
+ R_LARCH_SOP_PUSH_DUP R_LARCH = 24
+ R_LARCH_SOP_PUSH_GPREL R_LARCH = 25
+ R_LARCH_SOP_PUSH_TLS_TPREL R_LARCH = 26
+ R_LARCH_SOP_PUSH_TLS_GOT R_LARCH = 27
+ R_LARCH_SOP_PUSH_TLS_GD R_LARCH = 28
+ R_LARCH_SOP_PUSH_PLT_PCREL R_LARCH = 29
+ R_LARCH_SOP_ASSERT R_LARCH = 30
+ R_LARCH_SOP_NOT R_LARCH = 31
+ R_LARCH_SOP_SUB R_LARCH = 32
+ R_LARCH_SOP_SL R_LARCH = 33
+ R_LARCH_SOP_SR R_LARCH = 34
+ R_LARCH_SOP_ADD R_LARCH = 35
+ R_LARCH_SOP_AND R_LARCH = 36
+ R_LARCH_SOP_IF_ELSE R_LARCH = 37
+ R_LARCH_SOP_POP_32_S_10_5 R_LARCH = 38
+ R_LARCH_SOP_POP_32_U_10_12 R_LARCH = 39
+ R_LARCH_SOP_POP_32_S_10_12 R_LARCH = 40
+ R_LARCH_SOP_POP_32_S_10_16 R_LARCH = 41
+ R_LARCH_SOP_POP_32_S_10_16_S2 R_LARCH = 42
+ R_LARCH_SOP_POP_32_S_5_20 R_LARCH = 43
+ R_LARCH_SOP_POP_32_S_0_5_10_16_S2 R_LARCH = 44
+ R_LARCH_SOP_POP_32_S_0_10_10_16_S2 R_LARCH = 45
+ R_LARCH_SOP_POP_32_U R_LARCH = 46
+ R_LARCH_ADD8 R_LARCH = 47
+ R_LARCH_ADD16 R_LARCH = 48
+ R_LARCH_ADD24 R_LARCH = 49
+ R_LARCH_ADD32 R_LARCH = 50
+ R_LARCH_ADD64 R_LARCH = 51
+ R_LARCH_SUB8 R_LARCH = 52
+ R_LARCH_SUB16 R_LARCH = 53
+ R_LARCH_SUB24 R_LARCH = 54
+ R_LARCH_SUB32 R_LARCH = 55
+ R_LARCH_SUB64 R_LARCH = 56
+ R_LARCH_GNU_VTINHERIT R_LARCH = 57
+ R_LARCH_GNU_VTENTRY R_LARCH = 58
+ R_LARCH_B16 R_LARCH = 64
+ R_LARCH_B21 R_LARCH = 65
+ R_LARCH_B26 R_LARCH = 66
+ R_LARCH_ABS_HI20 R_LARCH = 67
+ R_LARCH_ABS_LO12 R_LARCH = 68
+ R_LARCH_ABS64_LO20 R_LARCH = 69
+ R_LARCH_ABS64_HI12 R_LARCH = 70
+ R_LARCH_PCALA_HI20 R_LARCH = 71
+ R_LARCH_PCALA_LO12 R_LARCH = 72
+ R_LARCH_PCALA64_LO20 R_LARCH = 73
+ R_LARCH_PCALA64_HI12 R_LARCH = 74
+ R_LARCH_GOT_PC_HI20 R_LARCH = 75
+ R_LARCH_GOT_PC_LO12 R_LARCH = 76
+ R_LARCH_GOT64_PC_LO20 R_LARCH = 77
+ R_LARCH_GOT64_PC_HI12 R_LARCH = 78
+ R_LARCH_GOT_HI20 R_LARCH = 79
+ R_LARCH_GOT_LO12 R_LARCH = 80
+ R_LARCH_GOT64_LO20 R_LARCH = 81
+ R_LARCH_GOT64_HI12 R_LARCH = 82
+ R_LARCH_TLS_LE_HI20 R_LARCH = 83
+ R_LARCH_TLS_LE_LO12 R_LARCH = 84
+ R_LARCH_TLS_LE64_LO20 R_LARCH = 85
+ R_LARCH_TLS_LE64_HI12 R_LARCH = 86
+ R_LARCH_TLS_IE_PC_HI20 R_LARCH = 87
+ R_LARCH_TLS_IE_PC_LO12 R_LARCH = 88
+ R_LARCH_TLS_IE64_PC_LO20 R_LARCH = 89
+ R_LARCH_TLS_IE64_PC_HI12 R_LARCH = 90
+ R_LARCH_TLS_IE_HI20 R_LARCH = 91
+ R_LARCH_TLS_IE_LO12 R_LARCH = 92
+ R_LARCH_TLS_IE64_LO20 R_LARCH = 93
+ R_LARCH_TLS_IE64_HI12 R_LARCH = 94
+ R_LARCH_TLS_LD_PC_HI20 R_LARCH = 95
+ R_LARCH_TLS_LD_HI20 R_LARCH = 96
+ R_LARCH_TLS_GD_PC_HI20 R_LARCH = 97
+ R_LARCH_TLS_GD_HI20 R_LARCH = 98
+ R_LARCH_32_PCREL R_LARCH = 99
+ R_LARCH_RELAX R_LARCH = 100
+ R_LARCH_DELETE R_LARCH = 101
+ R_LARCH_ALIGN R_LARCH = 102
+ R_LARCH_PCREL20_S2 R_LARCH = 103
+ R_LARCH_CFA R_LARCH = 104
+ R_LARCH_ADD6 R_LARCH = 105
+ R_LARCH_SUB6 R_LARCH = 106
+ R_LARCH_ADD_ULEB128 R_LARCH = 107
+ R_LARCH_SUB_ULEB128 R_LARCH = 108
+ R_LARCH_64_PCREL R_LARCH = 109
+)</pre> <h3 id="R_LARCH.GoString">func (R_LARCH) <span>GoString</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (i R_LARCH) GoString() string</pre> <h3 id="R_LARCH.String">func (R_LARCH) <span>String</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (i R_LARCH) String() string</pre> <h2 id="R_MIPS">type <span>R_MIPS</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>Relocation types for MIPS. </p>
+<pre data-language="go">type R_MIPS int</pre> <pre data-language="go">const (
+ R_MIPS_NONE R_MIPS = 0
+ R_MIPS_16 R_MIPS = 1
+ R_MIPS_32 R_MIPS = 2
+ R_MIPS_REL32 R_MIPS = 3
+ R_MIPS_26 R_MIPS = 4
+ R_MIPS_HI16 R_MIPS = 5 /* high 16 bits of symbol value */
+ R_MIPS_LO16 R_MIPS = 6 /* low 16 bits of symbol value */
+ R_MIPS_GPREL16 R_MIPS = 7 /* GP-relative reference */
+ R_MIPS_LITERAL R_MIPS = 8 /* Reference to literal section */
+ R_MIPS_GOT16 R_MIPS = 9 /* Reference to global offset table */
+ R_MIPS_PC16 R_MIPS = 10 /* 16 bit PC relative reference */
+ R_MIPS_CALL16 R_MIPS = 11 /* 16 bit call through glbl offset tbl */
+ R_MIPS_GPREL32 R_MIPS = 12
+ R_MIPS_SHIFT5 R_MIPS = 16
+ R_MIPS_SHIFT6 R_MIPS = 17
+ R_MIPS_64 R_MIPS = 18
+ R_MIPS_GOT_DISP R_MIPS = 19
+ R_MIPS_GOT_PAGE R_MIPS = 20
+ R_MIPS_GOT_OFST R_MIPS = 21
+ R_MIPS_GOT_HI16 R_MIPS = 22
+ R_MIPS_GOT_LO16 R_MIPS = 23
+ R_MIPS_SUB R_MIPS = 24
+ R_MIPS_INSERT_A R_MIPS = 25
+ R_MIPS_INSERT_B R_MIPS = 26
+ R_MIPS_DELETE R_MIPS = 27
+ R_MIPS_HIGHER R_MIPS = 28
+ R_MIPS_HIGHEST R_MIPS = 29
+ R_MIPS_CALL_HI16 R_MIPS = 30
+ R_MIPS_CALL_LO16 R_MIPS = 31
+ R_MIPS_SCN_DISP R_MIPS = 32
+ R_MIPS_REL16 R_MIPS = 33
+ R_MIPS_ADD_IMMEDIATE R_MIPS = 34
+ R_MIPS_PJUMP R_MIPS = 35
+ R_MIPS_RELGOT R_MIPS = 36
+ R_MIPS_JALR R_MIPS = 37
+
+ R_MIPS_TLS_DTPMOD32 R_MIPS = 38 /* Module number 32 bit */
+ R_MIPS_TLS_DTPREL32 R_MIPS = 39 /* Module-relative offset 32 bit */
+ R_MIPS_TLS_DTPMOD64 R_MIPS = 40 /* Module number 64 bit */
+ R_MIPS_TLS_DTPREL64 R_MIPS = 41 /* Module-relative offset 64 bit */
+ R_MIPS_TLS_GD R_MIPS = 42 /* 16 bit GOT offset for GD */
+ R_MIPS_TLS_LDM R_MIPS = 43 /* 16 bit GOT offset for LDM */
+ R_MIPS_TLS_DTPREL_HI16 R_MIPS = 44 /* Module-relative offset, high 16 bits */
+ R_MIPS_TLS_DTPREL_LO16 R_MIPS = 45 /* Module-relative offset, low 16 bits */
+ R_MIPS_TLS_GOTTPREL R_MIPS = 46 /* 16 bit GOT offset for IE */
+ R_MIPS_TLS_TPREL32 R_MIPS = 47 /* TP-relative offset, 32 bit */
+ R_MIPS_TLS_TPREL64 R_MIPS = 48 /* TP-relative offset, 64 bit */
+ R_MIPS_TLS_TPREL_HI16 R_MIPS = 49 /* TP-relative offset, high 16 bits */
+ R_MIPS_TLS_TPREL_LO16 R_MIPS = 50 /* TP-relative offset, low 16 bits */
+
+ R_MIPS_PC32 R_MIPS = 248 /* 32 bit PC relative reference */
+)</pre> <h3 id="R_MIPS.GoString">func (R_MIPS) <span>GoString</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (i R_MIPS) GoString() string</pre> <h3 id="R_MIPS.String">func (R_MIPS) <span>String</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (i R_MIPS) String() string</pre> <h2 id="R_PPC">type <span>R_PPC</span> </h2> <p>Relocation types for PowerPC. </p>
+<p>Values that are shared by both R_PPC and R_PPC64 are prefixed with R_POWERPC_ in the ELF standard. For the R_PPC type, the relevant shared relocations have been renamed with the prefix R_PPC_. The original name follows the value in a comment. </p>
+<pre data-language="go">type R_PPC int</pre> <pre data-language="go">const (
+ R_PPC_NONE R_PPC = 0 // R_POWERPC_NONE
+ R_PPC_ADDR32 R_PPC = 1 // R_POWERPC_ADDR32
+ R_PPC_ADDR24 R_PPC = 2 // R_POWERPC_ADDR24
+ R_PPC_ADDR16 R_PPC = 3 // R_POWERPC_ADDR16
+ R_PPC_ADDR16_LO R_PPC = 4 // R_POWERPC_ADDR16_LO
+ R_PPC_ADDR16_HI R_PPC = 5 // R_POWERPC_ADDR16_HI
+ R_PPC_ADDR16_HA R_PPC = 6 // R_POWERPC_ADDR16_HA
+ R_PPC_ADDR14 R_PPC = 7 // R_POWERPC_ADDR14
+ R_PPC_ADDR14_BRTAKEN R_PPC = 8 // R_POWERPC_ADDR14_BRTAKEN
+ R_PPC_ADDR14_BRNTAKEN R_PPC = 9 // R_POWERPC_ADDR14_BRNTAKEN
+ R_PPC_REL24 R_PPC = 10 // R_POWERPC_REL24
+ R_PPC_REL14 R_PPC = 11 // R_POWERPC_REL14
+ R_PPC_REL14_BRTAKEN R_PPC = 12 // R_POWERPC_REL14_BRTAKEN
+ R_PPC_REL14_BRNTAKEN R_PPC = 13 // R_POWERPC_REL14_BRNTAKEN
+ R_PPC_GOT16 R_PPC = 14 // R_POWERPC_GOT16
+ R_PPC_GOT16_LO R_PPC = 15 // R_POWERPC_GOT16_LO
+ R_PPC_GOT16_HI R_PPC = 16 // R_POWERPC_GOT16_HI
+ R_PPC_GOT16_HA R_PPC = 17 // R_POWERPC_GOT16_HA
+ R_PPC_PLTREL24 R_PPC = 18
+ R_PPC_COPY R_PPC = 19 // R_POWERPC_COPY
+ R_PPC_GLOB_DAT R_PPC = 20 // R_POWERPC_GLOB_DAT
+ R_PPC_JMP_SLOT R_PPC = 21 // R_POWERPC_JMP_SLOT
+ R_PPC_RELATIVE R_PPC = 22 // R_POWERPC_RELATIVE
+ R_PPC_LOCAL24PC R_PPC = 23
+ R_PPC_UADDR32 R_PPC = 24 // R_POWERPC_UADDR32
+ R_PPC_UADDR16 R_PPC = 25 // R_POWERPC_UADDR16
+ R_PPC_REL32 R_PPC = 26 // R_POWERPC_REL32
+ R_PPC_PLT32 R_PPC = 27 // R_POWERPC_PLT32
+ R_PPC_PLTREL32 R_PPC = 28 // R_POWERPC_PLTREL32
+ R_PPC_PLT16_LO R_PPC = 29 // R_POWERPC_PLT16_LO
+ R_PPC_PLT16_HI R_PPC = 30 // R_POWERPC_PLT16_HI
+ R_PPC_PLT16_HA R_PPC = 31 // R_POWERPC_PLT16_HA
+ R_PPC_SDAREL16 R_PPC = 32
+ R_PPC_SECTOFF R_PPC = 33 // R_POWERPC_SECTOFF
+ R_PPC_SECTOFF_LO R_PPC = 34 // R_POWERPC_SECTOFF_LO
+ R_PPC_SECTOFF_HI R_PPC = 35 // R_POWERPC_SECTOFF_HI
+ R_PPC_SECTOFF_HA R_PPC = 36 // R_POWERPC_SECTOFF_HA
+ R_PPC_TLS R_PPC = 67 // R_POWERPC_TLS
+ R_PPC_DTPMOD32 R_PPC = 68 // R_POWERPC_DTPMOD32
+ R_PPC_TPREL16 R_PPC = 69 // R_POWERPC_TPREL16
+ R_PPC_TPREL16_LO R_PPC = 70 // R_POWERPC_TPREL16_LO
+ R_PPC_TPREL16_HI R_PPC = 71 // R_POWERPC_TPREL16_HI
+ R_PPC_TPREL16_HA R_PPC = 72 // R_POWERPC_TPREL16_HA
+ R_PPC_TPREL32 R_PPC = 73 // R_POWERPC_TPREL32
+ R_PPC_DTPREL16 R_PPC = 74 // R_POWERPC_DTPREL16
+ R_PPC_DTPREL16_LO R_PPC = 75 // R_POWERPC_DTPREL16_LO
+ R_PPC_DTPREL16_HI R_PPC = 76 // R_POWERPC_DTPREL16_HI
+ R_PPC_DTPREL16_HA R_PPC = 77 // R_POWERPC_DTPREL16_HA
+ R_PPC_DTPREL32 R_PPC = 78 // R_POWERPC_DTPREL32
+ R_PPC_GOT_TLSGD16 R_PPC = 79 // R_POWERPC_GOT_TLSGD16
+ R_PPC_GOT_TLSGD16_LO R_PPC = 80 // R_POWERPC_GOT_TLSGD16_LO
+ R_PPC_GOT_TLSGD16_HI R_PPC = 81 // R_POWERPC_GOT_TLSGD16_HI
+ R_PPC_GOT_TLSGD16_HA R_PPC = 82 // R_POWERPC_GOT_TLSGD16_HA
+ R_PPC_GOT_TLSLD16 R_PPC = 83 // R_POWERPC_GOT_TLSLD16
+ R_PPC_GOT_TLSLD16_LO R_PPC = 84 // R_POWERPC_GOT_TLSLD16_LO
+ R_PPC_GOT_TLSLD16_HI R_PPC = 85 // R_POWERPC_GOT_TLSLD16_HI
+ R_PPC_GOT_TLSLD16_HA R_PPC = 86 // R_POWERPC_GOT_TLSLD16_HA
+ R_PPC_GOT_TPREL16 R_PPC = 87 // R_POWERPC_GOT_TPREL16
+ R_PPC_GOT_TPREL16_LO R_PPC = 88 // R_POWERPC_GOT_TPREL16_LO
+ R_PPC_GOT_TPREL16_HI R_PPC = 89 // R_POWERPC_GOT_TPREL16_HI
+ R_PPC_GOT_TPREL16_HA R_PPC = 90 // R_POWERPC_GOT_TPREL16_HA
+ R_PPC_EMB_NADDR32 R_PPC = 101
+ R_PPC_EMB_NADDR16 R_PPC = 102
+ R_PPC_EMB_NADDR16_LO R_PPC = 103
+ R_PPC_EMB_NADDR16_HI R_PPC = 104
+ R_PPC_EMB_NADDR16_HA R_PPC = 105
+ R_PPC_EMB_SDAI16 R_PPC = 106
+ R_PPC_EMB_SDA2I16 R_PPC = 107
+ R_PPC_EMB_SDA2REL R_PPC = 108
+ R_PPC_EMB_SDA21 R_PPC = 109
+ R_PPC_EMB_MRKREF R_PPC = 110
+ R_PPC_EMB_RELSEC16 R_PPC = 111
+ R_PPC_EMB_RELST_LO R_PPC = 112
+ R_PPC_EMB_RELST_HI R_PPC = 113
+ R_PPC_EMB_RELST_HA R_PPC = 114
+ R_PPC_EMB_BIT_FLD R_PPC = 115
+ R_PPC_EMB_RELSDA R_PPC = 116
+)</pre> <h3 id="R_PPC.GoString">func (R_PPC) <span>GoString</span> </h3> <pre data-language="go">func (i R_PPC) GoString() string</pre> <h3 id="R_PPC.String">func (R_PPC) <span>String</span> </h3> <pre data-language="go">func (i R_PPC) String() string</pre> <h2 id="R_PPC64">type <span>R_PPC64</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>Relocation types for 64-bit PowerPC or Power Architecture processors. </p>
+<p>Values that are shared by both R_PPC and R_PPC64 are prefixed with R_POWERPC_ in the ELF standard. For the R_PPC64 type, the relevant shared relocations have been renamed with the prefix R_PPC64_. The original name follows the value in a comment. </p>
+<pre data-language="go">type R_PPC64 int</pre> <pre data-language="go">const (
+ R_PPC64_NONE R_PPC64 = 0 // R_POWERPC_NONE
+ R_PPC64_ADDR32 R_PPC64 = 1 // R_POWERPC_ADDR32
+ R_PPC64_ADDR24 R_PPC64 = 2 // R_POWERPC_ADDR24
+ R_PPC64_ADDR16 R_PPC64 = 3 // R_POWERPC_ADDR16
+ R_PPC64_ADDR16_LO R_PPC64 = 4 // R_POWERPC_ADDR16_LO
+ R_PPC64_ADDR16_HI R_PPC64 = 5 // R_POWERPC_ADDR16_HI
+ R_PPC64_ADDR16_HA R_PPC64 = 6 // R_POWERPC_ADDR16_HA
+ R_PPC64_ADDR14 R_PPC64 = 7 // R_POWERPC_ADDR14
+ R_PPC64_ADDR14_BRTAKEN R_PPC64 = 8 // R_POWERPC_ADDR14_BRTAKEN
+ R_PPC64_ADDR14_BRNTAKEN R_PPC64 = 9 // R_POWERPC_ADDR14_BRNTAKEN
+ R_PPC64_REL24 R_PPC64 = 10 // R_POWERPC_REL24
+ R_PPC64_REL14 R_PPC64 = 11 // R_POWERPC_REL14
+ R_PPC64_REL14_BRTAKEN R_PPC64 = 12 // R_POWERPC_REL14_BRTAKEN
+ R_PPC64_REL14_BRNTAKEN R_PPC64 = 13 // R_POWERPC_REL14_BRNTAKEN
+ R_PPC64_GOT16 R_PPC64 = 14 // R_POWERPC_GOT16
+ R_PPC64_GOT16_LO R_PPC64 = 15 // R_POWERPC_GOT16_LO
+ R_PPC64_GOT16_HI R_PPC64 = 16 // R_POWERPC_GOT16_HI
+ R_PPC64_GOT16_HA R_PPC64 = 17 // R_POWERPC_GOT16_HA
+ R_PPC64_COPY R_PPC64 = 19 // R_POWERPC_COPY
+ R_PPC64_GLOB_DAT R_PPC64 = 20 // R_POWERPC_GLOB_DAT
+ R_PPC64_JMP_SLOT R_PPC64 = 21 // R_POWERPC_JMP_SLOT
+ R_PPC64_RELATIVE R_PPC64 = 22 // R_POWERPC_RELATIVE
+ R_PPC64_UADDR32 R_PPC64 = 24 // R_POWERPC_UADDR32
+ R_PPC64_UADDR16 R_PPC64 = 25 // R_POWERPC_UADDR16
+ R_PPC64_REL32 R_PPC64 = 26 // R_POWERPC_REL32
+ R_PPC64_PLT32 R_PPC64 = 27 // R_POWERPC_PLT32
+ R_PPC64_PLTREL32 R_PPC64 = 28 // R_POWERPC_PLTREL32
+ R_PPC64_PLT16_LO R_PPC64 = 29 // R_POWERPC_PLT16_LO
+ R_PPC64_PLT16_HI R_PPC64 = 30 // R_POWERPC_PLT16_HI
+ R_PPC64_PLT16_HA R_PPC64 = 31 // R_POWERPC_PLT16_HA
+ R_PPC64_SECTOFF R_PPC64 = 33 // R_POWERPC_SECTOFF
+ R_PPC64_SECTOFF_LO R_PPC64 = 34 // R_POWERPC_SECTOFF_LO
+ R_PPC64_SECTOFF_HI R_PPC64 = 35 // R_POWERPC_SECTOFF_HI
+ R_PPC64_SECTOFF_HA R_PPC64 = 36 // R_POWERPC_SECTOFF_HA
+ R_PPC64_REL30 R_PPC64 = 37 // R_POWERPC_ADDR30
+ R_PPC64_ADDR64 R_PPC64 = 38
+ R_PPC64_ADDR16_HIGHER R_PPC64 = 39
+ R_PPC64_ADDR16_HIGHERA R_PPC64 = 40
+ R_PPC64_ADDR16_HIGHEST R_PPC64 = 41
+ R_PPC64_ADDR16_HIGHESTA R_PPC64 = 42
+ R_PPC64_UADDR64 R_PPC64 = 43
+ R_PPC64_REL64 R_PPC64 = 44
+ R_PPC64_PLT64 R_PPC64 = 45
+ R_PPC64_PLTREL64 R_PPC64 = 46
+ R_PPC64_TOC16 R_PPC64 = 47
+ R_PPC64_TOC16_LO R_PPC64 = 48
+ R_PPC64_TOC16_HI R_PPC64 = 49
+ R_PPC64_TOC16_HA R_PPC64 = 50
+ R_PPC64_TOC R_PPC64 = 51
+ R_PPC64_PLTGOT16 R_PPC64 = 52
+ R_PPC64_PLTGOT16_LO R_PPC64 = 53
+ R_PPC64_PLTGOT16_HI R_PPC64 = 54
+ R_PPC64_PLTGOT16_HA R_PPC64 = 55
+ R_PPC64_ADDR16_DS R_PPC64 = 56
+ R_PPC64_ADDR16_LO_DS R_PPC64 = 57
+ R_PPC64_GOT16_DS R_PPC64 = 58
+ R_PPC64_GOT16_LO_DS R_PPC64 = 59
+ R_PPC64_PLT16_LO_DS R_PPC64 = 60
+ R_PPC64_SECTOFF_DS R_PPC64 = 61
+ R_PPC64_SECTOFF_LO_DS R_PPC64 = 62
+ R_PPC64_TOC16_DS R_PPC64 = 63
+ R_PPC64_TOC16_LO_DS R_PPC64 = 64
+ R_PPC64_PLTGOT16_DS R_PPC64 = 65
+ R_PPC64_PLTGOT_LO_DS R_PPC64 = 66
+ R_PPC64_TLS R_PPC64 = 67 // R_POWERPC_TLS
+ R_PPC64_DTPMOD64 R_PPC64 = 68 // R_POWERPC_DTPMOD64
+ R_PPC64_TPREL16 R_PPC64 = 69 // R_POWERPC_TPREL16
+ R_PPC64_TPREL16_LO R_PPC64 = 70 // R_POWERPC_TPREL16_LO
+ R_PPC64_TPREL16_HI R_PPC64 = 71 // R_POWERPC_TPREL16_HI
+ R_PPC64_TPREL16_HA R_PPC64 = 72 // R_POWERPC_TPREL16_HA
+ R_PPC64_TPREL64 R_PPC64 = 73 // R_POWERPC_TPREL64
+ R_PPC64_DTPREL16 R_PPC64 = 74 // R_POWERPC_DTPREL16
+ R_PPC64_DTPREL16_LO R_PPC64 = 75 // R_POWERPC_DTPREL16_LO
+ R_PPC64_DTPREL16_HI R_PPC64 = 76 // R_POWERPC_DTPREL16_HI
+ R_PPC64_DTPREL16_HA R_PPC64 = 77 // R_POWERPC_DTPREL16_HA
+ R_PPC64_DTPREL64 R_PPC64 = 78 // R_POWERPC_DTPREL64
+ R_PPC64_GOT_TLSGD16 R_PPC64 = 79 // R_POWERPC_GOT_TLSGD16
+ R_PPC64_GOT_TLSGD16_LO R_PPC64 = 80 // R_POWERPC_GOT_TLSGD16_LO
+ R_PPC64_GOT_TLSGD16_HI R_PPC64 = 81 // R_POWERPC_GOT_TLSGD16_HI
+ R_PPC64_GOT_TLSGD16_HA R_PPC64 = 82 // R_POWERPC_GOT_TLSGD16_HA
+ R_PPC64_GOT_TLSLD16 R_PPC64 = 83 // R_POWERPC_GOT_TLSLD16
+ R_PPC64_GOT_TLSLD16_LO R_PPC64 = 84 // R_POWERPC_GOT_TLSLD16_LO
+ R_PPC64_GOT_TLSLD16_HI R_PPC64 = 85 // R_POWERPC_GOT_TLSLD16_HI
+ R_PPC64_GOT_TLSLD16_HA R_PPC64 = 86 // R_POWERPC_GOT_TLSLD16_HA
+ R_PPC64_GOT_TPREL16_DS R_PPC64 = 87 // R_POWERPC_GOT_TPREL16_DS
+ R_PPC64_GOT_TPREL16_LO_DS R_PPC64 = 88 // R_POWERPC_GOT_TPREL16_LO_DS
+ R_PPC64_GOT_TPREL16_HI R_PPC64 = 89 // R_POWERPC_GOT_TPREL16_HI
+ R_PPC64_GOT_TPREL16_HA R_PPC64 = 90 // R_POWERPC_GOT_TPREL16_HA
+ R_PPC64_GOT_DTPREL16_DS R_PPC64 = 91 // R_POWERPC_GOT_DTPREL16_DS
+ R_PPC64_GOT_DTPREL16_LO_DS R_PPC64 = 92 // R_POWERPC_GOT_DTPREL16_LO_DS
+ R_PPC64_GOT_DTPREL16_HI R_PPC64 = 93 // R_POWERPC_GOT_DTPREL16_HI
+ R_PPC64_GOT_DTPREL16_HA R_PPC64 = 94 // R_POWERPC_GOT_DTPREL16_HA
+ R_PPC64_TPREL16_DS R_PPC64 = 95
+ R_PPC64_TPREL16_LO_DS R_PPC64 = 96
+ R_PPC64_TPREL16_HIGHER R_PPC64 = 97
+ R_PPC64_TPREL16_HIGHERA R_PPC64 = 98
+ R_PPC64_TPREL16_HIGHEST R_PPC64 = 99
+ R_PPC64_TPREL16_HIGHESTA R_PPC64 = 100
+ R_PPC64_DTPREL16_DS R_PPC64 = 101
+ R_PPC64_DTPREL16_LO_DS R_PPC64 = 102
+ R_PPC64_DTPREL16_HIGHER R_PPC64 = 103
+ R_PPC64_DTPREL16_HIGHERA R_PPC64 = 104
+ R_PPC64_DTPREL16_HIGHEST R_PPC64 = 105
+ R_PPC64_DTPREL16_HIGHESTA R_PPC64 = 106
+ R_PPC64_TLSGD R_PPC64 = 107
+ R_PPC64_TLSLD R_PPC64 = 108
+ R_PPC64_TOCSAVE R_PPC64 = 109
+ R_PPC64_ADDR16_HIGH R_PPC64 = 110
+ R_PPC64_ADDR16_HIGHA R_PPC64 = 111
+ R_PPC64_TPREL16_HIGH R_PPC64 = 112
+ R_PPC64_TPREL16_HIGHA R_PPC64 = 113
+ R_PPC64_DTPREL16_HIGH R_PPC64 = 114
+ R_PPC64_DTPREL16_HIGHA R_PPC64 = 115
+ R_PPC64_REL24_NOTOC R_PPC64 = 116
+ R_PPC64_ADDR64_LOCAL R_PPC64 = 117
+ R_PPC64_ENTRY R_PPC64 = 118
+ R_PPC64_PLTSEQ R_PPC64 = 119
+ R_PPC64_PLTCALL R_PPC64 = 120
+ R_PPC64_PLTSEQ_NOTOC R_PPC64 = 121
+ R_PPC64_PLTCALL_NOTOC R_PPC64 = 122
+ R_PPC64_PCREL_OPT R_PPC64 = 123
+ R_PPC64_REL24_P9NOTOC R_PPC64 = 124
+ R_PPC64_D34 R_PPC64 = 128
+ R_PPC64_D34_LO R_PPC64 = 129
+ R_PPC64_D34_HI30 R_PPC64 = 130
+ R_PPC64_D34_HA30 R_PPC64 = 131
+ R_PPC64_PCREL34 R_PPC64 = 132
+ R_PPC64_GOT_PCREL34 R_PPC64 = 133
+ R_PPC64_PLT_PCREL34 R_PPC64 = 134
+ R_PPC64_PLT_PCREL34_NOTOC R_PPC64 = 135
+ R_PPC64_ADDR16_HIGHER34 R_PPC64 = 136
+ R_PPC64_ADDR16_HIGHERA34 R_PPC64 = 137
+ R_PPC64_ADDR16_HIGHEST34 R_PPC64 = 138
+ R_PPC64_ADDR16_HIGHESTA34 R_PPC64 = 139
+ R_PPC64_REL16_HIGHER34 R_PPC64 = 140
+ R_PPC64_REL16_HIGHERA34 R_PPC64 = 141
+ R_PPC64_REL16_HIGHEST34 R_PPC64 = 142
+ R_PPC64_REL16_HIGHESTA34 R_PPC64 = 143
+ R_PPC64_D28 R_PPC64 = 144
+ R_PPC64_PCREL28 R_PPC64 = 145
+ R_PPC64_TPREL34 R_PPC64 = 146
+ R_PPC64_DTPREL34 R_PPC64 = 147
+ R_PPC64_GOT_TLSGD_PCREL34 R_PPC64 = 148
+ R_PPC64_GOT_TLSLD_PCREL34 R_PPC64 = 149
+ R_PPC64_GOT_TPREL_PCREL34 R_PPC64 = 150
+ R_PPC64_GOT_DTPREL_PCREL34 R_PPC64 = 151
+ R_PPC64_REL16_HIGH R_PPC64 = 240
+ R_PPC64_REL16_HIGHA R_PPC64 = 241
+ R_PPC64_REL16_HIGHER R_PPC64 = 242
+ R_PPC64_REL16_HIGHERA R_PPC64 = 243
+ R_PPC64_REL16_HIGHEST R_PPC64 = 244
+ R_PPC64_REL16_HIGHESTA R_PPC64 = 245
+ R_PPC64_REL16DX_HA R_PPC64 = 246 // R_POWERPC_REL16DX_HA
+ R_PPC64_JMP_IREL R_PPC64 = 247
+ R_PPC64_IRELATIVE R_PPC64 = 248 // R_POWERPC_IRELATIVE
+ R_PPC64_REL16 R_PPC64 = 249 // R_POWERPC_REL16
+ R_PPC64_REL16_LO R_PPC64 = 250 // R_POWERPC_REL16_LO
+ R_PPC64_REL16_HI R_PPC64 = 251 // R_POWERPC_REL16_HI
+ R_PPC64_REL16_HA R_PPC64 = 252 // R_POWERPC_REL16_HA
+ R_PPC64_GNU_VTINHERIT R_PPC64 = 253
+ R_PPC64_GNU_VTENTRY R_PPC64 = 254
+)</pre> <h3 id="R_PPC64.GoString">func (R_PPC64) <span>GoString</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (i R_PPC64) GoString() string</pre> <h3 id="R_PPC64.String">func (R_PPC64) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (i R_PPC64) String() string</pre> <h2 id="R_RISCV">type <span>R_RISCV</span> <span title="Added in Go 1.11">1.11</span> </h2> <p>Relocation types for RISC-V processors. </p>
+<pre data-language="go">type R_RISCV int</pre> <pre data-language="go">const (
+ R_RISCV_NONE R_RISCV = 0 /* No relocation. */
+ R_RISCV_32 R_RISCV = 1 /* Add 32 bit zero extended symbol value */
+ R_RISCV_64 R_RISCV = 2 /* Add 64 bit symbol value. */
+ R_RISCV_RELATIVE R_RISCV = 3 /* Add load address of shared object. */
+ R_RISCV_COPY R_RISCV = 4 /* Copy data from shared object. */
+ R_RISCV_JUMP_SLOT R_RISCV = 5 /* Set GOT entry to code address. */
+ R_RISCV_TLS_DTPMOD32 R_RISCV = 6 /* 32 bit ID of module containing symbol */
+ R_RISCV_TLS_DTPMOD64 R_RISCV = 7 /* ID of module containing symbol */
+ R_RISCV_TLS_DTPREL32 R_RISCV = 8 /* 32 bit relative offset in TLS block */
+ R_RISCV_TLS_DTPREL64 R_RISCV = 9 /* Relative offset in TLS block */
+ R_RISCV_TLS_TPREL32 R_RISCV = 10 /* 32 bit relative offset in static TLS block */
+ R_RISCV_TLS_TPREL64 R_RISCV = 11 /* Relative offset in static TLS block */
+ R_RISCV_BRANCH R_RISCV = 16 /* PC-relative branch */
+ R_RISCV_JAL R_RISCV = 17 /* PC-relative jump */
+ R_RISCV_CALL R_RISCV = 18 /* PC-relative call */
+ R_RISCV_CALL_PLT R_RISCV = 19 /* PC-relative call (PLT) */
+ R_RISCV_GOT_HI20 R_RISCV = 20 /* PC-relative GOT reference */
+ R_RISCV_TLS_GOT_HI20 R_RISCV = 21 /* PC-relative TLS IE GOT offset */
+ R_RISCV_TLS_GD_HI20 R_RISCV = 22 /* PC-relative TLS GD reference */
+ R_RISCV_PCREL_HI20 R_RISCV = 23 /* PC-relative reference */
+ R_RISCV_PCREL_LO12_I R_RISCV = 24 /* PC-relative reference */
+ R_RISCV_PCREL_LO12_S R_RISCV = 25 /* PC-relative reference */
+ R_RISCV_HI20 R_RISCV = 26 /* Absolute address */
+ R_RISCV_LO12_I R_RISCV = 27 /* Absolute address */
+ R_RISCV_LO12_S R_RISCV = 28 /* Absolute address */
+ R_RISCV_TPREL_HI20 R_RISCV = 29 /* TLS LE thread offset */
+ R_RISCV_TPREL_LO12_I R_RISCV = 30 /* TLS LE thread offset */
+ R_RISCV_TPREL_LO12_S R_RISCV = 31 /* TLS LE thread offset */
+ R_RISCV_TPREL_ADD R_RISCV = 32 /* TLS LE thread usage */
+ R_RISCV_ADD8 R_RISCV = 33 /* 8-bit label addition */
+ R_RISCV_ADD16 R_RISCV = 34 /* 16-bit label addition */
+ R_RISCV_ADD32 R_RISCV = 35 /* 32-bit label addition */
+ R_RISCV_ADD64 R_RISCV = 36 /* 64-bit label addition */
+ R_RISCV_SUB8 R_RISCV = 37 /* 8-bit label subtraction */
+ R_RISCV_SUB16 R_RISCV = 38 /* 16-bit label subtraction */
+ R_RISCV_SUB32 R_RISCV = 39 /* 32-bit label subtraction */
+ R_RISCV_SUB64 R_RISCV = 40 /* 64-bit label subtraction */
+ R_RISCV_GNU_VTINHERIT R_RISCV = 41 /* GNU C++ vtable hierarchy */
+ R_RISCV_GNU_VTENTRY R_RISCV = 42 /* GNU C++ vtable member usage */
+ R_RISCV_ALIGN R_RISCV = 43 /* Alignment statement */
+ R_RISCV_RVC_BRANCH R_RISCV = 44 /* PC-relative branch offset */
+ R_RISCV_RVC_JUMP R_RISCV = 45 /* PC-relative jump offset */
+ R_RISCV_RVC_LUI R_RISCV = 46 /* Absolute address */
+ R_RISCV_GPREL_I R_RISCV = 47 /* GP-relative reference */
+ R_RISCV_GPREL_S R_RISCV = 48 /* GP-relative reference */
+ R_RISCV_TPREL_I R_RISCV = 49 /* TP-relative TLS LE load */
+ R_RISCV_TPREL_S R_RISCV = 50 /* TP-relative TLS LE store */
+ R_RISCV_RELAX R_RISCV = 51 /* Instruction pair can be relaxed */
+ R_RISCV_SUB6 R_RISCV = 52 /* Local label subtraction */
+ R_RISCV_SET6 R_RISCV = 53 /* Local label subtraction */
+ R_RISCV_SET8 R_RISCV = 54 /* Local label subtraction */
+ R_RISCV_SET16 R_RISCV = 55 /* Local label subtraction */
+ R_RISCV_SET32 R_RISCV = 56 /* Local label subtraction */
+ R_RISCV_32_PCREL R_RISCV = 57 /* 32-bit PC relative */
+)</pre> <h3 id="R_RISCV.GoString">func (R_RISCV) <span>GoString</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (i R_RISCV) GoString() string</pre> <h3 id="R_RISCV.String">func (R_RISCV) <span>String</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (i R_RISCV) String() string</pre> <h2 id="R_SPARC">type <span>R_SPARC</span> </h2> <p>Relocation types for SPARC. </p>
+<pre data-language="go">type R_SPARC int</pre> <pre data-language="go">const (
+ R_SPARC_NONE R_SPARC = 0
+ R_SPARC_8 R_SPARC = 1
+ R_SPARC_16 R_SPARC = 2
+ R_SPARC_32 R_SPARC = 3
+ R_SPARC_DISP8 R_SPARC = 4
+ R_SPARC_DISP16 R_SPARC = 5
+ R_SPARC_DISP32 R_SPARC = 6
+ R_SPARC_WDISP30 R_SPARC = 7
+ R_SPARC_WDISP22 R_SPARC = 8
+ R_SPARC_HI22 R_SPARC = 9
+ R_SPARC_22 R_SPARC = 10
+ R_SPARC_13 R_SPARC = 11
+ R_SPARC_LO10 R_SPARC = 12
+ R_SPARC_GOT10 R_SPARC = 13
+ R_SPARC_GOT13 R_SPARC = 14
+ R_SPARC_GOT22 R_SPARC = 15
+ R_SPARC_PC10 R_SPARC = 16
+ R_SPARC_PC22 R_SPARC = 17
+ R_SPARC_WPLT30 R_SPARC = 18
+ R_SPARC_COPY R_SPARC = 19
+ R_SPARC_GLOB_DAT R_SPARC = 20
+ R_SPARC_JMP_SLOT R_SPARC = 21
+ R_SPARC_RELATIVE R_SPARC = 22
+ R_SPARC_UA32 R_SPARC = 23
+ R_SPARC_PLT32 R_SPARC = 24
+ R_SPARC_HIPLT22 R_SPARC = 25
+ R_SPARC_LOPLT10 R_SPARC = 26
+ R_SPARC_PCPLT32 R_SPARC = 27
+ R_SPARC_PCPLT22 R_SPARC = 28
+ R_SPARC_PCPLT10 R_SPARC = 29
+ R_SPARC_10 R_SPARC = 30
+ R_SPARC_11 R_SPARC = 31
+ R_SPARC_64 R_SPARC = 32
+ R_SPARC_OLO10 R_SPARC = 33
+ R_SPARC_HH22 R_SPARC = 34
+ R_SPARC_HM10 R_SPARC = 35
+ R_SPARC_LM22 R_SPARC = 36
+ R_SPARC_PC_HH22 R_SPARC = 37
+ R_SPARC_PC_HM10 R_SPARC = 38
+ R_SPARC_PC_LM22 R_SPARC = 39
+ R_SPARC_WDISP16 R_SPARC = 40
+ R_SPARC_WDISP19 R_SPARC = 41
+ R_SPARC_GLOB_JMP R_SPARC = 42
+ R_SPARC_7 R_SPARC = 43
+ R_SPARC_5 R_SPARC = 44
+ R_SPARC_6 R_SPARC = 45
+ R_SPARC_DISP64 R_SPARC = 46
+ R_SPARC_PLT64 R_SPARC = 47
+ R_SPARC_HIX22 R_SPARC = 48
+ R_SPARC_LOX10 R_SPARC = 49
+ R_SPARC_H44 R_SPARC = 50
+ R_SPARC_M44 R_SPARC = 51
+ R_SPARC_L44 R_SPARC = 52
+ R_SPARC_REGISTER R_SPARC = 53
+ R_SPARC_UA64 R_SPARC = 54
+ R_SPARC_UA16 R_SPARC = 55
+)</pre> <h3 id="R_SPARC.GoString">func (R_SPARC) <span>GoString</span> </h3> <pre data-language="go">func (i R_SPARC) GoString() string</pre> <h3 id="R_SPARC.String">func (R_SPARC) <span>String</span> </h3> <pre data-language="go">func (i R_SPARC) String() string</pre> <h2 id="R_X86_64">type <span>R_X86_64</span> </h2> <p>Relocation types for x86-64. </p>
+<pre data-language="go">type R_X86_64 int</pre> <pre data-language="go">const (
+ R_X86_64_NONE R_X86_64 = 0 /* No relocation. */
+ R_X86_64_64 R_X86_64 = 1 /* Add 64 bit symbol value. */
+ R_X86_64_PC32 R_X86_64 = 2 /* PC-relative 32 bit signed sym value. */
+ R_X86_64_GOT32 R_X86_64 = 3 /* PC-relative 32 bit GOT offset. */
+ R_X86_64_PLT32 R_X86_64 = 4 /* PC-relative 32 bit PLT offset. */
+ R_X86_64_COPY R_X86_64 = 5 /* Copy data from shared object. */
+ R_X86_64_GLOB_DAT R_X86_64 = 6 /* Set GOT entry to data address. */
+ R_X86_64_JMP_SLOT R_X86_64 = 7 /* Set GOT entry to code address. */
+ R_X86_64_RELATIVE R_X86_64 = 8 /* Add load address of shared object. */
+ R_X86_64_GOTPCREL R_X86_64 = 9 /* Add 32 bit signed pcrel offset to GOT. */
+ R_X86_64_32 R_X86_64 = 10 /* Add 32 bit zero extended symbol value */
+ R_X86_64_32S R_X86_64 = 11 /* Add 32 bit sign extended symbol value */
+ R_X86_64_16 R_X86_64 = 12 /* Add 16 bit zero extended symbol value */
+ R_X86_64_PC16 R_X86_64 = 13 /* Add 16 bit signed extended pc relative symbol value */
+ R_X86_64_8 R_X86_64 = 14 /* Add 8 bit zero extended symbol value */
+ R_X86_64_PC8 R_X86_64 = 15 /* Add 8 bit signed extended pc relative symbol value */
+ R_X86_64_DTPMOD64 R_X86_64 = 16 /* ID of module containing symbol */
+ R_X86_64_DTPOFF64 R_X86_64 = 17 /* Offset in TLS block */
+ R_X86_64_TPOFF64 R_X86_64 = 18 /* Offset in static TLS block */
+ R_X86_64_TLSGD R_X86_64 = 19 /* PC relative offset to GD GOT entry */
+ R_X86_64_TLSLD R_X86_64 = 20 /* PC relative offset to LD GOT entry */
+ R_X86_64_DTPOFF32 R_X86_64 = 21 /* Offset in TLS block */
+ R_X86_64_GOTTPOFF R_X86_64 = 22 /* PC relative offset to IE GOT entry */
+ R_X86_64_TPOFF32 R_X86_64 = 23 /* Offset in static TLS block */
+ R_X86_64_PC64 R_X86_64 = 24 /* PC relative 64-bit sign extended symbol value. */
+ R_X86_64_GOTOFF64 R_X86_64 = 25
+ R_X86_64_GOTPC32 R_X86_64 = 26
+ R_X86_64_GOT64 R_X86_64 = 27
+ R_X86_64_GOTPCREL64 R_X86_64 = 28
+ R_X86_64_GOTPC64 R_X86_64 = 29
+ R_X86_64_GOTPLT64 R_X86_64 = 30
+ R_X86_64_PLTOFF64 R_X86_64 = 31
+ R_X86_64_SIZE32 R_X86_64 = 32
+ R_X86_64_SIZE64 R_X86_64 = 33
+ R_X86_64_GOTPC32_TLSDESC R_X86_64 = 34
+ R_X86_64_TLSDESC_CALL R_X86_64 = 35
+ R_X86_64_TLSDESC R_X86_64 = 36
+ R_X86_64_IRELATIVE R_X86_64 = 37
+ R_X86_64_RELATIVE64 R_X86_64 = 38
+ R_X86_64_PC32_BND R_X86_64 = 39
+ R_X86_64_PLT32_BND R_X86_64 = 40
+ R_X86_64_GOTPCRELX R_X86_64 = 41
+ R_X86_64_REX_GOTPCRELX R_X86_64 = 42
+)</pre> <h3 id="R_X86_64.GoString">func (R_X86_64) <span>GoString</span> </h3> <pre data-language="go">func (i R_X86_64) GoString() string</pre> <h3 id="R_X86_64.String">func (R_X86_64) <span>String</span> </h3> <pre data-language="go">func (i R_X86_64) String() string</pre> <h2 id="Rel32">type <span>Rel32</span> </h2> <p>ELF32 Relocations that don't need an addend field. </p>
+<pre data-language="go">type Rel32 struct {
+ Off uint32 /* Location to be relocated. */
+ Info uint32 /* Relocation type and symbol index. */
+}
+</pre> <h2 id="Rel64">type <span>Rel64</span> </h2> <p>ELF64 relocations that don't need an addend field. </p>
+<pre data-language="go">type Rel64 struct {
+ Off uint64 /* Location to be relocated. */
+ Info uint64 /* Relocation type and symbol index. */
+}
+</pre> <h2 id="Rela32">type <span>Rela32</span> </h2> <p>ELF32 Relocations that need an addend field. </p>
+<pre data-language="go">type Rela32 struct {
+ Off uint32 /* Location to be relocated. */
+ Info uint32 /* Relocation type and symbol index. */
+ Addend int32 /* Addend. */
+}
+</pre> <h2 id="Rela64">type <span>Rela64</span> </h2> <p>ELF64 relocations that need an addend field. </p>
+<pre data-language="go">type Rela64 struct {
+ Off uint64 /* Location to be relocated. */
+ Info uint64 /* Relocation type and symbol index. */
+ Addend int64 /* Addend. */
+}
+</pre> <h2 id="Section">type <span>Section</span> </h2> <p>A Section represents a single section in an ELF file. </p>
+<pre data-language="go">type Section struct {
+ SectionHeader
+
+ // Embed ReaderAt for ReadAt method.
+ // Do not embed SectionReader directly
+ // to avoid having Read and Seek.
+ // If a client wants Read and Seek it must use
+ // Open() to avoid fighting over the seek offset
+ // with other clients.
+ //
+ // ReaderAt may be nil if the section is not easily available
+ // in a random-access form. For example, a compressed section
+ // may have a nil ReaderAt.
+ io.ReaderAt
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Section.Data">func (*Section) <span>Data</span> </h3> <pre data-language="go">func (s *Section) Data() ([]byte, error)</pre> <p>Data reads and returns the contents of the ELF section. Even if the section is stored compressed in the ELF file, Data returns uncompressed data. </p>
+<p>For an <a href="#SHT_NOBITS">SHT_NOBITS</a> section, Data always returns a non-nil error. </p>
+<h3 id="Section.Open">func (*Section) <span>Open</span> </h3> <pre data-language="go">func (s *Section) Open() io.ReadSeeker</pre> <p>Open returns a new ReadSeeker reading the ELF section. Even if the section is stored compressed in the ELF file, the ReadSeeker reads uncompressed data. </p>
+<p>For an <a href="#SHT_NOBITS">SHT_NOBITS</a> section, all calls to the opened reader will return a non-nil error. </p>
+<h2 id="Section32">type <span>Section32</span> </h2> <p>ELF32 Section header. </p>
+<pre data-language="go">type Section32 struct {
+ Name uint32 /* Section name (index into the section header string table). */
+ Type uint32 /* Section type. */
+ Flags uint32 /* Section flags. */
+ Addr uint32 /* Address in memory image. */
+ Off uint32 /* Offset in file. */
+ Size uint32 /* Size in bytes. */
+ Link uint32 /* Index of a related section. */
+ Info uint32 /* Depends on section type. */
+ Addralign uint32 /* Alignment in bytes. */
+ Entsize uint32 /* Size of each entry in section. */
+}
+</pre> <h2 id="Section64">type <span>Section64</span> </h2> <p>ELF64 Section header. </p>
+<pre data-language="go">type Section64 struct {
+ Name uint32 /* Section name (index into the section header string table). */
+ Type uint32 /* Section type. */
+ Flags uint64 /* Section flags. */
+ Addr uint64 /* Address in memory image. */
+ Off uint64 /* Offset in file. */
+ Size uint64 /* Size in bytes. */
+ Link uint32 /* Index of a related section. */
+ Info uint32 /* Depends on section type. */
+ Addralign uint64 /* Alignment in bytes. */
+ Entsize uint64 /* Size of each entry in section. */
+}
+</pre> <h2 id="SectionFlag">type <span>SectionFlag</span> </h2> <p>Section flags. </p>
+<pre data-language="go">type SectionFlag uint32</pre> <pre data-language="go">const (
+ SHF_WRITE SectionFlag = 0x1 /* Section contains writable data. */
+ SHF_ALLOC SectionFlag = 0x2 /* Section occupies memory. */
+ SHF_EXECINSTR SectionFlag = 0x4 /* Section contains instructions. */
+ SHF_MERGE SectionFlag = 0x10 /* Section may be merged. */
+ SHF_STRINGS SectionFlag = 0x20 /* Section contains strings. */
+ SHF_INFO_LINK SectionFlag = 0x40 /* sh_info holds section index. */
+ SHF_LINK_ORDER SectionFlag = 0x80 /* Special ordering requirements. */
+ SHF_OS_NONCONFORMING SectionFlag = 0x100 /* OS-specific processing required. */
+ SHF_GROUP SectionFlag = 0x200 /* Member of section group. */
+ SHF_TLS SectionFlag = 0x400 /* Section contains TLS data. */
+ SHF_COMPRESSED SectionFlag = 0x800 /* Section is compressed. */
+ SHF_MASKOS SectionFlag = 0x0ff00000 /* OS-specific semantics. */
+ SHF_MASKPROC SectionFlag = 0xf0000000 /* Processor-specific semantics. */
+)</pre> <h3 id="SectionFlag.GoString">func (SectionFlag) <span>GoString</span> </h3> <pre data-language="go">func (i SectionFlag) GoString() string</pre> <h3 id="SectionFlag.String">func (SectionFlag) <span>String</span> </h3> <pre data-language="go">func (i SectionFlag) String() string</pre> <h2 id="SectionHeader">type <span>SectionHeader</span> </h2> <p>A SectionHeader represents a single ELF section header. </p>
+<pre data-language="go">type SectionHeader struct {
+ Name string
+ Type SectionType
+ Flags SectionFlag
+ Addr uint64
+ Offset uint64
+ Size uint64
+ Link uint32
+ Info uint32
+ Addralign uint64
+ Entsize uint64
+
+ // FileSize is the size of this section in the file in bytes.
+ // If a section is compressed, FileSize is the size of the
+ // compressed data, while Size (above) is the size of the
+ // uncompressed data.
+ FileSize uint64 // Go 1.6
+}
+</pre> <h2 id="SectionIndex">type <span>SectionIndex</span> </h2> <p>Special section indices. </p>
+<pre data-language="go">type SectionIndex int</pre> <pre data-language="go">const (
+ SHN_UNDEF SectionIndex = 0 /* Undefined, missing, irrelevant. */
+ SHN_LORESERVE SectionIndex = 0xff00 /* First of reserved range. */
+ SHN_LOPROC SectionIndex = 0xff00 /* First processor-specific. */
+ SHN_HIPROC SectionIndex = 0xff1f /* Last processor-specific. */
+ SHN_LOOS SectionIndex = 0xff20 /* First operating system-specific. */
+ SHN_HIOS SectionIndex = 0xff3f /* Last operating system-specific. */
+ SHN_ABS SectionIndex = 0xfff1 /* Absolute values. */
+ SHN_COMMON SectionIndex = 0xfff2 /* Common data. */
+ SHN_XINDEX SectionIndex = 0xffff /* Escape; index stored elsewhere. */
+ SHN_HIRESERVE SectionIndex = 0xffff /* Last of reserved range. */
+)</pre> <h3 id="SectionIndex.GoString">func (SectionIndex) <span>GoString</span> </h3> <pre data-language="go">func (i SectionIndex) GoString() string</pre> <h3 id="SectionIndex.String">func (SectionIndex) <span>String</span> </h3> <pre data-language="go">func (i SectionIndex) String() string</pre> <h2 id="SectionType">type <span>SectionType</span> </h2> <p>Section type. </p>
+<pre data-language="go">type SectionType uint32</pre> <pre data-language="go">const (
+ SHT_NULL SectionType = 0 /* inactive */
+ SHT_PROGBITS SectionType = 1 /* program defined information */
+ SHT_SYMTAB SectionType = 2 /* symbol table section */
+ SHT_STRTAB SectionType = 3 /* string table section */
+ SHT_RELA SectionType = 4 /* relocation section with addends */
+ SHT_HASH SectionType = 5 /* symbol hash table section */
+ SHT_DYNAMIC SectionType = 6 /* dynamic section */
+ SHT_NOTE SectionType = 7 /* note section */
+ SHT_NOBITS SectionType = 8 /* no space section */
+ SHT_REL SectionType = 9 /* relocation section - no addends */
+ SHT_SHLIB SectionType = 10 /* reserved - purpose unknown */
+ SHT_DYNSYM SectionType = 11 /* dynamic symbol table section */
+ SHT_INIT_ARRAY SectionType = 14 /* Initialization function pointers. */
+ SHT_FINI_ARRAY SectionType = 15 /* Termination function pointers. */
+ SHT_PREINIT_ARRAY SectionType = 16 /* Pre-initialization function ptrs. */
+ SHT_GROUP SectionType = 17 /* Section group. */
+ SHT_SYMTAB_SHNDX SectionType = 18 /* Section indexes (see SHN_XINDEX). */
+ SHT_LOOS SectionType = 0x60000000 /* First of OS specific semantics */
+ SHT_GNU_ATTRIBUTES SectionType = 0x6ffffff5 /* GNU object attributes */
+ SHT_GNU_HASH SectionType = 0x6ffffff6 /* GNU hash table */
+ SHT_GNU_LIBLIST SectionType = 0x6ffffff7 /* GNU prelink library list */
+ SHT_GNU_VERDEF SectionType = 0x6ffffffd /* GNU version definition section */
+ SHT_GNU_VERNEED SectionType = 0x6ffffffe /* GNU version needs section */
+ SHT_GNU_VERSYM SectionType = 0x6fffffff /* GNU version symbol table */
+ SHT_HIOS SectionType = 0x6fffffff /* Last of OS specific semantics */
+ SHT_LOPROC SectionType = 0x70000000 /* reserved range for processor */
+ SHT_MIPS_ABIFLAGS SectionType = 0x7000002a /* .MIPS.abiflags */
+ SHT_HIPROC SectionType = 0x7fffffff /* specific section header types */
+ SHT_LOUSER SectionType = 0x80000000 /* reserved range for application */
+ SHT_HIUSER SectionType = 0xffffffff /* specific indexes */
+)</pre> <h3 id="SectionType.GoString">func (SectionType) <span>GoString</span> </h3> <pre data-language="go">func (i SectionType) GoString() string</pre> <h3 id="SectionType.String">func (SectionType) <span>String</span> </h3> <pre data-language="go">func (i SectionType) String() string</pre> <h2 id="Sym32">type <span>Sym32</span> </h2> <p>ELF32 Symbol. </p>
+<pre data-language="go">type Sym32 struct {
+ Name uint32
+ Value uint32
+ Size uint32
+ Info uint8
+ Other uint8
+ Shndx uint16
+}
+</pre> <h2 id="Sym64">type <span>Sym64</span> </h2> <p>ELF64 symbol table entries. </p>
+<pre data-language="go">type Sym64 struct {
+ Name uint32 /* String table index of name. */
+ Info uint8 /* Type and binding information. */
+ Other uint8 /* Reserved (not used). */
+ Shndx uint16 /* Section index of symbol. */
+ Value uint64 /* Symbol value. */
+ Size uint64 /* Size of associated object. */
+}
+</pre> <h2 id="SymBind">type <span>SymBind</span> </h2> <p>Symbol Binding - ELFNN_ST_BIND - st_info </p>
+<pre data-language="go">type SymBind int</pre> <pre data-language="go">const (
+ STB_LOCAL SymBind = 0 /* Local symbol */
+ STB_GLOBAL SymBind = 1 /* Global symbol */
+ STB_WEAK SymBind = 2 /* like global - lower precedence */
+ STB_LOOS SymBind = 10 /* Reserved range for operating system */
+ STB_HIOS SymBind = 12 /* specific semantics. */
+ STB_LOPROC SymBind = 13 /* reserved range for processor */
+ STB_HIPROC SymBind = 15 /* specific semantics. */
+)</pre> <h3 id="ST_BIND">func <span>ST_BIND</span> </h3> <pre data-language="go">func ST_BIND(info uint8) SymBind</pre> <h3 id="SymBind.GoString">func (SymBind) <span>GoString</span> </h3> <pre data-language="go">func (i SymBind) GoString() string</pre> <h3 id="SymBind.String">func (SymBind) <span>String</span> </h3> <pre data-language="go">func (i SymBind) String() string</pre> <h2 id="SymType">type <span>SymType</span> </h2> <p>Symbol type - ELFNN_ST_TYPE - st_info </p>
+<pre data-language="go">type SymType int</pre> <pre data-language="go">const (
+ STT_NOTYPE SymType = 0 /* Unspecified type. */
+ STT_OBJECT SymType = 1 /* Data object. */
+ STT_FUNC SymType = 2 /* Function. */
+ STT_SECTION SymType = 3 /* Section. */
+ STT_FILE SymType = 4 /* Source file. */
+ STT_COMMON SymType = 5 /* Uninitialized common block. */
+ STT_TLS SymType = 6 /* TLS object. */
+ STT_LOOS SymType = 10 /* Reserved range for operating system */
+ STT_HIOS SymType = 12 /* specific semantics. */
+ STT_LOPROC SymType = 13 /* reserved range for processor */
+ STT_HIPROC SymType = 15 /* specific semantics. */
+)</pre> <h3 id="ST_TYPE">func <span>ST_TYPE</span> </h3> <pre data-language="go">func ST_TYPE(info uint8) SymType</pre> <h3 id="SymType.GoString">func (SymType) <span>GoString</span> </h3> <pre data-language="go">func (i SymType) GoString() string</pre> <h3 id="SymType.String">func (SymType) <span>String</span> </h3> <pre data-language="go">func (i SymType) String() string</pre> <h2 id="SymVis">type <span>SymVis</span> </h2> <p>Symbol visibility - ELFNN_ST_VISIBILITY - st_other </p>
+<pre data-language="go">type SymVis int</pre> <pre data-language="go">const (
+ STV_DEFAULT SymVis = 0x0 /* Default visibility (see binding). */
+ STV_INTERNAL SymVis = 0x1 /* Special meaning in relocatable objects. */
+ STV_HIDDEN SymVis = 0x2 /* Not visible. */
+ STV_PROTECTED SymVis = 0x3 /* Visible but not preemptible. */
+)</pre> <h3 id="ST_VISIBILITY">func <span>ST_VISIBILITY</span> </h3> <pre data-language="go">func ST_VISIBILITY(other uint8) SymVis</pre> <h3 id="SymVis.GoString">func (SymVis) <span>GoString</span> </h3> <pre data-language="go">func (i SymVis) GoString() string</pre> <h3 id="SymVis.String">func (SymVis) <span>String</span> </h3> <pre data-language="go">func (i SymVis) String() string</pre> <h2 id="Symbol">type <span>Symbol</span> </h2> <p>A Symbol represents an entry in an ELF symbol table section. </p>
+<pre data-language="go">type Symbol struct {
+ Name string
+ Info, Other byte
+ Section SectionIndex
+ Value, Size uint64
+
+ // Version and Library are present only for the dynamic symbol
+ // table.
+ Version string // Go 1.13
+ Library string // Go 1.13
+}
+</pre> <h2 id="Type">type <span>Type</span> </h2> <p>Type is found in Header.Type. </p>
+<pre data-language="go">type Type uint16</pre> <pre data-language="go">const (
+ ET_NONE Type = 0 /* Unknown type. */
+ ET_REL Type = 1 /* Relocatable. */
+ ET_EXEC Type = 2 /* Executable. */
+ ET_DYN Type = 3 /* Shared object. */
+ ET_CORE Type = 4 /* Core file. */
+ ET_LOOS Type = 0xfe00 /* First operating system specific. */
+ ET_HIOS Type = 0xfeff /* Last operating system-specific. */
+ ET_LOPROC Type = 0xff00 /* First processor-specific. */
+ ET_HIPROC Type = 0xffff /* Last processor-specific. */
+)</pre> <h3 id="Type.GoString">func (Type) <span>GoString</span> </h3> <pre data-language="go">func (i Type) GoString() string</pre> <h3 id="Type.String">func (Type) <span>String</span> </h3> <pre data-language="go">func (i Type) String() string</pre> <h2 id="Version">type <span>Version</span> </h2> <p>Version is found in Header.Ident[EI_VERSION] and Header.Version. </p>
+<pre data-language="go">type Version byte</pre> <pre data-language="go">const (
+ EV_NONE Version = 0
+ EV_CURRENT Version = 1
+)</pre> <h3 id="Version.GoString">func (Version) <span>GoString</span> </h3> <pre data-language="go">func (i Version) GoString() string</pre> <h3 id="Version.String">func (Version) <span>String</span> </h3> <pre data-language="go">func (i Version) String() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/debug/elf/" class="_attribution-link">http://golang.org/pkg/debug/elf/</a>
+ </p>
+</div>
diff --git a/devdocs/go/debug%2Fgosym%2Findex.html b/devdocs/go/debug%2Fgosym%2Findex.html
new file mode 100644
index 00000000..3b5510a0
--- /dev/null
+++ b/devdocs/go/debug%2Fgosym%2Findex.html
@@ -0,0 +1,133 @@
+<h1> Package gosym </h1> <ul id="short-nav">
+<li><code>import "debug/gosym"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package gosym implements access to the Go symbol and line number tables embedded in Go binaries generated by the gc compilers. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#DecodingError">type DecodingError</a></li>
+<li> <a href="#DecodingError.Error">func (e *DecodingError) Error() string</a>
+</li>
+<li><a href="#Func">type Func</a></li>
+<li><a href="#LineTable">type LineTable</a></li>
+<li> <a href="#NewLineTable">func NewLineTable(data []byte, text uint64) *LineTable</a>
+</li>
+<li> <a href="#LineTable.LineToPC">func (t *LineTable) LineToPC(line int, maxpc uint64) uint64</a>
+</li>
+<li> <a href="#LineTable.PCToLine">func (t *LineTable) PCToLine(pc uint64) int</a>
+</li>
+<li><a href="#Obj">type Obj</a></li>
+<li><a href="#Sym">type Sym</a></li>
+<li> <a href="#Sym.BaseName">func (s *Sym) BaseName() string</a>
+</li>
+<li> <a href="#Sym.PackageName">func (s *Sym) PackageName() string</a>
+</li>
+<li> <a href="#Sym.ReceiverName">func (s *Sym) ReceiverName() string</a>
+</li>
+<li> <a href="#Sym.Static">func (s *Sym) Static() bool</a>
+</li>
+<li><a href="#Table">type Table</a></li>
+<li> <a href="#NewTable">func NewTable(symtab []byte, pcln *LineTable) (*Table, error)</a>
+</li>
+<li> <a href="#Table.LineToPC">func (t *Table) LineToPC(file string, line int) (pc uint64, fn *Func, err error)</a>
+</li>
+<li> <a href="#Table.LookupFunc">func (t *Table) LookupFunc(name string) *Func</a>
+</li>
+<li> <a href="#Table.LookupSym">func (t *Table) LookupSym(name string) *Sym</a>
+</li>
+<li> <a href="#Table.PCToFunc">func (t *Table) PCToFunc(pc uint64) *Func</a>
+</li>
+<li> <a href="#Table.PCToLine">func (t *Table) PCToLine(pc uint64) (file string, line int, fn *Func)</a>
+</li>
+<li> <a href="#Table.SymByAddr">func (t *Table) SymByAddr(addr uint64) *Sym</a>
+</li>
+<li><a href="#UnknownFileError">type UnknownFileError</a></li>
+<li> <a href="#UnknownFileError.Error">func (e UnknownFileError) Error() string</a>
+</li>
+<li><a href="#UnknownLineError">type UnknownLineError</a></li>
+<li> <a href="#UnknownLineError.Error">func (e *UnknownLineError) Error() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>pclntab.go</span> <span>symtab.go</span> </p> <h2 id="DecodingError">type <span>DecodingError</span> </h2> <p>DecodingError represents an error during the decoding of the symbol table. </p>
+<pre data-language="go">type DecodingError struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="DecodingError.Error">func (*DecodingError) <span>Error</span> </h3> <pre data-language="go">func (e *DecodingError) Error() string</pre> <h2 id="Func">type <span>Func</span> </h2> <p>A Func collects information about a single function. </p>
+<pre data-language="go">type Func struct {
+ Entry uint64
+ *Sym
+ End uint64
+ Params []*Sym // nil for Go 1.3 and later binaries
+ Locals []*Sym // nil for Go 1.3 and later binaries
+ FrameSize int
+ LineTable *LineTable
+ Obj *Obj
+}
+</pre> <h2 id="LineTable">type <span>LineTable</span> </h2> <p>A LineTable is a data structure mapping program counters to line numbers. </p>
+<p>In Go 1.1 and earlier, each function (represented by a <a href="#Func">Func</a>) had its own LineTable, and the line number corresponded to a numbering of all source lines in the program, across all files. That absolute line number would then have to be converted separately to a file name and line number within the file. </p>
+<p>In Go 1.2, the format of the data changed so that there is a single LineTable for the entire program, shared by all Funcs, and there are no absolute line numbers, just line numbers within specific files. </p>
+<p>For the most part, LineTable's methods should be treated as an internal detail of the package; callers should use the methods on <a href="#Table">Table</a> instead. </p>
+<pre data-language="go">type LineTable struct {
+ Data []byte
+ PC uint64
+ Line int
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewLineTable">func <span>NewLineTable</span> </h3> <pre data-language="go">func NewLineTable(data []byte, text uint64) *LineTable</pre> <p>NewLineTable returns a new PC/line table corresponding to the encoded data. Text must be the start address of the corresponding text segment. </p>
+<h3 id="LineTable.LineToPC">func (*LineTable) <span>LineToPC</span> </h3> <pre data-language="go">func (t *LineTable) LineToPC(line int, maxpc uint64) uint64</pre> <p>LineToPC returns the program counter for the given line number, considering only program counters before maxpc. </p>
+<p>Deprecated: Use Table's LineToPC method instead. </p>
+<h3 id="LineTable.PCToLine">func (*LineTable) <span>PCToLine</span> </h3> <pre data-language="go">func (t *LineTable) PCToLine(pc uint64) int</pre> <p>PCToLine returns the line number for the given program counter. </p>
+<p>Deprecated: Use Table's PCToLine method instead. </p>
+<h2 id="Obj">type <span>Obj</span> </h2> <p>An Obj represents a collection of functions in a symbol table. </p>
+<p>The exact method of division of a binary into separate Objs is an internal detail of the symbol table format. </p>
+<p>In early versions of Go each source file became a different Obj. </p>
+<p>In Go 1 and Go 1.1, each package produced one Obj for all Go sources and one Obj per C source file. </p>
+<p>In Go 1.2, there is a single Obj for the entire program. </p>
+<pre data-language="go">type Obj struct {
+ // Funcs is a list of functions in the Obj.
+ Funcs []Func
+
+ // In Go 1.1 and earlier, Paths is a list of symbols corresponding
+ // to the source file names that produced the Obj.
+ // In Go 1.2, Paths is nil.
+ // Use the keys of Table.Files to obtain a list of source files.
+ Paths []Sym // meta
+}
+</pre> <h2 id="Sym">type <span>Sym</span> </h2> <p>A Sym represents a single symbol table entry. </p>
+<pre data-language="go">type Sym struct {
+ Value uint64
+ Type byte
+ Name string
+ GoType uint64
+ // If this symbol is a function symbol, the corresponding Func
+ Func *Func
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Sym.BaseName">func (*Sym) <span>BaseName</span> </h3> <pre data-language="go">func (s *Sym) BaseName() string</pre> <p>BaseName returns the symbol name without the package or receiver name. </p>
+<h3 id="Sym.PackageName">func (*Sym) <span>PackageName</span> </h3> <pre data-language="go">func (s *Sym) PackageName() string</pre> <p>PackageName returns the package part of the symbol name, or the empty string if there is none. </p>
+<h3 id="Sym.ReceiverName">func (*Sym) <span>ReceiverName</span> </h3> <pre data-language="go">func (s *Sym) ReceiverName() string</pre> <p>ReceiverName returns the receiver type name of this symbol, or the empty string if there is none. A receiver name is only detected in the case that s.Name is fully-specified with a package name. </p>
+<h3 id="Sym.Static">func (*Sym) <span>Static</span> </h3> <pre data-language="go">func (s *Sym) Static() bool</pre> <p>Static reports whether this symbol is static (not visible outside its file). </p>
+<h2 id="Table">type <span>Table</span> </h2> <p>Table represents a Go symbol table. It stores all of the symbols decoded from the program and provides methods to translate between symbols, names, and addresses. </p>
+<pre data-language="go">type Table struct {
+ Syms []Sym // nil for Go 1.3 and later binaries
+ Funcs []Func
+ Files map[string]*Obj // for Go 1.2 and later all files map to one Obj
+ Objs []Obj // for Go 1.2 and later only one Obj in slice
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewTable">func <span>NewTable</span> </h3> <pre data-language="go">func NewTable(symtab []byte, pcln *LineTable) (*Table, error)</pre> <p>NewTable decodes the Go symbol table (the ".gosymtab" section in ELF), returning an in-memory representation. Starting with Go 1.3, the Go symbol table no longer includes symbol data. </p>
+<h3 id="Table.LineToPC">func (*Table) <span>LineToPC</span> </h3> <pre data-language="go">func (t *Table) LineToPC(file string, line int) (pc uint64, fn *Func, err error)</pre> <p>LineToPC looks up the first program counter on the given line in the named file. It returns <a href="#UnknownFileError">UnknownFileError</a> or <a href="#UnknownLineError">UnknownLineError</a> if there is an error looking up this line. </p>
+<h3 id="Table.LookupFunc">func (*Table) <span>LookupFunc</span> </h3> <pre data-language="go">func (t *Table) LookupFunc(name string) *Func</pre> <p>LookupFunc returns the text, data, or bss symbol with the given name, or nil if no such symbol is found. </p>
+<h3 id="Table.LookupSym">func (*Table) <span>LookupSym</span> </h3> <pre data-language="go">func (t *Table) LookupSym(name string) *Sym</pre> <p>LookupSym returns the text, data, or bss symbol with the given name, or nil if no such symbol is found. </p>
+<h3 id="Table.PCToFunc">func (*Table) <span>PCToFunc</span> </h3> <pre data-language="go">func (t *Table) PCToFunc(pc uint64) *Func</pre> <p>PCToFunc returns the function containing the program counter pc, or nil if there is no such function. </p>
+<h3 id="Table.PCToLine">func (*Table) <span>PCToLine</span> </h3> <pre data-language="go">func (t *Table) PCToLine(pc uint64) (file string, line int, fn *Func)</pre> <p>PCToLine looks up line number information for a program counter. If there is no information, it returns fn == nil. </p>
+<h3 id="Table.SymByAddr">func (*Table) <span>SymByAddr</span> </h3> <pre data-language="go">func (t *Table) SymByAddr(addr uint64) *Sym</pre> <p>SymByAddr returns the text, data, or bss symbol starting at the given address. </p>
+<h2 id="UnknownFileError">type <span>UnknownFileError</span> </h2> <p>UnknownFileError represents a failure to find the specific file in the symbol table. </p>
+<pre data-language="go">type UnknownFileError string</pre> <h3 id="UnknownFileError.Error">func (UnknownFileError) <span>Error</span> </h3> <pre data-language="go">func (e UnknownFileError) Error() string</pre> <h2 id="UnknownLineError">type <span>UnknownLineError</span> </h2> <p>UnknownLineError represents a failure to map a line to a program counter, either because the line is beyond the bounds of the file or because there is no code on the given line. </p>
+<pre data-language="go">type UnknownLineError struct {
+ File string
+ Line int
+}
+</pre> <h3 id="UnknownLineError.Error">func (*UnknownLineError) <span>Error</span> </h3> <pre data-language="go">func (e *UnknownLineError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/debug/gosym/" class="_attribution-link">http://golang.org/pkg/debug/gosym/</a>
+ </p>
+</div>
diff --git a/devdocs/go/debug%2Fmacho%2Findex.html b/devdocs/go/debug%2Fmacho%2Findex.html
new file mode 100644
index 00000000..2dadd0f1
--- /dev/null
+++ b/devdocs/go/debug%2Fmacho%2Findex.html
@@ -0,0 +1,542 @@
+<h1> Package macho </h1> <ul id="short-nav">
+<li><code>import "debug/macho"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package macho implements access to Mach-O object files. </p>
+<h3 id="hdr-Security">Security</h3> <p>This package is not designed to be hardened against adversarial inputs, and is outside the scope of <a href="https://go.dev/security/policy">https://go.dev/security/policy</a>. In particular, only basic validation is done when parsing object files. As such, care should be taken when parsing untrusted inputs, as parsing malformed files may consume significant resources, or cause panics. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Cpu">type Cpu</a></li>
+<li> <a href="#Cpu.GoString">func (i Cpu) GoString() string</a>
+</li>
+<li> <a href="#Cpu.String">func (i Cpu) String() string</a>
+</li>
+<li><a href="#Dylib">type Dylib</a></li>
+<li><a href="#DylibCmd">type DylibCmd</a></li>
+<li><a href="#Dysymtab">type Dysymtab</a></li>
+<li><a href="#DysymtabCmd">type DysymtabCmd</a></li>
+<li><a href="#FatArch">type FatArch</a></li>
+<li><a href="#FatArchHeader">type FatArchHeader</a></li>
+<li><a href="#FatFile">type FatFile</a></li>
+<li> <a href="#NewFatFile">func NewFatFile(r io.ReaderAt) (*FatFile, error)</a>
+</li>
+<li> <a href="#OpenFat">func OpenFat(name string) (*FatFile, error)</a>
+</li>
+<li> <a href="#FatFile.Close">func (ff *FatFile) Close() error</a>
+</li>
+<li><a href="#File">type File</a></li>
+<li> <a href="#NewFile">func NewFile(r io.ReaderAt) (*File, error)</a>
+</li>
+<li> <a href="#Open">func Open(name string) (*File, error)</a>
+</li>
+<li> <a href="#File.Close">func (f *File) Close() error</a>
+</li>
+<li> <a href="#File.DWARF">func (f *File) DWARF() (*dwarf.Data, error)</a>
+</li>
+<li> <a href="#File.ImportedLibraries">func (f *File) ImportedLibraries() ([]string, error)</a>
+</li>
+<li> <a href="#File.ImportedSymbols">func (f *File) ImportedSymbols() ([]string, error)</a>
+</li>
+<li> <a href="#File.Section">func (f *File) Section(name string) *Section</a>
+</li>
+<li> <a href="#File.Segment">func (f *File) Segment(name string) *Segment</a>
+</li>
+<li><a href="#FileHeader">type FileHeader</a></li>
+<li><a href="#FormatError">type FormatError</a></li>
+<li> <a href="#FormatError.Error">func (e *FormatError) Error() string</a>
+</li>
+<li><a href="#Load">type Load</a></li>
+<li><a href="#LoadBytes">type LoadBytes</a></li>
+<li> <a href="#LoadBytes.Raw">func (b LoadBytes) Raw() []byte</a>
+</li>
+<li><a href="#LoadCmd">type LoadCmd</a></li>
+<li> <a href="#LoadCmd.GoString">func (i LoadCmd) GoString() string</a>
+</li>
+<li> <a href="#LoadCmd.String">func (i LoadCmd) String() string</a>
+</li>
+<li><a href="#Nlist32">type Nlist32</a></li>
+<li><a href="#Nlist64">type Nlist64</a></li>
+<li><a href="#Regs386">type Regs386</a></li>
+<li><a href="#RegsAMD64">type RegsAMD64</a></li>
+<li><a href="#Reloc">type Reloc</a></li>
+<li><a href="#RelocTypeARM">type RelocTypeARM</a></li>
+<li> <a href="#RelocTypeARM.GoString">func (r RelocTypeARM) GoString() string</a>
+</li>
+<li> <a href="#RelocTypeARM.String">func (i RelocTypeARM) String() string</a>
+</li>
+<li><a href="#RelocTypeARM64">type RelocTypeARM64</a></li>
+<li> <a href="#RelocTypeARM64.GoString">func (r RelocTypeARM64) GoString() string</a>
+</li>
+<li> <a href="#RelocTypeARM64.String">func (i RelocTypeARM64) String() string</a>
+</li>
+<li><a href="#RelocTypeGeneric">type RelocTypeGeneric</a></li>
+<li> <a href="#RelocTypeGeneric.GoString">func (r RelocTypeGeneric) GoString() string</a>
+</li>
+<li> <a href="#RelocTypeGeneric.String">func (i RelocTypeGeneric) String() string</a>
+</li>
+<li><a href="#RelocTypeX86_64">type RelocTypeX86_64</a></li>
+<li> <a href="#RelocTypeX86_64.GoString">func (r RelocTypeX86_64) GoString() string</a>
+</li>
+<li> <a href="#RelocTypeX86_64.String">func (i RelocTypeX86_64) String() string</a>
+</li>
+<li><a href="#Rpath">type Rpath</a></li>
+<li><a href="#RpathCmd">type RpathCmd</a></li>
+<li><a href="#Section">type Section</a></li>
+<li> <a href="#Section.Data">func (s *Section) Data() ([]byte, error)</a>
+</li>
+<li> <a href="#Section.Open">func (s *Section) Open() io.ReadSeeker</a>
+</li>
+<li><a href="#Section32">type Section32</a></li>
+<li><a href="#Section64">type Section64</a></li>
+<li><a href="#SectionHeader">type SectionHeader</a></li>
+<li><a href="#Segment">type Segment</a></li>
+<li> <a href="#Segment.Data">func (s *Segment) Data() ([]byte, error)</a>
+</li>
+<li> <a href="#Segment.Open">func (s *Segment) Open() io.ReadSeeker</a>
+</li>
+<li><a href="#Segment32">type Segment32</a></li>
+<li><a href="#Segment64">type Segment64</a></li>
+<li><a href="#SegmentHeader">type SegmentHeader</a></li>
+<li><a href="#Symbol">type Symbol</a></li>
+<li><a href="#Symtab">type Symtab</a></li>
+<li><a href="#SymtabCmd">type SymtabCmd</a></li>
+<li><a href="#Thread">type Thread</a></li>
+<li><a href="#Type">type Type</a></li>
+<li> <a href="#Type.GoString">func (t Type) GoString() string</a>
+</li>
+<li> <a href="#Type.String">func (t Type) String() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>fat.go</span> <span>file.go</span> <span>macho.go</span> <span>reloctype.go</span> <span>reloctype_string.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ Magic32 uint32 = 0xfeedface
+ Magic64 uint32 = 0xfeedfacf
+ MagicFat uint32 = 0xcafebabe
+)</pre> <pre data-language="go">const (
+ FlagNoUndefs uint32 = 0x1
+ FlagIncrLink uint32 = 0x2
+ FlagDyldLink uint32 = 0x4
+ FlagBindAtLoad uint32 = 0x8
+ FlagPrebound uint32 = 0x10
+ FlagSplitSegs uint32 = 0x20
+ FlagLazyInit uint32 = 0x40
+ FlagTwoLevel uint32 = 0x80
+ FlagForceFlat uint32 = 0x100
+ FlagNoMultiDefs uint32 = 0x200
+ FlagNoFixPrebinding uint32 = 0x400
+ FlagPrebindable uint32 = 0x800
+ FlagAllModsBound uint32 = 0x1000
+ FlagSubsectionsViaSymbols uint32 = 0x2000
+ FlagCanonical uint32 = 0x4000
+ FlagWeakDefines uint32 = 0x8000
+ FlagBindsToWeak uint32 = 0x10000
+ FlagAllowStackExecution uint32 = 0x20000
+ FlagRootSafe uint32 = 0x40000
+ FlagSetuidSafe uint32 = 0x80000
+ FlagNoReexportedDylibs uint32 = 0x100000
+ FlagPIE uint32 = 0x200000
+ FlagDeadStrippableDylib uint32 = 0x400000
+ FlagHasTLVDescriptors uint32 = 0x800000
+ FlagNoHeapExecution uint32 = 0x1000000
+ FlagAppExtensionSafe uint32 = 0x2000000
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>ErrNotFat is returned from <a href="#NewFatFile">NewFatFile</a> or <a href="#OpenFat">OpenFat</a> when the file is not a universal binary but may be a thin binary, based on its magic number. </p>
+<pre data-language="go">var ErrNotFat = &amp;FormatError{0, "not a fat Mach-O file", nil}</pre> <h2 id="Cpu">type <span>Cpu</span> </h2> <p>A Cpu is a Mach-O cpu type. </p>
+<pre data-language="go">type Cpu uint32</pre> <pre data-language="go">const (
+ Cpu386 Cpu = 7
+ CpuAmd64 Cpu = Cpu386 | cpuArch64
+ CpuArm Cpu = 12
+ CpuArm64 Cpu = CpuArm | cpuArch64
+ CpuPpc Cpu = 18
+ CpuPpc64 Cpu = CpuPpc | cpuArch64
+)</pre> <h3 id="Cpu.GoString">func (Cpu) <span>GoString</span> </h3> <pre data-language="go">func (i Cpu) GoString() string</pre> <h3 id="Cpu.String">func (Cpu) <span>String</span> </h3> <pre data-language="go">func (i Cpu) String() string</pre> <h2 id="Dylib">type <span>Dylib</span> </h2> <p>A Dylib represents a Mach-O load dynamic library command. </p>
+<pre data-language="go">type Dylib struct {
+ LoadBytes
+ Name string
+ Time uint32
+ CurrentVersion uint32
+ CompatVersion uint32
+}
+</pre> <h2 id="DylibCmd">type <span>DylibCmd</span> </h2> <p>A DylibCmd is a Mach-O load dynamic library command. </p>
+<pre data-language="go">type DylibCmd struct {
+ Cmd LoadCmd
+ Len uint32
+ Name uint32
+ Time uint32
+ CurrentVersion uint32
+ CompatVersion uint32
+}
+</pre> <h2 id="Dysymtab">type <span>Dysymtab</span> </h2> <p>A Dysymtab represents a Mach-O dynamic symbol table command. </p>
+<pre data-language="go">type Dysymtab struct {
+ LoadBytes
+ DysymtabCmd
+ IndirectSyms []uint32 // indices into Symtab.Syms
+}
+</pre> <h2 id="DysymtabCmd">type <span>DysymtabCmd</span> </h2> <p>A DysymtabCmd is a Mach-O dynamic symbol table command. </p>
+<pre data-language="go">type DysymtabCmd struct {
+ Cmd LoadCmd
+ Len uint32
+ Ilocalsym uint32
+ Nlocalsym uint32
+ Iextdefsym uint32
+ Nextdefsym uint32
+ Iundefsym uint32
+ Nundefsym uint32
+ Tocoffset uint32
+ Ntoc uint32
+ Modtaboff uint32
+ Nmodtab uint32
+ Extrefsymoff uint32
+ Nextrefsyms uint32
+ Indirectsymoff uint32
+ Nindirectsyms uint32
+ Extreloff uint32
+ Nextrel uint32
+ Locreloff uint32
+ Nlocrel uint32
+}
+</pre> <h2 id="FatArch">type <span>FatArch</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A FatArch is a Mach-O File inside a FatFile. </p>
+<pre data-language="go">type FatArch struct {
+ FatArchHeader
+ *File
+}
+</pre> <h2 id="FatArchHeader">type <span>FatArchHeader</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A FatArchHeader represents a fat header for a specific image architecture. </p>
+<pre data-language="go">type FatArchHeader struct {
+ Cpu Cpu
+ SubCpu uint32
+ Offset uint32
+ Size uint32
+ Align uint32
+}
+</pre> <h2 id="FatFile">type <span>FatFile</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A FatFile is a Mach-O universal binary that contains at least one architecture. </p>
+<pre data-language="go">type FatFile struct {
+ Magic uint32
+ Arches []FatArch
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFatFile">func <span>NewFatFile</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func NewFatFile(r io.ReaderAt) (*FatFile, error)</pre> <p>NewFatFile creates a new <a href="#FatFile">FatFile</a> for accessing all the Mach-O images in a universal binary. The Mach-O binary is expected to start at position 0 in the ReaderAt. </p>
+<h3 id="OpenFat">func <span>OpenFat</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func OpenFat(name string) (*FatFile, error)</pre> <p>OpenFat opens the named file using <span>os.Open</span> and prepares it for use as a Mach-O universal binary. </p>
+<h3 id="FatFile.Close">func (*FatFile) <span>Close</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (ff *FatFile) Close() error</pre> <h2 id="File">type <span>File</span> </h2> <p>A File represents an open Mach-O file. </p>
+<pre data-language="go">type File struct {
+ FileHeader
+ ByteOrder binary.ByteOrder
+ Loads []Load
+ Sections []*Section
+
+ Symtab *Symtab
+ Dysymtab *Dysymtab
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFile">func <span>NewFile</span> </h3> <pre data-language="go">func NewFile(r io.ReaderAt) (*File, error)</pre> <p>NewFile creates a new <a href="#File">File</a> for accessing a Mach-O binary in an underlying reader. The Mach-O binary is expected to start at position 0 in the ReaderAt. </p>
+<h3 id="Open">func <span>Open</span> </h3> <pre data-language="go">func Open(name string) (*File, error)</pre> <p>Open opens the named file using <span>os.Open</span> and prepares it for use as a Mach-O binary. </p>
+<h3 id="File.Close">func (*File) <span>Close</span> </h3> <pre data-language="go">func (f *File) Close() error</pre> <p>Close closes the <a href="#File">File</a>. If the <a href="#File">File</a> was created using <a href="#NewFile">NewFile</a> directly instead of <a href="#Open">Open</a>, Close has no effect. </p>
+<h3 id="File.DWARF">func (*File) <span>DWARF</span> </h3> <pre data-language="go">func (f *File) DWARF() (*dwarf.Data, error)</pre> <p>DWARF returns the DWARF debug information for the Mach-O file. </p>
+<h3 id="File.ImportedLibraries">func (*File) <span>ImportedLibraries</span> </h3> <pre data-language="go">func (f *File) ImportedLibraries() ([]string, error)</pre> <p>ImportedLibraries returns the paths of all libraries referred to by the binary f that are expected to be linked with the binary at dynamic link time. </p>
+<h3 id="File.ImportedSymbols">func (*File) <span>ImportedSymbols</span> </h3> <pre data-language="go">func (f *File) ImportedSymbols() ([]string, error)</pre> <p>ImportedSymbols returns the names of all symbols referred to by the binary f that are expected to be satisfied by other libraries at dynamic load time. </p>
+<h3 id="File.Section">func (*File) <span>Section</span> </h3> <pre data-language="go">func (f *File) Section(name string) *Section</pre> <p>Section returns the first section with the given name, or nil if no such section exists. </p>
+<h3 id="File.Segment">func (*File) <span>Segment</span> </h3> <pre data-language="go">func (f *File) Segment(name string) *Segment</pre> <p>Segment returns the first Segment with the given name, or nil if no such segment exists. </p>
+<h2 id="FileHeader">type <span>FileHeader</span> </h2> <p>A FileHeader represents a Mach-O file header. </p>
+<pre data-language="go">type FileHeader struct {
+ Magic uint32
+ Cpu Cpu
+ SubCpu uint32
+ Type Type
+ Ncmd uint32
+ Cmdsz uint32
+ Flags uint32
+}
+</pre> <h2 id="FormatError">type <span>FormatError</span> </h2> <p>FormatError is returned by some operations if the data does not have the correct format for an object file. </p>
+<pre data-language="go">type FormatError struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="FormatError.Error">func (*FormatError) <span>Error</span> </h3> <pre data-language="go">func (e *FormatError) Error() string</pre> <h2 id="Load">type <span>Load</span> </h2> <p>A Load represents any Mach-O load command. </p>
+<pre data-language="go">type Load interface {
+ Raw() []byte
+}</pre> <h2 id="LoadBytes">type <span>LoadBytes</span> </h2> <p>A LoadBytes is the uninterpreted bytes of a Mach-O load command. </p>
+<pre data-language="go">type LoadBytes []byte</pre> <h3 id="LoadBytes.Raw">func (LoadBytes) <span>Raw</span> </h3> <pre data-language="go">func (b LoadBytes) Raw() []byte</pre> <h2 id="LoadCmd">type <span>LoadCmd</span> </h2> <p>A LoadCmd is a Mach-O load command. </p>
+<pre data-language="go">type LoadCmd uint32</pre> <pre data-language="go">const (
+ LoadCmdSegment LoadCmd = 0x1
+ LoadCmdSymtab LoadCmd = 0x2
+ LoadCmdThread LoadCmd = 0x4
+ LoadCmdUnixThread LoadCmd = 0x5 // thread+stack
+ LoadCmdDysymtab LoadCmd = 0xb
+ LoadCmdDylib LoadCmd = 0xc // load dylib command
+ LoadCmdDylinker LoadCmd = 0xf // id dylinker command (not load dylinker command)
+ LoadCmdSegment64 LoadCmd = 0x19
+ LoadCmdRpath LoadCmd = 0x8000001c
+)</pre> <h3 id="LoadCmd.GoString">func (LoadCmd) <span>GoString</span> </h3> <pre data-language="go">func (i LoadCmd) GoString() string</pre> <h3 id="LoadCmd.String">func (LoadCmd) <span>String</span> </h3> <pre data-language="go">func (i LoadCmd) String() string</pre> <h2 id="Nlist32">type <span>Nlist32</span> </h2> <p>An Nlist32 is a Mach-O 32-bit symbol table entry. </p>
+<pre data-language="go">type Nlist32 struct {
+ Name uint32
+ Type uint8
+ Sect uint8
+ Desc uint16
+ Value uint32
+}
+</pre> <h2 id="Nlist64">type <span>Nlist64</span> </h2> <p>An Nlist64 is a Mach-O 64-bit symbol table entry. </p>
+<pre data-language="go">type Nlist64 struct {
+ Name uint32
+ Type uint8
+ Sect uint8
+ Desc uint16
+ Value uint64
+}
+</pre> <h2 id="Regs386">type <span>Regs386</span> </h2> <p>Regs386 is the Mach-O 386 register structure. </p>
+<pre data-language="go">type Regs386 struct {
+ AX uint32
+ BX uint32
+ CX uint32
+ DX uint32
+ DI uint32
+ SI uint32
+ BP uint32
+ SP uint32
+ SS uint32
+ FLAGS uint32
+ IP uint32
+ CS uint32
+ DS uint32
+ ES uint32
+ FS uint32
+ GS uint32
+}
+</pre> <h2 id="RegsAMD64">type <span>RegsAMD64</span> </h2> <p>RegsAMD64 is the Mach-O AMD64 register structure. </p>
+<pre data-language="go">type RegsAMD64 struct {
+ AX uint64
+ BX uint64
+ CX uint64
+ DX uint64
+ DI uint64
+ SI uint64
+ BP uint64
+ SP uint64
+ R8 uint64
+ R9 uint64
+ R10 uint64
+ R11 uint64
+ R12 uint64
+ R13 uint64
+ R14 uint64
+ R15 uint64
+ IP uint64
+ FLAGS uint64
+ CS uint64
+ FS uint64
+ GS uint64
+}
+</pre> <h2 id="Reloc">type <span>Reloc</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>A Reloc represents a Mach-O relocation. </p>
+<pre data-language="go">type Reloc struct {
+ Addr uint32
+ Value uint32
+ // when Scattered == false &amp;&amp; Extern == true, Value is the symbol number.
+ // when Scattered == false &amp;&amp; Extern == false, Value is the section number.
+ // when Scattered == true, Value is the value that this reloc refers to.
+ Type uint8
+ Len uint8 // 0=byte, 1=word, 2=long, 3=quad
+ Pcrel bool
+ Extern bool // valid if Scattered == false
+ Scattered bool
+}
+</pre> <h2 id="RelocTypeARM">type <span>RelocTypeARM</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">type RelocTypeARM int</pre> <pre data-language="go">const (
+ ARM_RELOC_VANILLA RelocTypeARM = 0
+ ARM_RELOC_PAIR RelocTypeARM = 1
+ ARM_RELOC_SECTDIFF RelocTypeARM = 2
+ ARM_RELOC_LOCAL_SECTDIFF RelocTypeARM = 3
+ ARM_RELOC_PB_LA_PTR RelocTypeARM = 4
+ ARM_RELOC_BR24 RelocTypeARM = 5
+ ARM_THUMB_RELOC_BR22 RelocTypeARM = 6
+ ARM_THUMB_32BIT_BRANCH RelocTypeARM = 7
+ ARM_RELOC_HALF RelocTypeARM = 8
+ ARM_RELOC_HALF_SECTDIFF RelocTypeARM = 9
+)</pre> <h3 id="RelocTypeARM.GoString">func (RelocTypeARM) <span>GoString</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (r RelocTypeARM) GoString() string</pre> <h3 id="RelocTypeARM.String">func (RelocTypeARM) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (i RelocTypeARM) String() string</pre> <h2 id="RelocTypeARM64">type <span>RelocTypeARM64</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">type RelocTypeARM64 int</pre> <pre data-language="go">const (
+ ARM64_RELOC_UNSIGNED RelocTypeARM64 = 0
+ ARM64_RELOC_SUBTRACTOR RelocTypeARM64 = 1
+ ARM64_RELOC_BRANCH26 RelocTypeARM64 = 2
+ ARM64_RELOC_PAGE21 RelocTypeARM64 = 3
+ ARM64_RELOC_PAGEOFF12 RelocTypeARM64 = 4
+ ARM64_RELOC_GOT_LOAD_PAGE21 RelocTypeARM64 = 5
+ ARM64_RELOC_GOT_LOAD_PAGEOFF12 RelocTypeARM64 = 6
+ ARM64_RELOC_POINTER_TO_GOT RelocTypeARM64 = 7
+ ARM64_RELOC_TLVP_LOAD_PAGE21 RelocTypeARM64 = 8
+ ARM64_RELOC_TLVP_LOAD_PAGEOFF12 RelocTypeARM64 = 9
+ ARM64_RELOC_ADDEND RelocTypeARM64 = 10
+)</pre> <h3 id="RelocTypeARM64.GoString">func (RelocTypeARM64) <span>GoString</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (r RelocTypeARM64) GoString() string</pre> <h3 id="RelocTypeARM64.String">func (RelocTypeARM64) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (i RelocTypeARM64) String() string</pre> <h2 id="RelocTypeGeneric">type <span>RelocTypeGeneric</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">type RelocTypeGeneric int</pre> <pre data-language="go">const (
+ GENERIC_RELOC_VANILLA RelocTypeGeneric = 0
+ GENERIC_RELOC_PAIR RelocTypeGeneric = 1
+ GENERIC_RELOC_SECTDIFF RelocTypeGeneric = 2
+ GENERIC_RELOC_PB_LA_PTR RelocTypeGeneric = 3
+ GENERIC_RELOC_LOCAL_SECTDIFF RelocTypeGeneric = 4
+ GENERIC_RELOC_TLV RelocTypeGeneric = 5
+)</pre> <h3 id="RelocTypeGeneric.GoString">func (RelocTypeGeneric) <span>GoString</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (r RelocTypeGeneric) GoString() string</pre> <h3 id="RelocTypeGeneric.String">func (RelocTypeGeneric) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (i RelocTypeGeneric) String() string</pre> <h2 id="RelocTypeX86_64">type <span>RelocTypeX86_64</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">type RelocTypeX86_64 int</pre> <pre data-language="go">const (
+ X86_64_RELOC_UNSIGNED RelocTypeX86_64 = 0
+ X86_64_RELOC_SIGNED RelocTypeX86_64 = 1
+ X86_64_RELOC_BRANCH RelocTypeX86_64 = 2
+ X86_64_RELOC_GOT_LOAD RelocTypeX86_64 = 3
+ X86_64_RELOC_GOT RelocTypeX86_64 = 4
+ X86_64_RELOC_SUBTRACTOR RelocTypeX86_64 = 5
+ X86_64_RELOC_SIGNED_1 RelocTypeX86_64 = 6
+ X86_64_RELOC_SIGNED_2 RelocTypeX86_64 = 7
+ X86_64_RELOC_SIGNED_4 RelocTypeX86_64 = 8
+ X86_64_RELOC_TLV RelocTypeX86_64 = 9
+)</pre> <h3 id="RelocTypeX86_64.GoString">func (RelocTypeX86_64) <span>GoString</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (r RelocTypeX86_64) GoString() string</pre> <h3 id="RelocTypeX86_64.String">func (RelocTypeX86_64) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (i RelocTypeX86_64) String() string</pre> <h2 id="Rpath">type <span>Rpath</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>A Rpath represents a Mach-O rpath command. </p>
+<pre data-language="go">type Rpath struct {
+ LoadBytes
+ Path string
+}
+</pre> <h2 id="RpathCmd">type <span>RpathCmd</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>A RpathCmd is a Mach-O rpath command. </p>
+<pre data-language="go">type RpathCmd struct {
+ Cmd LoadCmd
+ Len uint32
+ Path uint32
+}
+</pre> <h2 id="Section">type <span>Section</span> </h2> <pre data-language="go">type Section struct {
+ SectionHeader
+ Relocs []Reloc // Go 1.10
+
+ // Embed ReaderAt for ReadAt method.
+ // Do not embed SectionReader directly
+ // to avoid having Read and Seek.
+ // If a client wants Read and Seek it must use
+ // Open() to avoid fighting over the seek offset
+ // with other clients.
+ io.ReaderAt
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Section.Data">func (*Section) <span>Data</span> </h3> <pre data-language="go">func (s *Section) Data() ([]byte, error)</pre> <p>Data reads and returns the contents of the Mach-O section. </p>
+<h3 id="Section.Open">func (*Section) <span>Open</span> </h3> <pre data-language="go">func (s *Section) Open() io.ReadSeeker</pre> <p>Open returns a new ReadSeeker reading the Mach-O section. </p>
+<h2 id="Section32">type <span>Section32</span> </h2> <p>A Section32 is a 32-bit Mach-O section header. </p>
+<pre data-language="go">type Section32 struct {
+ Name [16]byte
+ Seg [16]byte
+ Addr uint32
+ Size uint32
+ Offset uint32
+ Align uint32
+ Reloff uint32
+ Nreloc uint32
+ Flags uint32
+ Reserve1 uint32
+ Reserve2 uint32
+}
+</pre> <h2 id="Section64">type <span>Section64</span> </h2> <p>A Section64 is a 64-bit Mach-O section header. </p>
+<pre data-language="go">type Section64 struct {
+ Name [16]byte
+ Seg [16]byte
+ Addr uint64
+ Size uint64
+ Offset uint32
+ Align uint32
+ Reloff uint32
+ Nreloc uint32
+ Flags uint32
+ Reserve1 uint32
+ Reserve2 uint32
+ Reserve3 uint32
+}
+</pre> <h2 id="SectionHeader">type <span>SectionHeader</span> </h2> <pre data-language="go">type SectionHeader struct {
+ Name string
+ Seg string
+ Addr uint64
+ Size uint64
+ Offset uint32
+ Align uint32
+ Reloff uint32
+ Nreloc uint32
+ Flags uint32
+}
+</pre> <h2 id="Segment">type <span>Segment</span> </h2> <p>A Segment represents a Mach-O 32-bit or 64-bit load segment command. </p>
+<pre data-language="go">type Segment struct {
+ LoadBytes
+ SegmentHeader
+
+ // Embed ReaderAt for ReadAt method.
+ // Do not embed SectionReader directly
+ // to avoid having Read and Seek.
+ // If a client wants Read and Seek it must use
+ // Open() to avoid fighting over the seek offset
+ // with other clients.
+ io.ReaderAt
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Segment.Data">func (*Segment) <span>Data</span> </h3> <pre data-language="go">func (s *Segment) Data() ([]byte, error)</pre> <p>Data reads and returns the contents of the segment. </p>
+<h3 id="Segment.Open">func (*Segment) <span>Open</span> </h3> <pre data-language="go">func (s *Segment) Open() io.ReadSeeker</pre> <p>Open returns a new ReadSeeker reading the segment. </p>
+<h2 id="Segment32">type <span>Segment32</span> </h2> <p>A Segment32 is a 32-bit Mach-O segment load command. </p>
+<pre data-language="go">type Segment32 struct {
+ Cmd LoadCmd
+ Len uint32
+ Name [16]byte
+ Addr uint32
+ Memsz uint32
+ Offset uint32
+ Filesz uint32
+ Maxprot uint32
+ Prot uint32
+ Nsect uint32
+ Flag uint32
+}
+</pre> <h2 id="Segment64">type <span>Segment64</span> </h2> <p>A Segment64 is a 64-bit Mach-O segment load command. </p>
+<pre data-language="go">type Segment64 struct {
+ Cmd LoadCmd
+ Len uint32
+ Name [16]byte
+ Addr uint64
+ Memsz uint64
+ Offset uint64
+ Filesz uint64
+ Maxprot uint32
+ Prot uint32
+ Nsect uint32
+ Flag uint32
+}
+</pre> <h2 id="SegmentHeader">type <span>SegmentHeader</span> </h2> <p>A SegmentHeader is the header for a Mach-O 32-bit or 64-bit load segment command. </p>
+<pre data-language="go">type SegmentHeader struct {
+ Cmd LoadCmd
+ Len uint32
+ Name string
+ Addr uint64
+ Memsz uint64
+ Offset uint64
+ Filesz uint64
+ Maxprot uint32
+ Prot uint32
+ Nsect uint32
+ Flag uint32
+}
+</pre> <h2 id="Symbol">type <span>Symbol</span> </h2> <p>A Symbol is a Mach-O 32-bit or 64-bit symbol table entry. </p>
+<pre data-language="go">type Symbol struct {
+ Name string
+ Type uint8
+ Sect uint8
+ Desc uint16
+ Value uint64
+}
+</pre> <h2 id="Symtab">type <span>Symtab</span> </h2> <p>A Symtab represents a Mach-O symbol table command. </p>
+<pre data-language="go">type Symtab struct {
+ LoadBytes
+ SymtabCmd
+ Syms []Symbol
+}
+</pre> <h2 id="SymtabCmd">type <span>SymtabCmd</span> </h2> <p>A SymtabCmd is a Mach-O symbol table command. </p>
+<pre data-language="go">type SymtabCmd struct {
+ Cmd LoadCmd
+ Len uint32
+ Symoff uint32
+ Nsyms uint32
+ Stroff uint32
+ Strsize uint32
+}
+</pre> <h2 id="Thread">type <span>Thread</span> </h2> <p>A Thread is a Mach-O thread state command. </p>
+<pre data-language="go">type Thread struct {
+ Cmd LoadCmd
+ Len uint32
+ Type uint32
+ Data []uint32
+}
+</pre> <h2 id="Type">type <span>Type</span> </h2> <p>A Type is the Mach-O file type, e.g. an object file, executable, or dynamic library. </p>
+<pre data-language="go">type Type uint32</pre> <pre data-language="go">const (
+ TypeObj Type = 1
+ TypeExec Type = 2
+ TypeDylib Type = 6
+ TypeBundle Type = 8
+)</pre> <h3 id="Type.GoString">func (Type) <span>GoString</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (t Type) GoString() string</pre> <h3 id="Type.String">func (Type) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (t Type) String() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/debug/macho/" class="_attribution-link">http://golang.org/pkg/debug/macho/</a>
+ </p>
+</div>
diff --git a/devdocs/go/debug%2Fpe%2Findex.html b/devdocs/go/debug%2Fpe%2Findex.html
new file mode 100644
index 00000000..5df3a667
--- /dev/null
+++ b/devdocs/go/debug%2Fpe%2Findex.html
@@ -0,0 +1,350 @@
+<h1> Package pe </h1> <ul id="short-nav">
+<li><code>import "debug/pe"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package pe implements access to PE (Microsoft Windows Portable Executable) files. </p>
+<h3 id="hdr-Security">Security</h3> <p>This package is not designed to be hardened against adversarial inputs, and is outside the scope of <a href="https://go.dev/security/policy">https://go.dev/security/policy</a>. In particular, only basic validation is done when parsing object files. As such, care should be taken when parsing untrusted inputs, as parsing malformed files may consume significant resources, or cause panics. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#COFFSymbol">type COFFSymbol</a></li>
+<li> <a href="#COFFSymbol.FullName">func (sym *COFFSymbol) FullName(st StringTable) (string, error)</a>
+</li>
+<li><a href="#COFFSymbolAuxFormat5">type COFFSymbolAuxFormat5</a></li>
+<li><a href="#DataDirectory">type DataDirectory</a></li>
+<li><a href="#File">type File</a></li>
+<li> <a href="#NewFile">func NewFile(r io.ReaderAt) (*File, error)</a>
+</li>
+<li> <a href="#Open">func Open(name string) (*File, error)</a>
+</li>
+<li> <a href="#File.COFFSymbolReadSectionDefAux">func (f *File) COFFSymbolReadSectionDefAux(idx int) (*COFFSymbolAuxFormat5, error)</a>
+</li>
+<li> <a href="#File.Close">func (f *File) Close() error</a>
+</li>
+<li> <a href="#File.DWARF">func (f *File) DWARF() (*dwarf.Data, error)</a>
+</li>
+<li> <a href="#File.ImportedLibraries">func (f *File) ImportedLibraries() ([]string, error)</a>
+</li>
+<li> <a href="#File.ImportedSymbols">func (f *File) ImportedSymbols() ([]string, error)</a>
+</li>
+<li> <a href="#File.Section">func (f *File) Section(name string) *Section</a>
+</li>
+<li><a href="#FileHeader">type FileHeader</a></li>
+<li><a href="#FormatError">type FormatError</a></li>
+<li> <a href="#FormatError.Error">func (e *FormatError) Error() string</a>
+</li>
+<li><a href="#ImportDirectory">type ImportDirectory</a></li>
+<li><a href="#OptionalHeader32">type OptionalHeader32</a></li>
+<li><a href="#OptionalHeader64">type OptionalHeader64</a></li>
+<li><a href="#Reloc">type Reloc</a></li>
+<li><a href="#Section">type Section</a></li>
+<li> <a href="#Section.Data">func (s *Section) Data() ([]byte, error)</a>
+</li>
+<li> <a href="#Section.Open">func (s *Section) Open() io.ReadSeeker</a>
+</li>
+<li><a href="#SectionHeader">type SectionHeader</a></li>
+<li><a href="#SectionHeader32">type SectionHeader32</a></li>
+<li><a href="#StringTable">type StringTable</a></li>
+<li> <a href="#StringTable.String">func (st StringTable) String(start uint32) (string, error)</a>
+</li>
+<li><a href="#Symbol">type Symbol</a></li>
+</ul> <h3>Package files</h3> <p> <span>file.go</span> <span>pe.go</span> <span>section.go</span> <span>string.go</span> <span>symbol.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ IMAGE_FILE_MACHINE_UNKNOWN = 0x0
+ IMAGE_FILE_MACHINE_AM33 = 0x1d3
+ IMAGE_FILE_MACHINE_AMD64 = 0x8664
+ IMAGE_FILE_MACHINE_ARM = 0x1c0
+ IMAGE_FILE_MACHINE_ARMNT = 0x1c4
+ IMAGE_FILE_MACHINE_ARM64 = 0xaa64
+ IMAGE_FILE_MACHINE_EBC = 0xebc
+ IMAGE_FILE_MACHINE_I386 = 0x14c
+ IMAGE_FILE_MACHINE_IA64 = 0x200
+ IMAGE_FILE_MACHINE_LOONGARCH32 = 0x6232
+ IMAGE_FILE_MACHINE_LOONGARCH64 = 0x6264
+ IMAGE_FILE_MACHINE_M32R = 0x9041
+ IMAGE_FILE_MACHINE_MIPS16 = 0x266
+ IMAGE_FILE_MACHINE_MIPSFPU = 0x366
+ IMAGE_FILE_MACHINE_MIPSFPU16 = 0x466
+ IMAGE_FILE_MACHINE_POWERPC = 0x1f0
+ IMAGE_FILE_MACHINE_POWERPCFP = 0x1f1
+ IMAGE_FILE_MACHINE_R4000 = 0x166
+ IMAGE_FILE_MACHINE_SH3 = 0x1a2
+ IMAGE_FILE_MACHINE_SH3DSP = 0x1a3
+ IMAGE_FILE_MACHINE_SH4 = 0x1a6
+ IMAGE_FILE_MACHINE_SH5 = 0x1a8
+ IMAGE_FILE_MACHINE_THUMB = 0x1c2
+ IMAGE_FILE_MACHINE_WCEMIPSV2 = 0x169
+ IMAGE_FILE_MACHINE_RISCV32 = 0x5032
+ IMAGE_FILE_MACHINE_RISCV64 = 0x5064
+ IMAGE_FILE_MACHINE_RISCV128 = 0x5128
+)</pre> <p>IMAGE_DIRECTORY_ENTRY constants </p>
+<pre data-language="go">const (
+ IMAGE_DIRECTORY_ENTRY_EXPORT = 0
+ IMAGE_DIRECTORY_ENTRY_IMPORT = 1
+ IMAGE_DIRECTORY_ENTRY_RESOURCE = 2
+ IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3
+ IMAGE_DIRECTORY_ENTRY_SECURITY = 4
+ IMAGE_DIRECTORY_ENTRY_BASERELOC = 5
+ IMAGE_DIRECTORY_ENTRY_DEBUG = 6
+ IMAGE_DIRECTORY_ENTRY_ARCHITECTURE = 7
+ IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8
+ IMAGE_DIRECTORY_ENTRY_TLS = 9
+ IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10
+ IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11
+ IMAGE_DIRECTORY_ENTRY_IAT = 12
+ IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT = 13
+ IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR = 14
+)</pre> <p>Values of IMAGE_FILE_HEADER.Characteristics. These can be combined together. </p>
+<pre data-language="go">const (
+ IMAGE_FILE_RELOCS_STRIPPED = 0x0001
+ IMAGE_FILE_EXECUTABLE_IMAGE = 0x0002
+ IMAGE_FILE_LINE_NUMS_STRIPPED = 0x0004
+ IMAGE_FILE_LOCAL_SYMS_STRIPPED = 0x0008
+ IMAGE_FILE_AGGRESIVE_WS_TRIM = 0x0010
+ IMAGE_FILE_LARGE_ADDRESS_AWARE = 0x0020
+ IMAGE_FILE_BYTES_REVERSED_LO = 0x0080
+ IMAGE_FILE_32BIT_MACHINE = 0x0100
+ IMAGE_FILE_DEBUG_STRIPPED = 0x0200
+ IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 0x0400
+ IMAGE_FILE_NET_RUN_FROM_SWAP = 0x0800
+ IMAGE_FILE_SYSTEM = 0x1000
+ IMAGE_FILE_DLL = 0x2000
+ IMAGE_FILE_UP_SYSTEM_ONLY = 0x4000
+ IMAGE_FILE_BYTES_REVERSED_HI = 0x8000
+)</pre> <p>OptionalHeader64.Subsystem and OptionalHeader32.Subsystem values. </p>
+<pre data-language="go">const (
+ IMAGE_SUBSYSTEM_UNKNOWN = 0
+ IMAGE_SUBSYSTEM_NATIVE = 1
+ IMAGE_SUBSYSTEM_WINDOWS_GUI = 2
+ IMAGE_SUBSYSTEM_WINDOWS_CUI = 3
+ IMAGE_SUBSYSTEM_OS2_CUI = 5
+ IMAGE_SUBSYSTEM_POSIX_CUI = 7
+ IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8
+ IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9
+ IMAGE_SUBSYSTEM_EFI_APPLICATION = 10
+ IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11
+ IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12
+ IMAGE_SUBSYSTEM_EFI_ROM = 13
+ IMAGE_SUBSYSTEM_XBOX = 14
+ IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16
+)</pre> <p>OptionalHeader64.DllCharacteristics and OptionalHeader32.DllCharacteristics values. These can be combined together. </p>
+<pre data-language="go">const (
+ IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA = 0x0020
+ IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE = 0x0040
+ IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY = 0x0080
+ IMAGE_DLLCHARACTERISTICS_NX_COMPAT = 0x0100
+ IMAGE_DLLCHARACTERISTICS_NO_ISOLATION = 0x0200
+ IMAGE_DLLCHARACTERISTICS_NO_SEH = 0x0400
+ IMAGE_DLLCHARACTERISTICS_NO_BIND = 0x0800
+ IMAGE_DLLCHARACTERISTICS_APPCONTAINER = 0x1000
+ IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = 0x2000
+ IMAGE_DLLCHARACTERISTICS_GUARD_CF = 0x4000
+ IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = 0x8000
+)</pre> <p>Section characteristics flags. </p>
+<pre data-language="go">const (
+ IMAGE_SCN_CNT_CODE = 0x00000020
+ IMAGE_SCN_CNT_INITIALIZED_DATA = 0x00000040
+ IMAGE_SCN_CNT_UNINITIALIZED_DATA = 0x00000080
+ IMAGE_SCN_LNK_COMDAT = 0x00001000
+ IMAGE_SCN_MEM_DISCARDABLE = 0x02000000
+ IMAGE_SCN_MEM_EXECUTE = 0x20000000
+ IMAGE_SCN_MEM_READ = 0x40000000
+ IMAGE_SCN_MEM_WRITE = 0x80000000
+)</pre> <p>These constants make up the possible values for the 'Selection' field in an AuxFormat5. </p>
+<pre data-language="go">const (
+ IMAGE_COMDAT_SELECT_NODUPLICATES = 1
+ IMAGE_COMDAT_SELECT_ANY = 2
+ IMAGE_COMDAT_SELECT_SAME_SIZE = 3
+ IMAGE_COMDAT_SELECT_EXACT_MATCH = 4
+ IMAGE_COMDAT_SELECT_ASSOCIATIVE = 5
+ IMAGE_COMDAT_SELECT_LARGEST = 6
+)</pre> <pre data-language="go">const COFFSymbolSize = 18</pre> <h2 id="COFFSymbol">type <span>COFFSymbol</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>COFFSymbol represents single COFF symbol table record. </p>
+<pre data-language="go">type COFFSymbol struct {
+ Name [8]uint8
+ Value uint32
+ SectionNumber int16
+ Type uint16
+ StorageClass uint8
+ NumberOfAuxSymbols uint8
+}
+</pre> <h3 id="COFFSymbol.FullName">func (*COFFSymbol) <span>FullName</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (sym *COFFSymbol) FullName(st StringTable) (string, error)</pre> <p>FullName finds real name of symbol sym. Normally name is stored in sym.Name, but if it is longer then 8 characters, it is stored in COFF string table st instead. </p>
+<h2 id="COFFSymbolAuxFormat5">type <span>COFFSymbolAuxFormat5</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>COFFSymbolAuxFormat5 describes the expected form of an aux symbol attached to a section definition symbol. The PE format defines a number of different aux symbol formats: format 1 for function definitions, format 2 for .be and .ef symbols, and so on. Format 5 holds extra info associated with a section definition, including number of relocations + line numbers, as well as COMDAT info. See <a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-5-section-definitions">https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-5-section-definitions</a> for more on what's going on here. </p>
+<pre data-language="go">type COFFSymbolAuxFormat5 struct {
+ Size uint32
+ NumRelocs uint16
+ NumLineNumbers uint16
+ Checksum uint32
+ SecNum uint16
+ Selection uint8
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="DataDirectory">type <span>DataDirectory</span> <span title="Added in Go 1.3">1.3</span> </h2> <pre data-language="go">type DataDirectory struct {
+ VirtualAddress uint32
+ Size uint32
+}
+</pre> <h2 id="File">type <span>File</span> </h2> <p>A File represents an open PE file. </p>
+<pre data-language="go">type File struct {
+ FileHeader
+ OptionalHeader any // of type *OptionalHeader32 or *OptionalHeader64; added in Go 1.3
+ Sections []*Section
+ Symbols []*Symbol // COFF symbols with auxiliary symbol records removed; added in Go 1.1
+ COFFSymbols []COFFSymbol // all COFF symbols (including auxiliary symbol records); added in Go 1.8
+ StringTable StringTable // Go 1.8
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFile">func <span>NewFile</span> </h3> <pre data-language="go">func NewFile(r io.ReaderAt) (*File, error)</pre> <p>NewFile creates a new <a href="#File">File</a> for accessing a PE binary in an underlying reader. </p>
+<h3 id="Open">func <span>Open</span> </h3> <pre data-language="go">func Open(name string) (*File, error)</pre> <p>Open opens the named file using <span>os.Open</span> and prepares it for use as a PE binary. </p>
+<h3 id="File.COFFSymbolReadSectionDefAux">func (*File) <span>COFFSymbolReadSectionDefAux</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (f *File) COFFSymbolReadSectionDefAux(idx int) (*COFFSymbolAuxFormat5, error)</pre> <p>COFFSymbolReadSectionDefAux returns a blob of auxiliary information (including COMDAT info) for a section definition symbol. Here 'idx' is the index of a section symbol in the main <a href="#COFFSymbol">COFFSymbol</a> array for the File. Return value is a pointer to the appropriate aux symbol struct. For more info, see: </p>
+<p>auxiliary symbols: <a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-symbol-records">https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-symbol-records</a> COMDAT sections: <a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only">https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only</a> auxiliary info for section definitions: <a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-5-section-definitions">https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-5-section-definitions</a> </p>
+<h3 id="File.Close">func (*File) <span>Close</span> </h3> <pre data-language="go">func (f *File) Close() error</pre> <p>Close closes the <a href="#File">File</a>. If the <a href="#File">File</a> was created using <a href="#NewFile">NewFile</a> directly instead of <a href="#Open">Open</a>, Close has no effect. </p>
+<h3 id="File.DWARF">func (*File) <span>DWARF</span> </h3> <pre data-language="go">func (f *File) DWARF() (*dwarf.Data, error)</pre> <h3 id="File.ImportedLibraries">func (*File) <span>ImportedLibraries</span> </h3> <pre data-language="go">func (f *File) ImportedLibraries() ([]string, error)</pre> <p>ImportedLibraries returns the names of all libraries referred to by the binary f that are expected to be linked with the binary at dynamic link time. </p>
+<h3 id="File.ImportedSymbols">func (*File) <span>ImportedSymbols</span> </h3> <pre data-language="go">func (f *File) ImportedSymbols() ([]string, error)</pre> <p>ImportedSymbols returns the names of all symbols referred to by the binary f that are expected to be satisfied by other libraries at dynamic load time. It does not return weak symbols. </p>
+<h3 id="File.Section">func (*File) <span>Section</span> </h3> <pre data-language="go">func (f *File) Section(name string) *Section</pre> <p>Section returns the first section with the given name, or nil if no such section exists. </p>
+<h2 id="FileHeader">type <span>FileHeader</span> </h2> <pre data-language="go">type FileHeader struct {
+ Machine uint16
+ NumberOfSections uint16
+ TimeDateStamp uint32
+ PointerToSymbolTable uint32
+ NumberOfSymbols uint32
+ SizeOfOptionalHeader uint16
+ Characteristics uint16
+}
+</pre> <h2 id="FormatError">type <span>FormatError</span> </h2> <p>FormatError is unused. The type is retained for compatibility. </p>
+<pre data-language="go">type FormatError struct {
+}
+</pre> <h3 id="FormatError.Error">func (*FormatError) <span>Error</span> </h3> <pre data-language="go">func (e *FormatError) Error() string</pre> <h2 id="ImportDirectory">type <span>ImportDirectory</span> </h2> <pre data-language="go">type ImportDirectory struct {
+ OriginalFirstThunk uint32
+ TimeDateStamp uint32
+ ForwarderChain uint32
+ Name uint32
+ FirstThunk uint32
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="OptionalHeader32">type <span>OptionalHeader32</span> <span title="Added in Go 1.3">1.3</span> </h2> <pre data-language="go">type OptionalHeader32 struct {
+ Magic uint16
+ MajorLinkerVersion uint8
+ MinorLinkerVersion uint8
+ SizeOfCode uint32
+ SizeOfInitializedData uint32
+ SizeOfUninitializedData uint32
+ AddressOfEntryPoint uint32
+ BaseOfCode uint32
+ BaseOfData uint32
+ ImageBase uint32
+ SectionAlignment uint32
+ FileAlignment uint32
+ MajorOperatingSystemVersion uint16
+ MinorOperatingSystemVersion uint16
+ MajorImageVersion uint16
+ MinorImageVersion uint16
+ MajorSubsystemVersion uint16
+ MinorSubsystemVersion uint16
+ Win32VersionValue uint32
+ SizeOfImage uint32
+ SizeOfHeaders uint32
+ CheckSum uint32
+ Subsystem uint16
+ DllCharacteristics uint16
+ SizeOfStackReserve uint32
+ SizeOfStackCommit uint32
+ SizeOfHeapReserve uint32
+ SizeOfHeapCommit uint32
+ LoaderFlags uint32
+ NumberOfRvaAndSizes uint32
+ DataDirectory [16]DataDirectory
+}
+</pre> <h2 id="OptionalHeader64">type <span>OptionalHeader64</span> <span title="Added in Go 1.3">1.3</span> </h2> <pre data-language="go">type OptionalHeader64 struct {
+ Magic uint16
+ MajorLinkerVersion uint8
+ MinorLinkerVersion uint8
+ SizeOfCode uint32
+ SizeOfInitializedData uint32
+ SizeOfUninitializedData uint32
+ AddressOfEntryPoint uint32
+ BaseOfCode uint32
+ ImageBase uint64
+ SectionAlignment uint32
+ FileAlignment uint32
+ MajorOperatingSystemVersion uint16
+ MinorOperatingSystemVersion uint16
+ MajorImageVersion uint16
+ MinorImageVersion uint16
+ MajorSubsystemVersion uint16
+ MinorSubsystemVersion uint16
+ Win32VersionValue uint32
+ SizeOfImage uint32
+ SizeOfHeaders uint32
+ CheckSum uint32
+ Subsystem uint16
+ DllCharacteristics uint16
+ SizeOfStackReserve uint64
+ SizeOfStackCommit uint64
+ SizeOfHeapReserve uint64
+ SizeOfHeapCommit uint64
+ LoaderFlags uint32
+ NumberOfRvaAndSizes uint32
+ DataDirectory [16]DataDirectory
+}
+</pre> <h2 id="Reloc">type <span>Reloc</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>Reloc represents a PE COFF relocation. Each section contains its own relocation list. </p>
+<pre data-language="go">type Reloc struct {
+ VirtualAddress uint32
+ SymbolTableIndex uint32
+ Type uint16
+}
+</pre> <h2 id="Section">type <span>Section</span> </h2> <p>Section provides access to PE COFF section. </p>
+<pre data-language="go">type Section struct {
+ SectionHeader
+ Relocs []Reloc // Go 1.8
+
+ // Embed ReaderAt for ReadAt method.
+ // Do not embed SectionReader directly
+ // to avoid having Read and Seek.
+ // If a client wants Read and Seek it must use
+ // Open() to avoid fighting over the seek offset
+ // with other clients.
+ io.ReaderAt
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Section.Data">func (*Section) <span>Data</span> </h3> <pre data-language="go">func (s *Section) Data() ([]byte, error)</pre> <p>Data reads and returns the contents of the PE section s. </p>
+<p>If s.Offset is 0, the section has no contents, and Data will always return a non-nil error. </p>
+<h3 id="Section.Open">func (*Section) <span>Open</span> </h3> <pre data-language="go">func (s *Section) Open() io.ReadSeeker</pre> <p>Open returns a new ReadSeeker reading the PE section s. </p>
+<p>If s.Offset is 0, the section has no contents, and all calls to the returned reader will return a non-nil error. </p>
+<h2 id="SectionHeader">type <span>SectionHeader</span> </h2> <p>SectionHeader is similar to <a href="#SectionHeader32">SectionHeader32</a> with Name field replaced by Go string. </p>
+<pre data-language="go">type SectionHeader struct {
+ Name string
+ VirtualSize uint32
+ VirtualAddress uint32
+ Size uint32
+ Offset uint32
+ PointerToRelocations uint32
+ PointerToLineNumbers uint32
+ NumberOfRelocations uint16
+ NumberOfLineNumbers uint16
+ Characteristics uint32
+}
+</pre> <h2 id="SectionHeader32">type <span>SectionHeader32</span> </h2> <p>SectionHeader32 represents real PE COFF section header. </p>
+<pre data-language="go">type SectionHeader32 struct {
+ Name [8]uint8
+ VirtualSize uint32
+ VirtualAddress uint32
+ SizeOfRawData uint32
+ PointerToRawData uint32
+ PointerToRelocations uint32
+ PointerToLineNumbers uint32
+ NumberOfRelocations uint16
+ NumberOfLineNumbers uint16
+ Characteristics uint32
+}
+</pre> <h2 id="StringTable">type <span>StringTable</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>StringTable is a COFF string table. </p>
+<pre data-language="go">type StringTable []byte</pre> <h3 id="StringTable.String">func (StringTable) <span>String</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (st StringTable) String(start uint32) (string, error)</pre> <p>String extracts string from COFF string table st at offset start. </p>
+<h2 id="Symbol">type <span>Symbol</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>Symbol is similar to <a href="#COFFSymbol">COFFSymbol</a> with Name field replaced by Go string. Symbol also does not have NumberOfAuxSymbols. </p>
+<pre data-language="go">type Symbol struct {
+ Name string
+ Value uint32
+ SectionNumber int16
+ Type uint16
+ StorageClass uint8
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/debug/pe/" class="_attribution-link">http://golang.org/pkg/debug/pe/</a>
+ </p>
+</div>
diff --git a/devdocs/go/debug%2Fplan9obj%2Findex.html b/devdocs/go/debug%2Fplan9obj%2Findex.html
new file mode 100644
index 00000000..d4abc113
--- /dev/null
+++ b/devdocs/go/debug%2Fplan9obj%2Findex.html
@@ -0,0 +1,87 @@
+<h1> Package plan9obj </h1> <ul id="short-nav">
+<li><code>import "debug/plan9obj"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package plan9obj implements access to Plan 9 a.out object files. </p>
+<h3 id="hdr-Security">Security</h3> <p>This package is not designed to be hardened against adversarial inputs, and is outside the scope of <a href="https://go.dev/security/policy">https://go.dev/security/policy</a>. In particular, only basic validation is done when parsing object files. As such, care should be taken when parsing untrusted inputs, as parsing malformed files may consume significant resources, or cause panics. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#File">type File</a></li>
+<li> <a href="#NewFile">func NewFile(r io.ReaderAt) (*File, error)</a>
+</li>
+<li> <a href="#Open">func Open(name string) (*File, error)</a>
+</li>
+<li> <a href="#File.Close">func (f *File) Close() error</a>
+</li>
+<li> <a href="#File.Section">func (f *File) Section(name string) *Section</a>
+</li>
+<li> <a href="#File.Symbols">func (f *File) Symbols() ([]Sym, error)</a>
+</li>
+<li><a href="#FileHeader">type FileHeader</a></li>
+<li><a href="#Section">type Section</a></li>
+<li> <a href="#Section.Data">func (s *Section) Data() ([]byte, error)</a>
+</li>
+<li> <a href="#Section.Open">func (s *Section) Open() io.ReadSeeker</a>
+</li>
+<li><a href="#SectionHeader">type SectionHeader</a></li>
+<li><a href="#Sym">type Sym</a></li>
+</ul> <h3>Package files</h3> <p> <span>file.go</span> <span>plan9obj.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ Magic64 = 0x8000 // 64-bit expanded header
+
+ Magic386 = (4*11+0)*11 + 7
+ MagicAMD64 = (4*26+0)*26 + 7 + Magic64
+ MagicARM = (4*20+0)*20 + 7
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>ErrNoSymbols is returned by <a href="#File.Symbols">File.Symbols</a> if there is no such section in the File. </p>
+<pre data-language="go">var ErrNoSymbols = errors.New("no symbol section")</pre> <h2 id="File">type <span>File</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A File represents an open Plan 9 a.out file. </p>
+<pre data-language="go">type File struct {
+ FileHeader
+ Sections []*Section
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFile">func <span>NewFile</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func NewFile(r io.ReaderAt) (*File, error)</pre> <p>NewFile creates a new <a href="#File">File</a> for accessing a Plan 9 binary in an underlying reader. The Plan 9 binary is expected to start at position 0 in the ReaderAt. </p>
+<h3 id="Open">func <span>Open</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func Open(name string) (*File, error)</pre> <p>Open opens the named file using <span>os.Open</span> and prepares it for use as a Plan 9 a.out binary. </p>
+<h3 id="File.Close">func (*File) <span>Close</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (f *File) Close() error</pre> <p>Close closes the <a href="#File">File</a>. If the <a href="#File">File</a> was created using <a href="#NewFile">NewFile</a> directly instead of <a href="#Open">Open</a>, Close has no effect. </p>
+<h3 id="File.Section">func (*File) <span>Section</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (f *File) Section(name string) *Section</pre> <p>Section returns a section with the given name, or nil if no such section exists. </p>
+<h3 id="File.Symbols">func (*File) <span>Symbols</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (f *File) Symbols() ([]Sym, error)</pre> <p>Symbols returns the symbol table for f. </p>
+<h2 id="FileHeader">type <span>FileHeader</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A FileHeader represents a Plan 9 a.out file header. </p>
+<pre data-language="go">type FileHeader struct {
+ Magic uint32
+ Bss uint32
+ Entry uint64
+ PtrSize int
+ LoadAddress uint64 // Go 1.4
+ HdrSize uint64 // Go 1.4
+}
+</pre> <h2 id="Section">type <span>Section</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A Section represents a single section in a Plan 9 a.out file. </p>
+<pre data-language="go">type Section struct {
+ SectionHeader
+
+ // Embed ReaderAt for ReadAt method.
+ // Do not embed SectionReader directly
+ // to avoid having Read and Seek.
+ // If a client wants Read and Seek it must use
+ // Open() to avoid fighting over the seek offset
+ // with other clients.
+ io.ReaderAt
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Section.Data">func (*Section) <span>Data</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (s *Section) Data() ([]byte, error)</pre> <p>Data reads and returns the contents of the Plan 9 a.out section. </p>
+<h3 id="Section.Open">func (*Section) <span>Open</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (s *Section) Open() io.ReadSeeker</pre> <p>Open returns a new ReadSeeker reading the Plan 9 a.out section. </p>
+<h2 id="SectionHeader">type <span>SectionHeader</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A SectionHeader represents a single Plan 9 a.out section header. This structure doesn't exist on-disk, but eases navigation through the object file. </p>
+<pre data-language="go">type SectionHeader struct {
+ Name string
+ Size uint32
+ Offset uint32
+}
+</pre> <h2 id="Sym">type <span>Sym</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A Symbol represents an entry in a Plan 9 a.out symbol table section. </p>
+<pre data-language="go">type Sym struct {
+ Value uint64
+ Type rune
+ Name string
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/debug/plan9obj/" class="_attribution-link">http://golang.org/pkg/debug/plan9obj/</a>
+ </p>
+</div>
diff --git a/devdocs/go/embed%2Findex.html b/devdocs/go/embed%2Findex.html
new file mode 100644
index 00000000..39d4e2af
--- /dev/null
+++ b/devdocs/go/embed%2Findex.html
@@ -0,0 +1,102 @@
+<h1> Package embed </h1> <ul id="short-nav">
+<li><code>import "embed"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package embed provides access to files embedded in the running Go program. </p>
+<p>Go source files that import "embed" can use the //go:embed directive to initialize a variable of type string, []byte, or <a href="#FS">FS</a> with the contents of files read from the package directory or subdirectories at compile time. </p>
+<p>For example, here are three ways to embed a file named hello.txt and then print its contents at run time. </p>
+<p>Embedding one file into a string: </p>
+<pre data-language="go">import _ "embed"
+
+//go:embed hello.txt
+var s string
+print(s)
+</pre> <p>Embedding one file into a slice of bytes: </p>
+<pre data-language="go">import _ "embed"
+
+//go:embed hello.txt
+var b []byte
+print(string(b))
+</pre> <p>Embedded one or more files into a file system: </p>
+<pre data-language="go">import "embed"
+
+//go:embed hello.txt
+var f embed.FS
+data, _ := f.ReadFile("hello.txt")
+print(string(data))
+</pre> <h3 id="hdr-Directives">Directives</h3> <p>A //go:embed directive above a variable declaration specifies which files to embed, using one or more path.Match patterns. </p>
+<p>The directive must immediately precede a line containing the declaration of a single variable. Only blank lines and ‘//’ line comments are permitted between the directive and the declaration. </p>
+<p>The type of the variable must be a string type, or a slice of a byte type, or <a href="#FS">FS</a> (or an alias of <a href="#FS">FS</a>). </p>
+<p>For example: </p>
+<pre data-language="go">package server
+
+import "embed"
+
+// content holds our static web server content.
+//go:embed image/* template/*
+//go:embed html/index.html
+var content embed.FS
+</pre> <p>The Go build system will recognize the directives and arrange for the declared variable (in the example above, content) to be populated with the matching files from the file system. </p>
+<p>The //go:embed directive accepts multiple space-separated patterns for brevity, but it can also be repeated, to avoid very long lines when there are many patterns. The patterns are interpreted relative to the package directory containing the source file. The path separator is a forward slash, even on Windows systems. Patterns may not contain ‘.’ or ‘..’ or empty path elements, nor may they begin or end with a slash. To match everything in the current directory, use ‘*’ instead of ‘.’. To allow for naming files with spaces in their names, patterns can be written as Go double-quoted or back-quoted string literals. </p>
+<p>If a pattern names a directory, all files in the subtree rooted at that directory are embedded (recursively), except that files with names beginning with ‘.’ or ‘_’ are excluded. So the variable in the above example is almost equivalent to: </p>
+<pre data-language="go">// content is our static web server content.
+//go:embed image template html/index.html
+var content embed.FS
+</pre> <p>The difference is that ‘image/*’ embeds ‘image/.tempfile’ while ‘image’ does not. Neither embeds ‘image/dir/.tempfile’. </p>
+<p>If a pattern begins with the prefix ‘all:’, then the rule for walking directories is changed to include those files beginning with ‘.’ or ‘_’. For example, ‘all:image’ embeds both ‘image/.tempfile’ and ‘image/dir/.tempfile’. </p>
+<p>The //go:embed directive can be used with both exported and unexported variables, depending on whether the package wants to make the data available to other packages. It can only be used with variables at package scope, not with local variables. </p>
+<p>Patterns must not match files outside the package's module, such as ‘.git/*’ or symbolic links. Patterns must not match files whose names include the special punctuation characters " * &lt; &gt; ? ` ' | / \ and :. Matches for empty directories are ignored. After that, each pattern in a //go:embed line must match at least one file or non-empty directory. </p>
+<p>If any patterns are invalid or have invalid matches, the build will fail. </p>
+<h3 id="hdr-Strings_and_Bytes">Strings and Bytes</h3> <p>The //go:embed line for a variable of type string or []byte can have only a single pattern, and that pattern can match only a single file. The string or []byte is initialized with the contents of that file. </p>
+<p>The //go:embed directive requires importing "embed", even when using a string or []byte. In source files that don't refer to <a href="#FS">embed.FS</a>, use a blank import (import _ "embed"). </p>
+<h3 id="hdr-File_Systems">File Systems</h3> <p>For embedding a single file, a variable of type string or []byte is often best. The <a href="#FS">FS</a> type enables embedding a tree of files, such as a directory of static web server content, as in the example above. </p>
+<p>FS implements the <span>io/fs</span> package's <a href="#FS">FS</a> interface, so it can be used with any package that understands file systems, including <span>net/http</span>, <span>text/template</span>, and <span>html/template</span>. </p>
+<p>For example, given the content variable in the example above, we can write: </p>
+<pre data-language="go">http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(content))))
+
+template.ParseFS(content, "*.tmpl")
+</pre> <h3 id="hdr-Tools">Tools</h3> <p>To support tools that analyze Go packages, the patterns found in //go:embed lines are available in “go list” output. See the EmbedPatterns, TestEmbedPatterns, and XTestEmbedPatterns fields in the “go help list” output. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package embed_test
+
+import (
+ "embed"
+ "log"
+ "net/http"
+)
+
+//go:embed internal/embedtest/testdata/*.txt
+var content embed.FS
+
+func Example() {
+ mux := http.NewServeMux()
+ mux.Handle("/", http.FileServer(http.FS(content)))
+ err := http.ListenAndServe(":8080", mux)
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#FS">type FS</a></li>
+<li> <a href="#FS.Open">func (f FS) Open(name string) (fs.File, error)</a>
+</li>
+<li> <a href="#FS.ReadDir">func (f FS) ReadDir(name string) ([]fs.DirEntry, error)</a>
+</li>
+<li> <a href="#FS.ReadFile">func (f FS) ReadFile(name string) ([]byte, error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>embed.go</span> </p> <h2 id="FS">type <span>FS</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>An FS is a read-only collection of files, usually initialized with a //go:embed directive. When declared without a //go:embed directive, an FS is an empty file system. </p>
+<p>An FS is a read-only value, so it is safe to use from multiple goroutines simultaneously and also safe to assign values of type FS to each other. </p>
+<p>FS implements fs.FS, so it can be used with any package that understands file system interfaces, including net/http, text/template, and html/template. </p>
+<p>See the package documentation for more details about initializing an FS. </p>
+<pre data-language="go">type FS struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="FS.Open">func (FS) <span>Open</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (f FS) Open(name string) (fs.File, error)</pre> <p>Open opens the named file for reading and returns it as an <span>fs.File</span>. </p>
+<p>The returned file implements <span>io.Seeker</span> and <span>io.ReaderAt</span> when the file is not a directory. </p>
+<h3 id="FS.ReadDir">func (FS) <span>ReadDir</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (f FS) ReadDir(name string) ([]fs.DirEntry, error)</pre> <p>ReadDir reads and returns the entire named directory. </p>
+<h3 id="FS.ReadFile">func (FS) <span>ReadFile</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (f FS) ReadFile(name string) ([]byte, error)</pre> <p>ReadFile reads and returns the content of the named file. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/embed/" class="_attribution-link">http://golang.org/pkg/embed/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fascii85%2Findex.html b/devdocs/go/encoding%2Fascii85%2Findex.html
new file mode 100644
index 00000000..675d07d8
--- /dev/null
+++ b/devdocs/go/encoding%2Fascii85%2Findex.html
@@ -0,0 +1,28 @@
+<h1> Package ascii85 </h1> <ul id="short-nav">
+<li><code>import "encoding/ascii85"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package ascii85 implements the ascii85 data encoding as used in the btoa tool and Adobe's PostScript and PDF document formats. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Decode">func Decode(dst, src []byte, flush bool) (ndst, nsrc int, err error)</a></li>
+<li><a href="#Encode">func Encode(dst, src []byte) int</a></li>
+<li><a href="#MaxEncodedLen">func MaxEncodedLen(n int) int</a></li>
+<li><a href="#NewDecoder">func NewDecoder(r io.Reader) io.Reader</a></li>
+<li><a href="#NewEncoder">func NewEncoder(w io.Writer) io.WriteCloser</a></li>
+<li><a href="#CorruptInputError">type CorruptInputError</a></li>
+<li> <a href="#CorruptInputError.Error">func (e CorruptInputError) Error() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>ascii85.go</span> </p> <h2 id="Decode">func <span>Decode</span> </h2> <pre data-language="go">func Decode(dst, src []byte, flush bool) (ndst, nsrc int, err error)</pre> <p>Decode decodes src into dst, returning both the number of bytes written to dst and the number consumed from src. If src contains invalid ascii85 data, Decode will return the number of bytes successfully written and a <a href="#CorruptInputError">CorruptInputError</a>. Decode ignores space and control characters in src. Often, ascii85-encoded data is wrapped in &lt;~ and ~&gt; symbols. Decode expects these to have been stripped by the caller. </p>
+<p>If flush is true, Decode assumes that src represents the end of the input stream and processes it completely rather than wait for the completion of another 32-bit block. </p>
+<p><a href="#NewDecoder">NewDecoder</a> wraps an <span>io.Reader</span> interface around Decode. </p>
+<h2 id="Encode">func <span>Encode</span> </h2> <pre data-language="go">func Encode(dst, src []byte) int</pre> <p>Encode encodes src into at most <a href="#MaxEncodedLen">MaxEncodedLen</a>(len(src)) bytes of dst, returning the actual number of bytes written. </p>
+<p>The encoding handles 4-byte chunks, using a special encoding for the last fragment, so Encode is not appropriate for use on individual blocks of a large data stream. Use <a href="#NewEncoder">NewEncoder</a> instead. </p>
+<p>Often, ascii85-encoded data is wrapped in &lt;~ and ~&gt; symbols. Encode does not add these. </p>
+<h2 id="MaxEncodedLen">func <span>MaxEncodedLen</span> </h2> <pre data-language="go">func MaxEncodedLen(n int) int</pre> <p>MaxEncodedLen returns the maximum length of an encoding of n source bytes. </p>
+<h2 id="NewDecoder">func <span>NewDecoder</span> </h2> <pre data-language="go">func NewDecoder(r io.Reader) io.Reader</pre> <p>NewDecoder constructs a new ascii85 stream decoder. </p>
+<h2 id="NewEncoder">func <span>NewEncoder</span> </h2> <pre data-language="go">func NewEncoder(w io.Writer) io.WriteCloser</pre> <p>NewEncoder returns a new ascii85 stream encoder. Data written to the returned writer will be encoded and then written to w. Ascii85 encodings operate in 32-bit blocks; when finished writing, the caller must Close the returned encoder to flush any trailing partial block. </p>
+<h2 id="CorruptInputError">type <span>CorruptInputError</span> </h2> <pre data-language="go">type CorruptInputError int64</pre> <h3 id="CorruptInputError.Error">func (CorruptInputError) <span>Error</span> </h3> <pre data-language="go">func (e CorruptInputError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/ascii85/" class="_attribution-link">http://golang.org/pkg/encoding/ascii85/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fasn1%2Findex.html b/devdocs/go/encoding%2Fasn1%2Findex.html
new file mode 100644
index 00000000..d31a7032
--- /dev/null
+++ b/devdocs/go/encoding%2Fasn1%2Findex.html
@@ -0,0 +1,130 @@
+<h1> Package asn1 </h1> <ul id="short-nav">
+<li><code>import "encoding/asn1"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package asn1 implements parsing of DER-encoded ASN.1 data structures, as defined in ITU-T Rec X.690. </p>
+<p>See also “A Layman's Guide to a Subset of ASN.1, BER, and DER,” <a href="http://luca.ntop.org/Teaching/Appunti/asn1.html">http://luca.ntop.org/Teaching/Appunti/asn1.html</a>. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Marshal">func Marshal(val any) ([]byte, error)</a></li>
+<li><a href="#MarshalWithParams">func MarshalWithParams(val any, params string) ([]byte, error)</a></li>
+<li><a href="#Unmarshal">func Unmarshal(b []byte, val any) (rest []byte, err error)</a></li>
+<li><a href="#UnmarshalWithParams">func UnmarshalWithParams(b []byte, val any, params string) (rest []byte, err error)</a></li>
+<li><a href="#BitString">type BitString</a></li>
+<li> <a href="#BitString.At">func (b BitString) At(i int) int</a>
+</li>
+<li> <a href="#BitString.RightAlign">func (b BitString) RightAlign() []byte</a>
+</li>
+<li><a href="#Enumerated">type Enumerated</a></li>
+<li><a href="#Flag">type Flag</a></li>
+<li><a href="#ObjectIdentifier">type ObjectIdentifier</a></li>
+<li> <a href="#ObjectIdentifier.Equal">func (oi ObjectIdentifier) Equal(other ObjectIdentifier) bool</a>
+</li>
+<li> <a href="#ObjectIdentifier.String">func (oi ObjectIdentifier) String() string</a>
+</li>
+<li><a href="#RawContent">type RawContent</a></li>
+<li><a href="#RawValue">type RawValue</a></li>
+<li><a href="#StructuralError">type StructuralError</a></li>
+<li> <a href="#StructuralError.Error">func (e StructuralError) Error() string</a>
+</li>
+<li><a href="#SyntaxError">type SyntaxError</a></li>
+<li> <a href="#SyntaxError.Error">func (e SyntaxError) Error() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>asn1.go</span> <span>common.go</span> <span>marshal.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>ASN.1 tags represent the type of the following object. </p>
+<pre data-language="go">const (
+ TagBoolean = 1
+ TagInteger = 2
+ TagBitString = 3
+ TagOctetString = 4
+ TagNull = 5
+ TagOID = 6
+ TagEnum = 10
+ TagUTF8String = 12
+ TagSequence = 16
+ TagSet = 17
+ TagNumericString = 18
+ TagPrintableString = 19
+ TagT61String = 20
+ TagIA5String = 22
+ TagUTCTime = 23
+ TagGeneralizedTime = 24
+ TagGeneralString = 27
+ TagBMPString = 30
+)</pre> <p>ASN.1 class types represent the namespace of the tag. </p>
+<pre data-language="go">const (
+ ClassUniversal = 0
+ ClassApplication = 1
+ ClassContextSpecific = 2
+ ClassPrivate = 3
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>NullBytes contains bytes representing the DER-encoded ASN.1 NULL type. </p>
+<pre data-language="go">var NullBytes = []byte{TagNull, 0}</pre> <p>NullRawValue is a <a href="#RawValue">RawValue</a> with its Tag set to the ASN.1 NULL type tag (5). </p>
+<pre data-language="go">var NullRawValue = RawValue{Tag: TagNull}</pre> <h2 id="Marshal">func <span>Marshal</span> </h2> <pre data-language="go">func Marshal(val any) ([]byte, error)</pre> <p>Marshal returns the ASN.1 encoding of val. </p>
+<p>In addition to the struct tags recognized by Unmarshal, the following can be used: </p>
+<pre data-language="go">ia5: causes strings to be marshaled as ASN.1, IA5String values
+omitempty: causes empty slices to be skipped
+printable: causes strings to be marshaled as ASN.1, PrintableString values
+utf8: causes strings to be marshaled as ASN.1, UTF8String values
+utc: causes time.Time to be marshaled as ASN.1, UTCTime values
+generalized: causes time.Time to be marshaled as ASN.1, GeneralizedTime values
+</pre> <h2 id="MarshalWithParams">func <span>MarshalWithParams</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func MarshalWithParams(val any, params string) ([]byte, error)</pre> <p>MarshalWithParams allows field parameters to be specified for the top-level element. The form of the params is the same as the field tags. </p>
+<h2 id="Unmarshal">func <span>Unmarshal</span> </h2> <pre data-language="go">func Unmarshal(b []byte, val any) (rest []byte, err error)</pre> <p>Unmarshal parses the DER-encoded ASN.1 data structure b and uses the reflect package to fill in an arbitrary value pointed at by val. Because Unmarshal uses the reflect package, the structs being written to must use upper case field names. If val is nil or not a pointer, Unmarshal returns an error. </p>
+<p>After parsing b, any bytes that were leftover and not used to fill val will be returned in rest. When parsing a SEQUENCE into a struct, any trailing elements of the SEQUENCE that do not have matching fields in val will not be included in rest, as these are considered valid elements of the SEQUENCE and not trailing data. </p>
+<ul> <li><p>An ASN.1 INTEGER can be written to an int, int32, int64, or *<span>big.Int</span>. If the encoded value does not fit in the Go type, Unmarshal returns a parse error. </p></li>
+<li><p>An ASN.1 BIT STRING can be written to a <a href="#BitString">BitString</a>. </p></li>
+<li><p>An ASN.1 OCTET STRING can be written to a []byte. </p></li>
+<li><p>An ASN.1 OBJECT IDENTIFIER can be written to an <a href="#ObjectIdentifier">ObjectIdentifier</a>. </p></li>
+<li><p>An ASN.1 ENUMERATED can be written to an <a href="#Enumerated">Enumerated</a>. </p></li>
+<li><p>An ASN.1 UTCTIME or GENERALIZEDTIME can be written to a <span>time.Time</span>. </p></li>
+<li><p>An ASN.1 PrintableString, IA5String, or NumericString can be written to a string. </p></li>
+<li><p>Any of the above ASN.1 values can be written to an interface{}. The value stored in the interface has the corresponding Go type. For integers, that type is int64. </p></li>
+<li><p>An ASN.1 SEQUENCE OF x or SET OF x can be written to a slice if an x can be written to the slice's element type. </p></li>
+<li><p>An ASN.1 SEQUENCE or SET can be written to a struct if each of the elements in the sequence can be written to the corresponding element in the struct. </p></li>
+</ul> <p>The following tags on struct fields have special meaning to Unmarshal: </p>
+<pre data-language="go">application specifies that an APPLICATION tag is used
+private specifies that a PRIVATE tag is used
+default:x sets the default value for optional integer fields (only used if optional is also present)
+explicit specifies that an additional, explicit tag wraps the implicit one
+optional marks the field as ASN.1 OPTIONAL
+set causes a SET, rather than a SEQUENCE type to be expected
+tag:x specifies the ASN.1 tag number; implies ASN.1 CONTEXT SPECIFIC
+</pre> <p>When decoding an ASN.1 value with an IMPLICIT tag into a string field, Unmarshal will default to a PrintableString, which doesn't support characters such as '@' and '&amp;'. To force other encodings, use the following tags: </p>
+<pre data-language="go">ia5 causes strings to be unmarshaled as ASN.1 IA5String values
+numeric causes strings to be unmarshaled as ASN.1 NumericString values
+utf8 causes strings to be unmarshaled as ASN.1 UTF8String values
+</pre> <p>If the type of the first field of a structure is RawContent then the raw ASN1 contents of the struct will be stored in it. </p>
+<p>If the name of a slice type ends with "SET" then it's treated as if the "set" tag was set on it. This results in interpreting the type as a SET OF x rather than a SEQUENCE OF x. This can be used with nested slices where a struct tag cannot be given. </p>
+<p>Other ASN.1 types are not supported; if it encounters them, Unmarshal returns a parse error. </p>
+<h2 id="UnmarshalWithParams">func <span>UnmarshalWithParams</span> </h2> <pre data-language="go">func UnmarshalWithParams(b []byte, val any, params string) (rest []byte, err error)</pre> <p>UnmarshalWithParams allows field parameters to be specified for the top-level element. The form of the params is the same as the field tags. </p>
+<h2 id="BitString">type <span>BitString</span> </h2> <p>BitString is the structure to use when you want an ASN.1 BIT STRING type. A bit string is padded up to the nearest byte in memory and the number of valid bits is recorded. Padding bits will be zero. </p>
+<pre data-language="go">type BitString struct {
+ Bytes []byte // bits packed into bytes.
+ BitLength int // length in bits.
+}
+</pre> <h3 id="BitString.At">func (BitString) <span>At</span> </h3> <pre data-language="go">func (b BitString) At(i int) int</pre> <p>At returns the bit at the given index. If the index is out of range it returns 0. </p>
+<h3 id="BitString.RightAlign">func (BitString) <span>RightAlign</span> </h3> <pre data-language="go">func (b BitString) RightAlign() []byte</pre> <p>RightAlign returns a slice where the padding bits are at the beginning. The slice may share memory with the BitString. </p>
+<h2 id="Enumerated">type <span>Enumerated</span> </h2> <p>An Enumerated is represented as a plain int. </p>
+<pre data-language="go">type Enumerated int</pre> <h2 id="Flag">type <span>Flag</span> </h2> <p>A Flag accepts any data and is set to true if present. </p>
+<pre data-language="go">type Flag bool</pre> <h2 id="ObjectIdentifier">type <span>ObjectIdentifier</span> </h2> <p>An ObjectIdentifier represents an ASN.1 OBJECT IDENTIFIER. </p>
+<pre data-language="go">type ObjectIdentifier []int</pre> <h3 id="ObjectIdentifier.Equal">func (ObjectIdentifier) <span>Equal</span> </h3> <pre data-language="go">func (oi ObjectIdentifier) Equal(other ObjectIdentifier) bool</pre> <p>Equal reports whether oi and other represent the same identifier. </p>
+<h3 id="ObjectIdentifier.String">func (ObjectIdentifier) <span>String</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (oi ObjectIdentifier) String() string</pre> <h2 id="RawContent">type <span>RawContent</span> </h2> <p>RawContent is used to signal that the undecoded, DER data needs to be preserved for a struct. To use it, the first field of the struct must have this type. It's an error for any of the other fields to have this type. </p>
+<pre data-language="go">type RawContent []byte</pre> <h2 id="RawValue">type <span>RawValue</span> </h2> <p>A RawValue represents an undecoded ASN.1 object. </p>
+<pre data-language="go">type RawValue struct {
+ Class, Tag int
+ IsCompound bool
+ Bytes []byte
+ FullBytes []byte // includes the tag and length
+}
+</pre> <h2 id="StructuralError">type <span>StructuralError</span> </h2> <p>A StructuralError suggests that the ASN.1 data is valid, but the Go type which is receiving it doesn't match. </p>
+<pre data-language="go">type StructuralError struct {
+ Msg string
+}
+</pre> <h3 id="StructuralError.Error">func (StructuralError) <span>Error</span> </h3> <pre data-language="go">func (e StructuralError) Error() string</pre> <h2 id="SyntaxError">type <span>SyntaxError</span> </h2> <p>A SyntaxError suggests that the ASN.1 data is invalid. </p>
+<pre data-language="go">type SyntaxError struct {
+ Msg string
+}
+</pre> <h3 id="SyntaxError.Error">func (SyntaxError) <span>Error</span> </h3> <pre data-language="go">func (e SyntaxError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/asn1/" class="_attribution-link">http://golang.org/pkg/encoding/asn1/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fbase32%2Findex.html b/devdocs/go/encoding%2Fbase32%2Findex.html
new file mode 100644
index 00000000..d0c213b2
--- /dev/null
+++ b/devdocs/go/encoding%2Fbase32%2Findex.html
@@ -0,0 +1,96 @@
+<h1> Package base32 </h1> <ul id="short-nav">
+<li><code>import "encoding/base32"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package base32 implements base32 encoding as specified by RFC 4648. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#NewDecoder">func NewDecoder(enc *Encoding, r io.Reader) io.Reader</a></li>
+<li><a href="#NewEncoder">func NewEncoder(enc *Encoding, w io.Writer) io.WriteCloser</a></li>
+<li><a href="#CorruptInputError">type CorruptInputError</a></li>
+<li> <a href="#CorruptInputError.Error">func (e CorruptInputError) Error() string</a>
+</li>
+<li><a href="#Encoding">type Encoding</a></li>
+<li> <a href="#NewEncoding">func NewEncoding(encoder string) *Encoding</a>
+</li>
+<li> <a href="#Encoding.AppendDecode">func (enc *Encoding) AppendDecode(dst, src []byte) ([]byte, error)</a>
+</li>
+<li> <a href="#Encoding.AppendEncode">func (enc *Encoding) AppendEncode(dst, src []byte) []byte</a>
+</li>
+<li> <a href="#Encoding.Decode">func (enc *Encoding) Decode(dst, src []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Encoding.DecodeString">func (enc *Encoding) DecodeString(s string) ([]byte, error)</a>
+</li>
+<li> <a href="#Encoding.DecodedLen">func (enc *Encoding) DecodedLen(n int) int</a>
+</li>
+<li> <a href="#Encoding.Encode">func (enc *Encoding) Encode(dst, src []byte)</a>
+</li>
+<li> <a href="#Encoding.EncodeToString">func (enc *Encoding) EncodeToString(src []byte) string</a>
+</li>
+<li> <a href="#Encoding.EncodedLen">func (enc *Encoding) EncodedLen(n int) int</a>
+</li>
+<li> <a href="#Encoding.WithPadding">func (enc Encoding) WithPadding(padding rune) *Encoding</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Encoding_Decode">Encoding.Decode</a></dd> <dd><a class="exampleLink" href="#example_Encoding_DecodeString">Encoding.DecodeString</a></dd> <dd><a class="exampleLink" href="#example_Encoding_Encode">Encoding.Encode</a></dd> <dd><a class="exampleLink" href="#example_Encoding_EncodeToString">Encoding.EncodeToString</a></dd> <dd><a class="exampleLink" href="#example_NewEncoder">NewEncoder</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>base32.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ StdPadding rune = '=' // Standard padding character
+ NoPadding rune = -1 // No padding
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>HexEncoding is the “Extended Hex Alphabet” defined in RFC 4648. It is typically used in DNS. </p>
+<pre data-language="go">var HexEncoding = NewEncoding("0123456789ABCDEFGHIJKLMNOPQRSTUV")</pre> <p>StdEncoding is the standard base32 encoding, as defined in RFC 4648. </p>
+<pre data-language="go">var StdEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567")</pre> <h2 id="NewDecoder">func <span>NewDecoder</span> </h2> <pre data-language="go">func NewDecoder(enc *Encoding, r io.Reader) io.Reader</pre> <p>NewDecoder constructs a new base32 stream decoder. </p>
+<h2 id="NewEncoder">func <span>NewEncoder</span> </h2> <pre data-language="go">func NewEncoder(enc *Encoding, w io.Writer) io.WriteCloser</pre> <p>NewEncoder returns a new base32 stream encoder. Data written to the returned writer will be encoded using enc and then written to w. Base32 encodings operate in 5-byte blocks; when finished writing, the caller must Close the returned encoder to flush any partially written blocks. </p> <h4 id="example_NewEncoder"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">input := []byte("foo\x00bar")
+encoder := base32.NewEncoder(base32.StdEncoding, os.Stdout)
+encoder.Write(input)
+// Must close the encoder when finished to flush any partial blocks.
+// If you comment out the following line, the last partial block "r"
+// won't be encoded.
+encoder.Close()
+</pre> <p>Output:</p> <pre class="output" data-language="go">MZXW6ADCMFZA====
+</pre> <h2 id="CorruptInputError">type <span>CorruptInputError</span> </h2> <pre data-language="go">type CorruptInputError int64</pre> <h3 id="CorruptInputError.Error">func (CorruptInputError) <span>Error</span> </h3> <pre data-language="go">func (e CorruptInputError) Error() string</pre> <h2 id="Encoding">type <span>Encoding</span> </h2> <p>An Encoding is a radix 32 encoding/decoding scheme, defined by a 32-character alphabet. The most common is the "base32" encoding introduced for SASL GSSAPI and standardized in RFC 4648. The alternate "base32hex" encoding is used in DNSSEC. </p>
+<pre data-language="go">type Encoding struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewEncoding">func <span>NewEncoding</span> </h3> <pre data-language="go">func NewEncoding(encoder string) *Encoding</pre> <p>NewEncoding returns a new padded Encoding defined by the given alphabet, which must be a 32-byte string that contains unique byte values and does not contain the padding character or CR / LF ('\r', '\n'). The alphabet is treated as a sequence of byte values without any special treatment for multi-byte UTF-8. The resulting Encoding uses the default padding character ('='), which may be changed or disabled via <a href="#Encoding.WithPadding">Encoding.WithPadding</a>. </p>
+<h3 id="Encoding.AppendDecode">func (*Encoding) <span>AppendDecode</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (enc *Encoding) AppendDecode(dst, src []byte) ([]byte, error)</pre> <p>AppendDecode appends the base32 decoded src to dst and returns the extended buffer. If the input is malformed, it returns the partially decoded src and an error. </p>
+<h3 id="Encoding.AppendEncode">func (*Encoding) <span>AppendEncode</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (enc *Encoding) AppendEncode(dst, src []byte) []byte</pre> <p>AppendEncode appends the base32 encoded src to dst and returns the extended buffer. </p>
+<h3 id="Encoding.Decode">func (*Encoding) <span>Decode</span> </h3> <pre data-language="go">func (enc *Encoding) Decode(dst, src []byte) (n int, err error)</pre> <p>Decode decodes src using the encoding enc. It writes at most <a href="#Encoding.DecodedLen">Encoding.DecodedLen</a>(len(src)) bytes to dst and returns the number of bytes written. If src contains invalid base32 data, it will return the number of bytes successfully written and <a href="#CorruptInputError">CorruptInputError</a>. Newline characters (\r and \n) are ignored. </p> <h4 id="example_Encoding_Decode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := "JBSWY3DPFQQHO33SNRSCC==="
+dst := make([]byte, base32.StdEncoding.DecodedLen(len(str)))
+n, err := base32.StdEncoding.Decode(dst, []byte(str))
+if err != nil {
+ fmt.Println("decode error:", err)
+ return
+}
+dst = dst[:n]
+fmt.Printf("%q\n", dst)
+</pre> <p>Output:</p> <pre class="output" data-language="go">"Hello, world!"
+</pre> <h3 id="Encoding.DecodeString">func (*Encoding) <span>DecodeString</span> </h3> <pre data-language="go">func (enc *Encoding) DecodeString(s string) ([]byte, error)</pre> <p>DecodeString returns the bytes represented by the base32 string s. </p> <h4 id="example_Encoding_DecodeString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := "ONXW2ZJAMRQXIYJAO5UXI2BAAAQGC3TEEDX3XPY="
+data, err := base32.StdEncoding.DecodeString(str)
+if err != nil {
+ fmt.Println("error:", err)
+ return
+}
+fmt.Printf("%q\n", data)
+</pre> <p>Output:</p> <pre class="output" data-language="go">"some data with \x00 and \ufeff"
+</pre> <h3 id="Encoding.DecodedLen">func (*Encoding) <span>DecodedLen</span> </h3> <pre data-language="go">func (enc *Encoding) DecodedLen(n int) int</pre> <p>DecodedLen returns the maximum length in bytes of the decoded data corresponding to n bytes of base32-encoded data. </p>
+<h3 id="Encoding.Encode">func (*Encoding) <span>Encode</span> </h3> <pre data-language="go">func (enc *Encoding) Encode(dst, src []byte)</pre> <p>Encode encodes src using the encoding enc, writing <a href="#Encoding.EncodedLen">Encoding.EncodedLen</a>(len(src)) bytes to dst. </p>
+<p>The encoding pads the output to a multiple of 8 bytes, so Encode is not appropriate for use on individual blocks of a large data stream. Use <a href="#NewEncoder">NewEncoder</a> instead. </p> <h4 id="example_Encoding_Encode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">data := []byte("Hello, world!")
+dst := make([]byte, base32.StdEncoding.EncodedLen(len(data)))
+base32.StdEncoding.Encode(dst, data)
+fmt.Println(string(dst))
+</pre> <p>Output:</p> <pre class="output" data-language="go">JBSWY3DPFQQHO33SNRSCC===
+</pre> <h3 id="Encoding.EncodeToString">func (*Encoding) <span>EncodeToString</span> </h3> <pre data-language="go">func (enc *Encoding) EncodeToString(src []byte) string</pre> <p>EncodeToString returns the base32 encoding of src. </p> <h4 id="example_Encoding_EncodeToString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">data := []byte("any + old &amp; data")
+str := base32.StdEncoding.EncodeToString(data)
+fmt.Println(str)
+</pre> <p>Output:</p> <pre class="output" data-language="go">MFXHSIBLEBXWYZBAEYQGIYLUME======
+</pre> <h3 id="Encoding.EncodedLen">func (*Encoding) <span>EncodedLen</span> </h3> <pre data-language="go">func (enc *Encoding) EncodedLen(n int) int</pre> <p>EncodedLen returns the length in bytes of the base32 encoding of an input buffer of length n. </p>
+<h3 id="Encoding.WithPadding">func (Encoding) <span>WithPadding</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (enc Encoding) WithPadding(padding rune) *Encoding</pre> <p>WithPadding creates a new encoding identical to enc except with a specified padding character, or NoPadding to disable padding. The padding character must not be '\r' or '\n', must not be contained in the encoding's alphabet, must not be negative, and must be a rune equal or below '\xff'. Padding characters above '\x7f' are encoded as their exact byte value rather than using the UTF-8 representation of the codepoint. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/base32/" class="_attribution-link">http://golang.org/pkg/encoding/base32/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fbase64%2Findex.html b/devdocs/go/encoding%2Fbase64%2Findex.html
new file mode 100644
index 00000000..91acad34
--- /dev/null
+++ b/devdocs/go/encoding%2Fbase64%2Findex.html
@@ -0,0 +1,114 @@
+<h1> Package base64 </h1> <ul id="short-nav">
+<li><code>import "encoding/base64"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package base64 implements base64 encoding as specified by RFC 4648. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">msg := "Hello, 世界"
+encoded := base64.StdEncoding.EncodeToString([]byte(msg))
+fmt.Println(encoded)
+decoded, err := base64.StdEncoding.DecodeString(encoded)
+if err != nil {
+ fmt.Println("decode error:", err)
+ return
+}
+fmt.Println(string(decoded))
+</pre> <p>Output:</p> <pre class="output" data-language="go">SGVsbG8sIOS4lueVjA==
+Hello, 世界
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#NewDecoder">func NewDecoder(enc *Encoding, r io.Reader) io.Reader</a></li>
+<li><a href="#NewEncoder">func NewEncoder(enc *Encoding, w io.Writer) io.WriteCloser</a></li>
+<li><a href="#CorruptInputError">type CorruptInputError</a></li>
+<li> <a href="#CorruptInputError.Error">func (e CorruptInputError) Error() string</a>
+</li>
+<li><a href="#Encoding">type Encoding</a></li>
+<li> <a href="#NewEncoding">func NewEncoding(encoder string) *Encoding</a>
+</li>
+<li> <a href="#Encoding.AppendDecode">func (enc *Encoding) AppendDecode(dst, src []byte) ([]byte, error)</a>
+</li>
+<li> <a href="#Encoding.AppendEncode">func (enc *Encoding) AppendEncode(dst, src []byte) []byte</a>
+</li>
+<li> <a href="#Encoding.Decode">func (enc *Encoding) Decode(dst, src []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Encoding.DecodeString">func (enc *Encoding) DecodeString(s string) ([]byte, error)</a>
+</li>
+<li> <a href="#Encoding.DecodedLen">func (enc *Encoding) DecodedLen(n int) int</a>
+</li>
+<li> <a href="#Encoding.Encode">func (enc *Encoding) Encode(dst, src []byte)</a>
+</li>
+<li> <a href="#Encoding.EncodeToString">func (enc *Encoding) EncodeToString(src []byte) string</a>
+</li>
+<li> <a href="#Encoding.EncodedLen">func (enc *Encoding) EncodedLen(n int) int</a>
+</li>
+<li> <a href="#Encoding.Strict">func (enc Encoding) Strict() *Encoding</a>
+</li>
+<li> <a href="#Encoding.WithPadding">func (enc Encoding) WithPadding(padding rune) *Encoding</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example_Encoding_Decode">Encoding.Decode</a></dd> <dd><a class="exampleLink" href="#example_Encoding_DecodeString">Encoding.DecodeString</a></dd> <dd><a class="exampleLink" href="#example_Encoding_Encode">Encoding.Encode</a></dd> <dd><a class="exampleLink" href="#example_Encoding_EncodeToString">Encoding.EncodeToString</a></dd> <dd><a class="exampleLink" href="#example_NewEncoder">NewEncoder</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>base64.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ StdPadding rune = '=' // Standard padding character
+ NoPadding rune = -1 // No padding
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>RawStdEncoding is the standard raw, unpadded base64 encoding, as defined in RFC 4648 section 3.2. This is the same as <a href="#StdEncoding">StdEncoding</a> but omits padding characters. </p>
+<pre data-language="go">var RawStdEncoding = StdEncoding.WithPadding(NoPadding)</pre> <p>RawURLEncoding is the unpadded alternate base64 encoding defined in RFC 4648. It is typically used in URLs and file names. This is the same as <a href="#URLEncoding">URLEncoding</a> but omits padding characters. </p>
+<pre data-language="go">var RawURLEncoding = URLEncoding.WithPadding(NoPadding)</pre> <p>StdEncoding is the standard base64 encoding, as defined in RFC 4648. </p>
+<pre data-language="go">var StdEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")</pre> <p>URLEncoding is the alternate base64 encoding defined in RFC 4648. It is typically used in URLs and file names. </p>
+<pre data-language="go">var URLEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")</pre> <h2 id="NewDecoder">func <span>NewDecoder</span> </h2> <pre data-language="go">func NewDecoder(enc *Encoding, r io.Reader) io.Reader</pre> <p>NewDecoder constructs a new base64 stream decoder. </p>
+<h2 id="NewEncoder">func <span>NewEncoder</span> </h2> <pre data-language="go">func NewEncoder(enc *Encoding, w io.Writer) io.WriteCloser</pre> <p>NewEncoder returns a new base64 stream encoder. Data written to the returned writer will be encoded using enc and then written to w. Base64 encodings operate in 4-byte blocks; when finished writing, the caller must Close the returned encoder to flush any partially written blocks. </p> <h4 id="example_NewEncoder"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">input := []byte("foo\x00bar")
+encoder := base64.NewEncoder(base64.StdEncoding, os.Stdout)
+encoder.Write(input)
+// Must close the encoder when finished to flush any partial blocks.
+// If you comment out the following line, the last partial block "r"
+// won't be encoded.
+encoder.Close()
+</pre> <p>Output:</p> <pre class="output" data-language="go">Zm9vAGJhcg==
+</pre> <h2 id="CorruptInputError">type <span>CorruptInputError</span> </h2> <pre data-language="go">type CorruptInputError int64</pre> <h3 id="CorruptInputError.Error">func (CorruptInputError) <span>Error</span> </h3> <pre data-language="go">func (e CorruptInputError) Error() string</pre> <h2 id="Encoding">type <span>Encoding</span> </h2> <p>An Encoding is a radix 64 encoding/decoding scheme, defined by a 64-character alphabet. The most common encoding is the "base64" encoding defined in RFC 4648 and used in MIME (RFC 2045) and PEM (RFC 1421). RFC 4648 also defines an alternate encoding, which is the standard encoding with - and _ substituted for + and /. </p>
+<pre data-language="go">type Encoding struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewEncoding">func <span>NewEncoding</span> </h3> <pre data-language="go">func NewEncoding(encoder string) *Encoding</pre> <p>NewEncoding returns a new padded Encoding defined by the given alphabet, which must be a 64-byte string that contains unique byte values and does not contain the padding character or CR / LF ('\r', '\n'). The alphabet is treated as a sequence of byte values without any special treatment for multi-byte UTF-8. The resulting Encoding uses the default padding character ('='), which may be changed or disabled via <a href="#Encoding.WithPadding">Encoding.WithPadding</a>. </p>
+<h3 id="Encoding.AppendDecode">func (*Encoding) <span>AppendDecode</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (enc *Encoding) AppendDecode(dst, src []byte) ([]byte, error)</pre> <p>AppendDecode appends the base64 decoded src to dst and returns the extended buffer. If the input is malformed, it returns the partially decoded src and an error. </p>
+<h3 id="Encoding.AppendEncode">func (*Encoding) <span>AppendEncode</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (enc *Encoding) AppendEncode(dst, src []byte) []byte</pre> <p>AppendEncode appends the base64 encoded src to dst and returns the extended buffer. </p>
+<h3 id="Encoding.Decode">func (*Encoding) <span>Decode</span> </h3> <pre data-language="go">func (enc *Encoding) Decode(dst, src []byte) (n int, err error)</pre> <p>Decode decodes src using the encoding enc. It writes at most <a href="#Encoding.DecodedLen">Encoding.DecodedLen</a>(len(src)) bytes to dst and returns the number of bytes written. If src contains invalid base64 data, it will return the number of bytes successfully written and <a href="#CorruptInputError">CorruptInputError</a>. New line characters (\r and \n) are ignored. </p> <h4 id="example_Encoding_Decode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := "SGVsbG8sIHdvcmxkIQ=="
+dst := make([]byte, base64.StdEncoding.DecodedLen(len(str)))
+n, err := base64.StdEncoding.Decode(dst, []byte(str))
+if err != nil {
+ fmt.Println("decode error:", err)
+ return
+}
+dst = dst[:n]
+fmt.Printf("%q\n", dst)
+</pre> <p>Output:</p> <pre class="output" data-language="go">"Hello, world!"
+</pre> <h3 id="Encoding.DecodeString">func (*Encoding) <span>DecodeString</span> </h3> <pre data-language="go">func (enc *Encoding) DecodeString(s string) ([]byte, error)</pre> <p>DecodeString returns the bytes represented by the base64 string s. </p> <h4 id="example_Encoding_DecodeString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := "c29tZSBkYXRhIHdpdGggACBhbmQg77u/"
+data, err := base64.StdEncoding.DecodeString(str)
+if err != nil {
+ fmt.Println("error:", err)
+ return
+}
+fmt.Printf("%q\n", data)
+</pre> <p>Output:</p> <pre class="output" data-language="go">"some data with \x00 and \ufeff"
+</pre> <h3 id="Encoding.DecodedLen">func (*Encoding) <span>DecodedLen</span> </h3> <pre data-language="go">func (enc *Encoding) DecodedLen(n int) int</pre> <p>DecodedLen returns the maximum length in bytes of the decoded data corresponding to n bytes of base64-encoded data. </p>
+<h3 id="Encoding.Encode">func (*Encoding) <span>Encode</span> </h3> <pre data-language="go">func (enc *Encoding) Encode(dst, src []byte)</pre> <p>Encode encodes src using the encoding enc, writing <a href="#Encoding.EncodedLen">Encoding.EncodedLen</a>(len(src)) bytes to dst. </p>
+<p>The encoding pads the output to a multiple of 4 bytes, so Encode is not appropriate for use on individual blocks of a large data stream. Use <a href="#NewEncoder">NewEncoder</a> instead. </p> <h4 id="example_Encoding_Encode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">data := []byte("Hello, world!")
+dst := make([]byte, base64.StdEncoding.EncodedLen(len(data)))
+base64.StdEncoding.Encode(dst, data)
+fmt.Println(string(dst))
+</pre> <p>Output:</p> <pre class="output" data-language="go">SGVsbG8sIHdvcmxkIQ==
+</pre> <h3 id="Encoding.EncodeToString">func (*Encoding) <span>EncodeToString</span> </h3> <pre data-language="go">func (enc *Encoding) EncodeToString(src []byte) string</pre> <p>EncodeToString returns the base64 encoding of src. </p> <h4 id="example_Encoding_EncodeToString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">data := []byte("any + old &amp; data")
+str := base64.StdEncoding.EncodeToString(data)
+fmt.Println(str)
+</pre> <p>Output:</p> <pre class="output" data-language="go">YW55ICsgb2xkICYgZGF0YQ==
+</pre> <h3 id="Encoding.EncodedLen">func (*Encoding) <span>EncodedLen</span> </h3> <pre data-language="go">func (enc *Encoding) EncodedLen(n int) int</pre> <p>EncodedLen returns the length in bytes of the base64 encoding of an input buffer of length n. </p>
+<h3 id="Encoding.Strict">func (Encoding) <span>Strict</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (enc Encoding) Strict() *Encoding</pre> <p>Strict creates a new encoding identical to enc except with strict decoding enabled. In this mode, the decoder requires that trailing padding bits are zero, as described in RFC 4648 section 3.5. </p>
+<p>Note that the input is still malleable, as new line characters (CR and LF) are still ignored. </p>
+<h3 id="Encoding.WithPadding">func (Encoding) <span>WithPadding</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (enc Encoding) WithPadding(padding rune) *Encoding</pre> <p>WithPadding creates a new encoding identical to enc except with a specified padding character, or <a href="#NoPadding">NoPadding</a> to disable padding. The padding character must not be '\r' or '\n', must not be contained in the encoding's alphabet, must not be negative, and must be a rune equal or below '\xff'. Padding characters above '\x7f' are encoded as their exact byte value rather than using the UTF-8 representation of the codepoint. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/base64/" class="_attribution-link">http://golang.org/pkg/encoding/base64/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fbinary%2Findex.html b/devdocs/go/encoding%2Fbinary%2Findex.html
new file mode 100644
index 00000000..d018b748
--- /dev/null
+++ b/devdocs/go/encoding%2Fbinary%2Findex.html
@@ -0,0 +1,217 @@
+<h1> Package binary </h1> <ul id="short-nav">
+<li><code>import "encoding/binary"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package binary implements simple translation between numbers and byte sequences and encoding and decoding of varints. </p>
+<p>Numbers are translated by reading and writing fixed-size values. A fixed-size value is either a fixed-size arithmetic type (bool, int8, uint8, int16, float32, complex64, ...) or an array or struct containing only fixed-size values. </p>
+<p>The varint functions encode and decode single integer values using a variable-length encoding; smaller values require fewer bytes. For a specification, see <a href="https://developers.google.com/protocol-buffers/docs/encoding">https://developers.google.com/protocol-buffers/docs/encoding</a>. </p>
+<p>This package favors simplicity over efficiency. Clients that require high-performance serialization, especially for large data structures, should look at more advanced solutions such as the <span>encoding/gob</span> package or <span>google.golang.org/protobuf</span> for protocol buffers. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#AppendUvarint">func AppendUvarint(buf []byte, x uint64) []byte</a></li>
+<li><a href="#AppendVarint">func AppendVarint(buf []byte, x int64) []byte</a></li>
+<li><a href="#PutUvarint">func PutUvarint(buf []byte, x uint64) int</a></li>
+<li><a href="#PutVarint">func PutVarint(buf []byte, x int64) int</a></li>
+<li><a href="#Read">func Read(r io.Reader, order ByteOrder, data any) error</a></li>
+<li><a href="#ReadUvarint">func ReadUvarint(r io.ByteReader) (uint64, error)</a></li>
+<li><a href="#ReadVarint">func ReadVarint(r io.ByteReader) (int64, error)</a></li>
+<li><a href="#Size">func Size(v any) int</a></li>
+<li><a href="#Uvarint">func Uvarint(buf []byte) (uint64, int)</a></li>
+<li><a href="#Varint">func Varint(buf []byte) (int64, int)</a></li>
+<li><a href="#Write">func Write(w io.Writer, order ByteOrder, data any) error</a></li>
+<li><a href="#AppendByteOrder">type AppendByteOrder</a></li>
+<li><a href="#ByteOrder">type ByteOrder</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_ByteOrder_get">ByteOrder (Get)</a></dd> <dd><a class="exampleLink" href="#example_ByteOrder_put">ByteOrder (Put)</a></dd> <dd><a class="exampleLink" href="#example_PutUvarint">PutUvarint</a></dd> <dd><a class="exampleLink" href="#example_PutVarint">PutVarint</a></dd> <dd><a class="exampleLink" href="#example_Read">Read</a></dd> <dd><a class="exampleLink" href="#example_Read_multi">Read (Multi)</a></dd> <dd><a class="exampleLink" href="#example_Uvarint">Uvarint</a></dd> <dd><a class="exampleLink" href="#example_Varint">Varint</a></dd> <dd><a class="exampleLink" href="#example_Write">Write</a></dd> <dd><a class="exampleLink" href="#example_Write_multi">Write (Multi)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>binary.go</span> <span>native_endian_little.go</span> <span>varint.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>MaxVarintLenN is the maximum length of a varint-encoded N-bit integer. </p>
+<pre data-language="go">const (
+ MaxVarintLen16 = 3
+ MaxVarintLen32 = 5
+ MaxVarintLen64 = 10
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>BigEndian is the big-endian implementation of <a href="#ByteOrder">ByteOrder</a> and <a href="#AppendByteOrder">AppendByteOrder</a>. </p>
+<pre data-language="go">var BigEndian bigEndian</pre> <p>LittleEndian is the little-endian implementation of <a href="#ByteOrder">ByteOrder</a> and <a href="#AppendByteOrder">AppendByteOrder</a>. </p>
+<pre data-language="go">var LittleEndian littleEndian</pre> <p>NativeEndian is the native-endian implementation of <a href="#ByteOrder">ByteOrder</a> and <a href="#AppendByteOrder">AppendByteOrder</a>. </p>
+<pre data-language="go">var NativeEndian nativeEndian</pre> <h2 id="AppendUvarint">func <span>AppendUvarint</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func AppendUvarint(buf []byte, x uint64) []byte</pre> <p>AppendUvarint appends the varint-encoded form of x, as generated by <a href="#PutUvarint">PutUvarint</a>, to buf and returns the extended buffer. </p>
+<h2 id="AppendVarint">func <span>AppendVarint</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func AppendVarint(buf []byte, x int64) []byte</pre> <p>AppendVarint appends the varint-encoded form of x, as generated by <a href="#PutVarint">PutVarint</a>, to buf and returns the extended buffer. </p>
+<h2 id="PutUvarint">func <span>PutUvarint</span> </h2> <pre data-language="go">func PutUvarint(buf []byte, x uint64) int</pre> <p>PutUvarint encodes a uint64 into buf and returns the number of bytes written. If the buffer is too small, PutUvarint will panic. </p> <h4 id="example_PutUvarint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf := make([]byte, binary.MaxVarintLen64)
+
+for _, x := range []uint64{1, 2, 127, 128, 255, 256} {
+ n := binary.PutUvarint(buf, x)
+ fmt.Printf("%x\n", buf[:n])
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">01
+02
+7f
+8001
+ff01
+8002
+</pre> <h2 id="PutVarint">func <span>PutVarint</span> </h2> <pre data-language="go">func PutVarint(buf []byte, x int64) int</pre> <p>PutVarint encodes an int64 into buf and returns the number of bytes written. If the buffer is too small, PutVarint will panic. </p> <h4 id="example_PutVarint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf := make([]byte, binary.MaxVarintLen64)
+
+for _, x := range []int64{-65, -64, -2, -1, 0, 1, 2, 63, 64} {
+ n := binary.PutVarint(buf, x)
+ fmt.Printf("%x\n", buf[:n])
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">8101
+7f
+03
+01
+00
+02
+04
+7e
+8001
+</pre> <h2 id="Read">func <span>Read</span> </h2> <pre data-language="go">func Read(r io.Reader, order ByteOrder, data any) error</pre> <p>Read reads structured binary data from r into data. Data must be a pointer to a fixed-size value or a slice of fixed-size values. Bytes read from r are decoded using the specified byte order and written to successive fields of the data. When decoding boolean values, a zero byte is decoded as false, and any other non-zero byte is decoded as true. When reading into structs, the field data for fields with blank (_) field names is skipped; i.e., blank field names may be used for padding. When reading into a struct, all non-blank fields must be exported or Read may panic. </p>
+<p>The error is <span>io.EOF</span> only if no bytes were read. If an <span>io.EOF</span> happens after reading some but not all the bytes, Read returns <span>io.ErrUnexpectedEOF</span>. </p> <h4 id="example_Read"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var pi float64
+b := []byte{0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40}
+buf := bytes.NewReader(b)
+err := binary.Read(buf, binary.LittleEndian, &amp;pi)
+if err != nil {
+ fmt.Println("binary.Read failed:", err)
+}
+fmt.Print(pi)
+</pre> <p>Output:</p> <pre class="output" data-language="go">3.141592653589793
+</pre> <h4 id="example_Read_multi"> <span class="text">Example (Multi)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte{0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40, 0xff, 0x01, 0x02, 0x03, 0xbe, 0xef}
+r := bytes.NewReader(b)
+
+var data struct {
+ PI float64
+ Uate uint8
+ Mine [3]byte
+ Too uint16
+}
+
+if err := binary.Read(r, binary.LittleEndian, &amp;data); err != nil {
+ fmt.Println("binary.Read failed:", err)
+}
+
+fmt.Println(data.PI)
+fmt.Println(data.Uate)
+fmt.Printf("% x\n", data.Mine)
+fmt.Println(data.Too)
+</pre> <p>Output:</p> <pre class="output" data-language="go">3.141592653589793
+255
+01 02 03
+61374
+</pre> <h2 id="ReadUvarint">func <span>ReadUvarint</span> </h2> <pre data-language="go">func ReadUvarint(r io.ByteReader) (uint64, error)</pre> <p>ReadUvarint reads an encoded unsigned integer from r and returns it as a uint64. The error is <span>io.EOF</span> only if no bytes were read. If an <span>io.EOF</span> happens after reading some but not all the bytes, ReadUvarint returns <span>io.ErrUnexpectedEOF</span>. </p>
+<h2 id="ReadVarint">func <span>ReadVarint</span> </h2> <pre data-language="go">func ReadVarint(r io.ByteReader) (int64, error)</pre> <p>ReadVarint reads an encoded signed integer from r and returns it as an int64. The error is <span>io.EOF</span> only if no bytes were read. If an <span>io.EOF</span> happens after reading some but not all the bytes, ReadVarint returns <span>io.ErrUnexpectedEOF</span>. </p>
+<h2 id="Size">func <span>Size</span> </h2> <pre data-language="go">func Size(v any) int</pre> <p>Size returns how many bytes <a href="#Write">Write</a> would generate to encode the value v, which must be a fixed-size value or a slice of fixed-size values, or a pointer to such data. If v is neither of these, Size returns -1. </p>
+<h2 id="Uvarint">func <span>Uvarint</span> </h2> <pre data-language="go">func Uvarint(buf []byte) (uint64, int)</pre> <p>Uvarint decodes a uint64 from buf and returns that value and the number of bytes read (&gt; 0). If an error occurred, the value is 0 and the number of bytes n is &lt;= 0 meaning: </p>
+<pre data-language="go">n == 0: buf too small
+n &lt; 0: value larger than 64 bits (overflow)
+ and -n is the number of bytes read
+</pre> <h4 id="example_Uvarint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">inputs := [][]byte{
+ {0x01},
+ {0x02},
+ {0x7f},
+ {0x80, 0x01},
+ {0xff, 0x01},
+ {0x80, 0x02},
+}
+for _, b := range inputs {
+ x, n := binary.Uvarint(b)
+ if n != len(b) {
+ fmt.Println("Uvarint did not consume all of in")
+ }
+ fmt.Println(x)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">1
+2
+127
+128
+255
+256
+</pre> <h2 id="Varint">func <span>Varint</span> </h2> <pre data-language="go">func Varint(buf []byte) (int64, int)</pre> <p>Varint decodes an int64 from buf and returns that value and the number of bytes read (&gt; 0). If an error occurred, the value is 0 and the number of bytes n is &lt;= 0 with the following meaning: </p>
+<pre data-language="go">n == 0: buf too small
+n &lt; 0: value larger than 64 bits (overflow)
+ and -n is the number of bytes read
+</pre> <h4 id="example_Varint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">inputs := [][]byte{
+ {0x81, 0x01},
+ {0x7f},
+ {0x03},
+ {0x01},
+ {0x00},
+ {0x02},
+ {0x04},
+ {0x7e},
+ {0x80, 0x01},
+}
+for _, b := range inputs {
+ x, n := binary.Varint(b)
+ if n != len(b) {
+ fmt.Println("Varint did not consume all of in")
+ }
+ fmt.Println(x)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">-65
+-64
+-2
+-1
+0
+1
+2
+63
+64
+</pre> <h2 id="Write">func <span>Write</span> </h2> <pre data-language="go">func Write(w io.Writer, order ByteOrder, data any) error</pre> <p>Write writes the binary representation of data into w. Data must be a fixed-size value or a slice of fixed-size values, or a pointer to such data. Boolean values encode as one byte: 1 for true, and 0 for false. Bytes written to w are encoded using the specified byte order and read from successive fields of the data. When writing structs, zero values are written for fields with blank (_) field names. </p> <h4 id="example_Write"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf := new(bytes.Buffer)
+var pi float64 = math.Pi
+err := binary.Write(buf, binary.LittleEndian, pi)
+if err != nil {
+ fmt.Println("binary.Write failed:", err)
+}
+fmt.Printf("% x", buf.Bytes())
+</pre> <p>Output:</p> <pre class="output" data-language="go">18 2d 44 54 fb 21 09 40
+</pre> <h4 id="example_Write_multi"> <span class="text">Example (Multi)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf := new(bytes.Buffer)
+var data = []any{
+ uint16(61374),
+ int8(-54),
+ uint8(254),
+}
+for _, v := range data {
+ err := binary.Write(buf, binary.LittleEndian, v)
+ if err != nil {
+ fmt.Println("binary.Write failed:", err)
+ }
+}
+fmt.Printf("%x", buf.Bytes())
+</pre> <p>Output:</p> <pre class="output" data-language="go">beefcafe
+</pre> <h2 id="AppendByteOrder">type <span>AppendByteOrder</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>AppendByteOrder specifies how to append 16-, 32-, or 64-bit unsigned integers into a byte slice. </p>
+<p>It is implemented by <a href="#LittleEndian">LittleEndian</a>, <a href="#BigEndian">BigEndian</a>, and <a href="#NativeEndian">NativeEndian</a>. </p>
+<pre data-language="go">type AppendByteOrder interface {
+ AppendUint16([]byte, uint16) []byte
+ AppendUint32([]byte, uint32) []byte
+ AppendUint64([]byte, uint64) []byte
+ String() string
+}</pre> <h2 id="ByteOrder">type <span>ByteOrder</span> </h2> <p>A ByteOrder specifies how to convert byte slices into 16-, 32-, or 64-bit unsigned integers. </p>
+<p>It is implemented by <a href="#LittleEndian">LittleEndian</a>, <a href="#BigEndian">BigEndian</a>, and <a href="#NativeEndian">NativeEndian</a>. </p>
+<pre data-language="go">type ByteOrder interface {
+ Uint16([]byte) uint16
+ Uint32([]byte) uint32
+ Uint64([]byte) uint64
+ PutUint16([]byte, uint16)
+ PutUint32([]byte, uint32)
+ PutUint64([]byte, uint64)
+ String() string
+}</pre> <h4 id="example_ByteOrder_get"> <span class="text">Example (Get)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte{0xe8, 0x03, 0xd0, 0x07}
+x1 := binary.LittleEndian.Uint16(b[0:])
+x2 := binary.LittleEndian.Uint16(b[2:])
+fmt.Printf("%#04x %#04x\n", x1, x2)
+</pre> <p>Output:</p> <pre class="output" data-language="go">0x03e8 0x07d0
+</pre> <h4 id="example_ByteOrder_put"> <span class="text">Example (Put)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := make([]byte, 4)
+binary.LittleEndian.PutUint16(b[0:], 0x03e8)
+binary.LittleEndian.PutUint16(b[2:], 0x07d0)
+fmt.Printf("% x\n", b)
+</pre> <p>Output:</p> <pre class="output" data-language="go">e8 03 d0 07
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/binary/" class="_attribution-link">http://golang.org/pkg/encoding/binary/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fcsv%2Findex.html b/devdocs/go/encoding%2Fcsv%2Findex.html
new file mode 100644
index 00000000..ce4b7e36
--- /dev/null
+++ b/devdocs/go/encoding%2Fcsv%2Findex.html
@@ -0,0 +1,239 @@
+<h1> Package csv </h1> <ul id="short-nav">
+<li><code>import "encoding/csv"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package csv reads and writes comma-separated values (CSV) files. There are many kinds of CSV files; this package supports the format described in RFC 4180. </p>
+<p>A csv file contains zero or more records of one or more fields per record. Each record is separated by the newline character. The final record may optionally be followed by a newline character. </p>
+<pre data-language="go">field1,field2,field3
+</pre> <p>White space is considered part of a field. </p>
+<p>Carriage returns before newline characters are silently removed. </p>
+<p>Blank lines are ignored. A line with only whitespace characters (excluding the ending newline character) is not considered a blank line. </p>
+<p>Fields which start and stop with the quote character " are called quoted-fields. The beginning and ending quote are not part of the field. </p>
+<p>The source: </p>
+<pre data-language="go">normal string,"quoted-field"
+</pre> <p>results in the fields </p>
+<pre data-language="go">{`normal string`, `quoted-field`}
+</pre> <p>Within a quoted-field a quote character followed by a second quote character is considered a single quote. </p>
+<pre data-language="go">"the ""word"" is true","a ""quoted-field"""
+</pre> <p>results in </p>
+<pre data-language="go">{`the "word" is true`, `a "quoted-field"`}
+</pre> <p>Newlines and commas may be included in a quoted-field </p>
+<pre data-language="go">"Multi-line
+field","comma is ,"
+</pre> <p>results in </p>
+<pre data-language="go">{`Multi-line
+field`, `comma is ,`}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#ParseError">type ParseError</a></li>
+<li> <a href="#ParseError.Error">func (e *ParseError) Error() string</a>
+</li>
+<li> <a href="#ParseError.Unwrap">func (e *ParseError) Unwrap() error</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(r io.Reader) *Reader</a>
+</li>
+<li> <a href="#Reader.FieldPos">func (r *Reader) FieldPos(field int) (line, column int)</a>
+</li>
+<li> <a href="#Reader.InputOffset">func (r *Reader) InputOffset() int64</a>
+</li>
+<li> <a href="#Reader.Read">func (r *Reader) Read() (record []string, err error)</a>
+</li>
+<li> <a href="#Reader.ReadAll">func (r *Reader) ReadAll() (records [][]string, err error)</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w io.Writer) *Writer</a>
+</li>
+<li> <a href="#Writer.Error">func (w *Writer) Error() error</a>
+</li>
+<li> <a href="#Writer.Flush">func (w *Writer) Flush()</a>
+</li>
+<li> <a href="#Writer.Write">func (w *Writer) Write(record []string) error</a>
+</li>
+<li> <a href="#Writer.WriteAll">func (w *Writer) WriteAll(records [][]string) error</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Reader">Reader</a></dd> <dd><a class="exampleLink" href="#example_Reader_ReadAll">Reader.ReadAll</a></dd> <dd><a class="exampleLink" href="#example_Reader_options">Reader (Options)</a></dd> <dd><a class="exampleLink" href="#example_Writer">Writer</a></dd> <dd><a class="exampleLink" href="#example_Writer_WriteAll">Writer.WriteAll</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>reader.go</span> <span>writer.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>These are the errors that can be returned in [ParseError.Err]. </p>
+<pre data-language="go">var (
+ ErrBareQuote = errors.New("bare \" in non-quoted-field")
+ ErrQuote = errors.New("extraneous or missing \" in quoted-field")
+ ErrFieldCount = errors.New("wrong number of fields")
+
+ // Deprecated: ErrTrailingComma is no longer used.
+ ErrTrailingComma = errors.New("extra delimiter at end of line")
+)</pre> <h2 id="ParseError">type <span>ParseError</span> </h2> <p>A ParseError is returned for parsing errors. Line and column numbers are 1-indexed. </p>
+<pre data-language="go">type ParseError struct {
+ StartLine int // Line where the record starts; added in Go 1.10
+ Line int // Line where the error occurred
+ Column int // Column (1-based byte index) where the error occurred
+ Err error // The actual error
+}
+</pre> <h3 id="ParseError.Error">func (*ParseError) <span>Error</span> </h3> <pre data-language="go">func (e *ParseError) Error() string</pre> <h3 id="ParseError.Unwrap">func (*ParseError) <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e *ParseError) Unwrap() error</pre> <h2 id="Reader">type <span>Reader</span> </h2> <p>A Reader reads records from a CSV-encoded file. </p>
+<p>As returned by <a href="#NewReader">NewReader</a>, a Reader expects input conforming to RFC 4180. The exported fields can be changed to customize the details before the first call to <a href="#Reader.Read">Reader.Read</a> or <a href="#Reader.ReadAll">Reader.ReadAll</a>. </p>
+<p>The Reader converts all \r\n sequences in its input to plain \n, including in multiline field values, so that the returned data does not depend on which line-ending convention an input file uses. </p>
+<pre data-language="go">type Reader struct {
+ // Comma is the field delimiter.
+ // It is set to comma (',') by NewReader.
+ // Comma must be a valid rune and must not be \r, \n,
+ // or the Unicode replacement character (0xFFFD).
+ Comma rune
+
+ // Comment, if not 0, is the comment character. Lines beginning with the
+ // Comment character without preceding whitespace are ignored.
+ // With leading whitespace the Comment character becomes part of the
+ // field, even if TrimLeadingSpace is true.
+ // Comment must be a valid rune and must not be \r, \n,
+ // or the Unicode replacement character (0xFFFD).
+ // It must also not be equal to Comma.
+ Comment rune
+
+ // FieldsPerRecord is the number of expected fields per record.
+ // If FieldsPerRecord is positive, Read requires each record to
+ // have the given number of fields. If FieldsPerRecord is 0, Read sets it to
+ // the number of fields in the first record, so that future records must
+ // have the same field count. If FieldsPerRecord is negative, no check is
+ // made and records may have a variable number of fields.
+ FieldsPerRecord int
+
+ // If LazyQuotes is true, a quote may appear in an unquoted field and a
+ // non-doubled quote may appear in a quoted field.
+ LazyQuotes bool
+
+ // If TrimLeadingSpace is true, leading white space in a field is ignored.
+ // This is done even if the field delimiter, Comma, is white space.
+ TrimLeadingSpace bool
+
+ // ReuseRecord controls whether calls to Read may return a slice sharing
+ // the backing array of the previous call's returned slice for performance.
+ // By default, each call to Read returns newly allocated memory owned by the caller.
+ ReuseRecord bool // Go 1.9
+
+ // Deprecated: TrailingComma is no longer used.
+ TrailingComma bool
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Reader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">in := `first_name,last_name,username
+"Rob","Pike",rob
+Ken,Thompson,ken
+"Robert","Griesemer","gri"
+`
+r := csv.NewReader(strings.NewReader(in))
+
+for {
+ record, err := r.Read()
+ if err == io.EOF {
+ break
+ }
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ fmt.Println(record)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">[first_name last_name username]
+[Rob Pike rob]
+[Ken Thompson ken]
+[Robert Griesemer gri]
+</pre> <h4 id="example_Reader_options"> <span class="text">Example (Options)</span>
+</h4> <p>This example shows how csv.Reader can be configured to handle other types of CSV files. </p> <p>Code:</p> <pre class="code" data-language="go">in := `first_name;last_name;username
+"Rob";"Pike";rob
+# lines beginning with a # character are ignored
+Ken;Thompson;ken
+"Robert";"Griesemer";"gri"
+`
+r := csv.NewReader(strings.NewReader(in))
+r.Comma = ';'
+r.Comment = '#'
+
+records, err := r.ReadAll()
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Print(records)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[[first_name last_name username] [Rob Pike rob] [Ken Thompson ken] [Robert Griesemer gri]]
+</pre> <h3 id="NewReader">func <span>NewReader</span> </h3> <pre data-language="go">func NewReader(r io.Reader) *Reader</pre> <p>NewReader returns a new Reader that reads from r. </p>
+<h3 id="Reader.FieldPos">func (*Reader) <span>FieldPos</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (r *Reader) FieldPos(field int) (line, column int)</pre> <p>FieldPos returns the line and column corresponding to the start of the field with the given index in the slice most recently returned by <a href="#Reader.Read">Reader.Read</a>. Numbering of lines and columns starts at 1; columns are counted in bytes, not runes. </p>
+<p>If this is called with an out-of-bounds index, it panics. </p>
+<h3 id="Reader.InputOffset">func (*Reader) <span>InputOffset</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (r *Reader) InputOffset() int64</pre> <p>InputOffset returns the input stream byte offset of the current reader position. The offset gives the location of the end of the most recently read row and the beginning of the next row. </p>
+<h3 id="Reader.Read">func (*Reader) <span>Read</span> </h3> <pre data-language="go">func (r *Reader) Read() (record []string, err error)</pre> <p>Read reads one record (a slice of fields) from r. If the record has an unexpected number of fields, Read returns the record along with the error <a href="#ErrFieldCount">ErrFieldCount</a>. If the record contains a field that cannot be parsed, Read returns a partial record along with the parse error. The partial record contains all fields read before the error. If there is no data left to be read, Read returns nil, <span>io.EOF</span>. If [Reader.ReuseRecord] is true, the returned slice may be shared between multiple calls to Read. </p>
+<h3 id="Reader.ReadAll">func (*Reader) <span>ReadAll</span> </h3> <pre data-language="go">func (r *Reader) ReadAll() (records [][]string, err error)</pre> <p>ReadAll reads all the remaining records from r. Each record is a slice of fields. A successful call returns err == nil, not err == <span>io.EOF</span>. Because ReadAll is defined to read until EOF, it does not treat end of file as an error to be reported. </p> <h4 id="example_Reader_ReadAll"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">in := `first_name,last_name,username
+"Rob","Pike",rob
+Ken,Thompson,ken
+"Robert","Griesemer","gri"
+`
+r := csv.NewReader(strings.NewReader(in))
+
+records, err := r.ReadAll()
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Print(records)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[[first_name last_name username] [Rob Pike rob] [Ken Thompson ken] [Robert Griesemer gri]]
+</pre> <h2 id="Writer">type <span>Writer</span> </h2> <p>A Writer writes records using CSV encoding. </p>
+<p>As returned by <a href="#NewWriter">NewWriter</a>, a Writer writes records terminated by a newline and uses ',' as the field delimiter. The exported fields can be changed to customize the details before the first call to <a href="#Writer.Write">Writer.Write</a> or <a href="#Writer.WriteAll">Writer.WriteAll</a>. </p>
+<p>[Writer.Comma] is the field delimiter. </p>
+<p>If [Writer.UseCRLF] is true, the Writer ends each output line with \r\n instead of \n. </p>
+<p>The writes of individual records are buffered. After all data has been written, the client should call the <a href="#Writer.Flush">Writer.Flush</a> method to guarantee all data has been forwarded to the underlying <span>io.Writer</span>. Any errors that occurred should be checked by calling the <a href="#Writer.Error">Writer.Error</a> method. </p>
+<pre data-language="go">type Writer struct {
+ Comma rune // Field delimiter (set to ',' by NewWriter)
+ UseCRLF bool // True to use \r\n as the line terminator
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Writer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">records := [][]string{
+ {"first_name", "last_name", "username"},
+ {"Rob", "Pike", "rob"},
+ {"Ken", "Thompson", "ken"},
+ {"Robert", "Griesemer", "gri"},
+}
+
+w := csv.NewWriter(os.Stdout)
+
+for _, record := range records {
+ if err := w.Write(record); err != nil {
+ log.Fatalln("error writing record to csv:", err)
+ }
+}
+
+// Write any buffered data to the underlying writer (standard output).
+w.Flush()
+
+if err := w.Error(); err != nil {
+ log.Fatal(err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">first_name,last_name,username
+Rob,Pike,rob
+Ken,Thompson,ken
+Robert,Griesemer,gri
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(w io.Writer) *Writer</pre> <p>NewWriter returns a new Writer that writes to w. </p>
+<h3 id="Writer.Error">func (*Writer) <span>Error</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (w *Writer) Error() error</pre> <p>Error reports any error that has occurred during a previous <a href="#Writer.Write">Writer.Write</a> or <a href="#Writer.Flush">Writer.Flush</a>. </p>
+<h3 id="Writer.Flush">func (*Writer) <span>Flush</span> </h3> <pre data-language="go">func (w *Writer) Flush()</pre> <p>Flush writes any buffered data to the underlying <span>io.Writer</span>. To check if an error occurred during Flush, call <a href="#Writer.Error">Writer.Error</a>. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> </h3> <pre data-language="go">func (w *Writer) Write(record []string) error</pre> <p>Write writes a single CSV record to w along with any necessary quoting. A record is a slice of strings with each string being one field. Writes are buffered, so <a href="#Writer.Flush">Writer.Flush</a> must eventually be called to ensure that the record is written to the underlying <span>io.Writer</span>. </p>
+<h3 id="Writer.WriteAll">func (*Writer) <span>WriteAll</span> </h3> <pre data-language="go">func (w *Writer) WriteAll(records [][]string) error</pre> <p>WriteAll writes multiple CSV records to w using <a href="#Writer.Write">Writer.Write</a> and then calls <a href="#Writer.Flush">Writer.Flush</a>, returning any error from the Flush. </p> <h4 id="example_Writer_WriteAll"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">records := [][]string{
+ {"first_name", "last_name", "username"},
+ {"Rob", "Pike", "rob"},
+ {"Ken", "Thompson", "ken"},
+ {"Robert", "Griesemer", "gri"},
+}
+
+w := csv.NewWriter(os.Stdout)
+w.WriteAll(records) // calls Flush internally
+
+if err := w.Error(); err != nil {
+ log.Fatalln("error writing csv:", err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">first_name,last_name,username
+Rob,Pike,rob
+Ken,Thompson,ken
+Robert,Griesemer,gri
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/csv/" class="_attribution-link">http://golang.org/pkg/encoding/csv/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fgob%2Findex.html b/devdocs/go/encoding%2Fgob%2Findex.html
new file mode 100644
index 00000000..867a1b6c
--- /dev/null
+++ b/devdocs/go/encoding%2Fgob%2Findex.html
@@ -0,0 +1,374 @@
+<h1> Package gob </h1> <ul id="short-nav">
+<li><code>import "encoding/gob"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package gob manages streams of gobs - binary values exchanged between an <a href="#Encoder">Encoder</a> (transmitter) and a <a href="#Decoder">Decoder</a> (receiver). A typical use is transporting arguments and results of remote procedure calls (RPCs) such as those provided by <span>net/rpc</span>. </p>
+<p>The implementation compiles a custom codec for each data type in the stream and is most efficient when a single <a href="#Encoder">Encoder</a> is used to transmit a stream of values, amortizing the cost of compilation. </p>
+<h3 id="hdr-Basics">Basics</h3> <p>A stream of gobs is self-describing. Each data item in the stream is preceded by a specification of its type, expressed in terms of a small set of predefined types. Pointers are not transmitted, but the things they point to are transmitted; that is, the values are flattened. Nil pointers are not permitted, as they have no value. Recursive types work fine, but recursive values (data with cycles) are problematic. This may change. </p>
+<p>To use gobs, create an <a href="#Encoder">Encoder</a> and present it with a series of data items as values or addresses that can be dereferenced to values. The <a href="#Encoder">Encoder</a> makes sure all type information is sent before it is needed. At the receive side, a <a href="#Decoder">Decoder</a> retrieves values from the encoded stream and unpacks them into local variables. </p>
+<h3 id="hdr-Types_and_Values">Types and Values</h3> <p>The source and destination values/types need not correspond exactly. For structs, fields (identified by name) that are in the source but absent from the receiving variable will be ignored. Fields that are in the receiving variable but missing from the transmitted type or value will be ignored in the destination. If a field with the same name is present in both, their types must be compatible. Both the receiver and transmitter will do all necessary indirection and dereferencing to convert between gobs and actual Go values. For instance, a gob type that is schematically, </p>
+<pre data-language="go">struct { A, B int }
+</pre> <p>can be sent from or received into any of these Go types: </p>
+<pre data-language="go">struct { A, B int } // the same
+*struct { A, B int } // extra indirection of the struct
+struct { *A, **B int } // extra indirection of the fields
+struct { A, B int64 } // different concrete value type; see below
+</pre> <p>It may also be received into any of these: </p>
+<pre data-language="go">struct { A, B int } // the same
+struct { B, A int } // ordering doesn't matter; matching is by name
+struct { A, B, C int } // extra field (C) ignored
+struct { B int } // missing field (A) ignored; data will be dropped
+struct { B, C int } // missing field (A) ignored; extra field (C) ignored.
+</pre> <p>Attempting to receive into these types will draw a decode error: </p>
+<pre data-language="go">struct { A int; B uint } // change of signedness for B
+struct { A int; B float } // change of type for B
+struct { } // no field names in common
+struct { C, D int } // no field names in common
+</pre> <p>Integers are transmitted two ways: arbitrary precision signed integers or arbitrary precision unsigned integers. There is no int8, int16 etc. discrimination in the gob format; there are only signed and unsigned integers. As described below, the transmitter sends the value in a variable-length encoding; the receiver accepts the value and stores it in the destination variable. Floating-point numbers are always sent using IEEE-754 64-bit precision (see below). </p>
+<p>Signed integers may be received into any signed integer variable: int, int16, etc.; unsigned integers may be received into any unsigned integer variable; and floating point values may be received into any floating point variable. However, the destination variable must be able to represent the value or the decode operation will fail. </p>
+<p>Structs, arrays and slices are also supported. Structs encode and decode only exported fields. Strings and arrays of bytes are supported with a special, efficient representation (see below). When a slice is decoded, if the existing slice has capacity the slice will be extended in place; if not, a new array is allocated. Regardless, the length of the resulting slice reports the number of elements decoded. </p>
+<p>In general, if allocation is required, the decoder will allocate memory. If not, it will update the destination variables with values read from the stream. It does not initialize them first, so if the destination is a compound value such as a map, struct, or slice, the decoded values will be merged elementwise into the existing variables. </p>
+<p>Functions and channels will not be sent in a gob. Attempting to encode such a value at the top level will fail. A struct field of chan or func type is treated exactly like an unexported field and is ignored. </p>
+<p>Gob can encode a value of any type implementing the <a href="#GobEncoder">GobEncoder</a> or <span>encoding.BinaryMarshaler</span> interfaces by calling the corresponding method, in that order of preference. </p>
+<p>Gob can decode a value of any type implementing the <a href="#GobDecoder">GobDecoder</a> or <span>encoding.BinaryUnmarshaler</span> interfaces by calling the corresponding method, again in that order of preference. </p>
+<h3 id="hdr-Encoding_Details">Encoding Details</h3> <p>This section documents the encoding, details that are not important for most users. Details are presented bottom-up. </p>
+<p>An unsigned integer is sent one of two ways. If it is less than 128, it is sent as a byte with that value. Otherwise it is sent as a minimal-length big-endian (high byte first) byte stream holding the value, preceded by one byte holding the byte count, negated. Thus 0 is transmitted as (00), 7 is transmitted as (07) and 256 is transmitted as (FE 01 00). </p>
+<p>A boolean is encoded within an unsigned integer: 0 for false, 1 for true. </p>
+<p>A signed integer, i, is encoded within an unsigned integer, u. Within u, bits 1 upward contain the value; bit 0 says whether they should be complemented upon receipt. The encode algorithm looks like this: </p>
+<pre data-language="go">var u uint
+if i &lt; 0 {
+ u = (^uint(i) &lt;&lt; 1) | 1 // complement i, bit 0 is 1
+} else {
+ u = (uint(i) &lt;&lt; 1) // do not complement i, bit 0 is 0
+}
+encodeUnsigned(u)
+</pre> <p>The low bit is therefore analogous to a sign bit, but making it the complement bit instead guarantees that the largest negative integer is not a special case. For example, -129=^128=(^256&gt;&gt;1) encodes as (FE 01 01). </p>
+<p>Floating-point numbers are always sent as a representation of a float64 value. That value is converted to a uint64 using <span>math.Float64bits</span>. The uint64 is then byte-reversed and sent as a regular unsigned integer. The byte-reversal means the exponent and high-precision part of the mantissa go first. Since the low bits are often zero, this can save encoding bytes. For instance, 17.0 is encoded in only three bytes (FE 31 40). </p>
+<p>Strings and slices of bytes are sent as an unsigned count followed by that many uninterpreted bytes of the value. </p>
+<p>All other slices and arrays are sent as an unsigned count followed by that many elements using the standard gob encoding for their type, recursively. </p>
+<p>Maps are sent as an unsigned count followed by that many key, element pairs. Empty but non-nil maps are sent, so if the receiver has not allocated one already, one will always be allocated on receipt unless the transmitted map is nil and not at the top level. </p>
+<p>In slices and arrays, as well as maps, all elements, even zero-valued elements, are transmitted, even if all the elements are zero. </p>
+<p>Structs are sent as a sequence of (field number, field value) pairs. The field value is sent using the standard gob encoding for its type, recursively. If a field has the zero value for its type (except for arrays; see above), it is omitted from the transmission. The field number is defined by the type of the encoded struct: the first field of the encoded type is field 0, the second is field 1, etc. When encoding a value, the field numbers are delta encoded for efficiency and the fields are always sent in order of increasing field number; the deltas are therefore unsigned. The initialization for the delta encoding sets the field number to -1, so an unsigned integer field 0 with value 7 is transmitted as unsigned delta = 1, unsigned value = 7 or (01 07). Finally, after all the fields have been sent a terminating mark denotes the end of the struct. That mark is a delta=0 value, which has representation (00). </p>
+<p>Interface types are not checked for compatibility; all interface types are treated, for transmission, as members of a single "interface" type, analogous to int or []byte - in effect they're all treated as interface{}. Interface values are transmitted as a string identifying the concrete type being sent (a name that must be pre-defined by calling <a href="#Register">Register</a>), followed by a byte count of the length of the following data (so the value can be skipped if it cannot be stored), followed by the usual encoding of concrete (dynamic) value stored in the interface value. (A nil interface value is identified by the empty string and transmits no value.) Upon receipt, the decoder verifies that the unpacked concrete item satisfies the interface of the receiving variable. </p>
+<p>If a value is passed to <a href="#Encoder.Encode">Encoder.Encode</a> and the type is not a struct (or pointer to struct, etc.), for simplicity of processing it is represented as a struct of one field. The only visible effect of this is to encode a zero byte after the value, just as after the last field of an encoded struct, so that the decode algorithm knows when the top-level value is complete. </p>
+<p>The representation of types is described below. When a type is defined on a given connection between an <a href="#Encoder">Encoder</a> and <a href="#Decoder">Decoder</a>, it is assigned a signed integer type id. When <a href="#Encoder.Encode">Encoder.Encode</a>(v) is called, it makes sure there is an id assigned for the type of v and all its elements and then it sends the pair (typeid, encoded-v) where typeid is the type id of the encoded type of v and encoded-v is the gob encoding of the value v. </p>
+<p>To define a type, the encoder chooses an unused, positive type id and sends the pair (-type id, encoded-type) where encoded-type is the gob encoding of a wireType description, constructed from these types: </p>
+<pre data-language="go">type wireType struct {
+ ArrayT *ArrayType
+ SliceT *SliceType
+ StructT *StructType
+ MapT *MapType
+ GobEncoderT *gobEncoderType
+ BinaryMarshalerT *gobEncoderType
+ TextMarshalerT *gobEncoderType
+
+}
+type arrayType struct {
+ CommonType
+ Elem typeId
+ Len int
+}
+type CommonType struct {
+ Name string // the name of the struct type
+ Id int // the id of the type, repeated so it's inside the type
+}
+type sliceType struct {
+ CommonType
+ Elem typeId
+}
+type structType struct {
+ CommonType
+ Field []*fieldType // the fields of the struct.
+}
+type fieldType struct {
+ Name string // the name of the field.
+ Id int // the type id of the field, which must be already defined
+}
+type mapType struct {
+ CommonType
+ Key typeId
+ Elem typeId
+}
+type gobEncoderType struct {
+ CommonType
+}
+</pre> <p>If there are nested type ids, the types for all inner type ids must be defined before the top-level type id is used to describe an encoded-v. </p>
+<p>For simplicity in setup, the connection is defined to understand these types a priori, as well as the basic gob types int, uint, etc. Their ids are: </p>
+<pre data-language="go">bool 1
+int 2
+uint 3
+float 4
+[]byte 5
+string 6
+complex 7
+interface 8
+// gap for reserved ids.
+WireType 16
+ArrayType 17
+CommonType 18
+SliceType 19
+StructType 20
+FieldType 21
+// 22 is slice of fieldType.
+MapType 23
+</pre> <p>Finally, each message created by a call to Encode is preceded by an encoded unsigned integer count of the number of bytes remaining in the message. After the initial type name, interface values are wrapped the same way; in effect, the interface value acts like a recursive invocation of Encode. </p>
+<p>In summary, a gob stream looks like </p>
+<pre data-language="go">(byteCount (-type id, encoding of a wireType)* (type id, encoding of a value))*
+</pre> <p>where * signifies zero or more repetitions and the type id of a value must be predefined or be defined before the value in the stream. </p>
+<p>Compatibility: Any future changes to the package will endeavor to maintain compatibility with streams encoded using previous versions. That is, any released version of this package should be able to decode data written with any previously released version, subject to issues such as security fixes. See the Go compatibility document for background: <a href="https://golang.org/doc/go1compat">https://golang.org/doc/go1compat</a> </p>
+<p>See "Gobs of data" for a design discussion of the gob wire format: <a href="https://blog.golang.org/gobs-of-data">https://blog.golang.org/gobs-of-data</a> </p>
+<h3 id="hdr-Security">Security</h3> <p>This package is not designed to be hardened against adversarial inputs, and is outside the scope of <a href="https://go.dev/security/policy">https://go.dev/security/policy</a>. In particular, the <a href="#Decoder">Decoder</a> does only basic sanity checking on decoded input sizes, and its limits are not configurable. Care should be taken when decoding gob data from untrusted sources, which may consume significant resources. </p> <h4 id="example__basic"> <span class="text">Example (Basic)</span>
+</h4> <p>This example shows the basic usage of the package: Create an encoder, transmit some values, receive them with a decoder. </p> <p>Code:</p> <pre class="code" data-language="go">package gob_test
+
+import (
+ "bytes"
+ "encoding/gob"
+ "fmt"
+ "log"
+)
+
+type P struct {
+ X, Y, Z int
+ Name string
+}
+
+type Q struct {
+ X, Y *int32
+ Name string
+}
+
+// This example shows the basic usage of the package: Create an encoder,
+// transmit some values, receive them with a decoder.
+func Example_basic() {
+ // Initialize the encoder and decoder. Normally enc and dec would be
+ // bound to network connections and the encoder and decoder would
+ // run in different processes.
+ var network bytes.Buffer // Stand-in for a network connection
+ enc := gob.NewEncoder(&amp;network) // Will write to network.
+ dec := gob.NewDecoder(&amp;network) // Will read from network.
+
+ // Encode (send) some values.
+ err := enc.Encode(P{3, 4, 5, "Pythagoras"})
+ if err != nil {
+ log.Fatal("encode error:", err)
+ }
+ err = enc.Encode(P{1782, 1841, 1922, "Treehouse"})
+ if err != nil {
+ log.Fatal("encode error:", err)
+ }
+
+ // Decode (receive) and print the values.
+ var q Q
+ err = dec.Decode(&amp;q)
+ if err != nil {
+ log.Fatal("decode error 1:", err)
+ }
+ fmt.Printf("%q: {%d, %d}\n", q.Name, *q.X, *q.Y)
+ err = dec.Decode(&amp;q)
+ if err != nil {
+ log.Fatal("decode error 2:", err)
+ }
+ fmt.Printf("%q: {%d, %d}\n", q.Name, *q.X, *q.Y)
+
+ // Output:
+ // "Pythagoras": {3, 4}
+ // "Treehouse": {1782, 1841}
+}
+</pre> <h4 id="example__encodeDecode"> <span class="text">Example (EncodeDecode)</span>
+</h4> <p>This example transmits a value that implements the custom encoding and decoding methods. </p> <p>Code:</p> <pre class="code" data-language="go">package gob_test
+
+import (
+ "bytes"
+ "encoding/gob"
+ "fmt"
+ "log"
+)
+
+// The Vector type has unexported fields, which the package cannot access.
+// We therefore write a BinaryMarshal/BinaryUnmarshal method pair to allow us
+// to send and receive the type with the gob package. These interfaces are
+// defined in the "encoding" package.
+// We could equivalently use the locally defined GobEncode/GobDecoder
+// interfaces.
+type Vector struct {
+ x, y, z int
+}
+
+func (v Vector) MarshalBinary() ([]byte, error) {
+ // A simple encoding: plain text.
+ var b bytes.Buffer
+ fmt.Fprintln(&amp;b, v.x, v.y, v.z)
+ return b.Bytes(), nil
+}
+
+// UnmarshalBinary modifies the receiver so it must take a pointer receiver.
+func (v *Vector) UnmarshalBinary(data []byte) error {
+ // A simple encoding: plain text.
+ b := bytes.NewBuffer(data)
+ _, err := fmt.Fscanln(b, &amp;v.x, &amp;v.y, &amp;v.z)
+ return err
+}
+
+// This example transmits a value that implements the custom encoding and decoding methods.
+func Example_encodeDecode() {
+ var network bytes.Buffer // Stand-in for the network.
+
+ // Create an encoder and send a value.
+ enc := gob.NewEncoder(&amp;network)
+ err := enc.Encode(Vector{3, 4, 5})
+ if err != nil {
+ log.Fatal("encode:", err)
+ }
+
+ // Create a decoder and receive a value.
+ dec := gob.NewDecoder(&amp;network)
+ var v Vector
+ err = dec.Decode(&amp;v)
+ if err != nil {
+ log.Fatal("decode:", err)
+ }
+ fmt.Println(v)
+
+ // Output:
+ // {3 4 5}
+}
+</pre> <h4 id="example__interface"> <span class="text">Example (Interface)</span>
+</h4> <p>This example shows how to encode an interface value. The key distinction from regular types is to register the concrete type that implements the interface. </p> <p>Code:</p> <pre class="code" data-language="go">package gob_test
+
+import (
+ "bytes"
+ "encoding/gob"
+ "fmt"
+ "log"
+ "math"
+)
+
+type Point struct {
+ X, Y int
+}
+
+func (p Point) Hypotenuse() float64 {
+ return math.Hypot(float64(p.X), float64(p.Y))
+}
+
+type Pythagoras interface {
+ Hypotenuse() float64
+}
+
+// This example shows how to encode an interface value. The key
+// distinction from regular types is to register the concrete type that
+// implements the interface.
+func Example_interface() {
+ var network bytes.Buffer // Stand-in for the network.
+
+ // We must register the concrete type for the encoder and decoder (which would
+ // normally be on a separate machine from the encoder). On each end, this tells the
+ // engine which concrete type is being sent that implements the interface.
+ gob.Register(Point{})
+
+ // Create an encoder and send some values.
+ enc := gob.NewEncoder(&amp;network)
+ for i := 1; i &lt;= 3; i++ {
+ interfaceEncode(enc, Point{3 * i, 4 * i})
+ }
+
+ // Create a decoder and receive some values.
+ dec := gob.NewDecoder(&amp;network)
+ for i := 1; i &lt;= 3; i++ {
+ result := interfaceDecode(dec)
+ fmt.Println(result.Hypotenuse())
+ }
+
+ // Output:
+ // 5
+ // 10
+ // 15
+}
+
+// interfaceEncode encodes the interface value into the encoder.
+func interfaceEncode(enc *gob.Encoder, p Pythagoras) {
+ // The encode will fail unless the concrete type has been
+ // registered. We registered it in the calling function.
+
+ // Pass pointer to interface so Encode sees (and hence sends) a value of
+ // interface type. If we passed p directly it would see the concrete type instead.
+ // See the blog post, "The Laws of Reflection" for background.
+ err := enc.Encode(&amp;p)
+ if err != nil {
+ log.Fatal("encode:", err)
+ }
+}
+
+// interfaceDecode decodes the next interface value from the stream and returns it.
+func interfaceDecode(dec *gob.Decoder) Pythagoras {
+ // The decode will fail unless the concrete type on the wire has been
+ // registered. We registered it in the calling function.
+ var p Pythagoras
+ err := dec.Decode(&amp;p)
+ if err != nil {
+ log.Fatal("decode:", err)
+ }
+ return p
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Register">func Register(value any)</a></li>
+<li><a href="#RegisterName">func RegisterName(name string, value any)</a></li>
+<li><a href="#CommonType">type CommonType</a></li>
+<li><a href="#Decoder">type Decoder</a></li>
+<li> <a href="#NewDecoder">func NewDecoder(r io.Reader) *Decoder</a>
+</li>
+<li> <a href="#Decoder.Decode">func (dec *Decoder) Decode(e any) error</a>
+</li>
+<li> <a href="#Decoder.DecodeValue">func (dec *Decoder) DecodeValue(v reflect.Value) error</a>
+</li>
+<li><a href="#Encoder">type Encoder</a></li>
+<li> <a href="#NewEncoder">func NewEncoder(w io.Writer) *Encoder</a>
+</li>
+<li> <a href="#Encoder.Encode">func (enc *Encoder) Encode(e any) error</a>
+</li>
+<li> <a href="#Encoder.EncodeValue">func (enc *Encoder) EncodeValue(value reflect.Value) error</a>
+</li>
+<li><a href="#GobDecoder">type GobDecoder</a></li>
+<li><a href="#GobEncoder">type GobEncoder</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example__basic">Package (Basic)</a></dd> <dd><a class="exampleLink" href="#example__encodeDecode">Package (EncodeDecode)</a></dd> <dd><a class="exampleLink" href="#example__interface">Package (Interface)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>dec_helpers.go</span> <span>decode.go</span> <span>decoder.go</span> <span>doc.go</span> <span>enc_helpers.go</span> <span>encode.go</span> <span>encoder.go</span> <span>error.go</span> <span>type.go</span> </p> <h2 id="Register">func <span>Register</span> </h2> <pre data-language="go">func Register(value any)</pre> <p>Register records a type, identified by a value for that type, under its internal type name. That name will identify the concrete type of a value sent or received as an interface variable. Only types that will be transferred as implementations of interface values need to be registered. Expecting to be used only during initialization, it panics if the mapping between types and names is not a bijection. </p>
+<h2 id="RegisterName">func <span>RegisterName</span> </h2> <pre data-language="go">func RegisterName(name string, value any)</pre> <p>RegisterName is like <a href="#Register">Register</a> but uses the provided name rather than the type's default. </p>
+<h2 id="CommonType">type <span>CommonType</span> </h2> <p>CommonType holds elements of all types. It is a historical artifact, kept for binary compatibility and exported only for the benefit of the package's encoding of type descriptors. It is not intended for direct use by clients. </p>
+<pre data-language="go">type CommonType struct {
+ Name string
+ Id typeId
+}
+</pre> <h2 id="Decoder">type <span>Decoder</span> </h2> <p>A Decoder manages the receipt of type and data information read from the remote side of a connection. It is safe for concurrent use by multiple goroutines. </p>
+<p>The Decoder does only basic sanity checking on decoded input sizes, and its limits are not configurable. Take caution when decoding gob data from untrusted sources. </p>
+<pre data-language="go">type Decoder struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewDecoder">func <span>NewDecoder</span> </h3> <pre data-language="go">func NewDecoder(r io.Reader) *Decoder</pre> <p>NewDecoder returns a new decoder that reads from the <span>io.Reader</span>. If r does not also implement <span>io.ByteReader</span>, it will be wrapped in a <span>bufio.Reader</span>. </p>
+<h3 id="Decoder.Decode">func (*Decoder) <span>Decode</span> </h3> <pre data-language="go">func (dec *Decoder) Decode(e any) error</pre> <p>Decode reads the next value from the input stream and stores it in the data represented by the empty interface value. If e is nil, the value will be discarded. Otherwise, the value underlying e must be a pointer to the correct type for the next data item received. If the input is at EOF, Decode returns <span>io.EOF</span> and does not modify e. </p>
+<h3 id="Decoder.DecodeValue">func (*Decoder) <span>DecodeValue</span> </h3> <pre data-language="go">func (dec *Decoder) DecodeValue(v reflect.Value) error</pre> <p>DecodeValue reads the next value from the input stream. If v is the zero reflect.Value (v.Kind() == Invalid), DecodeValue discards the value. Otherwise, it stores the value into v. In that case, v must represent a non-nil pointer to data or be an assignable reflect.Value (v.CanSet()) If the input is at EOF, DecodeValue returns <span>io.EOF</span> and does not modify v. </p>
+<h2 id="Encoder">type <span>Encoder</span> </h2> <p>An Encoder manages the transmission of type and data information to the other side of a connection. It is safe for concurrent use by multiple goroutines. </p>
+<pre data-language="go">type Encoder struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewEncoder">func <span>NewEncoder</span> </h3> <pre data-language="go">func NewEncoder(w io.Writer) *Encoder</pre> <p>NewEncoder returns a new encoder that will transmit on the <span>io.Writer</span>. </p>
+<h3 id="Encoder.Encode">func (*Encoder) <span>Encode</span> </h3> <pre data-language="go">func (enc *Encoder) Encode(e any) error</pre> <p>Encode transmits the data item represented by the empty interface value, guaranteeing that all necessary type information has been transmitted first. Passing a nil pointer to Encoder will panic, as they cannot be transmitted by gob. </p>
+<h3 id="Encoder.EncodeValue">func (*Encoder) <span>EncodeValue</span> </h3> <pre data-language="go">func (enc *Encoder) EncodeValue(value reflect.Value) error</pre> <p>EncodeValue transmits the data item represented by the reflection value, guaranteeing that all necessary type information has been transmitted first. Passing a nil pointer to EncodeValue will panic, as they cannot be transmitted by gob. </p>
+<h2 id="GobDecoder">type <span>GobDecoder</span> </h2> <p>GobDecoder is the interface describing data that provides its own routine for decoding transmitted values sent by a GobEncoder. </p>
+<pre data-language="go">type GobDecoder interface {
+ // GobDecode overwrites the receiver, which must be a pointer,
+ // with the value represented by the byte slice, which was written
+ // by GobEncode, usually for the same concrete type.
+ GobDecode([]byte) error
+}</pre> <h2 id="GobEncoder">type <span>GobEncoder</span> </h2> <p>GobEncoder is the interface describing data that provides its own representation for encoding values for transmission to a GobDecoder. A type that implements GobEncoder and GobDecoder has complete control over the representation of its data and may therefore contain things such as private fields, channels, and functions, which are not usually transmissible in gob streams. </p>
+<p>Note: Since gobs can be stored permanently, it is good design to guarantee the encoding used by a GobEncoder is stable as the software evolves. For instance, it might make sense for GobEncode to include a version number in the encoding. </p>
+<pre data-language="go">type GobEncoder interface {
+ // GobEncode returns a byte slice representing the encoding of the
+ // receiver for transmission to a GobDecoder, usually of the same
+ // concrete type.
+ GobEncode() ([]byte, error)
+}</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/gob/" class="_attribution-link">http://golang.org/pkg/encoding/gob/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fhex%2Findex.html b/devdocs/go/encoding%2Fhex%2Findex.html
new file mode 100644
index 00000000..57e8bc67
--- /dev/null
+++ b/devdocs/go/encoding%2Fhex%2Findex.html
@@ -0,0 +1,106 @@
+<h1> Package hex </h1> <ul id="short-nav">
+<li><code>import "encoding/hex"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package hex implements hexadecimal encoding and decoding. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#AppendDecode">func AppendDecode(dst, src []byte) ([]byte, error)</a></li>
+<li><a href="#AppendEncode">func AppendEncode(dst, src []byte) []byte</a></li>
+<li><a href="#Decode">func Decode(dst, src []byte) (int, error)</a></li>
+<li><a href="#DecodeString">func DecodeString(s string) ([]byte, error)</a></li>
+<li><a href="#DecodedLen">func DecodedLen(x int) int</a></li>
+<li><a href="#Dump">func Dump(data []byte) string</a></li>
+<li><a href="#Dumper">func Dumper(w io.Writer) io.WriteCloser</a></li>
+<li><a href="#Encode">func Encode(dst, src []byte) int</a></li>
+<li><a href="#EncodeToString">func EncodeToString(src []byte) string</a></li>
+<li><a href="#EncodedLen">func EncodedLen(n int) int</a></li>
+<li><a href="#NewDecoder">func NewDecoder(r io.Reader) io.Reader</a></li>
+<li><a href="#NewEncoder">func NewEncoder(w io.Writer) io.Writer</a></li>
+<li><a href="#InvalidByteError">type InvalidByteError</a></li>
+<li> <a href="#InvalidByteError.Error">func (e InvalidByteError) Error() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Decode">Decode</a></dd> <dd><a class="exampleLink" href="#example_DecodeString">DecodeString</a></dd> <dd><a class="exampleLink" href="#example_Dump">Dump</a></dd> <dd><a class="exampleLink" href="#example_Dumper">Dumper</a></dd> <dd><a class="exampleLink" href="#example_Encode">Encode</a></dd> <dd><a class="exampleLink" href="#example_EncodeToString">EncodeToString</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>hex.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrLength reports an attempt to decode an odd-length input using <a href="#Decode">Decode</a> or <a href="#DecodeString">DecodeString</a>. The stream-based Decoder returns <span>io.ErrUnexpectedEOF</span> instead of ErrLength. </p>
+<pre data-language="go">var ErrLength = errors.New("encoding/hex: odd length hex string")</pre> <h2 id="AppendDecode">func <span>AppendDecode</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func AppendDecode(dst, src []byte) ([]byte, error)</pre> <p>AppendDecode appends the hexadecimally decoded src to dst and returns the extended buffer. If the input is malformed, it returns the partially decoded src and an error. </p>
+<h2 id="AppendEncode">func <span>AppendEncode</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func AppendEncode(dst, src []byte) []byte</pre> <p>AppendEncode appends the hexadecimally encoded src to dst and returns the extended buffer. </p>
+<h2 id="Decode">func <span>Decode</span> </h2> <pre data-language="go">func Decode(dst, src []byte) (int, error)</pre> <p>Decode decodes src into <a href="#DecodedLen">DecodedLen</a>(len(src)) bytes, returning the actual number of bytes written to dst. </p>
+<p>Decode expects that src contains only hexadecimal characters and that src has even length. If the input is malformed, Decode returns the number of bytes decoded before the error. </p> <h4 id="example_Decode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">src := []byte("48656c6c6f20476f7068657221")
+
+dst := make([]byte, hex.DecodedLen(len(src)))
+n, err := hex.Decode(dst, src)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s\n", dst[:n])
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello Gopher!
+</pre> <h2 id="DecodeString">func <span>DecodeString</span> </h2> <pre data-language="go">func DecodeString(s string) ([]byte, error)</pre> <p>DecodeString returns the bytes represented by the hexadecimal string s. </p>
+<p>DecodeString expects that src contains only hexadecimal characters and that src has even length. If the input is malformed, DecodeString returns the bytes decoded before the error. </p> <h4 id="example_DecodeString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const s = "48656c6c6f20476f7068657221"
+decoded, err := hex.DecodeString(s)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s\n", decoded)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello Gopher!
+</pre> <h2 id="DecodedLen">func <span>DecodedLen</span> </h2> <pre data-language="go">func DecodedLen(x int) int</pre> <p>DecodedLen returns the length of a decoding of x source bytes. Specifically, it returns x / 2. </p>
+<h2 id="Dump">func <span>Dump</span> </h2> <pre data-language="go">func Dump(data []byte) string</pre> <p>Dump returns a string that contains a hex dump of the given data. The format of the hex dump matches the output of `hexdump -C` on the command line. </p> <h4 id="example_Dump"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">content := []byte("Go is an open source programming language.")
+
+fmt.Printf("%s", hex.Dump(content))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">00000000 47 6f 20 69 73 20 61 6e 20 6f 70 65 6e 20 73 6f |Go is an open so|
+00000010 75 72 63 65 20 70 72 6f 67 72 61 6d 6d 69 6e 67 |urce programming|
+00000020 20 6c 61 6e 67 75 61 67 65 2e | language.|
+</pre> <h2 id="Dumper">func <span>Dumper</span> </h2> <pre data-language="go">func Dumper(w io.Writer) io.WriteCloser</pre> <p>Dumper returns a <span>io.WriteCloser</span> that writes a hex dump of all written data to w. The format of the dump matches the output of `hexdump -C` on the command line. </p> <h4 id="example_Dumper"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">lines := []string{
+ "Go is an open source programming language.",
+ "\n",
+ "We encourage all Go users to subscribe to golang-announce.",
+}
+
+stdoutDumper := hex.Dumper(os.Stdout)
+
+defer stdoutDumper.Close()
+
+for _, line := range lines {
+ stdoutDumper.Write([]byte(line))
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">00000000 47 6f 20 69 73 20 61 6e 20 6f 70 65 6e 20 73 6f |Go is an open so|
+00000010 75 72 63 65 20 70 72 6f 67 72 61 6d 6d 69 6e 67 |urce programming|
+00000020 20 6c 61 6e 67 75 61 67 65 2e 0a 57 65 20 65 6e | language..We en|
+00000030 63 6f 75 72 61 67 65 20 61 6c 6c 20 47 6f 20 75 |courage all Go u|
+00000040 73 65 72 73 20 74 6f 20 73 75 62 73 63 72 69 62 |sers to subscrib|
+00000050 65 20 74 6f 20 67 6f 6c 61 6e 67 2d 61 6e 6e 6f |e to golang-anno|
+00000060 75 6e 63 65 2e |unce.|
+</pre> <h2 id="Encode">func <span>Encode</span> </h2> <pre data-language="go">func Encode(dst, src []byte) int</pre> <p>Encode encodes src into <a href="#EncodedLen">EncodedLen</a>(len(src)) bytes of dst. As a convenience, it returns the number of bytes written to dst, but this value is always <a href="#EncodedLen">EncodedLen</a>(len(src)). Encode implements hexadecimal encoding. </p> <h4 id="example_Encode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">src := []byte("Hello Gopher!")
+
+dst := make([]byte, hex.EncodedLen(len(src)))
+hex.Encode(dst, src)
+
+fmt.Printf("%s\n", dst)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">48656c6c6f20476f7068657221
+</pre> <h2 id="EncodeToString">func <span>EncodeToString</span> </h2> <pre data-language="go">func EncodeToString(src []byte) string</pre> <p>EncodeToString returns the hexadecimal encoding of src. </p> <h4 id="example_EncodeToString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">src := []byte("Hello")
+encodedStr := hex.EncodeToString(src)
+
+fmt.Printf("%s\n", encodedStr)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">48656c6c6f
+</pre> <h2 id="EncodedLen">func <span>EncodedLen</span> </h2> <pre data-language="go">func EncodedLen(n int) int</pre> <p>EncodedLen returns the length of an encoding of n source bytes. Specifically, it returns n * 2. </p>
+<h2 id="NewDecoder">func <span>NewDecoder</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func NewDecoder(r io.Reader) io.Reader</pre> <p>NewDecoder returns an <span>io.Reader</span> that decodes hexadecimal characters from r. NewDecoder expects that r contain only an even number of hexadecimal characters. </p>
+<h2 id="NewEncoder">func <span>NewEncoder</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func NewEncoder(w io.Writer) io.Writer</pre> <p>NewEncoder returns an <span>io.Writer</span> that writes lowercase hexadecimal characters to w. </p>
+<h2 id="InvalidByteError">type <span>InvalidByteError</span> </h2> <p>InvalidByteError values describe errors resulting from an invalid byte in a hex string. </p>
+<pre data-language="go">type InvalidByteError byte</pre> <h3 id="InvalidByteError.Error">func (InvalidByteError) <span>Error</span> </h3> <pre data-language="go">func (e InvalidByteError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/hex/" class="_attribution-link">http://golang.org/pkg/encoding/hex/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Findex.html b/devdocs/go/encoding%2Findex.html
new file mode 100644
index 00000000..c613be2e
--- /dev/null
+++ b/devdocs/go/encoding%2Findex.html
@@ -0,0 +1,33 @@
+<h1> Package encoding </h1> <ul id="short-nav">
+<li><code>import "encoding"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package encoding defines interfaces shared by other packages that convert data to and from byte-level and textual representations. Packages that check for these interfaces include encoding/gob, encoding/json, and encoding/xml. As a result, implementing an interface once can make a type useful in multiple encodings. Standard types that implement these interfaces include time.Time and net.IP. The interfaces come in pairs that produce and consume encoded data. </p>
+<p>Adding encoding/decoding methods to existing types may constitute a breaking change, as they can be used for serialization in communicating with programs written with different library versions. The policy for packages maintained by the Go project is to only allow the addition of marshaling functions if no existing, reasonable marshaling exists. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#BinaryMarshaler">type BinaryMarshaler</a></li>
+<li><a href="#BinaryUnmarshaler">type BinaryUnmarshaler</a></li>
+<li><a href="#TextMarshaler">type TextMarshaler</a></li>
+<li><a href="#TextUnmarshaler">type TextUnmarshaler</a></li>
+</ul> <h3>Package files</h3> <p> <span>encoding.go</span> </p> <h2 id="BinaryMarshaler">type <span>BinaryMarshaler</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>BinaryMarshaler is the interface implemented by an object that can marshal itself into a binary form. </p>
+<p>MarshalBinary encodes the receiver into a binary form and returns the result. </p>
+<pre data-language="go">type BinaryMarshaler interface {
+ MarshalBinary() (data []byte, err error)
+}</pre> <h2 id="BinaryUnmarshaler">type <span>BinaryUnmarshaler</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>BinaryUnmarshaler is the interface implemented by an object that can unmarshal a binary representation of itself. </p>
+<p>UnmarshalBinary must be able to decode the form generated by MarshalBinary. UnmarshalBinary must copy the data if it wishes to retain the data after returning. </p>
+<pre data-language="go">type BinaryUnmarshaler interface {
+ UnmarshalBinary(data []byte) error
+}</pre> <h2 id="TextMarshaler">type <span>TextMarshaler</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>TextMarshaler is the interface implemented by an object that can marshal itself into a textual form. </p>
+<p>MarshalText encodes the receiver into UTF-8-encoded text and returns the result. </p>
+<pre data-language="go">type TextMarshaler interface {
+ MarshalText() (text []byte, err error)
+}</pre> <h2 id="TextUnmarshaler">type <span>TextUnmarshaler</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>TextUnmarshaler is the interface implemented by an object that can unmarshal a textual representation of itself. </p>
+<p>UnmarshalText must be able to decode the form generated by MarshalText. UnmarshalText must copy the text if it wishes to retain the text after returning. </p>
+<pre data-language="go">type TextUnmarshaler interface {
+ UnmarshalText(text []byte) error
+}</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="ascii85/index">ascii85</a> </td> <td class="pkg-synopsis"> Package ascii85 implements the ascii85 data encoding as used in the btoa tool and Adobe's PostScript and PDF document formats. </td> </tr> <tr> <td class="pkg-name"> <a href="asn1/index">asn1</a> </td> <td class="pkg-synopsis"> Package asn1 implements parsing of DER-encoded ASN.1 data structures, as defined in ITU-T Rec X.690. </td> </tr> <tr> <td class="pkg-name"> <a href="base32/index">base32</a> </td> <td class="pkg-synopsis"> Package base32 implements base32 encoding as specified by RFC 4648. </td> </tr> <tr> <td class="pkg-name"> <a href="base64/index">base64</a> </td> <td class="pkg-synopsis"> Package base64 implements base64 encoding as specified by RFC 4648. </td> </tr> <tr> <td class="pkg-name"> <a href="binary/index">binary</a> </td> <td class="pkg-synopsis"> Package binary implements simple translation between numbers and byte sequences and encoding and decoding of varints. </td> </tr> <tr> <td class="pkg-name"> <a href="csv/index">csv</a> </td> <td class="pkg-synopsis"> Package csv reads and writes comma-separated values (CSV) files. </td> </tr> <tr> <td class="pkg-name"> <a href="gob/index">gob</a> </td> <td class="pkg-synopsis"> Package gob manages streams of gobs - binary values exchanged between an [Encoder] (transmitter) and a [Decoder] (receiver). </td> </tr> <tr> <td class="pkg-name"> <a href="hex/index">hex</a> </td> <td class="pkg-synopsis"> Package hex implements hexadecimal encoding and decoding. </td> </tr> <tr> <td class="pkg-name"> <a href="json/index">json</a> </td> <td class="pkg-synopsis"> Package json implements encoding and decoding of JSON as defined in RFC 7159. </td> </tr> <tr> <td class="pkg-name"> <a href="pem/index">pem</a> </td> <td class="pkg-synopsis"> Package pem implements the PEM data encoding, which originated in Privacy Enhanced Mail. </td> </tr> <tr> <td class="pkg-name"> <a href="xml/index">xml</a> </td> <td class="pkg-synopsis"> Package xml implements a simple XML 1.0 parser that understands XML name spaces. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/" class="_attribution-link">http://golang.org/pkg/encoding/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fjson%2Findex.html b/devdocs/go/encoding%2Fjson%2Findex.html
new file mode 100644
index 00000000..4754164c
--- /dev/null
+++ b/devdocs/go/encoding%2Fjson%2Findex.html
@@ -0,0 +1,640 @@
+<h1> Package json </h1> <ul id="short-nav">
+<li><code>import "encoding/json"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package json implements encoding and decoding of JSON as defined in RFC 7159. The mapping between JSON and Go values is described in the documentation for the Marshal and Unmarshal functions. </p>
+<p>See "JSON and Go" for an introduction to this package: <a href="https://golang.org/doc/articles/json_and_go.html">https://golang.org/doc/articles/json_and_go.html</a> </p> <h4 id="example__customMarshalJSON"> <span class="text">Example (CustomMarshalJSON)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package json_test
+
+import (
+ "encoding/json"
+ "fmt"
+ "log"
+ "strings"
+)
+
+type Animal int
+
+const (
+ Unknown Animal = iota
+ Gopher
+ Zebra
+)
+
+func (a *Animal) UnmarshalJSON(b []byte) error {
+ var s string
+ if err := json.Unmarshal(b, &amp;s); err != nil {
+ return err
+ }
+ switch strings.ToLower(s) {
+ default:
+ *a = Unknown
+ case "gopher":
+ *a = Gopher
+ case "zebra":
+ *a = Zebra
+ }
+
+ return nil
+}
+
+func (a Animal) MarshalJSON() ([]byte, error) {
+ var s string
+ switch a {
+ default:
+ s = "unknown"
+ case Gopher:
+ s = "gopher"
+ case Zebra:
+ s = "zebra"
+ }
+
+ return json.Marshal(s)
+}
+
+func Example_customMarshalJSON() {
+ blob := `["gopher","armadillo","zebra","unknown","gopher","bee","gopher","zebra"]`
+ var zoo []Animal
+ if err := json.Unmarshal([]byte(blob), &amp;zoo); err != nil {
+ log.Fatal(err)
+ }
+
+ census := make(map[Animal]int)
+ for _, animal := range zoo {
+ census[animal] += 1
+ }
+
+ fmt.Printf("Zoo Census:\n* Gophers: %d\n* Zebras: %d\n* Unknown: %d\n",
+ census[Gopher], census[Zebra], census[Unknown])
+
+ // Output:
+ // Zoo Census:
+ // * Gophers: 3
+ // * Zebras: 2
+ // * Unknown: 3
+}
+</pre> <h4 id="example__textMarshalJSON"> <span class="text">Example (TextMarshalJSON)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package json_test
+
+import (
+ "encoding/json"
+ "fmt"
+ "log"
+ "strings"
+)
+
+type Size int
+
+const (
+ Unrecognized Size = iota
+ Small
+ Large
+)
+
+func (s *Size) UnmarshalText(text []byte) error {
+ switch strings.ToLower(string(text)) {
+ default:
+ *s = Unrecognized
+ case "small":
+ *s = Small
+ case "large":
+ *s = Large
+ }
+ return nil
+}
+
+func (s Size) MarshalText() ([]byte, error) {
+ var name string
+ switch s {
+ default:
+ name = "unrecognized"
+ case Small:
+ name = "small"
+ case Large:
+ name = "large"
+ }
+ return []byte(name), nil
+}
+
+func Example_textMarshalJSON() {
+ blob := `["small","regular","large","unrecognized","small","normal","small","large"]`
+ var inventory []Size
+ if err := json.Unmarshal([]byte(blob), &amp;inventory); err != nil {
+ log.Fatal(err)
+ }
+
+ counts := make(map[Size]int)
+ for _, size := range inventory {
+ counts[size] += 1
+ }
+
+ fmt.Printf("Inventory Counts:\n* Small: %d\n* Large: %d\n* Unrecognized: %d\n",
+ counts[Small], counts[Large], counts[Unrecognized])
+
+ // Output:
+ // Inventory Counts:
+ // * Small: 3
+ // * Large: 2
+ // * Unrecognized: 3
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Compact">func Compact(dst *bytes.Buffer, src []byte) error</a></li>
+<li><a href="#HTMLEscape">func HTMLEscape(dst *bytes.Buffer, src []byte)</a></li>
+<li><a href="#Indent">func Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error</a></li>
+<li><a href="#Marshal">func Marshal(v any) ([]byte, error)</a></li>
+<li><a href="#MarshalIndent">func MarshalIndent(v any, prefix, indent string) ([]byte, error)</a></li>
+<li><a href="#Unmarshal">func Unmarshal(data []byte, v any) error</a></li>
+<li><a href="#Valid">func Valid(data []byte) bool</a></li>
+<li><a href="#Decoder">type Decoder</a></li>
+<li> <a href="#NewDecoder">func NewDecoder(r io.Reader) *Decoder</a>
+</li>
+<li> <a href="#Decoder.Buffered">func (dec *Decoder) Buffered() io.Reader</a>
+</li>
+<li> <a href="#Decoder.Decode">func (dec *Decoder) Decode(v any) error</a>
+</li>
+<li> <a href="#Decoder.DisallowUnknownFields">func (dec *Decoder) DisallowUnknownFields()</a>
+</li>
+<li> <a href="#Decoder.InputOffset">func (dec *Decoder) InputOffset() int64</a>
+</li>
+<li> <a href="#Decoder.More">func (dec *Decoder) More() bool</a>
+</li>
+<li> <a href="#Decoder.Token">func (dec *Decoder) Token() (Token, error)</a>
+</li>
+<li> <a href="#Decoder.UseNumber">func (dec *Decoder) UseNumber()</a>
+</li>
+<li><a href="#Delim">type Delim</a></li>
+<li> <a href="#Delim.String">func (d Delim) String() string</a>
+</li>
+<li><a href="#Encoder">type Encoder</a></li>
+<li> <a href="#NewEncoder">func NewEncoder(w io.Writer) *Encoder</a>
+</li>
+<li> <a href="#Encoder.Encode">func (enc *Encoder) Encode(v any) error</a>
+</li>
+<li> <a href="#Encoder.SetEscapeHTML">func (enc *Encoder) SetEscapeHTML(on bool)</a>
+</li>
+<li> <a href="#Encoder.SetIndent">func (enc *Encoder) SetIndent(prefix, indent string)</a>
+</li>
+<li><a href="#InvalidUTF8Error">type InvalidUTF8Error</a></li>
+<li> <a href="#InvalidUTF8Error.Error">func (e *InvalidUTF8Error) Error() string</a>
+</li>
+<li><a href="#InvalidUnmarshalError">type InvalidUnmarshalError</a></li>
+<li> <a href="#InvalidUnmarshalError.Error">func (e *InvalidUnmarshalError) Error() string</a>
+</li>
+<li><a href="#Marshaler">type Marshaler</a></li>
+<li><a href="#MarshalerError">type MarshalerError</a></li>
+<li> <a href="#MarshalerError.Error">func (e *MarshalerError) Error() string</a>
+</li>
+<li> <a href="#MarshalerError.Unwrap">func (e *MarshalerError) Unwrap() error</a>
+</li>
+<li><a href="#Number">type Number</a></li>
+<li> <a href="#Number.Float64">func (n Number) Float64() (float64, error)</a>
+</li>
+<li> <a href="#Number.Int64">func (n Number) Int64() (int64, error)</a>
+</li>
+<li> <a href="#Number.String">func (n Number) String() string</a>
+</li>
+<li><a href="#RawMessage">type RawMessage</a></li>
+<li> <a href="#RawMessage.MarshalJSON">func (m RawMessage) MarshalJSON() ([]byte, error)</a>
+</li>
+<li> <a href="#RawMessage.UnmarshalJSON">func (m *RawMessage) UnmarshalJSON(data []byte) error</a>
+</li>
+<li><a href="#SyntaxError">type SyntaxError</a></li>
+<li> <a href="#SyntaxError.Error">func (e *SyntaxError) Error() string</a>
+</li>
+<li><a href="#Token">type Token</a></li>
+<li><a href="#UnmarshalFieldError">type UnmarshalFieldError</a></li>
+<li> <a href="#UnmarshalFieldError.Error">func (e *UnmarshalFieldError) Error() string</a>
+</li>
+<li><a href="#UnmarshalTypeError">type UnmarshalTypeError</a></li>
+<li> <a href="#UnmarshalTypeError.Error">func (e *UnmarshalTypeError) Error() string</a>
+</li>
+<li><a href="#Unmarshaler">type Unmarshaler</a></li>
+<li><a href="#UnsupportedTypeError">type UnsupportedTypeError</a></li>
+<li> <a href="#UnsupportedTypeError.Error">func (e *UnsupportedTypeError) Error() string</a>
+</li>
+<li><a href="#UnsupportedValueError">type UnsupportedValueError</a></li>
+<li> <a href="#UnsupportedValueError.Error">func (e *UnsupportedValueError) Error() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Decoder">Decoder</a></dd> <dd><a class="exampleLink" href="#example_Decoder_Decode_stream">Decoder.Decode (Stream)</a></dd> <dd><a class="exampleLink" href="#example_Decoder_Token">Decoder.Token</a></dd> <dd><a class="exampleLink" href="#example_HTMLEscape">HTMLEscape</a></dd> <dd><a class="exampleLink" href="#example_Indent">Indent</a></dd> <dd><a class="exampleLink" href="#example_Marshal">Marshal</a></dd> <dd><a class="exampleLink" href="#example_MarshalIndent">MarshalIndent</a></dd> <dd><a class="exampleLink" href="#example_RawMessage_marshal">RawMessage (Marshal)</a></dd> <dd><a class="exampleLink" href="#example_RawMessage_unmarshal">RawMessage (Unmarshal)</a></dd> <dd><a class="exampleLink" href="#example_Unmarshal">Unmarshal</a></dd> <dd><a class="exampleLink" href="#example_Valid">Valid</a></dd> <dd><a class="exampleLink" href="#example__customMarshalJSON">Package (CustomMarshalJSON)</a></dd> <dd><a class="exampleLink" href="#example__textMarshalJSON">Package (TextMarshalJSON)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>decode.go</span> <span>encode.go</span> <span>fold.go</span> <span>indent.go</span> <span>scanner.go</span> <span>stream.go</span> <span>tables.go</span> <span>tags.go</span> </p> <h2 id="Compact">func <span>Compact</span> </h2> <pre data-language="go">func Compact(dst *bytes.Buffer, src []byte) error</pre> <p>Compact appends to dst the JSON-encoded src with insignificant space characters elided. </p>
+<h2 id="HTMLEscape">func <span>HTMLEscape</span> </h2> <pre data-language="go">func HTMLEscape(dst *bytes.Buffer, src []byte)</pre> <p>HTMLEscape appends to dst the JSON-encoded src with &lt;, &gt;, &amp;, U+2028 and U+2029 characters inside string literals changed to \u003c, \u003e, \u0026, \u2028, \u2029 so that the JSON will be safe to embed inside HTML &lt;script&gt; tags. For historical reasons, web browsers don't honor standard HTML escaping within &lt;script&gt; tags, so an alternative JSON encoding must be used. </p> <h4 id="example_HTMLEscape"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var out bytes.Buffer
+json.HTMLEscape(&amp;out, []byte(`{"Name":"&lt;b&gt;HTML content&lt;/b&gt;"}`))
+out.WriteTo(os.Stdout)
+</pre> <p>Output:</p> <pre class="output" data-language="go">{"Name":"\u003cb\u003eHTML content\u003c/b\u003e"}
+</pre> <h2 id="Indent">func <span>Indent</span> </h2> <pre data-language="go">func Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error</pre> <p>Indent appends to dst an indented form of the JSON-encoded src. Each element in a JSON object or array begins on a new, indented line beginning with prefix followed by one or more copies of indent according to the indentation nesting. The data appended to dst does not begin with the prefix nor any indentation, to make it easier to embed inside other formatted JSON data. Although leading space characters (space, tab, carriage return, newline) at the beginning of src are dropped, trailing space characters at the end of src are preserved and copied to dst. For example, if src has no trailing spaces, neither will dst; if src ends in a trailing newline, so will dst. </p> <h4 id="example_Indent"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type Road struct {
+ Name string
+ Number int
+}
+roads := []Road{
+ {"Diamond Fork", 29},
+ {"Sheep Creek", 51},
+}
+
+b, err := json.Marshal(roads)
+if err != nil {
+ log.Fatal(err)
+}
+
+var out bytes.Buffer
+json.Indent(&amp;out, b, "=", "\t")
+out.WriteTo(os.Stdout)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[
+= {
+= "Name": "Diamond Fork",
+= "Number": 29
+= },
+= {
+= "Name": "Sheep Creek",
+= "Number": 51
+= }
+=]
+</pre> <h2 id="Marshal">func <span>Marshal</span> </h2> <pre data-language="go">func Marshal(v any) ([]byte, error)</pre> <p>Marshal returns the JSON encoding of v. </p>
+<p>Marshal traverses the value v recursively. If an encountered value implements <a href="#Marshaler">Marshaler</a> and is not a nil pointer, Marshal calls [Marshaler.MarshalJSON] to produce JSON. If no [Marshaler.MarshalJSON] method is present but the value implements <span>encoding.TextMarshaler</span> instead, Marshal calls <span>encoding.TextMarshaler.MarshalText</span> and encodes the result as a JSON string. The nil pointer exception is not strictly necessary but mimics a similar, necessary exception in the behavior of [Unmarshaler.UnmarshalJSON]. </p>
+<p>Otherwise, Marshal uses the following type-dependent default encodings: </p>
+<p>Boolean values encode as JSON booleans. </p>
+<p>Floating point, integer, and <a href="#Number">Number</a> values encode as JSON numbers. NaN and +/-Inf values will return an <a href="#UnsupportedValueError">UnsupportedValueError</a>. </p>
+<p>String values encode as JSON strings coerced to valid UTF-8, replacing invalid bytes with the Unicode replacement rune. So that the JSON will be safe to embed inside HTML &lt;script&gt; tags, the string is encoded using <a href="#HTMLEscape">HTMLEscape</a>, which replaces "&lt;", "&gt;", "&amp;", U+2028, and U+2029 are escaped to "\u003c","\u003e", "\u0026", "\u2028", and "\u2029". This replacement can be disabled when using an <a href="#Encoder">Encoder</a>, by calling <a href="#Encoder.SetEscapeHTML">Encoder.SetEscapeHTML</a>(false). </p>
+<p>Array and slice values encode as JSON arrays, except that []byte encodes as a base64-encoded string, and a nil slice encodes as the null JSON value. </p>
+<p>Struct values encode as JSON objects. Each exported struct field becomes a member of the object, using the field name as the object key, unless the field is omitted for one of the reasons given below. </p>
+<p>The encoding of each struct field can be customized by the format string stored under the "json" key in the struct field's tag. The format string gives the name of the field, possibly followed by a comma-separated list of options. The name may be empty in order to specify options without overriding the default field name. </p>
+<p>The "omitempty" option specifies that the field should be omitted from the encoding if the field has an empty value, defined as false, 0, a nil pointer, a nil interface value, and any empty array, slice, map, or string. </p>
+<p>As a special case, if the field tag is "-", the field is always omitted. Note that a field with name "-" can still be generated using the tag "-,". </p>
+<p>Examples of struct field tags and their meanings: </p>
+<pre data-language="go">// Field appears in JSON as key "myName".
+Field int `json:"myName"`
+
+// Field appears in JSON as key "myName" and
+// the field is omitted from the object if its value is empty,
+// as defined above.
+Field int `json:"myName,omitempty"`
+
+// Field appears in JSON as key "Field" (the default), but
+// the field is skipped if empty.
+// Note the leading comma.
+Field int `json:",omitempty"`
+
+// Field is ignored by this package.
+Field int `json:"-"`
+
+// Field appears in JSON as key "-".
+Field int `json:"-,"`
+</pre> <p>The "string" option signals that a field is stored as JSON inside a JSON-encoded string. It applies only to fields of string, floating point, integer, or boolean types. This extra level of encoding is sometimes used when communicating with JavaScript programs: </p>
+<pre data-language="go">Int64String int64 `json:",string"`
+</pre> <p>The key name will be used if it's a non-empty string consisting of only Unicode letters, digits, and ASCII punctuation except quotation marks, backslash, and comma. </p>
+<p>Embedded struct fields are usually marshaled as if their inner exported fields were fields in the outer struct, subject to the usual Go visibility rules amended as described in the next paragraph. An anonymous struct field with a name given in its JSON tag is treated as having that name, rather than being anonymous. An anonymous struct field of interface type is treated the same as having that type as its name, rather than being anonymous. </p>
+<p>The Go visibility rules for struct fields are amended for JSON when deciding which field to marshal or unmarshal. If there are multiple fields at the same level, and that level is the least nested (and would therefore be the nesting level selected by the usual Go rules), the following extra rules apply: </p>
+<p>1) Of those fields, if any are JSON-tagged, only tagged fields are considered, even if there are multiple untagged fields that would otherwise conflict. </p>
+<p>2) If there is exactly one field (tagged or not according to the first rule), that is selected. </p>
+<p>3) Otherwise there are multiple fields, and all are ignored; no error occurs. </p>
+<p>Handling of anonymous struct fields is new in Go 1.1. Prior to Go 1.1, anonymous struct fields were ignored. To force ignoring of an anonymous struct field in both current and earlier versions, give the field a JSON tag of "-". </p>
+<p>Map values encode as JSON objects. The map's key type must either be a string, an integer type, or implement <span>encoding.TextMarshaler</span>. The map keys are sorted and used as JSON object keys by applying the following rules, subject to the UTF-8 coercion described for string values above: </p>
+<ul> <li>keys of any string type are used directly </li>
+<li>
+<span>encoding.TextMarshalers</span> are marshaled </li>
+<li>integer keys are converted to strings </li>
+</ul> <p>Pointer values encode as the value pointed to. A nil pointer encodes as the null JSON value. </p>
+<p>Interface values encode as the value contained in the interface. A nil interface value encodes as the null JSON value. </p>
+<p>Channel, complex, and function values cannot be encoded in JSON. Attempting to encode such a value causes Marshal to return an <a href="#UnsupportedTypeError">UnsupportedTypeError</a>. </p>
+<p>JSON cannot represent cyclic data structures and Marshal does not handle them. Passing cyclic structures to Marshal will result in an error. </p> <h4 id="example_Marshal"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type ColorGroup struct {
+ ID int
+ Name string
+ Colors []string
+}
+group := ColorGroup{
+ ID: 1,
+ Name: "Reds",
+ Colors: []string{"Crimson", "Red", "Ruby", "Maroon"},
+}
+b, err := json.Marshal(group)
+if err != nil {
+ fmt.Println("error:", err)
+}
+os.Stdout.Write(b)
+</pre> <p>Output:</p> <pre class="output" data-language="go">{"ID":1,"Name":"Reds","Colors":["Crimson","Red","Ruby","Maroon"]}
+</pre> <h2 id="MarshalIndent">func <span>MarshalIndent</span> </h2> <pre data-language="go">func MarshalIndent(v any, prefix, indent string) ([]byte, error)</pre> <p>MarshalIndent is like <a href="#Marshal">Marshal</a> but applies <a href="#Indent">Indent</a> to format the output. Each JSON element in the output will begin on a new line beginning with prefix followed by one or more copies of indent according to the indentation nesting. </p> <h4 id="example_MarshalIndent"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">data := map[string]int{
+ "a": 1,
+ "b": 2,
+}
+
+b, err := json.MarshalIndent(data, "&lt;prefix&gt;", "&lt;indent&gt;")
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Println(string(b))
+</pre> <p>Output:</p> <pre class="output" data-language="go">{
+&lt;prefix&gt;&lt;indent&gt;"a": 1,
+&lt;prefix&gt;&lt;indent&gt;"b": 2
+&lt;prefix&gt;}
+</pre> <h2 id="Unmarshal">func <span>Unmarshal</span> </h2> <pre data-language="go">func Unmarshal(data []byte, v any) error</pre> <p>Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. If v is nil or not a pointer, Unmarshal returns an <a href="#InvalidUnmarshalError">InvalidUnmarshalError</a>. </p>
+<p>Unmarshal uses the inverse of the encodings that <a href="#Marshal">Marshal</a> uses, allocating maps, slices, and pointers as necessary, with the following additional rules: </p>
+<p>To unmarshal JSON into a pointer, Unmarshal first handles the case of the JSON being the JSON literal null. In that case, Unmarshal sets the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into the value pointed at by the pointer. If the pointer is nil, Unmarshal allocates a new value for it to point to. </p>
+<p>To unmarshal JSON into a value implementing <a href="#Unmarshaler">Unmarshaler</a>, Unmarshal calls that value's [Unmarshaler.UnmarshalJSON] method, including when the input is a JSON null. Otherwise, if the value implements <span>encoding.TextUnmarshaler</span> and the input is a JSON quoted string, Unmarshal calls <span>encoding.TextUnmarshaler.UnmarshalText</span> with the unquoted form of the string. </p>
+<p>To unmarshal JSON into a struct, Unmarshal matches incoming object keys to the keys used by <a href="#Marshal">Marshal</a> (either the struct field name or its tag), preferring an exact match but also accepting a case-insensitive match. By default, object keys which don't have a corresponding struct field are ignored (see <a href="#Decoder.DisallowUnknownFields">Decoder.DisallowUnknownFields</a> for an alternative). </p>
+<p>To unmarshal JSON into an interface value, Unmarshal stores one of these in the interface value: </p>
+<ul> <li>bool, for JSON booleans </li>
+<li>float64, for JSON numbers </li>
+<li>string, for JSON strings </li>
+<li>[]interface{}, for JSON arrays </li>
+<li>map[string]interface{}, for JSON objects </li>
+<li>nil for JSON null </li>
+</ul> <p>To unmarshal a JSON array into a slice, Unmarshal resets the slice length to zero and then appends each element to the slice. As a special case, to unmarshal an empty JSON array into a slice, Unmarshal replaces the slice with a new empty slice. </p>
+<p>To unmarshal a JSON array into a Go array, Unmarshal decodes JSON array elements into corresponding Go array elements. If the Go array is smaller than the JSON array, the additional JSON array elements are discarded. If the JSON array is smaller than the Go array, the additional Go array elements are set to zero values. </p>
+<p>To unmarshal a JSON object into a map, Unmarshal first establishes a map to use. If the map is nil, Unmarshal allocates a new map. Otherwise Unmarshal reuses the existing map, keeping existing entries. Unmarshal then stores key-value pairs from the JSON object into the map. The map's key type must either be any string type, an integer, implement <a href="#Unmarshaler">json.Unmarshaler</a>, or implement <span>encoding.TextUnmarshaler</span>. </p>
+<p>If the JSON-encoded data contain a syntax error, Unmarshal returns a <a href="#SyntaxError">SyntaxError</a>. </p>
+<p>If a JSON value is not appropriate for a given target type, or if a JSON number overflows the target type, Unmarshal skips that field and completes the unmarshaling as best it can. If no more serious errors are encountered, Unmarshal returns an <a href="#UnmarshalTypeError">UnmarshalTypeError</a> describing the earliest such error. In any case, it's not guaranteed that all the remaining fields following the problematic one will be unmarshaled into the target object. </p>
+<p>The JSON null value unmarshals into an interface, map, pointer, or slice by setting that Go value to nil. Because null is often used in JSON to mean “not present,” unmarshaling a JSON null into any other Go type has no effect on the value and produces no error. </p>
+<p>When unmarshaling quoted strings, invalid UTF-8 or invalid UTF-16 surrogate pairs are not treated as an error. Instead, they are replaced by the Unicode replacement character U+FFFD. </p> <h4 id="example_Unmarshal"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var jsonBlob = []byte(`[
+ {"Name": "Platypus", "Order": "Monotremata"},
+ {"Name": "Quoll", "Order": "Dasyuromorphia"}
+]`)
+type Animal struct {
+ Name string
+ Order string
+}
+var animals []Animal
+err := json.Unmarshal(jsonBlob, &amp;animals)
+if err != nil {
+ fmt.Println("error:", err)
+}
+fmt.Printf("%+v", animals)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
+</pre> <h2 id="Valid">func <span>Valid</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Valid(data []byte) bool</pre> <p>Valid reports whether data is a valid JSON encoding. </p> <h4 id="example_Valid"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">goodJSON := `{"example": 1}`
+badJSON := `{"example":2:]}}`
+
+fmt.Println(json.Valid([]byte(goodJSON)), json.Valid([]byte(badJSON)))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true false
+</pre> <h2 id="Decoder">type <span>Decoder</span> </h2> <p>A Decoder reads and decodes JSON values from an input stream. </p>
+<pre data-language="go">type Decoder struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Decoder"> <span class="text">Example</span>
+</h4> <p>This example uses a Decoder to decode a stream of distinct JSON values. </p> <p>Code:</p> <pre class="code" data-language="go">const jsonStream = `
+ {"Name": "Ed", "Text": "Knock knock."}
+ {"Name": "Sam", "Text": "Who's there?"}
+ {"Name": "Ed", "Text": "Go fmt."}
+ {"Name": "Sam", "Text": "Go fmt who?"}
+ {"Name": "Ed", "Text": "Go fmt yourself!"}
+`
+type Message struct {
+ Name, Text string
+}
+dec := json.NewDecoder(strings.NewReader(jsonStream))
+for {
+ var m Message
+ if err := dec.Decode(&amp;m); err == io.EOF {
+ break
+ } else if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("%s: %s\n", m.Name, m.Text)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">Ed: Knock knock.
+Sam: Who's there?
+Ed: Go fmt.
+Sam: Go fmt who?
+Ed: Go fmt yourself!
+</pre> <h3 id="NewDecoder">func <span>NewDecoder</span> </h3> <pre data-language="go">func NewDecoder(r io.Reader) *Decoder</pre> <p>NewDecoder returns a new decoder that reads from r. </p>
+<p>The decoder introduces its own buffering and may read data from r beyond the JSON values requested. </p>
+<h3 id="Decoder.Buffered">func (*Decoder) <span>Buffered</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (dec *Decoder) Buffered() io.Reader</pre> <p>Buffered returns a reader of the data remaining in the Decoder's buffer. The reader is valid until the next call to <a href="#Decoder.Decode">Decoder.Decode</a>. </p>
+<h3 id="Decoder.Decode">func (*Decoder) <span>Decode</span> </h3> <pre data-language="go">func (dec *Decoder) Decode(v any) error</pre> <p>Decode reads the next JSON-encoded value from its input and stores it in the value pointed to by v. </p>
+<p>See the documentation for <a href="#Unmarshal">Unmarshal</a> for details about the conversion of JSON into a Go value. </p> <h4 id="example_Decoder_Decode_stream"> <span class="text">Example (Stream)</span>
+</h4> <p>This example uses a Decoder to decode a streaming array of JSON objects. </p> <p>Code:</p> <pre class="code" data-language="go">const jsonStream = `
+ [
+ {"Name": "Ed", "Text": "Knock knock."},
+ {"Name": "Sam", "Text": "Who's there?"},
+ {"Name": "Ed", "Text": "Go fmt."},
+ {"Name": "Sam", "Text": "Go fmt who?"},
+ {"Name": "Ed", "Text": "Go fmt yourself!"}
+ ]
+`
+type Message struct {
+ Name, Text string
+}
+dec := json.NewDecoder(strings.NewReader(jsonStream))
+
+// read open bracket
+t, err := dec.Token()
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%T: %v\n", t, t)
+
+// while the array contains values
+for dec.More() {
+ var m Message
+ // decode an array value (Message)
+ err := dec.Decode(&amp;m)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ fmt.Printf("%v: %v\n", m.Name, m.Text)
+}
+
+// read closing bracket
+t, err = dec.Token()
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%T: %v\n", t, t)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">json.Delim: [
+Ed: Knock knock.
+Sam: Who's there?
+Ed: Go fmt.
+Sam: Go fmt who?
+Ed: Go fmt yourself!
+json.Delim: ]
+</pre> <h3 id="Decoder.DisallowUnknownFields">func (*Decoder) <span>DisallowUnknownFields</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (dec *Decoder) DisallowUnknownFields()</pre> <p>DisallowUnknownFields causes the Decoder to return an error when the destination is a struct and the input contains object keys which do not match any non-ignored, exported fields in the destination. </p>
+<h3 id="Decoder.InputOffset">func (*Decoder) <span>InputOffset</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (dec *Decoder) InputOffset() int64</pre> <p>InputOffset returns the input stream byte offset of the current decoder position. The offset gives the location of the end of the most recently returned token and the beginning of the next token. </p>
+<h3 id="Decoder.More">func (*Decoder) <span>More</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (dec *Decoder) More() bool</pre> <p>More reports whether there is another element in the current array or object being parsed. </p>
+<h3 id="Decoder.Token">func (*Decoder) <span>Token</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (dec *Decoder) Token() (Token, error)</pre> <p>Token returns the next JSON token in the input stream. At the end of the input stream, Token returns nil, <span>io.EOF</span>. </p>
+<p>Token guarantees that the delimiters [ ] { } it returns are properly nested and matched: if Token encounters an unexpected delimiter in the input, it will return an error. </p>
+<p>The input stream consists of basic JSON values—bool, string, number, and null—along with delimiters [ ] { } of type <a href="#Delim">Delim</a> to mark the start and end of arrays and objects. Commas and colons are elided. </p> <h4 id="example_Decoder_Token"> <span class="text">Example</span>
+</h4> <p>This example uses a Decoder to decode a stream of distinct JSON values. </p> <p>Code:</p> <pre class="code" data-language="go">const jsonStream = `
+ {"Message": "Hello", "Array": [1, 2, 3], "Null": null, "Number": 1.234}
+`
+dec := json.NewDecoder(strings.NewReader(jsonStream))
+for {
+ t, err := dec.Token()
+ if err == io.EOF {
+ break
+ }
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("%T: %v", t, t)
+ if dec.More() {
+ fmt.Printf(" (more)")
+ }
+ fmt.Printf("\n")
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">json.Delim: { (more)
+string: Message (more)
+string: Hello (more)
+string: Array (more)
+json.Delim: [ (more)
+float64: 1 (more)
+float64: 2 (more)
+float64: 3
+json.Delim: ] (more)
+string: Null (more)
+&lt;nil&gt;: &lt;nil&gt; (more)
+string: Number (more)
+float64: 1.234
+json.Delim: }
+</pre> <h3 id="Decoder.UseNumber">func (*Decoder) <span>UseNumber</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (dec *Decoder) UseNumber()</pre> <p>UseNumber causes the Decoder to unmarshal a number into an interface{} as a <a href="#Number">Number</a> instead of as a float64. </p>
+<h2 id="Delim">type <span>Delim</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Delim is a JSON array or object delimiter, one of [ ] { or }. </p>
+<pre data-language="go">type Delim rune</pre> <h3 id="Delim.String">func (Delim) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (d Delim) String() string</pre> <h2 id="Encoder">type <span>Encoder</span> </h2> <p>An Encoder writes JSON values to an output stream. </p>
+<pre data-language="go">type Encoder struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewEncoder">func <span>NewEncoder</span> </h3> <pre data-language="go">func NewEncoder(w io.Writer) *Encoder</pre> <p>NewEncoder returns a new encoder that writes to w. </p>
+<h3 id="Encoder.Encode">func (*Encoder) <span>Encode</span> </h3> <pre data-language="go">func (enc *Encoder) Encode(v any) error</pre> <p>Encode writes the JSON encoding of v to the stream, followed by a newline character. </p>
+<p>See the documentation for <a href="#Marshal">Marshal</a> for details about the conversion of Go values to JSON. </p>
+<h3 id="Encoder.SetEscapeHTML">func (*Encoder) <span>SetEscapeHTML</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (enc *Encoder) SetEscapeHTML(on bool)</pre> <p>SetEscapeHTML specifies whether problematic HTML characters should be escaped inside JSON quoted strings. The default behavior is to escape &amp;, &lt;, and &gt; to \u0026, \u003c, and \u003e to avoid certain safety problems that can arise when embedding JSON in HTML. </p>
+<p>In non-HTML settings where the escaping interferes with the readability of the output, SetEscapeHTML(false) disables this behavior. </p>
+<h3 id="Encoder.SetIndent">func (*Encoder) <span>SetIndent</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (enc *Encoder) SetIndent(prefix, indent string)</pre> <p>SetIndent instructs the encoder to format each subsequent encoded value as if indented by the package-level function Indent(dst, src, prefix, indent). Calling SetIndent("", "") disables indentation. </p>
+<h2 id="InvalidUTF8Error">type <span>InvalidUTF8Error</span> </h2> <p>Before Go 1.2, an InvalidUTF8Error was returned by <a href="#Marshal">Marshal</a> when attempting to encode a string value with invalid UTF-8 sequences. As of Go 1.2, <a href="#Marshal">Marshal</a> instead coerces the string to valid UTF-8 by replacing invalid bytes with the Unicode replacement rune U+FFFD. </p>
+<p>Deprecated: No longer used; kept for compatibility. </p>
+<pre data-language="go">type InvalidUTF8Error struct {
+ S string // the whole string value that caused the error
+}
+</pre> <h3 id="InvalidUTF8Error.Error">func (*InvalidUTF8Error) <span>Error</span> </h3> <pre data-language="go">func (e *InvalidUTF8Error) Error() string</pre> <h2 id="InvalidUnmarshalError">type <span>InvalidUnmarshalError</span> </h2> <p>An InvalidUnmarshalError describes an invalid argument passed to <a href="#Unmarshal">Unmarshal</a>. (The argument to <a href="#Unmarshal">Unmarshal</a> must be a non-nil pointer.) </p>
+<pre data-language="go">type InvalidUnmarshalError struct {
+ Type reflect.Type
+}
+</pre> <h3 id="InvalidUnmarshalError.Error">func (*InvalidUnmarshalError) <span>Error</span> </h3> <pre data-language="go">func (e *InvalidUnmarshalError) Error() string</pre> <h2 id="Marshaler">type <span>Marshaler</span> </h2> <p>Marshaler is the interface implemented by types that can marshal themselves into valid JSON. </p>
+<pre data-language="go">type Marshaler interface {
+ MarshalJSON() ([]byte, error)
+}</pre> <h2 id="MarshalerError">type <span>MarshalerError</span> </h2> <p>A MarshalerError represents an error from calling a [Marshaler.MarshalJSON] or <span>encoding.TextMarshaler.MarshalText</span> method. </p>
+<pre data-language="go">type MarshalerError struct {
+ Type reflect.Type
+ Err error
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="MarshalerError.Error">func (*MarshalerError) <span>Error</span> </h3> <pre data-language="go">func (e *MarshalerError) Error() string</pre> <h3 id="MarshalerError.Unwrap">func (*MarshalerError) <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e *MarshalerError) Unwrap() error</pre> <p>Unwrap returns the underlying error. </p>
+<h2 id="Number">type <span>Number</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>A Number represents a JSON number literal. </p>
+<pre data-language="go">type Number string</pre> <h3 id="Number.Float64">func (Number) <span>Float64</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (n Number) Float64() (float64, error)</pre> <p>Float64 returns the number as a float64. </p>
+<h3 id="Number.Int64">func (Number) <span>Int64</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (n Number) Int64() (int64, error)</pre> <p>Int64 returns the number as an int64. </p>
+<h3 id="Number.String">func (Number) <span>String</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (n Number) String() string</pre> <p>String returns the literal text of the number. </p>
+<h2 id="RawMessage">type <span>RawMessage</span> </h2> <p>RawMessage is a raw encoded JSON value. It implements <a href="#Marshaler">Marshaler</a> and <a href="#Unmarshaler">Unmarshaler</a> and can be used to delay JSON decoding or precompute a JSON encoding. </p>
+<pre data-language="go">type RawMessage []byte</pre> <h4 id="example_RawMessage_marshal"> <span class="text">Example (Marshal)</span>
+</h4> <p>This example uses RawMessage to use a precomputed JSON during marshal. </p> <p>Code:</p> <pre class="code" data-language="go">h := json.RawMessage(`{"precomputed": true}`)
+
+c := struct {
+ Header *json.RawMessage `json:"header"`
+ Body string `json:"body"`
+}{Header: &amp;h, Body: "Hello Gophers!"}
+
+b, err := json.MarshalIndent(&amp;c, "", "\t")
+if err != nil {
+ fmt.Println("error:", err)
+}
+os.Stdout.Write(b)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">{
+ "header": {
+ "precomputed": true
+ },
+ "body": "Hello Gophers!"
+}
+</pre> <h4 id="example_RawMessage_unmarshal"> <span class="text">Example (Unmarshal)</span>
+</h4> <p>This example uses RawMessage to delay parsing part of a JSON message. </p> <p>Code:</p> <pre class="code" data-language="go">type Color struct {
+ Space string
+ Point json.RawMessage // delay parsing until we know the color space
+}
+type RGB struct {
+ R uint8
+ G uint8
+ B uint8
+}
+type YCbCr struct {
+ Y uint8
+ Cb int8
+ Cr int8
+}
+
+var j = []byte(`[
+ {"Space": "YCbCr", "Point": {"Y": 255, "Cb": 0, "Cr": -10}},
+ {"Space": "RGB", "Point": {"R": 98, "G": 218, "B": 255}}
+]`)
+var colors []Color
+err := json.Unmarshal(j, &amp;colors)
+if err != nil {
+ log.Fatalln("error:", err)
+}
+
+for _, c := range colors {
+ var dst any
+ switch c.Space {
+ case "RGB":
+ dst = new(RGB)
+ case "YCbCr":
+ dst = new(YCbCr)
+ }
+ err := json.Unmarshal(c.Point, dst)
+ if err != nil {
+ log.Fatalln("error:", err)
+ }
+ fmt.Println(c.Space, dst)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">YCbCr &amp;{255 0 -10}
+RGB &amp;{98 218 255}
+</pre> <h3 id="RawMessage.MarshalJSON">func (RawMessage) <span>MarshalJSON</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (m RawMessage) MarshalJSON() ([]byte, error)</pre> <p>MarshalJSON returns m as the JSON encoding of m. </p>
+<h3 id="RawMessage.UnmarshalJSON">func (*RawMessage) <span>UnmarshalJSON</span> </h3> <pre data-language="go">func (m *RawMessage) UnmarshalJSON(data []byte) error</pre> <p>UnmarshalJSON sets *m to a copy of data. </p>
+<h2 id="SyntaxError">type <span>SyntaxError</span> </h2> <p>A SyntaxError is a description of a JSON syntax error. <a href="#Unmarshal">Unmarshal</a> will return a SyntaxError if the JSON can't be parsed. </p>
+<pre data-language="go">type SyntaxError struct {
+ Offset int64 // error occurred after reading Offset bytes
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="SyntaxError.Error">func (*SyntaxError) <span>Error</span> </h3> <pre data-language="go">func (e *SyntaxError) Error() string</pre> <h2 id="Token">type <span>Token</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Token holds a value of one of these types: </p>
+<ul> <li>
+<a href="#Delim">Delim</a>, for the four JSON delimiters [ ] { } </li>
+<li>bool, for JSON booleans </li>
+<li>float64, for JSON numbers </li>
+<li>
+<a href="#Number">Number</a>, for JSON numbers </li>
+<li>string, for JSON string literals </li>
+<li>nil, for JSON null </li>
+</ul> <pre data-language="go">type Token any</pre> <h2 id="UnmarshalFieldError">type <span>UnmarshalFieldError</span> </h2> <p>An UnmarshalFieldError describes a JSON object key that led to an unexported (and therefore unwritable) struct field. </p>
+<p>Deprecated: No longer used; kept for compatibility. </p>
+<pre data-language="go">type UnmarshalFieldError struct {
+ Key string
+ Type reflect.Type
+ Field reflect.StructField
+}
+</pre> <h3 id="UnmarshalFieldError.Error">func (*UnmarshalFieldError) <span>Error</span> </h3> <pre data-language="go">func (e *UnmarshalFieldError) Error() string</pre> <h2 id="UnmarshalTypeError">type <span>UnmarshalTypeError</span> </h2> <p>An UnmarshalTypeError describes a JSON value that was not appropriate for a value of a specific Go type. </p>
+<pre data-language="go">type UnmarshalTypeError struct {
+ Value string // description of JSON value - "bool", "array", "number -5"
+ Type reflect.Type // type of Go value it could not be assigned to
+ Offset int64 // error occurred after reading Offset bytes; added in Go 1.5
+ Struct string // name of the struct type containing the field; added in Go 1.8
+ Field string // the full path from root node to the field; added in Go 1.8
+}
+</pre> <h3 id="UnmarshalTypeError.Error">func (*UnmarshalTypeError) <span>Error</span> </h3> <pre data-language="go">func (e *UnmarshalTypeError) Error() string</pre> <h2 id="Unmarshaler">type <span>Unmarshaler</span> </h2> <p>Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. The input can be assumed to be a valid encoding of a JSON value. UnmarshalJSON must copy the JSON data if it wishes to retain the data after returning. </p>
+<p>By convention, to approximate the behavior of <a href="#Unmarshal">Unmarshal</a> itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as a no-op. </p>
+<pre data-language="go">type Unmarshaler interface {
+ UnmarshalJSON([]byte) error
+}</pre> <h2 id="UnsupportedTypeError">type <span>UnsupportedTypeError</span> </h2> <p>An UnsupportedTypeError is returned by <a href="#Marshal">Marshal</a> when attempting to encode an unsupported value type. </p>
+<pre data-language="go">type UnsupportedTypeError struct {
+ Type reflect.Type
+}
+</pre> <h3 id="UnsupportedTypeError.Error">func (*UnsupportedTypeError) <span>Error</span> </h3> <pre data-language="go">func (e *UnsupportedTypeError) Error() string</pre> <h2 id="UnsupportedValueError">type <span>UnsupportedValueError</span> </h2> <p>An UnsupportedValueError is returned by <a href="#Marshal">Marshal</a> when attempting to encode an unsupported value. </p>
+<pre data-language="go">type UnsupportedValueError struct {
+ Value reflect.Value
+ Str string
+}
+</pre> <h3 id="UnsupportedValueError.Error">func (*UnsupportedValueError) <span>Error</span> </h3> <pre data-language="go">func (e *UnsupportedValueError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/json/" class="_attribution-link">http://golang.org/pkg/encoding/json/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fpem%2Findex.html b/devdocs/go/encoding%2Fpem%2Findex.html
new file mode 100644
index 00000000..1d12d49b
--- /dev/null
+++ b/devdocs/go/encoding%2Fpem%2Findex.html
@@ -0,0 +1,78 @@
+<h1> Package pem </h1> <ul id="short-nav">
+<li><code>import "encoding/pem"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package pem implements the PEM data encoding, which originated in Privacy Enhanced Mail. The most common use of PEM encoding today is in TLS keys and certificates. See RFC 1421. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Encode">func Encode(out io.Writer, b *Block) error</a></li>
+<li><a href="#EncodeToMemory">func EncodeToMemory(b *Block) []byte</a></li>
+<li><a href="#Block">type Block</a></li>
+<li> <a href="#Decode">func Decode(data []byte) (p *Block, rest []byte)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Decode">Decode</a></dd> <dd><a class="exampleLink" href="#example_Encode">Encode</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>pem.go</span> </p> <h2 id="Encode">func <span>Encode</span> </h2> <pre data-language="go">func Encode(out io.Writer, b *Block) error</pre> <p>Encode writes the PEM encoding of b to out. </p> <h4 id="example_Encode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">block := &amp;pem.Block{
+ Type: "MESSAGE",
+ Headers: map[string]string{
+ "Animal": "Gopher",
+ },
+ Bytes: []byte("test"),
+}
+
+if err := pem.Encode(os.Stdout, block); err != nil {
+ log.Fatal(err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">-----BEGIN MESSAGE-----
+Animal: Gopher
+
+dGVzdA==
+-----END MESSAGE-----
+</pre> <h2 id="EncodeToMemory">func <span>EncodeToMemory</span> </h2> <pre data-language="go">func EncodeToMemory(b *Block) []byte</pre> <p>EncodeToMemory returns the PEM encoding of b. </p>
+<p>If b has invalid headers and cannot be encoded, EncodeToMemory returns nil. If it is important to report details about this error case, use <a href="#Encode">Encode</a> instead. </p>
+<h2 id="Block">type <span>Block</span> </h2> <p>A Block represents a PEM encoded structure. </p>
+<p>The encoded form is: </p>
+<pre data-language="go">-----BEGIN Type-----
+Headers
+base64-encoded Bytes
+-----END Type-----
+</pre> <p>where [Block.Headers] is a possibly empty sequence of Key: Value lines. </p>
+<pre data-language="go">type Block struct {
+ Type string // The type, taken from the preamble (i.e. "RSA PRIVATE KEY").
+ Headers map[string]string // Optional headers.
+ Bytes []byte // The decoded bytes of the contents. Typically a DER encoded ASN.1 structure.
+}
+</pre> <h3 id="Decode">func <span>Decode</span> </h3> <pre data-language="go">func Decode(data []byte) (p *Block, rest []byte)</pre> <p>Decode will find the next PEM formatted block (certificate, private key etc) in the input. It returns that block and the remainder of the input. If no PEM data is found, p is nil and the whole of the input is returned in rest. </p> <h4 id="example_Decode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var pubPEMData = []byte(`
+-----BEGIN PUBLIC KEY-----
+MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlRuRnThUjU8/prwYxbty
+WPT9pURI3lbsKMiB6Fn/VHOKE13p4D8xgOCADpdRagdT6n4etr9atzDKUSvpMtR3
+CP5noNc97WiNCggBjVWhs7szEe8ugyqF23XwpHQ6uV1LKH50m92MbOWfCtjU9p/x
+qhNpQQ1AZhqNy5Gevap5k8XzRmjSldNAFZMY7Yv3Gi+nyCwGwpVtBUwhuLzgNFK/
+yDtw2WcWmUU7NuC8Q6MWvPebxVtCfVp/iQU6q60yyt6aGOBkhAX0LpKAEhKidixY
+nP9PNVBvxgu3XZ4P36gZV6+ummKdBVnc3NqwBLu5+CcdRdusmHPHd5pHf4/38Z3/
+6qU2a/fPvWzceVTEgZ47QjFMTCTmCwNt29cvi7zZeQzjtwQgn4ipN9NibRH/Ax/q
+TbIzHfrJ1xa2RteWSdFjwtxi9C20HUkjXSeI4YlzQMH0fPX6KCE7aVePTOnB69I/
+a9/q96DiXZajwlpq3wFctrs1oXqBp5DVrCIj8hU2wNgB7LtQ1mCtsYz//heai0K9
+PhE4X6hiE0YmeAZjR0uHl8M/5aW9xCoJ72+12kKpWAa0SFRWLy6FejNYCYpkupVJ
+yecLk/4L1W0l6jQQZnWErXZYe0PNFcmwGXy1Rep83kfBRNKRy5tvocalLlwXLdUk
+AIU+2GKjyT3iMuzZxxFxPFMCAwEAAQ==
+-----END PUBLIC KEY-----
+and some more`)
+
+block, rest := pem.Decode(pubPEMData)
+if block == nil || block.Type != "PUBLIC KEY" {
+ log.Fatal("failed to decode PEM block containing public key")
+}
+
+pub, err := x509.ParsePKIXPublicKey(block.Bytes)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("Got a %T, with remaining data: %q", pub, rest)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Got a *rsa.PublicKey, with remaining data: "and some more"
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/pem/" class="_attribution-link">http://golang.org/pkg/encoding/pem/</a>
+ </p>
+</div>
diff --git a/devdocs/go/encoding%2Fxml%2Findex.html b/devdocs/go/encoding%2Fxml%2Findex.html
new file mode 100644
index 00000000..381d7195
--- /dev/null
+++ b/devdocs/go/encoding%2Fxml%2Findex.html
@@ -0,0 +1,596 @@
+<h1> Package xml </h1> <ul id="short-nav">
+<li><code>import "encoding/xml"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package xml implements a simple XML 1.0 parser that understands XML name spaces. </p> <h4 id="example__customMarshalXML"> <span class="text">Example (CustomMarshalXML)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package xml_test
+
+import (
+ "encoding/xml"
+ "fmt"
+ "log"
+ "strings"
+)
+
+type Animal int
+
+const (
+ Unknown Animal = iota
+ Gopher
+ Zebra
+)
+
+func (a *Animal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
+ var s string
+ if err := d.DecodeElement(&amp;s, &amp;start); err != nil {
+ return err
+ }
+ switch strings.ToLower(s) {
+ default:
+ *a = Unknown
+ case "gopher":
+ *a = Gopher
+ case "zebra":
+ *a = Zebra
+ }
+
+ return nil
+}
+
+func (a Animal) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
+ var s string
+ switch a {
+ default:
+ s = "unknown"
+ case Gopher:
+ s = "gopher"
+ case Zebra:
+ s = "zebra"
+ }
+ return e.EncodeElement(s, start)
+}
+
+func Example_customMarshalXML() {
+ blob := `
+ &lt;animals&gt;
+ &lt;animal&gt;gopher&lt;/animal&gt;
+ &lt;animal&gt;armadillo&lt;/animal&gt;
+ &lt;animal&gt;zebra&lt;/animal&gt;
+ &lt;animal&gt;unknown&lt;/animal&gt;
+ &lt;animal&gt;gopher&lt;/animal&gt;
+ &lt;animal&gt;bee&lt;/animal&gt;
+ &lt;animal&gt;gopher&lt;/animal&gt;
+ &lt;animal&gt;zebra&lt;/animal&gt;
+ &lt;/animals&gt;`
+ var zoo struct {
+ Animals []Animal `xml:"animal"`
+ }
+ if err := xml.Unmarshal([]byte(blob), &amp;zoo); err != nil {
+ log.Fatal(err)
+ }
+
+ census := make(map[Animal]int)
+ for _, animal := range zoo.Animals {
+ census[animal] += 1
+ }
+
+ fmt.Printf("Zoo Census:\n* Gophers: %d\n* Zebras: %d\n* Unknown: %d\n",
+ census[Gopher], census[Zebra], census[Unknown])
+
+ // Output:
+ // Zoo Census:
+ // * Gophers: 3
+ // * Zebras: 2
+ // * Unknown: 3
+}
+</pre> <h4 id="example__textMarshalXML"> <span class="text">Example (TextMarshalXML)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package xml_test
+
+import (
+ "encoding/xml"
+ "fmt"
+ "log"
+ "strings"
+)
+
+type Size int
+
+const (
+ Unrecognized Size = iota
+ Small
+ Large
+)
+
+func (s *Size) UnmarshalText(text []byte) error {
+ switch strings.ToLower(string(text)) {
+ default:
+ *s = Unrecognized
+ case "small":
+ *s = Small
+ case "large":
+ *s = Large
+ }
+ return nil
+}
+
+func (s Size) MarshalText() ([]byte, error) {
+ var name string
+ switch s {
+ default:
+ name = "unrecognized"
+ case Small:
+ name = "small"
+ case Large:
+ name = "large"
+ }
+ return []byte(name), nil
+}
+
+func Example_textMarshalXML() {
+ blob := `
+ &lt;sizes&gt;
+ &lt;size&gt;small&lt;/size&gt;
+ &lt;size&gt;regular&lt;/size&gt;
+ &lt;size&gt;large&lt;/size&gt;
+ &lt;size&gt;unrecognized&lt;/size&gt;
+ &lt;size&gt;small&lt;/size&gt;
+ &lt;size&gt;normal&lt;/size&gt;
+ &lt;size&gt;small&lt;/size&gt;
+ &lt;size&gt;large&lt;/size&gt;
+ &lt;/sizes&gt;`
+ var inventory struct {
+ Sizes []Size `xml:"size"`
+ }
+ if err := xml.Unmarshal([]byte(blob), &amp;inventory); err != nil {
+ log.Fatal(err)
+ }
+
+ counts := make(map[Size]int)
+ for _, size := range inventory.Sizes {
+ counts[size] += 1
+ }
+
+ fmt.Printf("Inventory Counts:\n* Small: %d\n* Large: %d\n* Unrecognized: %d\n",
+ counts[Small], counts[Large], counts[Unrecognized])
+
+ // Output:
+ // Inventory Counts:
+ // * Small: 3
+ // * Large: 2
+ // * Unrecognized: 3
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Escape">func Escape(w io.Writer, s []byte)</a></li>
+<li><a href="#EscapeText">func EscapeText(w io.Writer, s []byte) error</a></li>
+<li><a href="#Marshal">func Marshal(v any) ([]byte, error)</a></li>
+<li><a href="#MarshalIndent">func MarshalIndent(v any, prefix, indent string) ([]byte, error)</a></li>
+<li><a href="#Unmarshal">func Unmarshal(data []byte, v any) error</a></li>
+<li><a href="#Attr">type Attr</a></li>
+<li><a href="#CharData">type CharData</a></li>
+<li> <a href="#CharData.Copy">func (c CharData) Copy() CharData</a>
+</li>
+<li><a href="#Comment">type Comment</a></li>
+<li> <a href="#Comment.Copy">func (c Comment) Copy() Comment</a>
+</li>
+<li><a href="#Decoder">type Decoder</a></li>
+<li> <a href="#NewDecoder">func NewDecoder(r io.Reader) *Decoder</a>
+</li>
+<li> <a href="#NewTokenDecoder">func NewTokenDecoder(t TokenReader) *Decoder</a>
+</li>
+<li> <a href="#Decoder.Decode">func (d *Decoder) Decode(v any) error</a>
+</li>
+<li> <a href="#Decoder.DecodeElement">func (d *Decoder) DecodeElement(v any, start *StartElement) error</a>
+</li>
+<li> <a href="#Decoder.InputOffset">func (d *Decoder) InputOffset() int64</a>
+</li>
+<li> <a href="#Decoder.InputPos">func (d *Decoder) InputPos() (line, column int)</a>
+</li>
+<li> <a href="#Decoder.RawToken">func (d *Decoder) RawToken() (Token, error)</a>
+</li>
+<li> <a href="#Decoder.Skip">func (d *Decoder) Skip() error</a>
+</li>
+<li> <a href="#Decoder.Token">func (d *Decoder) Token() (Token, error)</a>
+</li>
+<li><a href="#Directive">type Directive</a></li>
+<li> <a href="#Directive.Copy">func (d Directive) Copy() Directive</a>
+</li>
+<li><a href="#Encoder">type Encoder</a></li>
+<li> <a href="#NewEncoder">func NewEncoder(w io.Writer) *Encoder</a>
+</li>
+<li> <a href="#Encoder.Close">func (enc *Encoder) Close() error</a>
+</li>
+<li> <a href="#Encoder.Encode">func (enc *Encoder) Encode(v any) error</a>
+</li>
+<li> <a href="#Encoder.EncodeElement">func (enc *Encoder) EncodeElement(v any, start StartElement) error</a>
+</li>
+<li> <a href="#Encoder.EncodeToken">func (enc *Encoder) EncodeToken(t Token) error</a>
+</li>
+<li> <a href="#Encoder.Flush">func (enc *Encoder) Flush() error</a>
+</li>
+<li> <a href="#Encoder.Indent">func (enc *Encoder) Indent(prefix, indent string)</a>
+</li>
+<li><a href="#EndElement">type EndElement</a></li>
+<li><a href="#Marshaler">type Marshaler</a></li>
+<li><a href="#MarshalerAttr">type MarshalerAttr</a></li>
+<li><a href="#Name">type Name</a></li>
+<li><a href="#ProcInst">type ProcInst</a></li>
+<li> <a href="#ProcInst.Copy">func (p ProcInst) Copy() ProcInst</a>
+</li>
+<li><a href="#StartElement">type StartElement</a></li>
+<li> <a href="#StartElement.Copy">func (e StartElement) Copy() StartElement</a>
+</li>
+<li> <a href="#StartElement.End">func (e StartElement) End() EndElement</a>
+</li>
+<li><a href="#SyntaxError">type SyntaxError</a></li>
+<li> <a href="#SyntaxError.Error">func (e *SyntaxError) Error() string</a>
+</li>
+<li><a href="#TagPathError">type TagPathError</a></li>
+<li> <a href="#TagPathError.Error">func (e *TagPathError) Error() string</a>
+</li>
+<li><a href="#Token">type Token</a></li>
+<li> <a href="#CopyToken">func CopyToken(t Token) Token</a>
+</li>
+<li><a href="#TokenReader">type TokenReader</a></li>
+<li><a href="#UnmarshalError">type UnmarshalError</a></li>
+<li> <a href="#UnmarshalError.Error">func (e UnmarshalError) Error() string</a>
+</li>
+<li><a href="#Unmarshaler">type Unmarshaler</a></li>
+<li><a href="#UnmarshalerAttr">type UnmarshalerAttr</a></li>
+<li><a href="#UnsupportedTypeError">type UnsupportedTypeError</a></li>
+<li> <a href="#UnsupportedTypeError.Error">func (e *UnsupportedTypeError) Error() string</a>
+</li>
+<li><a href="#pkg-note-BUG">Bugs</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Encoder">Encoder</a></dd> <dd><a class="exampleLink" href="#example_MarshalIndent">MarshalIndent</a></dd> <dd><a class="exampleLink" href="#example_Unmarshal">Unmarshal</a></dd> <dd><a class="exampleLink" href="#example__customMarshalXML">Package (CustomMarshalXML)</a></dd> <dd><a class="exampleLink" href="#example__textMarshalXML">Package (TextMarshalXML)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>marshal.go</span> <span>read.go</span> <span>typeinfo.go</span> <span>xml.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ // Header is a generic XML header suitable for use with the output of [Marshal].
+ // This is not automatically added to any output of this package,
+ // it is provided as a convenience.
+ Header = `&lt;?xml version="1.0" encoding="UTF-8"?&gt;` + "\n"
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>HTMLAutoClose is the set of HTML elements that should be considered to close automatically. </p>
+<p>See the [Decoder.Strict] and [Decoder.Entity] fields' documentation. </p>
+<pre data-language="go">var HTMLAutoClose []string = htmlAutoClose</pre> <p>HTMLEntity is an entity map containing translations for the standard HTML entity characters. </p>
+<p>See the [Decoder.Strict] and [Decoder.Entity] fields' documentation. </p>
+<pre data-language="go">var HTMLEntity map[string]string = htmlEntity</pre> <h2 id="Escape">func <span>Escape</span> </h2> <pre data-language="go">func Escape(w io.Writer, s []byte)</pre> <p>Escape is like <a href="#EscapeText">EscapeText</a> but omits the error return value. It is provided for backwards compatibility with Go 1.0. Code targeting Go 1.1 or later should use <a href="#EscapeText">EscapeText</a>. </p>
+<h2 id="EscapeText">func <span>EscapeText</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func EscapeText(w io.Writer, s []byte) error</pre> <p>EscapeText writes to w the properly escaped XML equivalent of the plain text data s. </p>
+<h2 id="Marshal">func <span>Marshal</span> </h2> <pre data-language="go">func Marshal(v any) ([]byte, error)</pre> <p>Marshal returns the XML encoding of v. </p>
+<p>Marshal handles an array or slice by marshaling each of the elements. Marshal handles a pointer by marshaling the value it points at or, if the pointer is nil, by writing nothing. Marshal handles an interface value by marshaling the value it contains or, if the interface value is nil, by writing nothing. Marshal handles all other data by writing one or more XML elements containing the data. </p>
+<p>The name for the XML elements is taken from, in order of preference: </p>
+<ul> <li>the tag on the XMLName field, if the data is a struct </li>
+<li>the value of the XMLName field of type <a href="#Name">Name</a> </li>
+<li>the tag of the struct field used to obtain the data </li>
+<li>the name of the struct field used to obtain the data </li>
+<li>the name of the marshaled type </li>
+</ul> <p>The XML element for a struct contains marshaled elements for each of the exported fields of the struct, with these exceptions: </p>
+<ul> <li>the XMLName field, described above, is omitted. </li>
+<li>a field with tag "-" is omitted. </li>
+<li>a field with tag "name,attr" becomes an attribute with the given name in the XML element. </li>
+<li>a field with tag ",attr" becomes an attribute with the field name in the XML element. </li>
+<li>a field with tag ",chardata" is written as character data, not as an XML element. </li>
+<li>a field with tag ",cdata" is written as character data wrapped in one or more &lt;![CDATA[ ... ]]&gt; tags, not as an XML element. </li>
+<li>a field with tag ",innerxml" is written verbatim, not subject to the usual marshaling procedure. </li>
+<li>a field with tag ",comment" is written as an XML comment, not subject to the usual marshaling procedure. It must not contain the "--" string within it. </li>
+<li>a field with a tag including the "omitempty" option is omitted if the field value is empty. The empty values are false, 0, any nil pointer or interface value, and any array, slice, map, or string of length zero. </li>
+<li>an anonymous struct field is handled as if the fields of its value were part of the outer struct. </li>
+<li>a field implementing <a href="#Marshaler">Marshaler</a> is written by calling its MarshalXML method. </li>
+<li>a field implementing <span>encoding.TextMarshaler</span> is written by encoding the result of its MarshalText method as text. </li>
+</ul> <p>If a field uses a tag "a&gt;b&gt;c", then the element c will be nested inside parent elements a and b. Fields that appear next to each other that name the same parent will be enclosed in one XML element. </p>
+<p>If the XML name for a struct field is defined by both the field tag and the struct's XMLName field, the names must match. </p>
+<p>See <a href="#MarshalIndent">MarshalIndent</a> for an example. </p>
+<p>Marshal will return an error if asked to marshal a channel, function, or map. </p>
+<h2 id="MarshalIndent">func <span>MarshalIndent</span> </h2> <pre data-language="go">func MarshalIndent(v any, prefix, indent string) ([]byte, error)</pre> <p>MarshalIndent works like <a href="#Marshal">Marshal</a>, but each XML element begins on a new indented line that starts with prefix and is followed by one or more copies of indent according to the nesting depth. </p> <h4 id="example_MarshalIndent"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type Address struct {
+ City, State string
+}
+type Person struct {
+ XMLName xml.Name `xml:"person"`
+ Id int `xml:"id,attr"`
+ FirstName string `xml:"name&gt;first"`
+ LastName string `xml:"name&gt;last"`
+ Age int `xml:"age"`
+ Height float32 `xml:"height,omitempty"`
+ Married bool
+ Address
+ Comment string `xml:",comment"`
+}
+
+v := &amp;Person{Id: 13, FirstName: "John", LastName: "Doe", Age: 42}
+v.Comment = " Need more details. "
+v.Address = Address{"Hanga Roa", "Easter Island"}
+
+output, err := xml.MarshalIndent(v, " ", " ")
+if err != nil {
+ fmt.Printf("error: %v\n", err)
+}
+
+os.Stdout.Write(output)
+</pre> <p>Output:</p> <pre class="output" data-language="go"> &lt;person id="13"&gt;
+ &lt;name&gt;
+ &lt;first&gt;John&lt;/first&gt;
+ &lt;last&gt;Doe&lt;/last&gt;
+ &lt;/name&gt;
+ &lt;age&gt;42&lt;/age&gt;
+ &lt;Married&gt;false&lt;/Married&gt;
+ &lt;City&gt;Hanga Roa&lt;/City&gt;
+ &lt;State&gt;Easter Island&lt;/State&gt;
+ &lt;!-- Need more details. --&gt;
+ &lt;/person&gt;
+</pre> <h2 id="Unmarshal">func <span>Unmarshal</span> </h2> <pre data-language="go">func Unmarshal(data []byte, v any) error</pre> <p>Unmarshal parses the XML-encoded data and stores the result in the value pointed to by v, which must be an arbitrary struct, slice, or string. Well-formed data that does not fit into v is discarded. </p>
+<p>Because Unmarshal uses the reflect package, it can only assign to exported (upper case) fields. Unmarshal uses a case-sensitive comparison to match XML element names to tag values and struct field names. </p>
+<p>Unmarshal maps an XML element to a struct using the following rules. In the rules, the tag of a field refers to the value associated with the key 'xml' in the struct field's tag (see the example above). </p>
+<ul> <li><p>If the struct has a field of type []byte or string with tag ",innerxml", Unmarshal accumulates the raw XML nested inside the element in that field. The rest of the rules still apply. </p></li>
+<li><p>If the struct has a field named XMLName of type Name, Unmarshal records the element name in that field. </p></li>
+<li><p>If the XMLName field has an associated tag of the form "name" or "namespace-URL name", the XML element must have the given name (and, optionally, name space) or else Unmarshal returns an error. </p></li>
+<li><p>If the XML element has an attribute whose name matches a struct field name with an associated tag containing ",attr" or the explicit name in a struct field tag of the form "name,attr", Unmarshal records the attribute value in that field. </p></li>
+<li><p>If the XML element has an attribute not handled by the previous rule and the struct has a field with an associated tag containing ",any,attr", Unmarshal records the attribute value in the first such field. </p></li>
+<li><p>If the XML element contains character data, that data is accumulated in the first struct field that has tag ",chardata". The struct field may have type []byte or string. If there is no such field, the character data is discarded. </p></li>
+<li><p>If the XML element contains comments, they are accumulated in the first struct field that has tag ",comment". The struct field may have type []byte or string. If there is no such field, the comments are discarded. </p></li>
+<li><p>If the XML element contains a sub-element whose name matches the prefix of a tag formatted as "a" or "a&gt;b&gt;c", unmarshal will descend into the XML structure looking for elements with the given names, and will map the innermost elements to that struct field. A tag starting with "&gt;" is equivalent to one starting with the field name followed by "&gt;". </p></li>
+<li><p>If the XML element contains a sub-element whose name matches a struct field's XMLName tag and the struct field has no explicit name tag as per the previous rule, unmarshal maps the sub-element to that struct field. </p></li>
+<li><p>If the XML element contains a sub-element whose name matches a field without any mode flags (",attr", ",chardata", etc), Unmarshal maps the sub-element to that struct field. </p></li>
+<li><p>If the XML element contains a sub-element that hasn't matched any of the above rules and the struct has a field with tag ",any", unmarshal maps the sub-element to that struct field. </p></li>
+<li><p>An anonymous struct field is handled as if the fields of its value were part of the outer struct. </p></li>
+<li><p>A struct field with tag "-" is never unmarshaled into. </p></li>
+</ul> <p>If Unmarshal encounters a field type that implements the Unmarshaler interface, Unmarshal calls its UnmarshalXML method to produce the value from the XML element. Otherwise, if the value implements <span>encoding.TextUnmarshaler</span>, Unmarshal calls that value's UnmarshalText method. </p>
+<p>Unmarshal maps an XML element to a string or []byte by saving the concatenation of that element's character data in the string or []byte. The saved []byte is never nil. </p>
+<p>Unmarshal maps an attribute value to a string or []byte by saving the value in the string or slice. </p>
+<p>Unmarshal maps an attribute value to an <a href="#Attr">Attr</a> by saving the attribute, including its name, in the Attr. </p>
+<p>Unmarshal maps an XML element or attribute value to a slice by extending the length of the slice and mapping the element or attribute to the newly created value. </p>
+<p>Unmarshal maps an XML element or attribute value to a bool by setting it to the boolean value represented by the string. Whitespace is trimmed and ignored. </p>
+<p>Unmarshal maps an XML element or attribute value to an integer or floating-point field by setting the field to the result of interpreting the string value in decimal. There is no check for overflow. Whitespace is trimmed and ignored. </p>
+<p>Unmarshal maps an XML element to a Name by recording the element name. </p>
+<p>Unmarshal maps an XML element to a pointer by setting the pointer to a freshly allocated value and then mapping the element to that value. </p>
+<p>A missing element or empty attribute value will be unmarshaled as a zero value. If the field is a slice, a zero value will be appended to the field. Otherwise, the field will be set to its zero value. </p> <h4 id="example_Unmarshal"> <span class="text">Example</span>
+</h4> <p>This example demonstrates unmarshaling an XML excerpt into a value with some preset fields. Note that the Phone field isn't modified and that the XML &lt;Company&gt; element is ignored. Also, the Groups field is assigned considering the element path provided in its tag. </p> <p>Code:</p> <pre class="code" data-language="go">type Email struct {
+ Where string `xml:"where,attr"`
+ Addr string
+}
+type Address struct {
+ City, State string
+}
+type Result struct {
+ XMLName xml.Name `xml:"Person"`
+ Name string `xml:"FullName"`
+ Phone string
+ Email []Email
+ Groups []string `xml:"Group&gt;Value"`
+ Address
+}
+v := Result{Name: "none", Phone: "none"}
+
+data := `
+ &lt;Person&gt;
+ &lt;FullName&gt;Grace R. Emlin&lt;/FullName&gt;
+ &lt;Company&gt;Example Inc.&lt;/Company&gt;
+ &lt;Email where="home"&gt;
+ &lt;Addr&gt;gre@example.com&lt;/Addr&gt;
+ &lt;/Email&gt;
+ &lt;Email where='work'&gt;
+ &lt;Addr&gt;gre@work.com&lt;/Addr&gt;
+ &lt;/Email&gt;
+ &lt;Group&gt;
+ &lt;Value&gt;Friends&lt;/Value&gt;
+ &lt;Value&gt;Squash&lt;/Value&gt;
+ &lt;/Group&gt;
+ &lt;City&gt;Hanga Roa&lt;/City&gt;
+ &lt;State&gt;Easter Island&lt;/State&gt;
+ &lt;/Person&gt;
+ `
+err := xml.Unmarshal([]byte(data), &amp;v)
+if err != nil {
+ fmt.Printf("error: %v", err)
+ return
+}
+fmt.Printf("XMLName: %#v\n", v.XMLName)
+fmt.Printf("Name: %q\n", v.Name)
+fmt.Printf("Phone: %q\n", v.Phone)
+fmt.Printf("Email: %v\n", v.Email)
+fmt.Printf("Groups: %v\n", v.Groups)
+fmt.Printf("Address: %v\n", v.Address)
+</pre> <p>Output:</p> <pre class="output" data-language="go">XMLName: xml.Name{Space:"", Local:"Person"}
+Name: "Grace R. Emlin"
+Phone: "none"
+Email: [{home gre@example.com} {work gre@work.com}]
+Groups: [Friends Squash]
+Address: {Hanga Roa Easter Island}
+</pre> <h2 id="Attr">type <span>Attr</span> </h2> <p>An Attr represents an attribute in an XML element (Name=Value). </p>
+<pre data-language="go">type Attr struct {
+ Name Name
+ Value string
+}
+</pre> <h2 id="CharData">type <span>CharData</span> </h2> <p>A CharData represents XML character data (raw text), in which XML escape sequences have been replaced by the characters they represent. </p>
+<pre data-language="go">type CharData []byte</pre> <h3 id="CharData.Copy">func (CharData) <span>Copy</span> </h3> <pre data-language="go">func (c CharData) Copy() CharData</pre> <p>Copy creates a new copy of CharData. </p>
+<h2 id="Comment">type <span>Comment</span> </h2> <p>A Comment represents an XML comment of the form &lt;!--comment--&gt;. The bytes do not include the &lt;!-- and --&gt; comment markers. </p>
+<pre data-language="go">type Comment []byte</pre> <h3 id="Comment.Copy">func (Comment) <span>Copy</span> </h3> <pre data-language="go">func (c Comment) Copy() Comment</pre> <p>Copy creates a new copy of Comment. </p>
+<h2 id="Decoder">type <span>Decoder</span> </h2> <p>A Decoder represents an XML parser reading a particular input stream. The parser assumes that its input is encoded in UTF-8. </p>
+<pre data-language="go">type Decoder struct {
+ // Strict defaults to true, enforcing the requirements
+ // of the XML specification.
+ // If set to false, the parser allows input containing common
+ // mistakes:
+ // * If an element is missing an end tag, the parser invents
+ // end tags as necessary to keep the return values from Token
+ // properly balanced.
+ // * In attribute values and character data, unknown or malformed
+ // character entities (sequences beginning with &amp;) are left alone.
+ //
+ // Setting:
+ //
+ // d.Strict = false
+ // d.AutoClose = xml.HTMLAutoClose
+ // d.Entity = xml.HTMLEntity
+ //
+ // creates a parser that can handle typical HTML.
+ //
+ // Strict mode does not enforce the requirements of the XML name spaces TR.
+ // In particular it does not reject name space tags using undefined prefixes.
+ // Such tags are recorded with the unknown prefix as the name space URL.
+ Strict bool
+
+ // When Strict == false, AutoClose indicates a set of elements to
+ // consider closed immediately after they are opened, regardless
+ // of whether an end element is present.
+ AutoClose []string
+
+ // Entity can be used to map non-standard entity names to string replacements.
+ // The parser behaves as if these standard mappings are present in the map,
+ // regardless of the actual map content:
+ //
+ // "lt": "&lt;",
+ // "gt": "&gt;",
+ // "amp": "&amp;",
+ // "apos": "'",
+ // "quot": `"`,
+ Entity map[string]string
+
+ // CharsetReader, if non-nil, defines a function to generate
+ // charset-conversion readers, converting from the provided
+ // non-UTF-8 charset into UTF-8. If CharsetReader is nil or
+ // returns an error, parsing stops with an error. One of the
+ // CharsetReader's result values must be non-nil.
+ CharsetReader func(charset string, input io.Reader) (io.Reader, error)
+
+ // DefaultSpace sets the default name space used for unadorned tags,
+ // as if the entire XML stream were wrapped in an element containing
+ // the attribute xmlns="DefaultSpace".
+ DefaultSpace string // Go 1.1
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewDecoder">func <span>NewDecoder</span> </h3> <pre data-language="go">func NewDecoder(r io.Reader) *Decoder</pre> <p>NewDecoder creates a new XML parser reading from r. If r does not implement <span>io.ByteReader</span>, NewDecoder will do its own buffering. </p>
+<h3 id="NewTokenDecoder">func <span>NewTokenDecoder</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func NewTokenDecoder(t TokenReader) *Decoder</pre> <p>NewTokenDecoder creates a new XML parser using an underlying token stream. </p>
+<h3 id="Decoder.Decode">func (*Decoder) <span>Decode</span> </h3> <pre data-language="go">func (d *Decoder) Decode(v any) error</pre> <p>Decode works like <a href="#Unmarshal">Unmarshal</a>, except it reads the decoder stream to find the start element. </p>
+<h3 id="Decoder.DecodeElement">func (*Decoder) <span>DecodeElement</span> </h3> <pre data-language="go">func (d *Decoder) DecodeElement(v any, start *StartElement) error</pre> <p>DecodeElement works like <a href="#Unmarshal">Unmarshal</a> except that it takes a pointer to the start XML element to decode into v. It is useful when a client reads some raw XML tokens itself but also wants to defer to <a href="#Unmarshal">Unmarshal</a> for some elements. </p>
+<h3 id="Decoder.InputOffset">func (*Decoder) <span>InputOffset</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (d *Decoder) InputOffset() int64</pre> <p>InputOffset returns the input stream byte offset of the current decoder position. The offset gives the location of the end of the most recently returned token and the beginning of the next token. </p>
+<h3 id="Decoder.InputPos">func (*Decoder) <span>InputPos</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (d *Decoder) InputPos() (line, column int)</pre> <p>InputPos returns the line of the current decoder position and the 1 based input position of the line. The position gives the location of the end of the most recently returned token. </p>
+<h3 id="Decoder.RawToken">func (*Decoder) <span>RawToken</span> </h3> <pre data-language="go">func (d *Decoder) RawToken() (Token, error)</pre> <p>RawToken is like <a href="#Decoder.Token">Decoder.Token</a> but does not verify that start and end elements match and does not translate name space prefixes to their corresponding URLs. </p>
+<h3 id="Decoder.Skip">func (*Decoder) <span>Skip</span> </h3> <pre data-language="go">func (d *Decoder) Skip() error</pre> <p>Skip reads tokens until it has consumed the end element matching the most recent start element already consumed, skipping nested structures. It returns nil if it finds an end element matching the start element; otherwise it returns an error describing the problem. </p>
+<h3 id="Decoder.Token">func (*Decoder) <span>Token</span> </h3> <pre data-language="go">func (d *Decoder) Token() (Token, error)</pre> <p>Token returns the next XML token in the input stream. At the end of the input stream, Token returns nil, <span>io.EOF</span>. </p>
+<p>Slices of bytes in the returned token data refer to the parser's internal buffer and remain valid only until the next call to Token. To acquire a copy of the bytes, call <a href="#CopyToken">CopyToken</a> or the token's Copy method. </p>
+<p>Token expands self-closing elements such as &lt;br&gt; into separate start and end elements returned by successive calls. </p>
+<p>Token guarantees that the <a href="#StartElement">StartElement</a> and <a href="#EndElement">EndElement</a> tokens it returns are properly nested and matched: if Token encounters an unexpected end element or EOF before all expected end elements, it will return an error. </p>
+<p>If [Decoder.CharsetReader] is called and returns an error, the error is wrapped and returned. </p>
+<p>Token implements XML name spaces as described by <a href="https://www.w3.org/TR/REC-xml-names/">https://www.w3.org/TR/REC-xml-names/</a>. Each of the <a href="#Name">Name</a> structures contained in the Token has the Space set to the URL identifying its name space when known. If Token encounters an unrecognized name space prefix, it uses the prefix as the Space rather than report an error. </p>
+<h2 id="Directive">type <span>Directive</span> </h2> <p>A Directive represents an XML directive of the form &lt;!text&gt;. The bytes do not include the &lt;! and &gt; markers. </p>
+<pre data-language="go">type Directive []byte</pre> <h3 id="Directive.Copy">func (Directive) <span>Copy</span> </h3> <pre data-language="go">func (d Directive) Copy() Directive</pre> <p>Copy creates a new copy of Directive. </p>
+<h2 id="Encoder">type <span>Encoder</span> </h2> <p>An Encoder writes XML data to an output stream. </p>
+<pre data-language="go">type Encoder struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Encoder"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type Address struct {
+ City, State string
+}
+type Person struct {
+ XMLName xml.Name `xml:"person"`
+ Id int `xml:"id,attr"`
+ FirstName string `xml:"name&gt;first"`
+ LastName string `xml:"name&gt;last"`
+ Age int `xml:"age"`
+ Height float32 `xml:"height,omitempty"`
+ Married bool
+ Address
+ Comment string `xml:",comment"`
+}
+
+v := &amp;Person{Id: 13, FirstName: "John", LastName: "Doe", Age: 42}
+v.Comment = " Need more details. "
+v.Address = Address{"Hanga Roa", "Easter Island"}
+
+enc := xml.NewEncoder(os.Stdout)
+enc.Indent(" ", " ")
+if err := enc.Encode(v); err != nil {
+ fmt.Printf("error: %v\n", err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go"> &lt;person id="13"&gt;
+ &lt;name&gt;
+ &lt;first&gt;John&lt;/first&gt;
+ &lt;last&gt;Doe&lt;/last&gt;
+ &lt;/name&gt;
+ &lt;age&gt;42&lt;/age&gt;
+ &lt;Married&gt;false&lt;/Married&gt;
+ &lt;City&gt;Hanga Roa&lt;/City&gt;
+ &lt;State&gt;Easter Island&lt;/State&gt;
+ &lt;!-- Need more details. --&gt;
+ &lt;/person&gt;
+</pre> <h3 id="NewEncoder">func <span>NewEncoder</span> </h3> <pre data-language="go">func NewEncoder(w io.Writer) *Encoder</pre> <p>NewEncoder returns a new encoder that writes to w. </p>
+<h3 id="Encoder.Close">func (*Encoder) <span>Close</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (enc *Encoder) Close() error</pre> <p>Close the Encoder, indicating that no more data will be written. It flushes any buffered XML to the underlying writer and returns an error if the written XML is invalid (e.g. by containing unclosed elements). </p>
+<h3 id="Encoder.Encode">func (*Encoder) <span>Encode</span> </h3> <pre data-language="go">func (enc *Encoder) Encode(v any) error</pre> <p>Encode writes the XML encoding of v to the stream. </p>
+<p>See the documentation for <a href="#Marshal">Marshal</a> for details about the conversion of Go values to XML. </p>
+<p>Encode calls <a href="#Encoder.Flush">Encoder.Flush</a> before returning. </p>
+<h3 id="Encoder.EncodeElement">func (*Encoder) <span>EncodeElement</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (enc *Encoder) EncodeElement(v any, start StartElement) error</pre> <p>EncodeElement writes the XML encoding of v to the stream, using start as the outermost tag in the encoding. </p>
+<p>See the documentation for <a href="#Marshal">Marshal</a> for details about the conversion of Go values to XML. </p>
+<p>EncodeElement calls <a href="#Encoder.Flush">Encoder.Flush</a> before returning. </p>
+<h3 id="Encoder.EncodeToken">func (*Encoder) <span>EncodeToken</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (enc *Encoder) EncodeToken(t Token) error</pre> <p>EncodeToken writes the given XML token to the stream. It returns an error if <a href="#StartElement">StartElement</a> and <a href="#EndElement">EndElement</a> tokens are not properly matched. </p>
+<p>EncodeToken does not call <a href="#Encoder.Flush">Encoder.Flush</a>, because usually it is part of a larger operation such as <a href="#Encoder.Encode">Encoder.Encode</a> or <a href="#Encoder.EncodeElement">Encoder.EncodeElement</a> (or a custom <a href="#Marshaler">Marshaler</a>'s MarshalXML invoked during those), and those will call Flush when finished. Callers that create an Encoder and then invoke EncodeToken directly, without using Encode or EncodeElement, need to call Flush when finished to ensure that the XML is written to the underlying writer. </p>
+<p>EncodeToken allows writing a <a href="#ProcInst">ProcInst</a> with Target set to "xml" only as the first token in the stream. </p>
+<h3 id="Encoder.Flush">func (*Encoder) <span>Flush</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (enc *Encoder) Flush() error</pre> <p>Flush flushes any buffered XML to the underlying writer. See the <a href="#Encoder.EncodeToken">Encoder.EncodeToken</a> documentation for details about when it is necessary. </p>
+<h3 id="Encoder.Indent">func (*Encoder) <span>Indent</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (enc *Encoder) Indent(prefix, indent string)</pre> <p>Indent sets the encoder to generate XML in which each element begins on a new indented line that starts with prefix and is followed by one or more copies of indent according to the nesting depth. </p>
+<h2 id="EndElement">type <span>EndElement</span> </h2> <p>An EndElement represents an XML end element. </p>
+<pre data-language="go">type EndElement struct {
+ Name Name
+}
+</pre> <h2 id="Marshaler">type <span>Marshaler</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>Marshaler is the interface implemented by objects that can marshal themselves into valid XML elements. </p>
+<p>MarshalXML encodes the receiver as zero or more XML elements. By convention, arrays or slices are typically encoded as a sequence of elements, one per entry. Using start as the element tag is not required, but doing so will enable <a href="#Unmarshal">Unmarshal</a> to match the XML elements to the correct struct field. One common implementation strategy is to construct a separate value with a layout corresponding to the desired XML and then to encode it using e.EncodeElement. Another common strategy is to use repeated calls to e.EncodeToken to generate the XML output one token at a time. The sequence of encoded tokens must make up zero or more valid XML elements. </p>
+<pre data-language="go">type Marshaler interface {
+ MarshalXML(e *Encoder, start StartElement) error
+}</pre> <h2 id="MarshalerAttr">type <span>MarshalerAttr</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>MarshalerAttr is the interface implemented by objects that can marshal themselves into valid XML attributes. </p>
+<p>MarshalXMLAttr returns an XML attribute with the encoded value of the receiver. Using name as the attribute name is not required, but doing so will enable <a href="#Unmarshal">Unmarshal</a> to match the attribute to the correct struct field. If MarshalXMLAttr returns the zero attribute <a href="#Attr">Attr</a>{}, no attribute will be generated in the output. MarshalXMLAttr is used only for struct fields with the "attr" option in the field tag. </p>
+<pre data-language="go">type MarshalerAttr interface {
+ MarshalXMLAttr(name Name) (Attr, error)
+}</pre> <h2 id="Name">type <span>Name</span> </h2> <p>A Name represents an XML name (Local) annotated with a name space identifier (Space). In tokens returned by <a href="#Decoder.Token">Decoder.Token</a>, the Space identifier is given as a canonical URL, not the short prefix used in the document being parsed. </p>
+<pre data-language="go">type Name struct {
+ Space, Local string
+}
+</pre> <h2 id="ProcInst">type <span>ProcInst</span> </h2> <p>A ProcInst represents an XML processing instruction of the form &lt;?target inst?&gt; </p>
+<pre data-language="go">type ProcInst struct {
+ Target string
+ Inst []byte
+}
+</pre> <h3 id="ProcInst.Copy">func (ProcInst) <span>Copy</span> </h3> <pre data-language="go">func (p ProcInst) Copy() ProcInst</pre> <p>Copy creates a new copy of ProcInst. </p>
+<h2 id="StartElement">type <span>StartElement</span> </h2> <p>A StartElement represents an XML start element. </p>
+<pre data-language="go">type StartElement struct {
+ Name Name
+ Attr []Attr
+}
+</pre> <h3 id="StartElement.Copy">func (StartElement) <span>Copy</span> </h3> <pre data-language="go">func (e StartElement) Copy() StartElement</pre> <p>Copy creates a new copy of StartElement. </p>
+<h3 id="StartElement.End">func (StartElement) <span>End</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (e StartElement) End() EndElement</pre> <p>End returns the corresponding XML end element. </p>
+<h2 id="SyntaxError">type <span>SyntaxError</span> </h2> <p>A SyntaxError represents a syntax error in the XML input stream. </p>
+<pre data-language="go">type SyntaxError struct {
+ Msg string
+ Line int
+}
+</pre> <h3 id="SyntaxError.Error">func (*SyntaxError) <span>Error</span> </h3> <pre data-language="go">func (e *SyntaxError) Error() string</pre> <h2 id="TagPathError">type <span>TagPathError</span> </h2> <p>A TagPathError represents an error in the unmarshaling process caused by the use of field tags with conflicting paths. </p>
+<pre data-language="go">type TagPathError struct {
+ Struct reflect.Type
+ Field1, Tag1 string
+ Field2, Tag2 string
+}
+</pre> <h3 id="TagPathError.Error">func (*TagPathError) <span>Error</span> </h3> <pre data-language="go">func (e *TagPathError) Error() string</pre> <h2 id="Token">type <span>Token</span> </h2> <p>A Token is an interface holding one of the token types: <a href="#StartElement">StartElement</a>, <a href="#EndElement">EndElement</a>, <a href="#CharData">CharData</a>, <a href="#Comment">Comment</a>, <a href="#ProcInst">ProcInst</a>, or <a href="#Directive">Directive</a>. </p>
+<pre data-language="go">type Token any</pre> <h3 id="CopyToken">func <span>CopyToken</span> </h3> <pre data-language="go">func CopyToken(t Token) Token</pre> <p>CopyToken returns a copy of a Token. </p>
+<h2 id="TokenReader">type <span>TokenReader</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>A TokenReader is anything that can decode a stream of XML tokens, including a <a href="#Decoder">Decoder</a>. </p>
+<p>When Token encounters an error or end-of-file condition after successfully reading a token, it returns the token. It may return the (non-nil) error from the same call or return the error (and a nil token) from a subsequent call. An instance of this general case is that a TokenReader returning a non-nil token at the end of the token stream may return either io.EOF or a nil error. The next Read should return nil, <span>io.EOF</span>. </p>
+<p>Implementations of Token are discouraged from returning a nil token with a nil error. Callers should treat a return of nil, nil as indicating that nothing happened; in particular it does not indicate EOF. </p>
+<pre data-language="go">type TokenReader interface {
+ Token() (Token, error)
+}</pre> <h2 id="UnmarshalError">type <span>UnmarshalError</span> </h2> <p>An UnmarshalError represents an error in the unmarshaling process. </p>
+<pre data-language="go">type UnmarshalError string</pre> <h3 id="UnmarshalError.Error">func (UnmarshalError) <span>Error</span> </h3> <pre data-language="go">func (e UnmarshalError) Error() string</pre> <h2 id="Unmarshaler">type <span>Unmarshaler</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>Unmarshaler is the interface implemented by objects that can unmarshal an XML element description of themselves. </p>
+<p>UnmarshalXML decodes a single XML element beginning with the given start element. If it returns an error, the outer call to Unmarshal stops and returns that error. UnmarshalXML must consume exactly one XML element. One common implementation strategy is to unmarshal into a separate value with a layout matching the expected XML using d.DecodeElement, and then to copy the data from that value into the receiver. Another common strategy is to use d.Token to process the XML object one token at a time. UnmarshalXML may not use d.RawToken. </p>
+<pre data-language="go">type Unmarshaler interface {
+ UnmarshalXML(d *Decoder, start StartElement) error
+}</pre> <h2 id="UnmarshalerAttr">type <span>UnmarshalerAttr</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>UnmarshalerAttr is the interface implemented by objects that can unmarshal an XML attribute description of themselves. </p>
+<p>UnmarshalXMLAttr decodes a single XML attribute. If it returns an error, the outer call to <a href="#Unmarshal">Unmarshal</a> stops and returns that error. UnmarshalXMLAttr is used only for struct fields with the "attr" option in the field tag. </p>
+<pre data-language="go">type UnmarshalerAttr interface {
+ UnmarshalXMLAttr(attr Attr) error
+}</pre> <h2 id="UnsupportedTypeError">type <span>UnsupportedTypeError</span> </h2> <p>UnsupportedTypeError is returned when <a href="#Marshal">Marshal</a> encounters a type that cannot be converted into XML. </p>
+<pre data-language="go">type UnsupportedTypeError struct {
+ Type reflect.Type
+}
+</pre> <h3 id="UnsupportedTypeError.Error">func (*UnsupportedTypeError) <span>Error</span> </h3> <pre data-language="go">func (e *UnsupportedTypeError) Error() string</pre> <h2 id="pkg-note-BUG">Bugs</h2> <ul> <li>☞ <p>Mapping between XML elements and data structures is inherently flawed: an XML element is an order-dependent collection of anonymous values, while a data structure is an order-independent collection of named values. See <span>encoding/json</span> for a textual representation more suitable to data structures. </p>
+</li> </ul><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/encoding/xml/" class="_attribution-link">http://golang.org/pkg/encoding/xml/</a>
+ </p>
+</div>
diff --git a/devdocs/go/errors%2Findex.html b/devdocs/go/errors%2Findex.html
new file mode 100644
index 00000000..3eb8f8a2
--- /dev/null
+++ b/devdocs/go/errors%2Findex.html
@@ -0,0 +1,118 @@
+<h1> Package errors </h1> <ul id="short-nav">
+<li><code>import "errors"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package errors implements functions to manipulate errors. </p>
+<p>The <a href="#New">New</a> function creates errors whose only content is a text message. </p>
+<p>An error e wraps another error if e's type has one of the methods </p>
+<pre data-language="go">Unwrap() error
+Unwrap() []error
+</pre> <p>If e.Unwrap() returns a non-nil error w or a slice containing w, then we say that e wraps w. A nil error returned from e.Unwrap() indicates that e does not wrap any error. It is invalid for an Unwrap method to return an []error containing a nil error value. </p>
+<p>An easy way to create wrapped errors is to call <span>fmt.Errorf</span> and apply the %w verb to the error argument: </p>
+<pre data-language="go">wrapsErr := fmt.Errorf("... %w ...", ..., err, ...)
+</pre> <p>Successive unwrapping of an error creates a tree. The <a href="#Is">Is</a> and <a href="#As">As</a> functions inspect an error's tree by examining first the error itself followed by the tree of each of its children in turn (pre-order, depth-first traversal). </p>
+<p><a href="#Is">Is</a> examines the tree of its first argument looking for an error that matches the second. It reports whether it finds a match. It should be used in preference to simple equality checks: </p>
+<pre data-language="go">if errors.Is(err, fs.ErrExist)
+</pre> <p>is preferable to </p>
+<pre data-language="go">if err == fs.ErrExist
+</pre> <p>because the former will succeed if err wraps <span>io/fs.ErrExist</span>. </p>
+<p><a href="#As">As</a> examines the tree of its first argument looking for an error that can be assigned to its second argument, which must be a pointer. If it succeeds, it performs the assignment and returns true. Otherwise, it returns false. The form </p>
+<pre data-language="go">var perr *fs.PathError
+if errors.As(err, &amp;perr) {
+ fmt.Println(perr.Path)
+}
+</pre> <p>is preferable to </p>
+<pre data-language="go">if perr, ok := err.(*fs.PathError); ok {
+ fmt.Println(perr.Path)
+}
+</pre> <p>because the former will succeed if err wraps an <span>*io/fs.PathError</span>. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">if err := oops(); err != nil {
+ fmt.Println(err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">1989-03-15 22:30:00 +0000 UTC: the file system has gone away
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#As">func As(err error, target any) bool</a></li>
+<li><a href="#Is">func Is(err, target error) bool</a></li>
+<li><a href="#Join">func Join(errs ...error) error</a></li>
+<li><a href="#New">func New(text string) error</a></li>
+<li><a href="#Unwrap">func Unwrap(err error) error</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example_As">As</a></dd> <dd><a class="exampleLink" href="#example_Is">Is</a></dd> <dd><a class="exampleLink" href="#example_Join">Join</a></dd> <dd><a class="exampleLink" href="#example_New">New</a></dd> <dd><a class="exampleLink" href="#example_New_errorf">New (Errorf)</a></dd> <dd><a class="exampleLink" href="#example_Unwrap">Unwrap</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>errors.go</span> <span>join.go</span> <span>wrap.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrUnsupported indicates that a requested operation cannot be performed, because it is unsupported. For example, a call to <span>os.Link</span> when using a file system that does not support hard links. </p>
+<p>Functions and methods should not return this error but should instead return an error including appropriate context that satisfies </p>
+<pre data-language="go">errors.Is(err, errors.ErrUnsupported)
+</pre> <p>either by directly wrapping ErrUnsupported or by implementing an <a href="#Is">Is</a> method. </p>
+<p>Functions and methods should document the cases in which an error wrapping this will be returned. </p>
+<pre data-language="go">var ErrUnsupported = New("unsupported operation")</pre> <h2 id="As">func <span>As</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func As(err error, target any) bool</pre> <p>As finds the first error in err's tree that matches target, and if one is found, sets target to that error value and returns true. Otherwise, it returns false. </p>
+<p>The tree consists of err itself, followed by the errors obtained by repeatedly calling its Unwrap() error or Unwrap() []error method. When err wraps multiple errors, As examines err followed by a depth-first traversal of its children. </p>
+<p>An error matches target if the error's concrete value is assignable to the value pointed to by target, or if the error has a method As(interface{}) bool such that As(target) returns true. In the latter case, the As method is responsible for setting target. </p>
+<p>An error type might provide an As method so it can be treated as if it were a different error type. </p>
+<p>As panics if target is not a non-nil pointer to either a type that implements error, or to any interface type. </p> <h4 id="example_As"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">if _, err := os.Open("non-existing"); err != nil {
+ var pathError *fs.PathError
+ if errors.As(err, &amp;pathError) {
+ fmt.Println("Failed at path:", pathError.Path)
+ } else {
+ fmt.Println(err)
+ }
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Failed at path: non-existing
+</pre> <h2 id="Is">func <span>Is</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func Is(err, target error) bool</pre> <p>Is reports whether any error in err's tree matches target. </p>
+<p>The tree consists of err itself, followed by the errors obtained by repeatedly calling its Unwrap() error or Unwrap() []error method. When err wraps multiple errors, Is examines err followed by a depth-first traversal of its children. </p>
+<p>An error is considered to match a target if it is equal to that target or if it implements a method Is(error) bool such that Is(target) returns true. </p>
+<p>An error type might provide an Is method so it can be treated as equivalent to an existing error. For example, if MyError defines </p>
+<pre data-language="go">func (m MyError) Is(target error) bool { return target == fs.ErrExist }
+</pre> <p>then Is(MyError{}, fs.ErrExist) returns true. See <span>syscall.Errno.Is</span> for an example in the standard library. An Is method should only shallowly compare err and the target and not call <a href="#Unwrap">Unwrap</a> on either. </p> <h4 id="example_Is"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">if _, err := os.Open("non-existing"); err != nil {
+ if errors.Is(err, fs.ErrNotExist) {
+ fmt.Println("file does not exist")
+ } else {
+ fmt.Println(err)
+ }
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">file does not exist
+</pre> <h2 id="Join">func <span>Join</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func Join(errs ...error) error</pre> <p>Join returns an error that wraps the given errors. Any nil error values are discarded. Join returns nil if every value in errs is nil. The error formats as the concatenation of the strings obtained by calling the Error method of each element of errs, with a newline between each string. </p>
+<p>A non-nil error returned by Join implements the Unwrap() []error method. </p> <h4 id="example_Join"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">err1 := errors.New("err1")
+err2 := errors.New("err2")
+err := errors.Join(err1, err2)
+fmt.Println(err)
+if errors.Is(err, err1) {
+ fmt.Println("err is err1")
+}
+if errors.Is(err, err2) {
+ fmt.Println("err is err2")
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">err1
+err2
+err is err1
+err is err2
+</pre> <h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New(text string) error</pre> <p>New returns an error that formats as the given text. Each call to New returns a distinct error value even if the text is identical. </p> <h4 id="example_New"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">err := errors.New("emit macho dwarf: elf header corrupted")
+if err != nil {
+ fmt.Print(err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">emit macho dwarf: elf header corrupted
+</pre> <h4 id="example_New_errorf"> <span class="text">Example (Errorf)</span>
+</h4> <p>The fmt package's Errorf function lets us use the package's formatting features to create descriptive error messages. </p> <p>Code:</p> <pre class="code" data-language="go">const name, id = "bimmler", 17
+err := fmt.Errorf("user %q (id %d) not found", name, id)
+if err != nil {
+ fmt.Print(err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">user "bimmler" (id 17) not found
+</pre> <h2 id="Unwrap">func <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func Unwrap(err error) error</pre> <p>Unwrap returns the result of calling the Unwrap method on err, if err's type contains an Unwrap method returning error. Otherwise, Unwrap returns nil. </p>
+<p>Unwrap only calls a method of the form "Unwrap() error". In particular Unwrap does not unwrap errors returned by <a href="#Join">Join</a>. </p> <h4 id="example_Unwrap"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">err1 := errors.New("error1")
+err2 := fmt.Errorf("error2: [%w]", err1)
+fmt.Println(err2)
+fmt.Println(errors.Unwrap(err2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">error2: [error1]
+error1
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/errors/" class="_attribution-link">http://golang.org/pkg/errors/</a>
+ </p>
+</div>
diff --git a/devdocs/go/expvar%2Findex.html b/devdocs/go/expvar%2Findex.html
new file mode 100644
index 00000000..fed3e6d1
--- /dev/null
+++ b/devdocs/go/expvar%2Findex.html
@@ -0,0 +1,120 @@
+<h1> Package expvar </h1> <ul id="short-nav">
+<li><code>import "expvar"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package expvar provides a standardized interface to public variables, such as operation counters in servers. It exposes these variables via HTTP at /debug/vars in JSON format. </p>
+<p>Operations to set or modify these public variables are atomic. </p>
+<p>In addition to adding the HTTP handler, this package registers the following variables: </p>
+<pre data-language="go">cmdline os.Args
+memstats runtime.Memstats
+</pre> <p>The package is sometimes only imported for the side effect of registering its HTTP handler and the above variables. To use it this way, link this package into your program: </p>
+<pre data-language="go">import _ "expvar"
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Do">func Do(f func(KeyValue))</a></li>
+<li><a href="#Handler">func Handler() http.Handler</a></li>
+<li><a href="#Publish">func Publish(name string, v Var)</a></li>
+<li><a href="#Float">type Float</a></li>
+<li> <a href="#NewFloat">func NewFloat(name string) *Float</a>
+</li>
+<li> <a href="#Float.Add">func (v *Float) Add(delta float64)</a>
+</li>
+<li> <a href="#Float.Set">func (v *Float) Set(value float64)</a>
+</li>
+<li> <a href="#Float.String">func (v *Float) String() string</a>
+</li>
+<li> <a href="#Float.Value">func (v *Float) Value() float64</a>
+</li>
+<li><a href="#Func">type Func</a></li>
+<li> <a href="#Func.String">func (f Func) String() string</a>
+</li>
+<li> <a href="#Func.Value">func (f Func) Value() any</a>
+</li>
+<li><a href="#Int">type Int</a></li>
+<li> <a href="#NewInt">func NewInt(name string) *Int</a>
+</li>
+<li> <a href="#Int.Add">func (v *Int) Add(delta int64)</a>
+</li>
+<li> <a href="#Int.Set">func (v *Int) Set(value int64)</a>
+</li>
+<li> <a href="#Int.String">func (v *Int) String() string</a>
+</li>
+<li> <a href="#Int.Value">func (v *Int) Value() int64</a>
+</li>
+<li><a href="#KeyValue">type KeyValue</a></li>
+<li><a href="#Map">type Map</a></li>
+<li> <a href="#NewMap">func NewMap(name string) *Map</a>
+</li>
+<li> <a href="#Map.Add">func (v *Map) Add(key string, delta int64)</a>
+</li>
+<li> <a href="#Map.AddFloat">func (v *Map) AddFloat(key string, delta float64)</a>
+</li>
+<li> <a href="#Map.Delete">func (v *Map) Delete(key string)</a>
+</li>
+<li> <a href="#Map.Do">func (v *Map) Do(f func(KeyValue))</a>
+</li>
+<li> <a href="#Map.Get">func (v *Map) Get(key string) Var</a>
+</li>
+<li> <a href="#Map.Init">func (v *Map) Init() *Map</a>
+</li>
+<li> <a href="#Map.Set">func (v *Map) Set(key string, av Var)</a>
+</li>
+<li> <a href="#Map.String">func (v *Map) String() string</a>
+</li>
+<li><a href="#String">type String</a></li>
+<li> <a href="#NewString">func NewString(name string) *String</a>
+</li>
+<li> <a href="#String.Set">func (v *String) Set(value string)</a>
+</li>
+<li> <a href="#String.String">func (v *String) String() string</a>
+</li>
+<li> <a href="#String.Value">func (v *String) Value() string</a>
+</li>
+<li><a href="#Var">type Var</a></li>
+<li> <a href="#Get">func Get(name string) Var</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>expvar.go</span> </p> <h2 id="Do">func <span>Do</span> </h2> <pre data-language="go">func Do(f func(KeyValue))</pre> <p>Do calls f for each exported variable. The global variable map is locked during the iteration, but existing entries may be concurrently updated. </p>
+<h2 id="Handler">func <span>Handler</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func Handler() http.Handler</pre> <p>Handler returns the expvar HTTP Handler. </p>
+<p>This is only needed to install the handler in a non-standard location. </p>
+<h2 id="Publish">func <span>Publish</span> </h2> <pre data-language="go">func Publish(name string, v Var)</pre> <p>Publish declares a named exported variable. This should be called from a package's init function when it creates its Vars. If the name is already registered then this will log.Panic. </p>
+<h2 id="Float">type <span>Float</span> </h2> <p>Float is a 64-bit float variable that satisfies the <a href="#Var">Var</a> interface. </p>
+<pre data-language="go">type Float struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFloat">func <span>NewFloat</span> </h3> <pre data-language="go">func NewFloat(name string) *Float</pre> <h3 id="Float.Add">func (*Float) <span>Add</span> </h3> <pre data-language="go">func (v *Float) Add(delta float64)</pre> <p>Add adds delta to v. </p>
+<h3 id="Float.Set">func (*Float) <span>Set</span> </h3> <pre data-language="go">func (v *Float) Set(value float64)</pre> <p>Set sets v to value. </p>
+<h3 id="Float.String">func (*Float) <span>String</span> </h3> <pre data-language="go">func (v *Float) String() string</pre> <h3 id="Float.Value">func (*Float) <span>Value</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (v *Float) Value() float64</pre> <h2 id="Func">type <span>Func</span> </h2> <p>Func implements <a href="#Var">Var</a> by calling the function and formatting the returned value using JSON. </p>
+<pre data-language="go">type Func func() any</pre> <h3 id="Func.String">func (Func) <span>String</span> </h3> <pre data-language="go">func (f Func) String() string</pre> <h3 id="Func.Value">func (Func) <span>Value</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (f Func) Value() any</pre> <h2 id="Int">type <span>Int</span> </h2> <p>Int is a 64-bit integer variable that satisfies the <a href="#Var">Var</a> interface. </p>
+<pre data-language="go">type Int struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewInt">func <span>NewInt</span> </h3> <pre data-language="go">func NewInt(name string) *Int</pre> <h3 id="Int.Add">func (*Int) <span>Add</span> </h3> <pre data-language="go">func (v *Int) Add(delta int64)</pre> <h3 id="Int.Set">func (*Int) <span>Set</span> </h3> <pre data-language="go">func (v *Int) Set(value int64)</pre> <h3 id="Int.String">func (*Int) <span>String</span> </h3> <pre data-language="go">func (v *Int) String() string</pre> <h3 id="Int.Value">func (*Int) <span>Value</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (v *Int) Value() int64</pre> <h2 id="KeyValue">type <span>KeyValue</span> </h2> <p>KeyValue represents a single entry in a <a href="#Map">Map</a>. </p>
+<pre data-language="go">type KeyValue struct {
+ Key string
+ Value Var
+}
+</pre> <h2 id="Map">type <span>Map</span> </h2> <p>Map is a string-to-Var map variable that satisfies the <a href="#Var">Var</a> interface. </p>
+<pre data-language="go">type Map struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewMap">func <span>NewMap</span> </h3> <pre data-language="go">func NewMap(name string) *Map</pre> <h3 id="Map.Add">func (*Map) <span>Add</span> </h3> <pre data-language="go">func (v *Map) Add(key string, delta int64)</pre> <p>Add adds delta to the *<a href="#Int">Int</a> value stored under the given map key. </p>
+<h3 id="Map.AddFloat">func (*Map) <span>AddFloat</span> </h3> <pre data-language="go">func (v *Map) AddFloat(key string, delta float64)</pre> <p>AddFloat adds delta to the *<a href="#Float">Float</a> value stored under the given map key. </p>
+<h3 id="Map.Delete">func (*Map) <span>Delete</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (v *Map) Delete(key string)</pre> <p>Delete deletes the given key from the map. </p>
+<h3 id="Map.Do">func (*Map) <span>Do</span> </h3> <pre data-language="go">func (v *Map) Do(f func(KeyValue))</pre> <p>Do calls f for each entry in the map. The map is locked during the iteration, but existing entries may be concurrently updated. </p>
+<h3 id="Map.Get">func (*Map) <span>Get</span> </h3> <pre data-language="go">func (v *Map) Get(key string) Var</pre> <h3 id="Map.Init">func (*Map) <span>Init</span> </h3> <pre data-language="go">func (v *Map) Init() *Map</pre> <p>Init removes all keys from the map. </p>
+<h3 id="Map.Set">func (*Map) <span>Set</span> </h3> <pre data-language="go">func (v *Map) Set(key string, av Var)</pre> <h3 id="Map.String">func (*Map) <span>String</span> </h3> <pre data-language="go">func (v *Map) String() string</pre> <h2 id="String">type <span>String</span> </h2> <p>String is a string variable, and satisfies the <a href="#Var">Var</a> interface. </p>
+<pre data-language="go">type String struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewString">func <span>NewString</span> </h3> <pre data-language="go">func NewString(name string) *String</pre> <h3 id="String.Set">func (*String) <span>Set</span> </h3> <pre data-language="go">func (v *String) Set(value string)</pre> <h3 id="String.String">func (*String) <span>String</span> </h3> <pre data-language="go">func (v *String) String() string</pre> <p>String implements the <a href="#Var">Var</a> interface. To get the unquoted string use <a href="#String.Value">String.Value</a>. </p>
+<h3 id="String.Value">func (*String) <span>Value</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (v *String) Value() string</pre> <h2 id="Var">type <span>Var</span> </h2> <p>Var is an abstract type for all exported variables. </p>
+<pre data-language="go">type Var interface {
+ // String returns a valid JSON value for the variable.
+ // Types with String methods that do not return valid JSON
+ // (such as time.Time) must not be used as a Var.
+ String() string
+}</pre> <h3 id="Get">func <span>Get</span> </h3> <pre data-language="go">func Get(name string) Var</pre> <p>Get retrieves a named exported variable. It returns nil if the name has not been registered. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/expvar/" class="_attribution-link">http://golang.org/pkg/expvar/</a>
+ </p>
+</div>
diff --git a/devdocs/go/flag%2Findex.html b/devdocs/go/flag%2Findex.html
new file mode 100644
index 00000000..e8f9a4df
--- /dev/null
+++ b/devdocs/go/flag%2Findex.html
@@ -0,0 +1,452 @@
+<h1> Package flag </h1> <ul id="short-nav">
+<li><code>import "flag"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package flag implements command-line flag parsing. </p>
+<h3 id="hdr-Usage">Usage</h3> <p>Define flags using <a href="#String">flag.String</a>, <a href="#Bool">Bool</a>, <a href="#Int">Int</a>, etc. </p>
+<p>This declares an integer flag, -n, stored in the pointer nFlag, with type *int: </p>
+<pre data-language="go">import "flag"
+var nFlag = flag.Int("n", 1234, "help message for flag n")
+</pre> <p>If you like, you can bind the flag to a variable using the Var() functions. </p>
+<pre data-language="go">var flagvar int
+func init() {
+ flag.IntVar(&amp;flagvar, "flagname", 1234, "help message for flagname")
+}
+</pre> <p>Or you can create custom flags that satisfy the Value interface (with pointer receivers) and couple them to flag parsing by </p>
+<pre data-language="go">flag.Var(&amp;flagVal, "name", "help message for flagname")
+</pre> <p>For such flags, the default value is just the initial value of the variable. </p>
+<p>After all flags are defined, call </p>
+<pre data-language="go">flag.Parse()
+</pre> <p>to parse the command line into the defined flags. </p>
+<p>Flags may then be used directly. If you're using the flags themselves, they are all pointers; if you bind to variables, they're values. </p>
+<pre data-language="go">fmt.Println("ip has value ", *ip)
+fmt.Println("flagvar has value ", flagvar)
+</pre> <p>After parsing, the arguments following the flags are available as the slice <a href="#Args">flag.Args</a> or individually as <a href="#Arg">flag.Arg</a>(i). The arguments are indexed from 0 through <a href="#NArg">flag.NArg</a>-1. </p>
+<h3 id="hdr-Command_line_flag_syntax">Command line flag syntax</h3> <p>The following forms are permitted: </p>
+<pre data-language="go">-flag
+--flag // double dashes are also permitted
+-flag=x
+-flag x // non-boolean flags only
+</pre> <p>One or two dashes may be used; they are equivalent. The last form is not permitted for boolean flags because the meaning of the command </p>
+<pre data-language="go">cmd -x *
+</pre> <p>where * is a Unix shell wildcard, will change if there is a file called 0, false, etc. You must use the -flag=false form to turn off a boolean flag. </p>
+<p>Flag parsing stops just before the first non-flag argument ("-" is a non-flag argument) or after the terminator "--". </p>
+<p>Integer flags accept 1234, 0664, 0x1234 and may be negative. Boolean flags may be: </p>
+<pre data-language="go">1, 0, t, f, T, F, true, false, TRUE, FALSE, True, False
+</pre> <p>Duration flags accept any input valid for time.ParseDuration. </p>
+<p>The default set of command-line flags is controlled by top-level functions. The <a href="#FlagSet">FlagSet</a> type allows one to define independent sets of flags, such as to implement subcommands in a command-line interface. The methods of <a href="#FlagSet">FlagSet</a> are analogous to the top-level functions for the command-line flag set. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// These examples demonstrate more intricate uses of the flag package.
+package flag_test
+
+import (
+ "errors"
+ "flag"
+ "fmt"
+ "strings"
+ "time"
+)
+
+// Example 1: A single string flag called "species" with default value "gopher".
+var species = flag.String("species", "gopher", "the species we are studying")
+
+// Example 2: Two flags sharing a variable, so we can have a shorthand.
+// The order of initialization is undefined, so make sure both use the
+// same default value. They must be set up with an init function.
+var gopherType string
+
+func init() {
+ const (
+ defaultGopher = "pocket"
+ usage = "the variety of gopher"
+ )
+ flag.StringVar(&amp;gopherType, "gopher_type", defaultGopher, usage)
+ flag.StringVar(&amp;gopherType, "g", defaultGopher, usage+" (shorthand)")
+}
+
+// Example 3: A user-defined flag type, a slice of durations.
+type interval []time.Duration
+
+// String is the method to format the flag's value, part of the flag.Value interface.
+// The String method's output will be used in diagnostics.
+func (i *interval) String() string {
+ return fmt.Sprint(*i)
+}
+
+// Set is the method to set the flag value, part of the flag.Value interface.
+// Set's argument is a string to be parsed to set the flag.
+// It's a comma-separated list, so we split it.
+func (i *interval) Set(value string) error {
+ // If we wanted to allow the flag to be set multiple times,
+ // accumulating values, we would delete this if statement.
+ // That would permit usages such as
+ // -deltaT 10s -deltaT 15s
+ // and other combinations.
+ if len(*i) &gt; 0 {
+ return errors.New("interval flag already set")
+ }
+ for _, dt := range strings.Split(value, ",") {
+ duration, err := time.ParseDuration(dt)
+ if err != nil {
+ return err
+ }
+ *i = append(*i, duration)
+ }
+ return nil
+}
+
+// Define a flag to accumulate durations. Because it has a special type,
+// we need to use the Var function and therefore create the flag during
+// init.
+
+var intervalFlag interval
+
+func init() {
+ // Tie the command-line flag to the intervalFlag variable and
+ // set a usage message.
+ flag.Var(&amp;intervalFlag, "deltaT", "comma-separated list of intervals to use between events")
+}
+
+func Example() {
+ // All the interesting pieces are with the variables declared above, but
+ // to enable the flag package to see the flags defined there, one must
+ // execute, typically at the start of main (not init!):
+ // flag.Parse()
+ // We don't call it here because this code is a function called "Example"
+ // that is part of the testing suite for the package, which has already
+ // parsed the flags. When viewed at pkg.go.dev, however, the function is
+ // renamed to "main" and it could be run as a standalone example.
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Arg">func Arg(i int) string</a></li>
+<li><a href="#Args">func Args() []string</a></li>
+<li><a href="#Bool">func Bool(name string, value bool, usage string) *bool</a></li>
+<li><a href="#BoolFunc">func BoolFunc(name, usage string, fn func(string) error)</a></li>
+<li><a href="#BoolVar">func BoolVar(p *bool, name string, value bool, usage string)</a></li>
+<li><a href="#Duration">func Duration(name string, value time.Duration, usage string) *time.Duration</a></li>
+<li><a href="#DurationVar">func DurationVar(p *time.Duration, name string, value time.Duration, usage string)</a></li>
+<li><a href="#Float64">func Float64(name string, value float64, usage string) *float64</a></li>
+<li><a href="#Float64Var">func Float64Var(p *float64, name string, value float64, usage string)</a></li>
+<li><a href="#Func">func Func(name, usage string, fn func(string) error)</a></li>
+<li><a href="#Int">func Int(name string, value int, usage string) *int</a></li>
+<li><a href="#Int64">func Int64(name string, value int64, usage string) *int64</a></li>
+<li><a href="#Int64Var">func Int64Var(p *int64, name string, value int64, usage string)</a></li>
+<li><a href="#IntVar">func IntVar(p *int, name string, value int, usage string)</a></li>
+<li><a href="#NArg">func NArg() int</a></li>
+<li><a href="#NFlag">func NFlag() int</a></li>
+<li><a href="#Parse">func Parse()</a></li>
+<li><a href="#Parsed">func Parsed() bool</a></li>
+<li><a href="#PrintDefaults">func PrintDefaults()</a></li>
+<li><a href="#Set">func Set(name, value string) error</a></li>
+<li><a href="#String">func String(name string, value string, usage string) *string</a></li>
+<li><a href="#StringVar">func StringVar(p *string, name string, value string, usage string)</a></li>
+<li><a href="#TextVar">func TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string)</a></li>
+<li><a href="#Uint">func Uint(name string, value uint, usage string) *uint</a></li>
+<li><a href="#Uint64">func Uint64(name string, value uint64, usage string) *uint64</a></li>
+<li><a href="#Uint64Var">func Uint64Var(p *uint64, name string, value uint64, usage string)</a></li>
+<li><a href="#UintVar">func UintVar(p *uint, name string, value uint, usage string)</a></li>
+<li><a href="#UnquoteUsage">func UnquoteUsage(flag *Flag) (name string, usage string)</a></li>
+<li><a href="#Var">func Var(value Value, name string, usage string)</a></li>
+<li><a href="#Visit">func Visit(fn func(*Flag))</a></li>
+<li><a href="#VisitAll">func VisitAll(fn func(*Flag))</a></li>
+<li><a href="#ErrorHandling">type ErrorHandling</a></li>
+<li><a href="#Flag">type Flag</a></li>
+<li> <a href="#Lookup">func Lookup(name string) *Flag</a>
+</li>
+<li><a href="#FlagSet">type FlagSet</a></li>
+<li> <a href="#NewFlagSet">func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet</a>
+</li>
+<li> <a href="#FlagSet.Arg">func (f *FlagSet) Arg(i int) string</a>
+</li>
+<li> <a href="#FlagSet.Args">func (f *FlagSet) Args() []string</a>
+</li>
+<li> <a href="#FlagSet.Bool">func (f *FlagSet) Bool(name string, value bool, usage string) *bool</a>
+</li>
+<li> <a href="#FlagSet.BoolFunc">func (f *FlagSet) BoolFunc(name, usage string, fn func(string) error)</a>
+</li>
+<li> <a href="#FlagSet.BoolVar">func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string)</a>
+</li>
+<li> <a href="#FlagSet.Duration">func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration</a>
+</li>
+<li> <a href="#FlagSet.DurationVar">func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string)</a>
+</li>
+<li> <a href="#FlagSet.ErrorHandling">func (f *FlagSet) ErrorHandling() ErrorHandling</a>
+</li>
+<li> <a href="#FlagSet.Float64">func (f *FlagSet) Float64(name string, value float64, usage string) *float64</a>
+</li>
+<li> <a href="#FlagSet.Float64Var">func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string)</a>
+</li>
+<li> <a href="#FlagSet.Func">func (f *FlagSet) Func(name, usage string, fn func(string) error)</a>
+</li>
+<li> <a href="#FlagSet.Init">func (f *FlagSet) Init(name string, errorHandling ErrorHandling)</a>
+</li>
+<li> <a href="#FlagSet.Int">func (f *FlagSet) Int(name string, value int, usage string) *int</a>
+</li>
+<li> <a href="#FlagSet.Int64">func (f *FlagSet) Int64(name string, value int64, usage string) *int64</a>
+</li>
+<li> <a href="#FlagSet.Int64Var">func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string)</a>
+</li>
+<li> <a href="#FlagSet.IntVar">func (f *FlagSet) IntVar(p *int, name string, value int, usage string)</a>
+</li>
+<li> <a href="#FlagSet.Lookup">func (f *FlagSet) Lookup(name string) *Flag</a>
+</li>
+<li> <a href="#FlagSet.NArg">func (f *FlagSet) NArg() int</a>
+</li>
+<li> <a href="#FlagSet.NFlag">func (f *FlagSet) NFlag() int</a>
+</li>
+<li> <a href="#FlagSet.Name">func (f *FlagSet) Name() string</a>
+</li>
+<li> <a href="#FlagSet.Output">func (f *FlagSet) Output() io.Writer</a>
+</li>
+<li> <a href="#FlagSet.Parse">func (f *FlagSet) Parse(arguments []string) error</a>
+</li>
+<li> <a href="#FlagSet.Parsed">func (f *FlagSet) Parsed() bool</a>
+</li>
+<li> <a href="#FlagSet.PrintDefaults">func (f *FlagSet) PrintDefaults()</a>
+</li>
+<li> <a href="#FlagSet.Set">func (f *FlagSet) Set(name, value string) error</a>
+</li>
+<li> <a href="#FlagSet.SetOutput">func (f *FlagSet) SetOutput(output io.Writer)</a>
+</li>
+<li> <a href="#FlagSet.String">func (f *FlagSet) String(name string, value string, usage string) *string</a>
+</li>
+<li> <a href="#FlagSet.StringVar">func (f *FlagSet) StringVar(p *string, name string, value string, usage string)</a>
+</li>
+<li> <a href="#FlagSet.TextVar">func (f *FlagSet) TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string)</a>
+</li>
+<li> <a href="#FlagSet.Uint">func (f *FlagSet) Uint(name string, value uint, usage string) *uint</a>
+</li>
+<li> <a href="#FlagSet.Uint64">func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64</a>
+</li>
+<li> <a href="#FlagSet.Uint64Var">func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string)</a>
+</li>
+<li> <a href="#FlagSet.UintVar">func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string)</a>
+</li>
+<li> <a href="#FlagSet.Var">func (f *FlagSet) Var(value Value, name string, usage string)</a>
+</li>
+<li> <a href="#FlagSet.Visit">func (f *FlagSet) Visit(fn func(*Flag))</a>
+</li>
+<li> <a href="#FlagSet.VisitAll">func (f *FlagSet) VisitAll(fn func(*Flag))</a>
+</li>
+<li><a href="#Getter">type Getter</a></li>
+<li><a href="#Value">type Value</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example_BoolFunc">BoolFunc</a></dd> <dd><a class="exampleLink" href="#example_Func">Func</a></dd> <dd><a class="exampleLink" href="#example_TextVar">TextVar</a></dd> <dd><a class="exampleLink" href="#example_Value">Value</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>flag.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>CommandLine is the default set of command-line flags, parsed from <span>os.Args</span>. The top-level functions such as <a href="#BoolVar">BoolVar</a>, <a href="#Arg">Arg</a>, and so on are wrappers for the methods of CommandLine. </p>
+<pre data-language="go">var CommandLine = NewFlagSet(os.Args[0], ExitOnError)</pre> <p>ErrHelp is the error returned if the -help or -h flag is invoked but no such flag is defined. </p>
+<pre data-language="go">var ErrHelp = errors.New("flag: help requested")</pre> <p>Usage prints a usage message documenting all defined command-line flags to <a href="#CommandLine">CommandLine</a>'s output, which by default is <span>os.Stderr</span>. It is called when an error occurs while parsing flags. The function is a variable that may be changed to point to a custom function. By default it prints a simple header and calls <a href="#PrintDefaults">PrintDefaults</a>; for details about the format of the output and how to control it, see the documentation for <a href="#PrintDefaults">PrintDefaults</a>. Custom usage functions may choose to exit the program; by default exiting happens anyway as the command line's error handling strategy is set to <a href="#ExitOnError">ExitOnError</a>. </p>
+<pre data-language="go">var Usage = func() {
+ fmt.Fprintf(CommandLine.Output(), "Usage of %s:\n", os.Args[0])
+ PrintDefaults()
+}</pre> <h2 id="Arg">func <span>Arg</span> </h2> <pre data-language="go">func Arg(i int) string</pre> <p>Arg returns the i'th command-line argument. Arg(0) is the first remaining argument after flags have been processed. Arg returns an empty string if the requested element does not exist. </p>
+<h2 id="Args">func <span>Args</span> </h2> <pre data-language="go">func Args() []string</pre> <p>Args returns the non-flag command-line arguments. </p>
+<h2 id="Bool">func <span>Bool</span> </h2> <pre data-language="go">func Bool(name string, value bool, usage string) *bool</pre> <p>Bool defines a bool flag with specified name, default value, and usage string. The return value is the address of a bool variable that stores the value of the flag. </p>
+<h2 id="BoolFunc">func <span>BoolFunc</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func BoolFunc(name, usage string, fn func(string) error)</pre> <p>BoolFunc defines a flag with the specified name and usage string without requiring values. Each time the flag is seen, fn is called with the value of the flag. If fn returns a non-nil error, it will be treated as a flag value parsing error. </p> <h4 id="example_BoolFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fs := flag.NewFlagSet("ExampleBoolFunc", flag.ContinueOnError)
+fs.SetOutput(os.Stdout)
+
+fs.BoolFunc("log", "logs a dummy message", func(s string) error {
+ fmt.Println("dummy message:", s)
+ return nil
+})
+fs.Parse([]string{"-log"})
+fs.Parse([]string{"-log=0"})
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">dummy message: true
+dummy message: 0
+</pre> <h2 id="BoolVar">func <span>BoolVar</span> </h2> <pre data-language="go">func BoolVar(p *bool, name string, value bool, usage string)</pre> <p>BoolVar defines a bool flag with specified name, default value, and usage string. The argument p points to a bool variable in which to store the value of the flag. </p>
+<h2 id="Duration">func <span>Duration</span> </h2> <pre data-language="go">func Duration(name string, value time.Duration, usage string) *time.Duration</pre> <p>Duration defines a time.Duration flag with specified name, default value, and usage string. The return value is the address of a time.Duration variable that stores the value of the flag. The flag accepts a value acceptable to time.ParseDuration. </p>
+<h2 id="DurationVar">func <span>DurationVar</span> </h2> <pre data-language="go">func DurationVar(p *time.Duration, name string, value time.Duration, usage string)</pre> <p>DurationVar defines a time.Duration flag with specified name, default value, and usage string. The argument p points to a time.Duration variable in which to store the value of the flag. The flag accepts a value acceptable to time.ParseDuration. </p>
+<h2 id="Float64">func <span>Float64</span> </h2> <pre data-language="go">func Float64(name string, value float64, usage string) *float64</pre> <p>Float64 defines a float64 flag with specified name, default value, and usage string. The return value is the address of a float64 variable that stores the value of the flag. </p>
+<h2 id="Float64Var">func <span>Float64Var</span> </h2> <pre data-language="go">func Float64Var(p *float64, name string, value float64, usage string)</pre> <p>Float64Var defines a float64 flag with specified name, default value, and usage string. The argument p points to a float64 variable in which to store the value of the flag. </p>
+<h2 id="Func">func <span>Func</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func Func(name, usage string, fn func(string) error)</pre> <p>Func defines a flag with the specified name and usage string. Each time the flag is seen, fn is called with the value of the flag. If fn returns a non-nil error, it will be treated as a flag value parsing error. </p> <h4 id="example_Func"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fs := flag.NewFlagSet("ExampleFunc", flag.ContinueOnError)
+fs.SetOutput(os.Stdout)
+var ip net.IP
+fs.Func("ip", "`IP address` to parse", func(s string) error {
+ ip = net.ParseIP(s)
+ if ip == nil {
+ return errors.New("could not parse IP")
+ }
+ return nil
+})
+fs.Parse([]string{"-ip", "127.0.0.1"})
+fmt.Printf("{ip: %v, loopback: %t}\n\n", ip, ip.IsLoopback())
+
+// 256 is not a valid IPv4 component
+fs.Parse([]string{"-ip", "256.0.0.1"})
+fmt.Printf("{ip: %v, loopback: %t}\n\n", ip, ip.IsLoopback())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">{ip: 127.0.0.1, loopback: true}
+
+invalid value "256.0.0.1" for flag -ip: could not parse IP
+Usage of ExampleFunc:
+ -ip IP address
+ IP address to parse
+{ip: &lt;nil&gt;, loopback: false}
+</pre> <h2 id="Int">func <span>Int</span> </h2> <pre data-language="go">func Int(name string, value int, usage string) *int</pre> <p>Int defines an int flag with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the flag. </p>
+<h2 id="Int64">func <span>Int64</span> </h2> <pre data-language="go">func Int64(name string, value int64, usage string) *int64</pre> <p>Int64 defines an int64 flag with specified name, default value, and usage string. The return value is the address of an int64 variable that stores the value of the flag. </p>
+<h2 id="Int64Var">func <span>Int64Var</span> </h2> <pre data-language="go">func Int64Var(p *int64, name string, value int64, usage string)</pre> <p>Int64Var defines an int64 flag with specified name, default value, and usage string. The argument p points to an int64 variable in which to store the value of the flag. </p>
+<h2 id="IntVar">func <span>IntVar</span> </h2> <pre data-language="go">func IntVar(p *int, name string, value int, usage string)</pre> <p>IntVar defines an int flag with specified name, default value, and usage string. The argument p points to an int variable in which to store the value of the flag. </p>
+<h2 id="NArg">func <span>NArg</span> </h2> <pre data-language="go">func NArg() int</pre> <p>NArg is the number of arguments remaining after flags have been processed. </p>
+<h2 id="NFlag">func <span>NFlag</span> </h2> <pre data-language="go">func NFlag() int</pre> <p>NFlag returns the number of command-line flags that have been set. </p>
+<h2 id="Parse">func <span>Parse</span> </h2> <pre data-language="go">func Parse()</pre> <p>Parse parses the command-line flags from <span>os.Args</span>[1:]. Must be called after all flags are defined and before flags are accessed by the program. </p>
+<h2 id="Parsed">func <span>Parsed</span> </h2> <pre data-language="go">func Parsed() bool</pre> <p>Parsed reports whether the command-line flags have been parsed. </p>
+<h2 id="PrintDefaults">func <span>PrintDefaults</span> </h2> <pre data-language="go">func PrintDefaults()</pre> <p>PrintDefaults prints, to standard error unless configured otherwise, a usage message showing the default settings of all defined command-line flags. For an integer valued flag x, the default output has the form </p>
+<pre data-language="go">-x int
+ usage-message-for-x (default 7)
+</pre> <p>The usage message will appear on a separate line for anything but a bool flag with a one-byte name. For bool flags, the type is omitted and if the flag name is one byte the usage message appears on the same line. The parenthetical default is omitted if the default is the zero value for the type. The listed type, here int, can be changed by placing a back-quoted name in the flag's usage string; the first such item in the message is taken to be a parameter name to show in the message and the back quotes are stripped from the message when displayed. For instance, given </p>
+<pre data-language="go">flag.String("I", "", "search `directory` for include files")
+</pre> <p>the output will be </p>
+<pre data-language="go">-I directory
+ search directory for include files.
+</pre> <p>To change the destination for flag messages, call <a href="#CommandLine">CommandLine</a>.SetOutput. </p>
+<h2 id="Set">func <span>Set</span> </h2> <pre data-language="go">func Set(name, value string) error</pre> <p>Set sets the value of the named command-line flag. </p>
+<h2 id="String">func <span>String</span> </h2> <pre data-language="go">func String(name string, value string, usage string) *string</pre> <p>String defines a string flag with specified name, default value, and usage string. The return value is the address of a string variable that stores the value of the flag. </p>
+<h2 id="StringVar">func <span>StringVar</span> </h2> <pre data-language="go">func StringVar(p *string, name string, value string, usage string)</pre> <p>StringVar defines a string flag with specified name, default value, and usage string. The argument p points to a string variable in which to store the value of the flag. </p>
+<h2 id="TextVar">func <span>TextVar</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string)</pre> <p>TextVar defines a flag with a specified name, default value, and usage string. The argument p must be a pointer to a variable that will hold the value of the flag, and p must implement encoding.TextUnmarshaler. If the flag is used, the flag value will be passed to p's UnmarshalText method. The type of the default value must be the same as the type of p. </p> <h4 id="example_TextVar"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fs := flag.NewFlagSet("ExampleTextVar", flag.ContinueOnError)
+fs.SetOutput(os.Stdout)
+var ip net.IP
+fs.TextVar(&amp;ip, "ip", net.IPv4(192, 168, 0, 100), "`IP address` to parse")
+fs.Parse([]string{"-ip", "127.0.0.1"})
+fmt.Printf("{ip: %v}\n\n", ip)
+
+// 256 is not a valid IPv4 component
+ip = nil
+fs.Parse([]string{"-ip", "256.0.0.1"})
+fmt.Printf("{ip: %v}\n\n", ip)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">{ip: 127.0.0.1}
+
+invalid value "256.0.0.1" for flag -ip: invalid IP address: 256.0.0.1
+Usage of ExampleTextVar:
+ -ip IP address
+ IP address to parse (default 192.168.0.100)
+{ip: &lt;nil&gt;}
+</pre> <h2 id="Uint">func <span>Uint</span> </h2> <pre data-language="go">func Uint(name string, value uint, usage string) *uint</pre> <p>Uint defines a uint flag with specified name, default value, and usage string. The return value is the address of a uint variable that stores the value of the flag. </p>
+<h2 id="Uint64">func <span>Uint64</span> </h2> <pre data-language="go">func Uint64(name string, value uint64, usage string) *uint64</pre> <p>Uint64 defines a uint64 flag with specified name, default value, and usage string. The return value is the address of a uint64 variable that stores the value of the flag. </p>
+<h2 id="Uint64Var">func <span>Uint64Var</span> </h2> <pre data-language="go">func Uint64Var(p *uint64, name string, value uint64, usage string)</pre> <p>Uint64Var defines a uint64 flag with specified name, default value, and usage string. The argument p points to a uint64 variable in which to store the value of the flag. </p>
+<h2 id="UintVar">func <span>UintVar</span> </h2> <pre data-language="go">func UintVar(p *uint, name string, value uint, usage string)</pre> <p>UintVar defines a uint flag with specified name, default value, and usage string. The argument p points to a uint variable in which to store the value of the flag. </p>
+<h2 id="UnquoteUsage">func <span>UnquoteUsage</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func UnquoteUsage(flag *Flag) (name string, usage string)</pre> <p>UnquoteUsage extracts a back-quoted name from the usage string for a flag and returns it and the un-quoted usage. Given "a `name` to show" it returns ("name", "a name to show"). If there are no back quotes, the name is an educated guess of the type of the flag's value, or the empty string if the flag is boolean. </p>
+<h2 id="Var">func <span>Var</span> </h2> <pre data-language="go">func Var(value Value, name string, usage string)</pre> <p>Var defines a flag with the specified name and usage string. The type and value of the flag are represented by the first argument, of type <a href="#Value">Value</a>, which typically holds a user-defined implementation of <a href="#Value">Value</a>. For instance, the caller could create a flag that turns a comma-separated string into a slice of strings by giving the slice the methods of <a href="#Value">Value</a>; in particular, <a href="#Set">Set</a> would decompose the comma-separated string into the slice. </p>
+<h2 id="Visit">func <span>Visit</span> </h2> <pre data-language="go">func Visit(fn func(*Flag))</pre> <p>Visit visits the command-line flags in lexicographical order, calling fn for each. It visits only those flags that have been set. </p>
+<h2 id="VisitAll">func <span>VisitAll</span> </h2> <pre data-language="go">func VisitAll(fn func(*Flag))</pre> <p>VisitAll visits the command-line flags in lexicographical order, calling fn for each. It visits all flags, even those not set. </p>
+<h2 id="ErrorHandling">type <span>ErrorHandling</span> </h2> <p>ErrorHandling defines how <a href="#FlagSet.Parse">FlagSet.Parse</a> behaves if the parse fails. </p>
+<pre data-language="go">type ErrorHandling int</pre> <p>These constants cause <a href="#FlagSet.Parse">FlagSet.Parse</a> to behave as described if the parse fails. </p>
+<pre data-language="go">const (
+ ContinueOnError ErrorHandling = iota // Return a descriptive error.
+ ExitOnError // Call os.Exit(2) or for -h/-help Exit(0).
+ PanicOnError // Call panic with a descriptive error.
+)</pre> <h2 id="Flag">type <span>Flag</span> </h2> <p>A Flag represents the state of a flag. </p>
+<pre data-language="go">type Flag struct {
+ Name string // name as it appears on command line
+ Usage string // help message
+ Value Value // value as set
+ DefValue string // default value (as text); for usage message
+}
+</pre> <h3 id="Lookup">func <span>Lookup</span> </h3> <pre data-language="go">func Lookup(name string) *Flag</pre> <p>Lookup returns the <a href="#Flag">Flag</a> structure of the named command-line flag, returning nil if none exists. </p>
+<h2 id="FlagSet">type <span>FlagSet</span> </h2> <p>A FlagSet represents a set of defined flags. The zero value of a FlagSet has no name and has <a href="#ContinueOnError">ContinueOnError</a> error handling. </p>
+<p><a href="#Flag">Flag</a> names must be unique within a FlagSet. An attempt to define a flag whose name is already in use will cause a panic. </p>
+<pre data-language="go">type FlagSet struct {
+ // Usage is the function called when an error occurs while parsing flags.
+ // The field is a function (not a method) that may be changed to point to
+ // a custom error handler. What happens after Usage is called depends
+ // on the ErrorHandling setting; for the command line, this defaults
+ // to ExitOnError, which exits the program after calling Usage.
+ Usage func()
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFlagSet">func <span>NewFlagSet</span> </h3> <pre data-language="go">func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet</pre> <p>NewFlagSet returns a new, empty flag set with the specified name and error handling property. If the name is not empty, it will be printed in the default usage message and in error messages. </p>
+<h3 id="FlagSet.Arg">func (*FlagSet) <span>Arg</span> </h3> <pre data-language="go">func (f *FlagSet) Arg(i int) string</pre> <p>Arg returns the i'th argument. Arg(0) is the first remaining argument after flags have been processed. Arg returns an empty string if the requested element does not exist. </p>
+<h3 id="FlagSet.Args">func (*FlagSet) <span>Args</span> </h3> <pre data-language="go">func (f *FlagSet) Args() []string</pre> <p>Args returns the non-flag arguments. </p>
+<h3 id="FlagSet.Bool">func (*FlagSet) <span>Bool</span> </h3> <pre data-language="go">func (f *FlagSet) Bool(name string, value bool, usage string) *bool</pre> <p>Bool defines a bool flag with specified name, default value, and usage string. The return value is the address of a bool variable that stores the value of the flag. </p>
+<h3 id="FlagSet.BoolFunc">func (*FlagSet) <span>BoolFunc</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (f *FlagSet) BoolFunc(name, usage string, fn func(string) error)</pre> <p>BoolFunc defines a flag with the specified name and usage string without requiring values. Each time the flag is seen, fn is called with the value of the flag. If fn returns a non-nil error, it will be treated as a flag value parsing error. </p>
+<h3 id="FlagSet.BoolVar">func (*FlagSet) <span>BoolVar</span> </h3> <pre data-language="go">func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string)</pre> <p>BoolVar defines a bool flag with specified name, default value, and usage string. The argument p points to a bool variable in which to store the value of the flag. </p>
+<h3 id="FlagSet.Duration">func (*FlagSet) <span>Duration</span> </h3> <pre data-language="go">func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration</pre> <p>Duration defines a time.Duration flag with specified name, default value, and usage string. The return value is the address of a time.Duration variable that stores the value of the flag. The flag accepts a value acceptable to time.ParseDuration. </p>
+<h3 id="FlagSet.DurationVar">func (*FlagSet) <span>DurationVar</span> </h3> <pre data-language="go">func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string)</pre> <p>DurationVar defines a time.Duration flag with specified name, default value, and usage string. The argument p points to a time.Duration variable in which to store the value of the flag. The flag accepts a value acceptable to time.ParseDuration. </p>
+<h3 id="FlagSet.ErrorHandling">func (*FlagSet) <span>ErrorHandling</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (f *FlagSet) ErrorHandling() ErrorHandling</pre> <p>ErrorHandling returns the error handling behavior of the flag set. </p>
+<h3 id="FlagSet.Float64">func (*FlagSet) <span>Float64</span> </h3> <pre data-language="go">func (f *FlagSet) Float64(name string, value float64, usage string) *float64</pre> <p>Float64 defines a float64 flag with specified name, default value, and usage string. The return value is the address of a float64 variable that stores the value of the flag. </p>
+<h3 id="FlagSet.Float64Var">func (*FlagSet) <span>Float64Var</span> </h3> <pre data-language="go">func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string)</pre> <p>Float64Var defines a float64 flag with specified name, default value, and usage string. The argument p points to a float64 variable in which to store the value of the flag. </p>
+<h3 id="FlagSet.Func">func (*FlagSet) <span>Func</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (f *FlagSet) Func(name, usage string, fn func(string) error)</pre> <p>Func defines a flag with the specified name and usage string. Each time the flag is seen, fn is called with the value of the flag. If fn returns a non-nil error, it will be treated as a flag value parsing error. </p>
+<h3 id="FlagSet.Init">func (*FlagSet) <span>Init</span> </h3> <pre data-language="go">func (f *FlagSet) Init(name string, errorHandling ErrorHandling)</pre> <p>Init sets the name and error handling property for a flag set. By default, the zero <a href="#FlagSet">FlagSet</a> uses an empty name and the <a href="#ContinueOnError">ContinueOnError</a> error handling policy. </p>
+<h3 id="FlagSet.Int">func (*FlagSet) <span>Int</span> </h3> <pre data-language="go">func (f *FlagSet) Int(name string, value int, usage string) *int</pre> <p>Int defines an int flag with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the flag. </p>
+<h3 id="FlagSet.Int64">func (*FlagSet) <span>Int64</span> </h3> <pre data-language="go">func (f *FlagSet) Int64(name string, value int64, usage string) *int64</pre> <p>Int64 defines an int64 flag with specified name, default value, and usage string. The return value is the address of an int64 variable that stores the value of the flag. </p>
+<h3 id="FlagSet.Int64Var">func (*FlagSet) <span>Int64Var</span> </h3> <pre data-language="go">func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string)</pre> <p>Int64Var defines an int64 flag with specified name, default value, and usage string. The argument p points to an int64 variable in which to store the value of the flag. </p>
+<h3 id="FlagSet.IntVar">func (*FlagSet) <span>IntVar</span> </h3> <pre data-language="go">func (f *FlagSet) IntVar(p *int, name string, value int, usage string)</pre> <p>IntVar defines an int flag with specified name, default value, and usage string. The argument p points to an int variable in which to store the value of the flag. </p>
+<h3 id="FlagSet.Lookup">func (*FlagSet) <span>Lookup</span> </h3> <pre data-language="go">func (f *FlagSet) Lookup(name string) *Flag</pre> <p>Lookup returns the <a href="#Flag">Flag</a> structure of the named flag, returning nil if none exists. </p>
+<h3 id="FlagSet.NArg">func (*FlagSet) <span>NArg</span> </h3> <pre data-language="go">func (f *FlagSet) NArg() int</pre> <p>NArg is the number of arguments remaining after flags have been processed. </p>
+<h3 id="FlagSet.NFlag">func (*FlagSet) <span>NFlag</span> </h3> <pre data-language="go">func (f *FlagSet) NFlag() int</pre> <p>NFlag returns the number of flags that have been set. </p>
+<h3 id="FlagSet.Name">func (*FlagSet) <span>Name</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (f *FlagSet) Name() string</pre> <p>Name returns the name of the flag set. </p>
+<h3 id="FlagSet.Output">func (*FlagSet) <span>Output</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (f *FlagSet) Output() io.Writer</pre> <p>Output returns the destination for usage and error messages. <span>os.Stderr</span> is returned if output was not set or was set to nil. </p>
+<h3 id="FlagSet.Parse">func (*FlagSet) <span>Parse</span> </h3> <pre data-language="go">func (f *FlagSet) Parse(arguments []string) error</pre> <p>Parse parses flag definitions from the argument list, which should not include the command name. Must be called after all flags in the <a href="#FlagSet">FlagSet</a> are defined and before flags are accessed by the program. The return value will be <a href="#ErrHelp">ErrHelp</a> if -help or -h were set but not defined. </p>
+<h3 id="FlagSet.Parsed">func (*FlagSet) <span>Parsed</span> </h3> <pre data-language="go">func (f *FlagSet) Parsed() bool</pre> <p>Parsed reports whether f.Parse has been called. </p>
+<h3 id="FlagSet.PrintDefaults">func (*FlagSet) <span>PrintDefaults</span> </h3> <pre data-language="go">func (f *FlagSet) PrintDefaults()</pre> <p>PrintDefaults prints, to standard error unless configured otherwise, the default values of all defined command-line flags in the set. See the documentation for the global function PrintDefaults for more information. </p>
+<h3 id="FlagSet.Set">func (*FlagSet) <span>Set</span> </h3> <pre data-language="go">func (f *FlagSet) Set(name, value string) error</pre> <p>Set sets the value of the named flag. </p>
+<h3 id="FlagSet.SetOutput">func (*FlagSet) <span>SetOutput</span> </h3> <pre data-language="go">func (f *FlagSet) SetOutput(output io.Writer)</pre> <p>SetOutput sets the destination for usage and error messages. If output is nil, <span>os.Stderr</span> is used. </p>
+<h3 id="FlagSet.String">func (*FlagSet) <span>String</span> </h3> <pre data-language="go">func (f *FlagSet) String(name string, value string, usage string) *string</pre> <p>String defines a string flag with specified name, default value, and usage string. The return value is the address of a string variable that stores the value of the flag. </p>
+<h3 id="FlagSet.StringVar">func (*FlagSet) <span>StringVar</span> </h3> <pre data-language="go">func (f *FlagSet) StringVar(p *string, name string, value string, usage string)</pre> <p>StringVar defines a string flag with specified name, default value, and usage string. The argument p points to a string variable in which to store the value of the flag. </p>
+<h3 id="FlagSet.TextVar">func (*FlagSet) <span>TextVar</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (f *FlagSet) TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string)</pre> <p>TextVar defines a flag with a specified name, default value, and usage string. The argument p must be a pointer to a variable that will hold the value of the flag, and p must implement encoding.TextUnmarshaler. If the flag is used, the flag value will be passed to p's UnmarshalText method. The type of the default value must be the same as the type of p. </p>
+<h3 id="FlagSet.Uint">func (*FlagSet) <span>Uint</span> </h3> <pre data-language="go">func (f *FlagSet) Uint(name string, value uint, usage string) *uint</pre> <p>Uint defines a uint flag with specified name, default value, and usage string. The return value is the address of a uint variable that stores the value of the flag. </p>
+<h3 id="FlagSet.Uint64">func (*FlagSet) <span>Uint64</span> </h3> <pre data-language="go">func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64</pre> <p>Uint64 defines a uint64 flag with specified name, default value, and usage string. The return value is the address of a uint64 variable that stores the value of the flag. </p>
+<h3 id="FlagSet.Uint64Var">func (*FlagSet) <span>Uint64Var</span> </h3> <pre data-language="go">func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string)</pre> <p>Uint64Var defines a uint64 flag with specified name, default value, and usage string. The argument p points to a uint64 variable in which to store the value of the flag. </p>
+<h3 id="FlagSet.UintVar">func (*FlagSet) <span>UintVar</span> </h3> <pre data-language="go">func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string)</pre> <p>UintVar defines a uint flag with specified name, default value, and usage string. The argument p points to a uint variable in which to store the value of the flag. </p>
+<h3 id="FlagSet.Var">func (*FlagSet) <span>Var</span> </h3> <pre data-language="go">func (f *FlagSet) Var(value Value, name string, usage string)</pre> <p>Var defines a flag with the specified name and usage string. The type and value of the flag are represented by the first argument, of type <a href="#Value">Value</a>, which typically holds a user-defined implementation of <a href="#Value">Value</a>. For instance, the caller could create a flag that turns a comma-separated string into a slice of strings by giving the slice the methods of <a href="#Value">Value</a>; in particular, <a href="#Set">Set</a> would decompose the comma-separated string into the slice. </p>
+<h3 id="FlagSet.Visit">func (*FlagSet) <span>Visit</span> </h3> <pre data-language="go">func (f *FlagSet) Visit(fn func(*Flag))</pre> <p>Visit visits the flags in lexicographical order, calling fn for each. It visits only those flags that have been set. </p>
+<h3 id="FlagSet.VisitAll">func (*FlagSet) <span>VisitAll</span> </h3> <pre data-language="go">func (f *FlagSet) VisitAll(fn func(*Flag))</pre> <p>VisitAll visits the flags in lexicographical order, calling fn for each. It visits all flags, even those not set. </p>
+<h2 id="Getter">type <span>Getter</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>Getter is an interface that allows the contents of a <a href="#Value">Value</a> to be retrieved. It wraps the <a href="#Value">Value</a> interface, rather than being part of it, because it appeared after Go 1 and its compatibility rules. All <a href="#Value">Value</a> types provided by this package satisfy the <a href="#Getter">Getter</a> interface, except the type used by <a href="#Func">Func</a>. </p>
+<pre data-language="go">type Getter interface {
+ Value
+ Get() any
+}</pre> <h2 id="Value">type <span>Value</span> </h2> <p>Value is the interface to the dynamic value stored in a flag. (The default value is represented as a string.) </p>
+<p>If a Value has an IsBoolFlag() bool method returning true, the command-line parser makes -name equivalent to -name=true rather than using the next command-line argument. </p>
+<p>Set is called once, in command line order, for each flag present. The flag package may call the <a href="#String">String</a> method with a zero-valued receiver, such as a nil pointer. </p>
+<pre data-language="go">type Value interface {
+ String() string
+ Set(string) error
+}</pre> <h4 id="example_Value"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package flag_test
+
+import (
+ "flag"
+ "fmt"
+ "net/url"
+)
+
+type URLValue struct {
+ URL *url.URL
+}
+
+func (v URLValue) String() string {
+ if v.URL != nil {
+ return v.URL.String()
+ }
+ return ""
+}
+
+func (v URLValue) Set(s string) error {
+ if u, err := url.Parse(s); err != nil {
+ return err
+ } else {
+ *v.URL = *u
+ }
+ return nil
+}
+
+var u = &amp;url.URL{}
+
+func ExampleValue() {
+ fs := flag.NewFlagSet("ExampleValue", flag.ExitOnError)
+ fs.Var(&amp;URLValue{u}, "url", "URL to parse")
+
+ fs.Parse([]string{"-url", "https://golang.org/pkg/flag/"})
+ fmt.Printf(`{scheme: %q, host: %q, path: %q}`, u.Scheme, u.Host, u.Path)
+
+ // Output:
+ // {scheme: "https", host: "golang.org", path: "/pkg/flag/"}
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/flag/" class="_attribution-link">http://golang.org/pkg/flag/</a>
+ </p>
+</div>
diff --git a/devdocs/go/fmt%2Findex.html b/devdocs/go/fmt%2Findex.html
new file mode 100644
index 00000000..f21c9bbf
--- /dev/null
+++ b/devdocs/go/fmt%2Findex.html
@@ -0,0 +1,627 @@
+<h1> Package fmt </h1> <ul id="short-nav">
+<li><code>import "fmt"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package fmt implements formatted I/O with functions analogous to C's printf and scanf. The format 'verbs' are derived from C's but are simpler. </p>
+<h3 id="hdr-Printing">Printing</h3> <p>The verbs: </p>
+<p>General: </p>
+<pre data-language="go">%v the value in a default format
+ when printing structs, the plus flag (%+v) adds field names
+%#v a Go-syntax representation of the value
+%T a Go-syntax representation of the type of the value
+%% a literal percent sign; consumes no value
+</pre> <p>Boolean: </p>
+<pre data-language="go">%t the word true or false
+</pre> <p>Integer: </p>
+<pre data-language="go">%b base 2
+%c the character represented by the corresponding Unicode code point
+%d base 10
+%o base 8
+%O base 8 with 0o prefix
+%q a single-quoted character literal safely escaped with Go syntax.
+%x base 16, with lower-case letters for a-f
+%X base 16, with upper-case letters for A-F
+%U Unicode format: U+1234; same as "U+%04X"
+</pre> <p>Floating-point and complex constituents: </p>
+<pre data-language="go">%b decimalless scientific notation with exponent a power of two,
+ in the manner of strconv.FormatFloat with the 'b' format,
+ e.g. -123456p-78
+%e scientific notation, e.g. -1.234456e+78
+%E scientific notation, e.g. -1.234456E+78
+%f decimal point but no exponent, e.g. 123.456
+%F synonym for %f
+%g %e for large exponents, %f otherwise. Precision is discussed below.
+%G %E for large exponents, %F otherwise
+%x hexadecimal notation (with decimal power of two exponent), e.g. -0x1.23abcp+20
+%X upper-case hexadecimal notation, e.g. -0X1.23ABCP+20
+</pre> <p>String and slice of bytes (treated equivalently with these verbs): </p>
+<pre data-language="go">%s the uninterpreted bytes of the string or slice
+%q a double-quoted string safely escaped with Go syntax
+%x base 16, lower-case, two characters per byte
+%X base 16, upper-case, two characters per byte
+</pre> <p>Slice: </p>
+<pre data-language="go">%p address of 0th element in base 16 notation, with leading 0x
+</pre> <p>Pointer: </p>
+<pre data-language="go">%p base 16 notation, with leading 0x
+The %b, %d, %o, %x and %X verbs also work with pointers,
+formatting the value exactly as if it were an integer.
+</pre> <p>The default format for %v is: </p>
+<pre data-language="go">bool: %t
+int, int8 etc.: %d
+uint, uint8 etc.: %d, %#x if printed with %#v
+float32, complex64, etc: %g
+string: %s
+chan: %p
+pointer: %p
+</pre> <p>For compound objects, the elements are printed using these rules, recursively, laid out like this: </p>
+<pre data-language="go">struct: {field0 field1 ...}
+array, slice: [elem0 elem1 ...]
+maps: map[key1:value1 key2:value2 ...]
+pointer to above: &amp;{}, &amp;[], &amp;map[]
+</pre> <p>Width is specified by an optional decimal number immediately preceding the verb. If absent, the width is whatever is necessary to represent the value. Precision is specified after the (optional) width by a period followed by a decimal number. If no period is present, a default precision is used. A period with no following number specifies a precision of zero. Examples: </p>
+<pre data-language="go">%f default width, default precision
+%9f width 9, default precision
+%.2f default width, precision 2
+%9.2f width 9, precision 2
+%9.f width 9, precision 0
+</pre> <p>Width and precision are measured in units of Unicode code points, that is, runes. (This differs from C's printf where the units are always measured in bytes.) Either or both of the flags may be replaced with the character '*', causing their values to be obtained from the next operand (preceding the one to format), which must be of type int. </p>
+<p>For most values, width is the minimum number of runes to output, padding the formatted form with spaces if necessary. </p>
+<p>For strings, byte slices and byte arrays, however, precision limits the length of the input to be formatted (not the size of the output), truncating if necessary. Normally it is measured in runes, but for these types when formatted with the %x or %X format it is measured in bytes. </p>
+<p>For floating-point values, width sets the minimum width of the field and precision sets the number of places after the decimal, if appropriate, except that for %g/%G precision sets the maximum number of significant digits (trailing zeros are removed). For example, given 12.345 the format %6.3f prints 12.345 while %.3g prints 12.3. The default precision for %e, %f and %#g is 6; for %g it is the smallest number of digits necessary to identify the value uniquely. </p>
+<p>For complex numbers, the width and precision apply to the two components independently and the result is parenthesized, so %f applied to 1.2+3.4i produces (1.200000+3.400000i). </p>
+<p>When formatting a single integer code point or a rune string (type []rune) with %q, invalid Unicode code points are changed to the Unicode replacement character, U+FFFD, as in strconv.QuoteRune. </p>
+<p>Other flags: </p>
+<pre data-language="go">'+' always print a sign for numeric values;
+ guarantee ASCII-only output for %q (%+q)
+'-' pad with spaces on the right rather than the left (left-justify the field)
+'#' alternate format: add leading 0b for binary (%#b), 0 for octal (%#o),
+ 0x or 0X for hex (%#x or %#X); suppress 0x for %p (%#p);
+ for %q, print a raw (backquoted) string if strconv.CanBackquote
+ returns true;
+ always print a decimal point for %e, %E, %f, %F, %g and %G;
+ do not remove trailing zeros for %g and %G;
+ write e.g. U+0078 'x' if the character is printable for %U (%#U).
+' ' (space) leave a space for elided sign in numbers (% d);
+ put spaces between bytes printing strings or slices in hex (% x, % X)
+'0' pad with leading zeros rather than spaces;
+ for numbers, this moves the padding after the sign;
+ ignored for strings, byte slices and byte arrays
+</pre> <p>Flags are ignored by verbs that do not expect them. For example there is no alternate decimal format, so %#d and %d behave identically. </p>
+<p>For each Printf-like function, there is also a Print function that takes no format and is equivalent to saying %v for every operand. Another variant Println inserts blanks between operands and appends a newline. </p>
+<p>Regardless of the verb, if an operand is an interface value, the internal concrete value is used, not the interface itself. Thus: </p>
+<pre data-language="go">var i interface{} = 23
+fmt.Printf("%v\n", i)
+</pre> <p>will print 23. </p>
+<p>Except when printed using the verbs %T and %p, special formatting considerations apply for operands that implement certain interfaces. In order of application: </p>
+<p>1. If the operand is a reflect.Value, the operand is replaced by the concrete value that it holds, and printing continues with the next rule. </p>
+<p>2. If an operand implements the Formatter interface, it will be invoked. In this case the interpretation of verbs and flags is controlled by that implementation. </p>
+<p>3. If the %v verb is used with the # flag (%#v) and the operand implements the GoStringer interface, that will be invoked. </p>
+<p>If the format (which is implicitly %v for Println etc.) is valid for a string (%s %q %x %X), or is %v but not %#v, the following two rules apply: </p>
+<p>4. If an operand implements the error interface, the Error method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any). </p>
+<p>5. If an operand implements method String() string, that method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any). </p>
+<p>For compound operands such as slices and structs, the format applies to the elements of each operand, recursively, not to the operand as a whole. Thus %q will quote each element of a slice of strings, and %6.2f will control formatting for each element of a floating-point array. </p>
+<p>However, when printing a byte slice with a string-like verb (%s %q %x %X), it is treated identically to a string, as a single item. </p>
+<p>To avoid recursion in cases such as </p>
+<pre data-language="go">type X string
+func (x X) String() string { return Sprintf("&lt;%s&gt;", x) }
+</pre> <p>convert the value before recurring: </p>
+<pre data-language="go">func (x X) String() string { return Sprintf("&lt;%s&gt;", string(x)) }
+</pre> <p>Infinite recursion can also be triggered by self-referential data structures, such as a slice that contains itself as an element, if that type has a String method. Such pathologies are rare, however, and the package does not protect against them. </p>
+<p>When printing a struct, fmt cannot and therefore does not invoke formatting methods such as Error or String on unexported fields. </p>
+<h3 id="hdr-Explicit_argument_indexes">Explicit argument indexes</h3> <p>In Printf, Sprintf, and Fprintf, the default behavior is for each formatting verb to format successive arguments passed in the call. However, the notation [n] immediately before the verb indicates that the nth one-indexed argument is to be formatted instead. The same notation before a '*' for a width or precision selects the argument index holding the value. After processing a bracketed expression [n], subsequent verbs will use arguments n+1, n+2, etc. unless otherwise directed. </p>
+<p>For example, </p>
+<pre data-language="go">fmt.Sprintf("%[2]d %[1]d\n", 11, 22)
+</pre> <p>will yield "22 11", while </p>
+<pre data-language="go">fmt.Sprintf("%[3]*.[2]*[1]f", 12.0, 2, 6)
+</pre> <p>equivalent to </p>
+<pre data-language="go">fmt.Sprintf("%6.2f", 12.0)
+</pre> <p>will yield " 12.00". Because an explicit index affects subsequent verbs, this notation can be used to print the same values multiple times by resetting the index for the first argument to be repeated: </p>
+<pre data-language="go">fmt.Sprintf("%d %d %#[1]x %#x", 16, 17)
+</pre> <p>will yield "16 17 0x10 0x11". </p>
+<h3 id="hdr-Format_errors">Format errors</h3> <p>If an invalid argument is given for a verb, such as providing a string to %d, the generated string will contain a description of the problem, as in these examples: </p>
+<pre data-language="go">Wrong type or unknown verb: %!verb(type=value)
+ Printf("%d", "hi"): %!d(string=hi)
+Too many arguments: %!(EXTRA type=value)
+ Printf("hi", "guys"): hi%!(EXTRA string=guys)
+Too few arguments: %!verb(MISSING)
+ Printf("hi%d"): hi%!d(MISSING)
+Non-int for width or precision: %!(BADWIDTH) or %!(BADPREC)
+ Printf("%*s", 4.5, "hi"): %!(BADWIDTH)hi
+ Printf("%.*s", 4.5, "hi"): %!(BADPREC)hi
+Invalid or invalid use of argument index: %!(BADINDEX)
+ Printf("%*[2]d", 7): %!d(BADINDEX)
+ Printf("%.[2]d", 7): %!d(BADINDEX)
+</pre> <p>All errors begin with the string "%!" followed sometimes by a single character (the verb) and end with a parenthesized description. </p>
+<p>If an Error or String method triggers a panic when called by a print routine, the fmt package reformats the error message from the panic, decorating it with an indication that it came through the fmt package. For example, if a String method calls panic("bad"), the resulting formatted message will look like </p>
+<pre data-language="go">%!s(PANIC=bad)
+</pre> <p>The %!s just shows the print verb in use when the failure occurred. If the panic is caused by a nil receiver to an Error or String method, however, the output is the undecorated string, "&lt;nil&gt;". </p>
+<h3 id="hdr-Scanning">Scanning</h3> <p>An analogous set of functions scans formatted text to yield values. Scan, Scanf and Scanln read from os.Stdin; Fscan, Fscanf and Fscanln read from a specified io.Reader; Sscan, Sscanf and Sscanln read from an argument string. </p>
+<p>Scan, Fscan, Sscan treat newlines in the input as spaces. </p>
+<p>Scanln, Fscanln and Sscanln stop scanning at a newline and require that the items be followed by a newline or EOF. </p>
+<p>Scanf, Fscanf, and Sscanf parse the arguments according to a format string, analogous to that of Printf. In the text that follows, 'space' means any Unicode whitespace character except newline. </p>
+<p>In the format string, a verb introduced by the % character consumes and parses input; these verbs are described in more detail below. A character other than %, space, or newline in the format consumes exactly that input character, which must be present. A newline with zero or more spaces before it in the format string consumes zero or more spaces in the input followed by a single newline or the end of the input. A space following a newline in the format string consumes zero or more spaces in the input. Otherwise, any run of one or more spaces in the format string consumes as many spaces as possible in the input. Unless the run of spaces in the format string appears adjacent to a newline, the run must consume at least one space from the input or find the end of the input. </p>
+<p>The handling of spaces and newlines differs from that of C's scanf family: in C, newlines are treated as any other space, and it is never an error when a run of spaces in the format string finds no spaces to consume in the input. </p>
+<p>The verbs behave analogously to those of Printf. For example, %x will scan an integer as a hexadecimal number, and %v will scan the default representation format for the value. The Printf verbs %p and %T and the flags # and + are not implemented. For floating-point and complex values, all valid formatting verbs (%b %e %E %f %F %g %G %x %X and %v) are equivalent and accept both decimal and hexadecimal notation (for example: "2.3e+7", "0x4.5p-8") and digit-separating underscores (for example: "3.14159_26535_89793"). </p>
+<p>Input processed by verbs is implicitly space-delimited: the implementation of every verb except %c starts by discarding leading spaces from the remaining input, and the %s verb (and %v reading into a string) stops consuming input at the first space or newline character. </p>
+<p>The familiar base-setting prefixes 0b (binary), 0o and 0 (octal), and 0x (hexadecimal) are accepted when scanning integers without a format or with the %v verb, as are digit-separating underscores. </p>
+<p>Width is interpreted in the input text but there is no syntax for scanning with a precision (no %5.2f, just %5f). If width is provided, it applies after leading spaces are trimmed and specifies the maximum number of runes to read to satisfy the verb. For example, </p>
+<pre data-language="go">Sscanf(" 1234567 ", "%5s%d", &amp;s, &amp;i)
+</pre> <p>will set s to "12345" and i to 67 while </p>
+<pre data-language="go">Sscanf(" 12 34 567 ", "%5s%d", &amp;s, &amp;i)
+</pre> <p>will set s to "12" and i to 34. </p>
+<p>In all the scanning functions, a carriage return followed immediately by a newline is treated as a plain newline (\r\n means the same as \n). </p>
+<p>In all the scanning functions, if an operand implements method Scan (that is, it implements the Scanner interface) that method will be used to scan the text for that operand. Also, if the number of arguments scanned is less than the number of arguments provided, an error is returned. </p>
+<p>All arguments to be scanned must be either pointers to basic types or implementations of the Scanner interface. </p>
+<p>Like Scanf and Fscanf, Sscanf need not consume its entire input. There is no way to recover how much of the input string Sscanf used. </p>
+<p>Note: Fscan etc. can read one character (rune) past the input they return, which means that a loop calling a scan routine may skip some of the input. This is usually a problem only when there is no space between input values. If the reader provided to Fscan implements ReadRune, that method will be used to read characters. If the reader also implements UnreadRune, that method will be used to save the character and successive calls will not lose data. To attach ReadRune and UnreadRune methods to a reader without that capability, use bufio.NewReader. </p> <h4 id="example__formats"> <span class="text">Example (Formats)</span>
+</h4> <p>These examples demonstrate the basics of printing using a format string. Printf, Sprintf, and Fprintf all take a format string that specifies how to format the subsequent arguments. For example, %d (we call that a 'verb') says to print the corresponding argument, which must be an integer (or something containing an integer, such as a slice of ints) in decimal. The verb %v ('v' for 'value') always formats the argument in its default form, just how Print or Println would show it. The special verb %T ('T' for 'Type') prints the type of the argument rather than its value. The examples are not exhaustive; see the package comment for all the details. </p> <p>Code:</p> <pre class="code" data-language="go">// A basic set of examples showing that %v is the default format, in this
+// case decimal for integers, which can be explicitly requested with %d;
+// the output is just what Println generates.
+integer := 23
+// Each of these prints "23" (without the quotes).
+fmt.Println(integer)
+fmt.Printf("%v\n", integer)
+fmt.Printf("%d\n", integer)
+
+// The special verb %T shows the type of an item rather than its value.
+fmt.Printf("%T %T\n", integer, &amp;integer)
+// Result: int *int
+
+// Println(x) is the same as Printf("%v\n", x) so we will use only Printf
+// in the following examples. Each one demonstrates how to format values of
+// a particular type, such as integers or strings. We start each format
+// string with %v to show the default output and follow that with one or
+// more custom formats.
+
+// Booleans print as "true" or "false" with %v or %t.
+truth := true
+fmt.Printf("%v %t\n", truth, truth)
+// Result: true true
+
+// Integers print as decimals with %v and %d,
+// or in hex with %x, octal with %o, or binary with %b.
+answer := 42
+fmt.Printf("%v %d %x %o %b\n", answer, answer, answer, answer, answer)
+// Result: 42 42 2a 52 101010
+
+// Floats have multiple formats: %v and %g print a compact representation,
+// while %f prints a decimal point and %e uses exponential notation. The
+// format %6.2f used here shows how to set the width and precision to
+// control the appearance of a floating-point value. In this instance, 6 is
+// the total width of the printed text for the value (note the extra spaces
+// in the output) and 2 is the number of decimal places to show.
+pi := math.Pi
+fmt.Printf("%v %g %.2f (%6.2f) %e\n", pi, pi, pi, pi, pi)
+// Result: 3.141592653589793 3.141592653589793 3.14 ( 3.14) 3.141593e+00
+
+// Complex numbers format as parenthesized pairs of floats, with an 'i'
+// after the imaginary part.
+point := 110.7 + 22.5i
+fmt.Printf("%v %g %.2f %.2e\n", point, point, point, point)
+// Result: (110.7+22.5i) (110.7+22.5i) (110.70+22.50i) (1.11e+02+2.25e+01i)
+
+// Runes are integers but when printed with %c show the character with that
+// Unicode value. The %q verb shows them as quoted characters, %U as a
+// hex Unicode code point, and %#U as both a code point and a quoted
+// printable form if the rune is printable.
+smile := '😀'
+fmt.Printf("%v %d %c %q %U %#U\n", smile, smile, smile, smile, smile, smile)
+// Result: 128512 128512 😀 '😀' U+1F600 U+1F600 '😀'
+
+// Strings are formatted with %v and %s as-is, with %q as quoted strings,
+// and %#q as backquoted strings.
+placeholders := `foo "bar"`
+fmt.Printf("%v %s %q %#q\n", placeholders, placeholders, placeholders, placeholders)
+// Result: foo "bar" foo "bar" "foo \"bar\"" `foo "bar"`
+
+// Maps formatted with %v show keys and values in their default formats.
+// The %#v form (the # is called a "flag" in this context) shows the map in
+// the Go source format. Maps are printed in a consistent order, sorted
+// by the values of the keys.
+isLegume := map[string]bool{
+ "peanut": true,
+ "dachshund": false,
+}
+fmt.Printf("%v %#v\n", isLegume, isLegume)
+// Result: map[dachshund:false peanut:true] map[string]bool{"dachshund":false, "peanut":true}
+
+// Structs formatted with %v show field values in their default formats.
+// The %+v form shows the fields by name, while %#v formats the struct in
+// Go source format.
+person := struct {
+ Name string
+ Age int
+}{"Kim", 22}
+fmt.Printf("%v %+v %#v\n", person, person, person)
+// Result: {Kim 22} {Name:Kim Age:22} struct { Name string; Age int }{Name:"Kim", Age:22}
+
+// The default format for a pointer shows the underlying value preceded by
+// an ampersand. The %p verb prints the pointer value in hex. We use a
+// typed nil for the argument to %p here because the value of any non-nil
+// pointer would change from run to run; run the commented-out Printf
+// call yourself to see.
+pointer := &amp;person
+fmt.Printf("%v %p\n", pointer, (*int)(nil))
+// Result: &amp;{Kim 22} 0x0
+// fmt.Printf("%v %p\n", pointer, pointer)
+// Result: &amp;{Kim 22} 0x010203 // See comment above.
+
+// Arrays and slices are formatted by applying the format to each element.
+greats := [5]string{"Kitano", "Kobayashi", "Kurosawa", "Miyazaki", "Ozu"}
+fmt.Printf("%v %q\n", greats, greats)
+// Result: [Kitano Kobayashi Kurosawa Miyazaki Ozu] ["Kitano" "Kobayashi" "Kurosawa" "Miyazaki" "Ozu"]
+
+kGreats := greats[:3]
+fmt.Printf("%v %q %#v\n", kGreats, kGreats, kGreats)
+// Result: [Kitano Kobayashi Kurosawa] ["Kitano" "Kobayashi" "Kurosawa"] []string{"Kitano", "Kobayashi", "Kurosawa"}
+
+// Byte slices are special. Integer verbs like %d print the elements in
+// that format. The %s and %q forms treat the slice like a string. The %x
+// verb has a special form with the space flag that puts a space between
+// the bytes.
+cmd := []byte("a⌘")
+fmt.Printf("%v %d %s %q %x % x\n", cmd, cmd, cmd, cmd, cmd, cmd)
+// Result: [97 226 140 152] [97 226 140 152] a⌘ "a⌘" 61e28c98 61 e2 8c 98
+
+// Types that implement Stringer are printed the same as strings. Because
+// Stringers return a string, we can print them using a string-specific
+// verb such as %q.
+now := time.Unix(123456789, 0).UTC() // time.Time implements fmt.Stringer.
+fmt.Printf("%v %q\n", now, now)
+// Result: 1973-11-29 21:33:09 +0000 UTC "1973-11-29 21:33:09 +0000 UTC"
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">23
+23
+23
+int *int
+true true
+42 42 2a 52 101010
+3.141592653589793 3.141592653589793 3.14 ( 3.14) 3.141593e+00
+(110.7+22.5i) (110.7+22.5i) (110.70+22.50i) (1.11e+02+2.25e+01i)
+128512 128512 😀 '😀' U+1F600 U+1F600 '😀'
+foo "bar" foo "bar" "foo \"bar\"" `foo "bar"`
+map[dachshund:false peanut:true] map[string]bool{"dachshund":false, "peanut":true}
+{Kim 22} {Name:Kim Age:22} struct { Name string; Age int }{Name:"Kim", Age:22}
+&amp;{Kim 22} 0x0
+[Kitano Kobayashi Kurosawa Miyazaki Ozu] ["Kitano" "Kobayashi" "Kurosawa" "Miyazaki" "Ozu"]
+[Kitano Kobayashi Kurosawa] ["Kitano" "Kobayashi" "Kurosawa"] []string{"Kitano", "Kobayashi", "Kurosawa"}
+[97 226 140 152] [97 226 140 152] a⌘ "a⌘" 61e28c98 61 e2 8c 98
+1973-11-29 21:33:09 +0000 UTC "1973-11-29 21:33:09 +0000 UTC"
+</pre> <h4 id="example__printers"> <span class="text">Example (Printers)</span>
+</h4> <p>Print, Println, and Printf lay out their arguments differently. In this example we can compare their behaviors. Println always adds blanks between the items it prints, while Print adds blanks only between non-string arguments and Printf does exactly what it is told. Sprint, Sprintln, Sprintf, Fprint, Fprintln, and Fprintf behave the same as their corresponding Print, Println, and Printf functions shown here. </p> <p>Code:</p> <pre class="code" data-language="go">a, b := 3.0, 4.0
+h := math.Hypot(a, b)
+
+// Print inserts blanks between arguments when neither is a string.
+// It does not add a newline to the output, so we add one explicitly.
+fmt.Print("The vector (", a, b, ") has length ", h, ".\n")
+
+// Println always inserts spaces between its arguments,
+// so it cannot be used to produce the same output as Print in this case;
+// its output has extra spaces.
+// Also, Println always adds a newline to the output.
+fmt.Println("The vector (", a, b, ") has length", h, ".")
+
+// Printf provides complete control but is more complex to use.
+// It does not add a newline to the output, so we add one explicitly
+// at the end of the format specifier string.
+fmt.Printf("The vector (%g %g) has length %g.\n", a, b, h)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">The vector (3 4) has length 5.
+The vector ( 3 4 ) has length 5 .
+The vector (3 4) has length 5.
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Append">func Append(b []byte, a ...any) []byte</a></li>
+<li><a href="#Appendf">func Appendf(b []byte, format string, a ...any) []byte</a></li>
+<li><a href="#Appendln">func Appendln(b []byte, a ...any) []byte</a></li>
+<li><a href="#Errorf">func Errorf(format string, a ...any) error</a></li>
+<li><a href="#FormatString">func FormatString(state State, verb rune) string</a></li>
+<li><a href="#Fprint">func Fprint(w io.Writer, a ...any) (n int, err error)</a></li>
+<li><a href="#Fprintf">func Fprintf(w io.Writer, format string, a ...any) (n int, err error)</a></li>
+<li><a href="#Fprintln">func Fprintln(w io.Writer, a ...any) (n int, err error)</a></li>
+<li><a href="#Fscan">func Fscan(r io.Reader, a ...any) (n int, err error)</a></li>
+<li><a href="#Fscanf">func Fscanf(r io.Reader, format string, a ...any) (n int, err error)</a></li>
+<li><a href="#Fscanln">func Fscanln(r io.Reader, a ...any) (n int, err error)</a></li>
+<li><a href="#Print">func Print(a ...any) (n int, err error)</a></li>
+<li><a href="#Printf">func Printf(format string, a ...any) (n int, err error)</a></li>
+<li><a href="#Println">func Println(a ...any) (n int, err error)</a></li>
+<li><a href="#Scan">func Scan(a ...any) (n int, err error)</a></li>
+<li><a href="#Scanf">func Scanf(format string, a ...any) (n int, err error)</a></li>
+<li><a href="#Scanln">func Scanln(a ...any) (n int, err error)</a></li>
+<li><a href="#Sprint">func Sprint(a ...any) string</a></li>
+<li><a href="#Sprintf">func Sprintf(format string, a ...any) string</a></li>
+<li><a href="#Sprintln">func Sprintln(a ...any) string</a></li>
+<li><a href="#Sscan">func Sscan(str string, a ...any) (n int, err error)</a></li>
+<li><a href="#Sscanf">func Sscanf(str string, format string, a ...any) (n int, err error)</a></li>
+<li><a href="#Sscanln">func Sscanln(str string, a ...any) (n int, err error)</a></li>
+<li><a href="#Formatter">type Formatter</a></li>
+<li><a href="#GoStringer">type GoStringer</a></li>
+<li><a href="#ScanState">type ScanState</a></li>
+<li><a href="#Scanner">type Scanner</a></li>
+<li><a href="#State">type State</a></li>
+<li><a href="#Stringer">type Stringer</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Errorf">Errorf</a></dd> <dd><a class="exampleLink" href="#example_Fprint">Fprint</a></dd> <dd><a class="exampleLink" href="#example_Fprintf">Fprintf</a></dd> <dd><a class="exampleLink" href="#example_Fprintln">Fprintln</a></dd> <dd><a class="exampleLink" href="#example_Fscanf">Fscanf</a></dd> <dd><a class="exampleLink" href="#example_Fscanln">Fscanln</a></dd> <dd><a class="exampleLink" href="#example_GoStringer">GoStringer</a></dd> <dd><a class="exampleLink" href="#example_Print">Print</a></dd> <dd><a class="exampleLink" href="#example_Printf">Printf</a></dd> <dd><a class="exampleLink" href="#example_Println">Println</a></dd> <dd><a class="exampleLink" href="#example_Sprint">Sprint</a></dd> <dd><a class="exampleLink" href="#example_Sprintf">Sprintf</a></dd> <dd><a class="exampleLink" href="#example_Sprintln">Sprintln</a></dd> <dd><a class="exampleLink" href="#example_Sscanf">Sscanf</a></dd> <dd><a class="exampleLink" href="#example_Stringer">Stringer</a></dd> <dd><a class="exampleLink" href="#example__formats">Package (Formats)</a></dd> <dd><a class="exampleLink" href="#example__printers">Package (Printers)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>doc.go</span> <span>errors.go</span> <span>format.go</span> <span>print.go</span> <span>scan.go</span> </p> <h2 id="Append">func <span>Append</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func Append(b []byte, a ...any) []byte</pre> <p>Append formats using the default formats for its operands, appends the result to the byte slice, and returns the updated slice. </p>
+<h2 id="Appendf">func <span>Appendf</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func Appendf(b []byte, format string, a ...any) []byte</pre> <p>Appendf formats according to a format specifier, appends the result to the byte slice, and returns the updated slice. </p>
+<h2 id="Appendln">func <span>Appendln</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func Appendln(b []byte, a ...any) []byte</pre> <p>Appendln formats using the default formats for its operands, appends the result to the byte slice, and returns the updated slice. Spaces are always added between operands and a newline is appended. </p>
+<h2 id="Errorf">func <span>Errorf</span> </h2> <pre data-language="go">func Errorf(format string, a ...any) error</pre> <p>Errorf formats according to a format specifier and returns the string as a value that satisfies error. </p>
+<p>If the format specifier includes a %w verb with an error operand, the returned error will implement an Unwrap method returning the operand. If there is more than one %w verb, the returned error will implement an Unwrap method returning a []error containing all the %w operands in the order they appear in the arguments. It is invalid to supply the %w verb with an operand that does not implement the error interface. The %w verb is otherwise a synonym for %v. </p> <h4 id="example_Errorf"> <span class="text">Example</span>
+</h4> <p>The Errorf function lets us use formatting features to create descriptive error messages. </p> <p>Code:</p> <pre class="code" data-language="go">const name, id = "bueller", 17
+err := fmt.Errorf("user %q (id %d) not found", name, id)
+fmt.Println(err.Error())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">user "bueller" (id 17) not found
+</pre> <h2 id="FormatString">func <span>FormatString</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func FormatString(state State, verb rune) string</pre> <p>FormatString returns a string representing the fully qualified formatting directive captured by the State, followed by the argument verb. (State does not itself contain the verb.) The result has a leading percent sign followed by any flags, the width, and the precision. Missing flags, width, and precision are omitted. This function allows a Formatter to reconstruct the original directive triggering the call to Format. </p>
+<h2 id="Fprint">func <span>Fprint</span> </h2> <pre data-language="go">func Fprint(w io.Writer, a ...any) (n int, err error)</pre> <p>Fprint formats using the default formats for its operands and writes to w. Spaces are added between operands when neither is a string. It returns the number of bytes written and any write error encountered. </p> <h4 id="example_Fprint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const name, age = "Kim", 22
+n, err := fmt.Fprint(os.Stdout, name, " is ", age, " years old.\n")
+
+// The n and err return values from Fprint are
+// those returned by the underlying io.Writer.
+if err != nil {
+ fmt.Fprintf(os.Stderr, "Fprint: %v\n", err)
+}
+fmt.Print(n, " bytes written.\n")
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Kim is 22 years old.
+21 bytes written.
+</pre> <h2 id="Fprintf">func <span>Fprintf</span> </h2> <pre data-language="go">func Fprintf(w io.Writer, format string, a ...any) (n int, err error)</pre> <p>Fprintf formats according to a format specifier and writes to w. It returns the number of bytes written and any write error encountered. </p> <h4 id="example_Fprintf"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const name, age = "Kim", 22
+n, err := fmt.Fprintf(os.Stdout, "%s is %d years old.\n", name, age)
+
+// The n and err return values from Fprintf are
+// those returned by the underlying io.Writer.
+if err != nil {
+ fmt.Fprintf(os.Stderr, "Fprintf: %v\n", err)
+}
+fmt.Printf("%d bytes written.\n", n)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Kim is 22 years old.
+21 bytes written.
+</pre> <h2 id="Fprintln">func <span>Fprintln</span> </h2> <pre data-language="go">func Fprintln(w io.Writer, a ...any) (n int, err error)</pre> <p>Fprintln formats using the default formats for its operands and writes to w. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered. </p> <h4 id="example_Fprintln"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const name, age = "Kim", 22
+n, err := fmt.Fprintln(os.Stdout, name, "is", age, "years old.")
+
+// The n and err return values from Fprintln are
+// those returned by the underlying io.Writer.
+if err != nil {
+ fmt.Fprintf(os.Stderr, "Fprintln: %v\n", err)
+}
+fmt.Println(n, "bytes written.")
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Kim is 22 years old.
+21 bytes written.
+</pre> <h2 id="Fscan">func <span>Fscan</span> </h2> <pre data-language="go">func Fscan(r io.Reader, a ...any) (n int, err error)</pre> <p>Fscan scans text read from r, storing successive space-separated values into successive arguments. Newlines count as space. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why. </p>
+<h2 id="Fscanf">func <span>Fscanf</span> </h2> <pre data-language="go">func Fscanf(r io.Reader, format string, a ...any) (n int, err error)</pre> <p>Fscanf scans text read from r, storing successive space-separated values into successive arguments as determined by the format. It returns the number of items successfully parsed. Newlines in the input must match newlines in the format. </p> <h4 id="example_Fscanf"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var (
+ i int
+ b bool
+ s string
+)
+r := strings.NewReader("5 true gophers")
+n, err := fmt.Fscanf(r, "%d %t %s", &amp;i, &amp;b, &amp;s)
+if err != nil {
+ fmt.Fprintf(os.Stderr, "Fscanf: %v\n", err)
+}
+fmt.Println(i, b, s)
+fmt.Println(n)
+</pre> <p>Output:</p> <pre class="output" data-language="go">5 true gophers
+3
+</pre> <h2 id="Fscanln">func <span>Fscanln</span> </h2> <pre data-language="go">func Fscanln(r io.Reader, a ...any) (n int, err error)</pre> <p>Fscanln is similar to Fscan, but stops scanning at a newline and after the final item there must be a newline or EOF. </p> <h4 id="example_Fscanln"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := `dmr 1771 1.61803398875
+ ken 271828 3.14159`
+r := strings.NewReader(s)
+var a string
+var b int
+var c float64
+for {
+ n, err := fmt.Fscanln(r, &amp;a, &amp;b, &amp;c)
+ if err == io.EOF {
+ break
+ }
+ if err != nil {
+ panic(err)
+ }
+ fmt.Printf("%d: %s, %d, %f\n", n, a, b, c)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">3: dmr, 1771, 1.618034
+3: ken, 271828, 3.141590
+</pre> <h2 id="Print">func <span>Print</span> </h2> <pre data-language="go">func Print(a ...any) (n int, err error)</pre> <p>Print formats using the default formats for its operands and writes to standard output. Spaces are added between operands when neither is a string. It returns the number of bytes written and any write error encountered. </p> <h4 id="example_Print"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const name, age = "Kim", 22
+fmt.Print(name, " is ", age, " years old.\n")
+
+// It is conventional not to worry about any
+// error returned by Print.
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Kim is 22 years old.
+</pre> <h2 id="Printf">func <span>Printf</span> </h2> <pre data-language="go">func Printf(format string, a ...any) (n int, err error)</pre> <p>Printf formats according to a format specifier and writes to standard output. It returns the number of bytes written and any write error encountered. </p> <h4 id="example_Printf"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const name, age = "Kim", 22
+fmt.Printf("%s is %d years old.\n", name, age)
+
+// It is conventional not to worry about any
+// error returned by Printf.
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Kim is 22 years old.
+</pre> <h2 id="Println">func <span>Println</span> </h2> <pre data-language="go">func Println(a ...any) (n int, err error)</pre> <p>Println formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered. </p> <h4 id="example_Println"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const name, age = "Kim", 22
+fmt.Println(name, "is", age, "years old.")
+
+// It is conventional not to worry about any
+// error returned by Println.
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Kim is 22 years old.
+</pre> <h2 id="Scan">func <span>Scan</span> </h2> <pre data-language="go">func Scan(a ...any) (n int, err error)</pre> <p>Scan scans text read from standard input, storing successive space-separated values into successive arguments. Newlines count as space. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why. </p>
+<h2 id="Scanf">func <span>Scanf</span> </h2> <pre data-language="go">func Scanf(format string, a ...any) (n int, err error)</pre> <p>Scanf scans text read from standard input, storing successive space-separated values into successive arguments as determined by the format. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why. Newlines in the input must match newlines in the format. The one exception: the verb %c always scans the next rune in the input, even if it is a space (or tab etc.) or newline. </p>
+<h2 id="Scanln">func <span>Scanln</span> </h2> <pre data-language="go">func Scanln(a ...any) (n int, err error)</pre> <p>Scanln is similar to Scan, but stops scanning at a newline and after the final item there must be a newline or EOF. </p>
+<h2 id="Sprint">func <span>Sprint</span> </h2> <pre data-language="go">func Sprint(a ...any) string</pre> <p>Sprint formats using the default formats for its operands and returns the resulting string. Spaces are added between operands when neither is a string. </p> <h4 id="example_Sprint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const name, age = "Kim", 22
+s := fmt.Sprint(name, " is ", age, " years old.\n")
+
+io.WriteString(os.Stdout, s) // Ignoring error for simplicity.
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Kim is 22 years old.
+</pre> <h2 id="Sprintf">func <span>Sprintf</span> </h2> <pre data-language="go">func Sprintf(format string, a ...any) string</pre> <p>Sprintf formats according to a format specifier and returns the resulting string. </p> <h4 id="example_Sprintf"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const name, age = "Kim", 22
+s := fmt.Sprintf("%s is %d years old.\n", name, age)
+
+io.WriteString(os.Stdout, s) // Ignoring error for simplicity.
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Kim is 22 years old.
+</pre> <h2 id="Sprintln">func <span>Sprintln</span> </h2> <pre data-language="go">func Sprintln(a ...any) string</pre> <p>Sprintln formats using the default formats for its operands and returns the resulting string. Spaces are always added between operands and a newline is appended. </p> <h4 id="example_Sprintln"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const name, age = "Kim", 22
+s := fmt.Sprintln(name, "is", age, "years old.")
+
+io.WriteString(os.Stdout, s) // Ignoring error for simplicity.
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Kim is 22 years old.
+</pre> <h2 id="Sscan">func <span>Sscan</span> </h2> <pre data-language="go">func Sscan(str string, a ...any) (n int, err error)</pre> <p>Sscan scans the argument string, storing successive space-separated values into successive arguments. Newlines count as space. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why. </p>
+<h2 id="Sscanf">func <span>Sscanf</span> </h2> <pre data-language="go">func Sscanf(str string, format string, a ...any) (n int, err error)</pre> <p>Sscanf scans the argument string, storing successive space-separated values into successive arguments as determined by the format. It returns the number of items successfully parsed. Newlines in the input must match newlines in the format. </p> <h4 id="example_Sscanf"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var name string
+var age int
+n, err := fmt.Sscanf("Kim is 22 years old", "%s is %d years old", &amp;name, &amp;age)
+if err != nil {
+ panic(err)
+}
+fmt.Printf("%d: %s, %d\n", n, name, age)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">2: Kim, 22
+</pre> <h2 id="Sscanln">func <span>Sscanln</span> </h2> <pre data-language="go">func Sscanln(str string, a ...any) (n int, err error)</pre> <p>Sscanln is similar to Sscan, but stops scanning at a newline and after the final item there must be a newline or EOF. </p>
+<h2 id="Formatter">type <span>Formatter</span> </h2> <p>Formatter is implemented by any value that has a Format method. The implementation controls how State and rune are interpreted, and may call Sprint() or Fprint(f) etc. to generate its output. </p>
+<pre data-language="go">type Formatter interface {
+ Format(f State, verb rune)
+}</pre> <h2 id="GoStringer">type <span>GoStringer</span> </h2> <p>GoStringer is implemented by any value that has a GoString method, which defines the Go syntax for that value. The GoString method is used to print values passed as an operand to a %#v format. </p>
+<pre data-language="go">type GoStringer interface {
+ GoString() string
+}</pre> <h4 id="example_GoStringer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package fmt_test
+
+import (
+ "fmt"
+)
+
+// Address has a City, State and a Country.
+type Address struct {
+ City string
+ State string
+ Country string
+}
+
+// Person has a Name, Age and Address.
+type Person struct {
+ Name string
+ Age uint
+ Addr *Address
+}
+
+// GoString makes Person satisfy the GoStringer interface.
+// The return value is valid Go code that can be used to reproduce the Person struct.
+func (p Person) GoString() string {
+ if p.Addr != nil {
+ return fmt.Sprintf("Person{Name: %q, Age: %d, Addr: &amp;Address{City: %q, State: %q, Country: %q}}", p.Name, int(p.Age), p.Addr.City, p.Addr.State, p.Addr.Country)
+ }
+ return fmt.Sprintf("Person{Name: %q, Age: %d}", p.Name, int(p.Age))
+}
+
+func ExampleGoStringer() {
+ p1 := Person{
+ Name: "Warren",
+ Age: 31,
+ Addr: &amp;Address{
+ City: "Denver",
+ State: "CO",
+ Country: "U.S.A.",
+ },
+ }
+ // If GoString() wasn't implemented, the output of `fmt.Printf("%#v", p1)` would be similar to
+ // Person{Name:"Warren", Age:0x1f, Addr:(*main.Address)(0x10448240)}
+ fmt.Printf("%#v\n", p1)
+
+ p2 := Person{
+ Name: "Theia",
+ Age: 4,
+ }
+ // If GoString() wasn't implemented, the output of `fmt.Printf("%#v", p2)` would be similar to
+ // Person{Name:"Theia", Age:0x4, Addr:(*main.Address)(nil)}
+ fmt.Printf("%#v\n", p2)
+
+ // Output:
+ // Person{Name: "Warren", Age: 31, Addr: &amp;Address{City: "Denver", State: "CO", Country: "U.S.A."}}
+ // Person{Name: "Theia", Age: 4}
+}
+</pre> <h2 id="ScanState">type <span>ScanState</span> </h2> <p>ScanState represents the scanner state passed to custom scanners. Scanners may do rune-at-a-time scanning or ask the ScanState to discover the next space-delimited token. </p>
+<pre data-language="go">type ScanState interface {
+ // ReadRune reads the next rune (Unicode code point) from the input.
+ // If invoked during Scanln, Fscanln, or Sscanln, ReadRune() will
+ // return EOF after returning the first '\n' or when reading beyond
+ // the specified width.
+ ReadRune() (r rune, size int, err error)
+ // UnreadRune causes the next call to ReadRune to return the same rune.
+ UnreadRune() error
+ // SkipSpace skips space in the input. Newlines are treated appropriately
+ // for the operation being performed; see the package documentation
+ // for more information.
+ SkipSpace()
+ // Token skips space in the input if skipSpace is true, then returns the
+ // run of Unicode code points c satisfying f(c). If f is nil,
+ // !unicode.IsSpace(c) is used; that is, the token will hold non-space
+ // characters. Newlines are treated appropriately for the operation being
+ // performed; see the package documentation for more information.
+ // The returned slice points to shared data that may be overwritten
+ // by the next call to Token, a call to a Scan function using the ScanState
+ // as input, or when the calling Scan method returns.
+ Token(skipSpace bool, f func(rune) bool) (token []byte, err error)
+ // Width returns the value of the width option and whether it has been set.
+ // The unit is Unicode code points.
+ Width() (wid int, ok bool)
+ // Because ReadRune is implemented by the interface, Read should never be
+ // called by the scanning routines and a valid implementation of
+ // ScanState may choose always to return an error from Read.
+ Read(buf []byte) (n int, err error)
+}</pre> <h2 id="Scanner">type <span>Scanner</span> </h2> <p>Scanner is implemented by any value that has a Scan method, which scans the input for the representation of a value and stores the result in the receiver, which must be a pointer to be useful. The Scan method is called for any argument to Scan, Scanf, or Scanln that implements it. </p>
+<pre data-language="go">type Scanner interface {
+ Scan(state ScanState, verb rune) error
+}</pre> <h2 id="State">type <span>State</span> </h2> <p>State represents the printer state passed to custom formatters. It provides access to the io.Writer interface plus information about the flags and options for the operand's format specifier. </p>
+<pre data-language="go">type State interface {
+ // Write is the function to call to emit formatted output to be printed.
+ Write(b []byte) (n int, err error)
+ // Width returns the value of the width option and whether it has been set.
+ Width() (wid int, ok bool)
+ // Precision returns the value of the precision option and whether it has been set.
+ Precision() (prec int, ok bool)
+
+ // Flag reports whether the flag c, a character, has been set.
+ Flag(c int) bool
+}</pre> <h2 id="Stringer">type <span>Stringer</span> </h2> <p>Stringer is implemented by any value that has a String method, which defines the “native” format for that value. The String method is used to print values passed as an operand to any format that accepts a string or to an unformatted printer such as Print. </p>
+<pre data-language="go">type Stringer interface {
+ String() string
+}</pre> <h4 id="example_Stringer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package fmt_test
+
+import (
+ "fmt"
+)
+
+// Animal has a Name and an Age to represent an animal.
+type Animal struct {
+ Name string
+ Age uint
+}
+
+// String makes Animal satisfy the Stringer interface.
+func (a Animal) String() string {
+ return fmt.Sprintf("%v (%d)", a.Name, a.Age)
+}
+
+func ExampleStringer() {
+ a := Animal{
+ Name: "Gopher",
+ Age: 2,
+ }
+ fmt.Println(a)
+ // Output: Gopher (2)
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/fmt/" class="_attribution-link">http://golang.org/pkg/fmt/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fast%2Findex.html b/devdocs/go/go%2Fast%2Findex.html
new file mode 100644
index 00000000..9bd381b0
--- /dev/null
+++ b/devdocs/go/go%2Fast%2Findex.html
@@ -0,0 +1,1031 @@
+<h1> Package ast </h1> <ul id="short-nav">
+<li><code>import "go/ast"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package ast declares the types used to represent syntax trees for Go packages. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#FileExports">func FileExports(src *File) bool</a></li>
+<li><a href="#FilterDecl">func FilterDecl(decl Decl, f Filter) bool</a></li>
+<li><a href="#FilterFile">func FilterFile(src *File, f Filter) bool</a></li>
+<li><a href="#FilterPackage">func FilterPackage(pkg *Package, f Filter) bool</a></li>
+<li><a href="#Fprint">func Fprint(w io.Writer, fset *token.FileSet, x any, f FieldFilter) error</a></li>
+<li><a href="#Inspect">func Inspect(node Node, f func(Node) bool)</a></li>
+<li><a href="#IsExported">func IsExported(name string) bool</a></li>
+<li><a href="#IsGenerated">func IsGenerated(file *File) bool</a></li>
+<li><a href="#NotNilFilter">func NotNilFilter(_ string, v reflect.Value) bool</a></li>
+<li><a href="#PackageExports">func PackageExports(pkg *Package) bool</a></li>
+<li><a href="#Print">func Print(fset *token.FileSet, x any) error</a></li>
+<li><a href="#SortImports">func SortImports(fset *token.FileSet, f *File)</a></li>
+<li><a href="#Walk">func Walk(v Visitor, node Node)</a></li>
+<li><a href="#ArrayType">type ArrayType</a></li>
+<li> <a href="#ArrayType.End">func (x *ArrayType) End() token.Pos</a>
+</li>
+<li> <a href="#ArrayType.Pos">func (x *ArrayType) Pos() token.Pos</a>
+</li>
+<li><a href="#AssignStmt">type AssignStmt</a></li>
+<li> <a href="#AssignStmt.End">func (s *AssignStmt) End() token.Pos</a>
+</li>
+<li> <a href="#AssignStmt.Pos">func (s *AssignStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#BadDecl">type BadDecl</a></li>
+<li> <a href="#BadDecl.End">func (d *BadDecl) End() token.Pos</a>
+</li>
+<li> <a href="#BadDecl.Pos">func (d *BadDecl) Pos() token.Pos</a>
+</li>
+<li><a href="#BadExpr">type BadExpr</a></li>
+<li> <a href="#BadExpr.End">func (x *BadExpr) End() token.Pos</a>
+</li>
+<li> <a href="#BadExpr.Pos">func (x *BadExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#BadStmt">type BadStmt</a></li>
+<li> <a href="#BadStmt.End">func (s *BadStmt) End() token.Pos</a>
+</li>
+<li> <a href="#BadStmt.Pos">func (s *BadStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#BasicLit">type BasicLit</a></li>
+<li> <a href="#BasicLit.End">func (x *BasicLit) End() token.Pos</a>
+</li>
+<li> <a href="#BasicLit.Pos">func (x *BasicLit) Pos() token.Pos</a>
+</li>
+<li><a href="#BinaryExpr">type BinaryExpr</a></li>
+<li> <a href="#BinaryExpr.End">func (x *BinaryExpr) End() token.Pos</a>
+</li>
+<li> <a href="#BinaryExpr.Pos">func (x *BinaryExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#BlockStmt">type BlockStmt</a></li>
+<li> <a href="#BlockStmt.End">func (s *BlockStmt) End() token.Pos</a>
+</li>
+<li> <a href="#BlockStmt.Pos">func (s *BlockStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#BranchStmt">type BranchStmt</a></li>
+<li> <a href="#BranchStmt.End">func (s *BranchStmt) End() token.Pos</a>
+</li>
+<li> <a href="#BranchStmt.Pos">func (s *BranchStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#CallExpr">type CallExpr</a></li>
+<li> <a href="#CallExpr.End">func (x *CallExpr) End() token.Pos</a>
+</li>
+<li> <a href="#CallExpr.Pos">func (x *CallExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#CaseClause">type CaseClause</a></li>
+<li> <a href="#CaseClause.End">func (s *CaseClause) End() token.Pos</a>
+</li>
+<li> <a href="#CaseClause.Pos">func (s *CaseClause) Pos() token.Pos</a>
+</li>
+<li><a href="#ChanDir">type ChanDir</a></li>
+<li><a href="#ChanType">type ChanType</a></li>
+<li> <a href="#ChanType.End">func (x *ChanType) End() token.Pos</a>
+</li>
+<li> <a href="#ChanType.Pos">func (x *ChanType) Pos() token.Pos</a>
+</li>
+<li><a href="#CommClause">type CommClause</a></li>
+<li> <a href="#CommClause.End">func (s *CommClause) End() token.Pos</a>
+</li>
+<li> <a href="#CommClause.Pos">func (s *CommClause) Pos() token.Pos</a>
+</li>
+<li><a href="#Comment">type Comment</a></li>
+<li> <a href="#Comment.End">func (c *Comment) End() token.Pos</a>
+</li>
+<li> <a href="#Comment.Pos">func (c *Comment) Pos() token.Pos</a>
+</li>
+<li><a href="#CommentGroup">type CommentGroup</a></li>
+<li> <a href="#CommentGroup.End">func (g *CommentGroup) End() token.Pos</a>
+</li>
+<li> <a href="#CommentGroup.Pos">func (g *CommentGroup) Pos() token.Pos</a>
+</li>
+<li> <a href="#CommentGroup.Text">func (g *CommentGroup) Text() string</a>
+</li>
+<li><a href="#CommentMap">type CommentMap</a></li>
+<li> <a href="#NewCommentMap">func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap</a>
+</li>
+<li> <a href="#CommentMap.Comments">func (cmap CommentMap) Comments() []*CommentGroup</a>
+</li>
+<li> <a href="#CommentMap.Filter">func (cmap CommentMap) Filter(node Node) CommentMap</a>
+</li>
+<li> <a href="#CommentMap.String">func (cmap CommentMap) String() string</a>
+</li>
+<li> <a href="#CommentMap.Update">func (cmap CommentMap) Update(old, new Node) Node</a>
+</li>
+<li><a href="#CompositeLit">type CompositeLit</a></li>
+<li> <a href="#CompositeLit.End">func (x *CompositeLit) End() token.Pos</a>
+</li>
+<li> <a href="#CompositeLit.Pos">func (x *CompositeLit) Pos() token.Pos</a>
+</li>
+<li><a href="#Decl">type Decl</a></li>
+<li><a href="#DeclStmt">type DeclStmt</a></li>
+<li> <a href="#DeclStmt.End">func (s *DeclStmt) End() token.Pos</a>
+</li>
+<li> <a href="#DeclStmt.Pos">func (s *DeclStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#DeferStmt">type DeferStmt</a></li>
+<li> <a href="#DeferStmt.End">func (s *DeferStmt) End() token.Pos</a>
+</li>
+<li> <a href="#DeferStmt.Pos">func (s *DeferStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#Ellipsis">type Ellipsis</a></li>
+<li> <a href="#Ellipsis.End">func (x *Ellipsis) End() token.Pos</a>
+</li>
+<li> <a href="#Ellipsis.Pos">func (x *Ellipsis) Pos() token.Pos</a>
+</li>
+<li><a href="#EmptyStmt">type EmptyStmt</a></li>
+<li> <a href="#EmptyStmt.End">func (s *EmptyStmt) End() token.Pos</a>
+</li>
+<li> <a href="#EmptyStmt.Pos">func (s *EmptyStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#Expr">type Expr</a></li>
+<li> <a href="#Unparen">func Unparen(e Expr) Expr</a>
+</li>
+<li><a href="#ExprStmt">type ExprStmt</a></li>
+<li> <a href="#ExprStmt.End">func (s *ExprStmt) End() token.Pos</a>
+</li>
+<li> <a href="#ExprStmt.Pos">func (s *ExprStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#Field">type Field</a></li>
+<li> <a href="#Field.End">func (f *Field) End() token.Pos</a>
+</li>
+<li> <a href="#Field.Pos">func (f *Field) Pos() token.Pos</a>
+</li>
+<li><a href="#FieldFilter">type FieldFilter</a></li>
+<li><a href="#FieldList">type FieldList</a></li>
+<li> <a href="#FieldList.End">func (f *FieldList) End() token.Pos</a>
+</li>
+<li> <a href="#FieldList.NumFields">func (f *FieldList) NumFields() int</a>
+</li>
+<li> <a href="#FieldList.Pos">func (f *FieldList) Pos() token.Pos</a>
+</li>
+<li><a href="#File">type File</a></li>
+<li> <a href="#MergePackageFiles">func MergePackageFiles(pkg *Package, mode MergeMode) *File</a>
+</li>
+<li> <a href="#File.End">func (f *File) End() token.Pos</a>
+</li>
+<li> <a href="#File.Pos">func (f *File) Pos() token.Pos</a>
+</li>
+<li><a href="#Filter">type Filter</a></li>
+<li><a href="#ForStmt">type ForStmt</a></li>
+<li> <a href="#ForStmt.End">func (s *ForStmt) End() token.Pos</a>
+</li>
+<li> <a href="#ForStmt.Pos">func (s *ForStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#FuncDecl">type FuncDecl</a></li>
+<li> <a href="#FuncDecl.End">func (d *FuncDecl) End() token.Pos</a>
+</li>
+<li> <a href="#FuncDecl.Pos">func (d *FuncDecl) Pos() token.Pos</a>
+</li>
+<li><a href="#FuncLit">type FuncLit</a></li>
+<li> <a href="#FuncLit.End">func (x *FuncLit) End() token.Pos</a>
+</li>
+<li> <a href="#FuncLit.Pos">func (x *FuncLit) Pos() token.Pos</a>
+</li>
+<li><a href="#FuncType">type FuncType</a></li>
+<li> <a href="#FuncType.End">func (x *FuncType) End() token.Pos</a>
+</li>
+<li> <a href="#FuncType.Pos">func (x *FuncType) Pos() token.Pos</a>
+</li>
+<li><a href="#GenDecl">type GenDecl</a></li>
+<li> <a href="#GenDecl.End">func (d *GenDecl) End() token.Pos</a>
+</li>
+<li> <a href="#GenDecl.Pos">func (d *GenDecl) Pos() token.Pos</a>
+</li>
+<li><a href="#GoStmt">type GoStmt</a></li>
+<li> <a href="#GoStmt.End">func (s *GoStmt) End() token.Pos</a>
+</li>
+<li> <a href="#GoStmt.Pos">func (s *GoStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#Ident">type Ident</a></li>
+<li> <a href="#NewIdent">func NewIdent(name string) *Ident</a>
+</li>
+<li> <a href="#Ident.End">func (x *Ident) End() token.Pos</a>
+</li>
+<li> <a href="#Ident.IsExported">func (id *Ident) IsExported() bool</a>
+</li>
+<li> <a href="#Ident.Pos">func (x *Ident) Pos() token.Pos</a>
+</li>
+<li> <a href="#Ident.String">func (id *Ident) String() string</a>
+</li>
+<li><a href="#IfStmt">type IfStmt</a></li>
+<li> <a href="#IfStmt.End">func (s *IfStmt) End() token.Pos</a>
+</li>
+<li> <a href="#IfStmt.Pos">func (s *IfStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#ImportSpec">type ImportSpec</a></li>
+<li> <a href="#ImportSpec.End">func (s *ImportSpec) End() token.Pos</a>
+</li>
+<li> <a href="#ImportSpec.Pos">func (s *ImportSpec) Pos() token.Pos</a>
+</li>
+<li><a href="#Importer">type Importer</a></li>
+<li><a href="#IncDecStmt">type IncDecStmt</a></li>
+<li> <a href="#IncDecStmt.End">func (s *IncDecStmt) End() token.Pos</a>
+</li>
+<li> <a href="#IncDecStmt.Pos">func (s *IncDecStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#IndexExpr">type IndexExpr</a></li>
+<li> <a href="#IndexExpr.End">func (x *IndexExpr) End() token.Pos</a>
+</li>
+<li> <a href="#IndexExpr.Pos">func (x *IndexExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#IndexListExpr">type IndexListExpr</a></li>
+<li> <a href="#IndexListExpr.End">func (x *IndexListExpr) End() token.Pos</a>
+</li>
+<li> <a href="#IndexListExpr.Pos">func (x *IndexListExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#InterfaceType">type InterfaceType</a></li>
+<li> <a href="#InterfaceType.End">func (x *InterfaceType) End() token.Pos</a>
+</li>
+<li> <a href="#InterfaceType.Pos">func (x *InterfaceType) Pos() token.Pos</a>
+</li>
+<li><a href="#KeyValueExpr">type KeyValueExpr</a></li>
+<li> <a href="#KeyValueExpr.End">func (x *KeyValueExpr) End() token.Pos</a>
+</li>
+<li> <a href="#KeyValueExpr.Pos">func (x *KeyValueExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#LabeledStmt">type LabeledStmt</a></li>
+<li> <a href="#LabeledStmt.End">func (s *LabeledStmt) End() token.Pos</a>
+</li>
+<li> <a href="#LabeledStmt.Pos">func (s *LabeledStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#MapType">type MapType</a></li>
+<li> <a href="#MapType.End">func (x *MapType) End() token.Pos</a>
+</li>
+<li> <a href="#MapType.Pos">func (x *MapType) Pos() token.Pos</a>
+</li>
+<li><a href="#MergeMode">type MergeMode</a></li>
+<li><a href="#Node">type Node</a></li>
+<li><a href="#ObjKind">type ObjKind</a></li>
+<li> <a href="#ObjKind.String">func (kind ObjKind) String() string</a>
+</li>
+<li><a href="#Object">type Object</a></li>
+<li> <a href="#NewObj">func NewObj(kind ObjKind, name string) *Object</a>
+</li>
+<li> <a href="#Object.Pos">func (obj *Object) Pos() token.Pos</a>
+</li>
+<li><a href="#Package">type Package</a></li>
+<li> <a href="#NewPackage">func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error)</a>
+</li>
+<li> <a href="#Package.End">func (p *Package) End() token.Pos</a>
+</li>
+<li> <a href="#Package.Pos">func (p *Package) Pos() token.Pos</a>
+</li>
+<li><a href="#ParenExpr">type ParenExpr</a></li>
+<li> <a href="#ParenExpr.End">func (x *ParenExpr) End() token.Pos</a>
+</li>
+<li> <a href="#ParenExpr.Pos">func (x *ParenExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#RangeStmt">type RangeStmt</a></li>
+<li> <a href="#RangeStmt.End">func (s *RangeStmt) End() token.Pos</a>
+</li>
+<li> <a href="#RangeStmt.Pos">func (s *RangeStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#ReturnStmt">type ReturnStmt</a></li>
+<li> <a href="#ReturnStmt.End">func (s *ReturnStmt) End() token.Pos</a>
+</li>
+<li> <a href="#ReturnStmt.Pos">func (s *ReturnStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#Scope">type Scope</a></li>
+<li> <a href="#NewScope">func NewScope(outer *Scope) *Scope</a>
+</li>
+<li> <a href="#Scope.Insert">func (s *Scope) Insert(obj *Object) (alt *Object)</a>
+</li>
+<li> <a href="#Scope.Lookup">func (s *Scope) Lookup(name string) *Object</a>
+</li>
+<li> <a href="#Scope.String">func (s *Scope) String() string</a>
+</li>
+<li><a href="#SelectStmt">type SelectStmt</a></li>
+<li> <a href="#SelectStmt.End">func (s *SelectStmt) End() token.Pos</a>
+</li>
+<li> <a href="#SelectStmt.Pos">func (s *SelectStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#SelectorExpr">type SelectorExpr</a></li>
+<li> <a href="#SelectorExpr.End">func (x *SelectorExpr) End() token.Pos</a>
+</li>
+<li> <a href="#SelectorExpr.Pos">func (x *SelectorExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#SendStmt">type SendStmt</a></li>
+<li> <a href="#SendStmt.End">func (s *SendStmt) End() token.Pos</a>
+</li>
+<li> <a href="#SendStmt.Pos">func (s *SendStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#SliceExpr">type SliceExpr</a></li>
+<li> <a href="#SliceExpr.End">func (x *SliceExpr) End() token.Pos</a>
+</li>
+<li> <a href="#SliceExpr.Pos">func (x *SliceExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#Spec">type Spec</a></li>
+<li><a href="#StarExpr">type StarExpr</a></li>
+<li> <a href="#StarExpr.End">func (x *StarExpr) End() token.Pos</a>
+</li>
+<li> <a href="#StarExpr.Pos">func (x *StarExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#Stmt">type Stmt</a></li>
+<li><a href="#StructType">type StructType</a></li>
+<li> <a href="#StructType.End">func (x *StructType) End() token.Pos</a>
+</li>
+<li> <a href="#StructType.Pos">func (x *StructType) Pos() token.Pos</a>
+</li>
+<li><a href="#SwitchStmt">type SwitchStmt</a></li>
+<li> <a href="#SwitchStmt.End">func (s *SwitchStmt) End() token.Pos</a>
+</li>
+<li> <a href="#SwitchStmt.Pos">func (s *SwitchStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#TypeAssertExpr">type TypeAssertExpr</a></li>
+<li> <a href="#TypeAssertExpr.End">func (x *TypeAssertExpr) End() token.Pos</a>
+</li>
+<li> <a href="#TypeAssertExpr.Pos">func (x *TypeAssertExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#TypeSpec">type TypeSpec</a></li>
+<li> <a href="#TypeSpec.End">func (s *TypeSpec) End() token.Pos</a>
+</li>
+<li> <a href="#TypeSpec.Pos">func (s *TypeSpec) Pos() token.Pos</a>
+</li>
+<li><a href="#TypeSwitchStmt">type TypeSwitchStmt</a></li>
+<li> <a href="#TypeSwitchStmt.End">func (s *TypeSwitchStmt) End() token.Pos</a>
+</li>
+<li> <a href="#TypeSwitchStmt.Pos">func (s *TypeSwitchStmt) Pos() token.Pos</a>
+</li>
+<li><a href="#UnaryExpr">type UnaryExpr</a></li>
+<li> <a href="#UnaryExpr.End">func (x *UnaryExpr) End() token.Pos</a>
+</li>
+<li> <a href="#UnaryExpr.Pos">func (x *UnaryExpr) Pos() token.Pos</a>
+</li>
+<li><a href="#ValueSpec">type ValueSpec</a></li>
+<li> <a href="#ValueSpec.End">func (s *ValueSpec) End() token.Pos</a>
+</li>
+<li> <a href="#ValueSpec.Pos">func (s *ValueSpec) Pos() token.Pos</a>
+</li>
+<li><a href="#Visitor">type Visitor</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_CommentMap">CommentMap</a></dd> <dd><a class="exampleLink" href="#example_Inspect">Inspect</a></dd> <dd><a class="exampleLink" href="#example_Print">Print</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>ast.go</span> <span>commentmap.go</span> <span>filter.go</span> <span>import.go</span> <span>print.go</span> <span>resolve.go</span> <span>scope.go</span> <span>walk.go</span> </p> <h2 id="FileExports">func <span>FileExports</span> </h2> <pre data-language="go">func FileExports(src *File) bool</pre> <p>FileExports trims the AST for a Go source file in place such that only exported nodes remain: all top-level identifiers which are not exported and their associated information (such as type, initial value, or function body) are removed. Non-exported fields and methods of exported types are stripped. The [File.Comments] list is not changed. </p>
+<p>FileExports reports whether there are exported declarations. </p>
+<h2 id="FilterDecl">func <span>FilterDecl</span> </h2> <pre data-language="go">func FilterDecl(decl Decl, f Filter) bool</pre> <p>FilterDecl trims the AST for a Go declaration in place by removing all names (including struct field and interface method names, but not from parameter lists) that don't pass through the filter f. </p>
+<p>FilterDecl reports whether there are any declared names left after filtering. </p>
+<h2 id="FilterFile">func <span>FilterFile</span> </h2> <pre data-language="go">func FilterFile(src *File, f Filter) bool</pre> <p>FilterFile trims the AST for a Go file in place by removing all names from top-level declarations (including struct field and interface method names, but not from parameter lists) that don't pass through the filter f. If the declaration is empty afterwards, the declaration is removed from the AST. Import declarations are always removed. The [File.Comments] list is not changed. </p>
+<p>FilterFile reports whether there are any top-level declarations left after filtering. </p>
+<h2 id="FilterPackage">func <span>FilterPackage</span> </h2> <pre data-language="go">func FilterPackage(pkg *Package, f Filter) bool</pre> <p>FilterPackage trims the AST for a Go package in place by removing all names from top-level declarations (including struct field and interface method names, but not from parameter lists) that don't pass through the filter f. If the declaration is empty afterwards, the declaration is removed from the AST. The pkg.Files list is not changed, so that file names and top-level package comments don't get lost. </p>
+<p>FilterPackage reports whether there are any top-level declarations left after filtering. </p>
+<h2 id="Fprint">func <span>Fprint</span> </h2> <pre data-language="go">func Fprint(w io.Writer, fset *token.FileSet, x any, f FieldFilter) error</pre> <p>Fprint prints the (sub-)tree starting at AST node x to w. If fset != nil, position information is interpreted relative to that file set. Otherwise positions are printed as integer values (file set specific offsets). </p>
+<p>A non-nil <a href="#FieldFilter">FieldFilter</a> f may be provided to control the output: struct fields for which f(fieldname, fieldvalue) is true are printed; all others are filtered from the output. Unexported struct fields are never printed. </p>
+<h2 id="Inspect">func <span>Inspect</span> </h2> <pre data-language="go">func Inspect(node Node, f func(Node) bool)</pre> <p>Inspect traverses an AST in depth-first order: It starts by calling f(node); node must not be nil. If f returns true, Inspect invokes f recursively for each of the non-nil children of node, followed by a call of f(nil). </p> <h4 id="example_Inspect"> <span class="text">Example</span>
+</h4> <p>This example demonstrates how to inspect the AST of a Go program. </p> <p>Code:</p> <pre class="code" data-language="go">// src is the input for which we want to inspect the AST.
+src := `
+package p
+const c = 1.0
+var X = f(3.14)*2 + c
+`
+
+// Create the AST by parsing src.
+fset := token.NewFileSet() // positions are relative to fset
+f, err := parser.ParseFile(fset, "src.go", src, 0)
+if err != nil {
+ panic(err)
+}
+
+// Inspect the AST and print all identifiers and literals.
+ast.Inspect(f, func(n ast.Node) bool {
+ var s string
+ switch x := n.(type) {
+ case *ast.BasicLit:
+ s = x.Value
+ case *ast.Ident:
+ s = x.Name
+ }
+ if s != "" {
+ fmt.Printf("%s:\t%s\n", fset.Position(n.Pos()), s)
+ }
+ return true
+})
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">src.go:2:9: p
+src.go:3:7: c
+src.go:3:11: 1.0
+src.go:4:5: X
+src.go:4:9: f
+src.go:4:11: 3.14
+src.go:4:17: 2
+src.go:4:21: c
+</pre> <h2 id="IsExported">func <span>IsExported</span> </h2> <pre data-language="go">func IsExported(name string) bool</pre> <p>IsExported reports whether name starts with an upper-case letter. </p>
+<h2 id="IsGenerated">func <span>IsGenerated</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func IsGenerated(file *File) bool</pre> <p>IsGenerated reports whether the file was generated by a program, not handwritten, by detecting the special comment described at <a href="https://go.dev/s/generatedcode">https://go.dev/s/generatedcode</a>. </p>
+<p>The syntax tree must have been parsed with the ParseComments flag. Example: </p>
+<pre data-language="go">f, err := parser.ParseFile(fset, filename, src, parser.ParseComments|parser.PackageClauseOnly)
+if err != nil { ... }
+gen := ast.IsGenerated(f)
+</pre> <h2 id="NotNilFilter">func <span>NotNilFilter</span> </h2> <pre data-language="go">func NotNilFilter(_ string, v reflect.Value) bool</pre> <p>NotNilFilter returns true for field values that are not nil; it returns false otherwise. </p>
+<h2 id="PackageExports">func <span>PackageExports</span> </h2> <pre data-language="go">func PackageExports(pkg *Package) bool</pre> <p>PackageExports trims the AST for a Go package in place such that only exported nodes remain. The pkg.Files list is not changed, so that file names and top-level package comments don't get lost. </p>
+<p>PackageExports reports whether there are exported declarations; it returns false otherwise. </p>
+<h2 id="Print">func <span>Print</span> </h2> <pre data-language="go">func Print(fset *token.FileSet, x any) error</pre> <p>Print prints x to standard output, skipping nil fields. Print(fset, x) is the same as Fprint(os.Stdout, fset, x, NotNilFilter). </p> <h4 id="example_Print"> <span class="text">Example</span>
+</h4> <p>This example shows what an AST looks like when printed for debugging. </p> <p>Code:</p> <pre class="code" data-language="go">// src is the input for which we want to print the AST.
+src := `
+package main
+func main() {
+ println("Hello, World!")
+}
+`
+
+// Create the AST by parsing src.
+fset := token.NewFileSet() // positions are relative to fset
+f, err := parser.ParseFile(fset, "", src, 0)
+if err != nil {
+ panic(err)
+}
+
+// Print the AST.
+ast.Print(fset, f)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go"> 0 *ast.File {
+ 1 . Package: 2:1
+ 2 . Name: *ast.Ident {
+ 3 . . NamePos: 2:9
+ 4 . . Name: "main"
+ 5 . }
+ 6 . Decls: []ast.Decl (len = 1) {
+ 7 . . 0: *ast.FuncDecl {
+ 8 . . . Name: *ast.Ident {
+ 9 . . . . NamePos: 3:6
+ 10 . . . . Name: "main"
+ 11 . . . . Obj: *ast.Object {
+ 12 . . . . . Kind: func
+ 13 . . . . . Name: "main"
+ 14 . . . . . Decl: *(obj @ 7)
+ 15 . . . . }
+ 16 . . . }
+ 17 . . . Type: *ast.FuncType {
+ 18 . . . . Func: 3:1
+ 19 . . . . Params: *ast.FieldList {
+ 20 . . . . . Opening: 3:10
+ 21 . . . . . Closing: 3:11
+ 22 . . . . }
+ 23 . . . }
+ 24 . . . Body: *ast.BlockStmt {
+ 25 . . . . Lbrace: 3:13
+ 26 . . . . List: []ast.Stmt (len = 1) {
+ 27 . . . . . 0: *ast.ExprStmt {
+ 28 . . . . . . X: *ast.CallExpr {
+ 29 . . . . . . . Fun: *ast.Ident {
+ 30 . . . . . . . . NamePos: 4:2
+ 31 . . . . . . . . Name: "println"
+ 32 . . . . . . . }
+ 33 . . . . . . . Lparen: 4:9
+ 34 . . . . . . . Args: []ast.Expr (len = 1) {
+ 35 . . . . . . . . 0: *ast.BasicLit {
+ 36 . . . . . . . . . ValuePos: 4:10
+ 37 . . . . . . . . . Kind: STRING
+ 38 . . . . . . . . . Value: "\"Hello, World!\""
+ 39 . . . . . . . . }
+ 40 . . . . . . . }
+ 41 . . . . . . . Ellipsis: -
+ 42 . . . . . . . Rparen: 4:25
+ 43 . . . . . . }
+ 44 . . . . . }
+ 45 . . . . }
+ 46 . . . . Rbrace: 5:1
+ 47 . . . }
+ 48 . . }
+ 49 . }
+ 50 . FileStart: 1:1
+ 51 . FileEnd: 5:3
+ 52 . Scope: *ast.Scope {
+ 53 . . Objects: map[string]*ast.Object (len = 1) {
+ 54 . . . "main": *(obj @ 11)
+ 55 . . }
+ 56 . }
+ 57 . Unresolved: []*ast.Ident (len = 1) {
+ 58 . . 0: *(obj @ 29)
+ 59 . }
+ 60 . GoVersion: ""
+ 61 }
+</pre> <h2 id="SortImports">func <span>SortImports</span> </h2> <pre data-language="go">func SortImports(fset *token.FileSet, f *File)</pre> <p>SortImports sorts runs of consecutive import lines in import blocks in f. It also removes duplicate imports when it is possible to do so without data loss. </p>
+<h2 id="Walk">func <span>Walk</span> </h2> <pre data-language="go">func Walk(v Visitor, node Node)</pre> <p>Walk traverses an AST in depth-first order: It starts by calling v.Visit(node); node must not be nil. If the visitor w returned by v.Visit(node) is not nil, Walk is invoked recursively with visitor w for each of the non-nil children of node, followed by a call of w.Visit(nil). </p>
+<h2 id="ArrayType">type <span>ArrayType</span> </h2> <p>An ArrayType node represents an array or slice type. </p>
+<pre data-language="go">type ArrayType struct {
+ Lbrack token.Pos // position of "["
+ Len Expr // Ellipsis node for [...]T array types, nil for slice types
+ Elt Expr // element type
+}
+</pre> <h3 id="ArrayType.End">func (*ArrayType) <span>End</span> </h3> <pre data-language="go">func (x *ArrayType) End() token.Pos</pre> <h3 id="ArrayType.Pos">func (*ArrayType) <span>Pos</span> </h3> <pre data-language="go">func (x *ArrayType) Pos() token.Pos</pre> <h2 id="AssignStmt">type <span>AssignStmt</span> </h2> <p>An AssignStmt node represents an assignment or a short variable declaration. </p>
+<pre data-language="go">type AssignStmt struct {
+ Lhs []Expr
+ TokPos token.Pos // position of Tok
+ Tok token.Token // assignment token, DEFINE
+ Rhs []Expr
+}
+</pre> <h3 id="AssignStmt.End">func (*AssignStmt) <span>End</span> </h3> <pre data-language="go">func (s *AssignStmt) End() token.Pos</pre> <h3 id="AssignStmt.Pos">func (*AssignStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *AssignStmt) Pos() token.Pos</pre> <h2 id="BadDecl">type <span>BadDecl</span> </h2> <p>A BadDecl node is a placeholder for a declaration containing syntax errors for which a correct declaration node cannot be created. </p>
+<pre data-language="go">type BadDecl struct {
+ From, To token.Pos // position range of bad declaration
+}
+</pre> <h3 id="BadDecl.End">func (*BadDecl) <span>End</span> </h3> <pre data-language="go">func (d *BadDecl) End() token.Pos</pre> <h3 id="BadDecl.Pos">func (*BadDecl) <span>Pos</span> </h3> <pre data-language="go">func (d *BadDecl) Pos() token.Pos</pre> <h2 id="BadExpr">type <span>BadExpr</span> </h2> <p>A BadExpr node is a placeholder for an expression containing syntax errors for which a correct expression node cannot be created. </p>
+<pre data-language="go">type BadExpr struct {
+ From, To token.Pos // position range of bad expression
+}
+</pre> <h3 id="BadExpr.End">func (*BadExpr) <span>End</span> </h3> <pre data-language="go">func (x *BadExpr) End() token.Pos</pre> <h3 id="BadExpr.Pos">func (*BadExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *BadExpr) Pos() token.Pos</pre> <h2 id="BadStmt">type <span>BadStmt</span> </h2> <p>A BadStmt node is a placeholder for statements containing syntax errors for which no correct statement nodes can be created. </p>
+<pre data-language="go">type BadStmt struct {
+ From, To token.Pos // position range of bad statement
+}
+</pre> <h3 id="BadStmt.End">func (*BadStmt) <span>End</span> </h3> <pre data-language="go">func (s *BadStmt) End() token.Pos</pre> <h3 id="BadStmt.Pos">func (*BadStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *BadStmt) Pos() token.Pos</pre> <h2 id="BasicLit">type <span>BasicLit</span> </h2> <p>A BasicLit node represents a literal of basic type. </p>
+<pre data-language="go">type BasicLit struct {
+ ValuePos token.Pos // literal position
+ Kind token.Token // token.INT, token.FLOAT, token.IMAG, token.CHAR, or token.STRING
+ Value string // literal string; e.g. 42, 0x7f, 3.14, 1e-9, 2.4i, 'a', '\x7f', "foo" or `\m\n\o`
+}
+</pre> <h3 id="BasicLit.End">func (*BasicLit) <span>End</span> </h3> <pre data-language="go">func (x *BasicLit) End() token.Pos</pre> <h3 id="BasicLit.Pos">func (*BasicLit) <span>Pos</span> </h3> <pre data-language="go">func (x *BasicLit) Pos() token.Pos</pre> <h2 id="BinaryExpr">type <span>BinaryExpr</span> </h2> <p>A BinaryExpr node represents a binary expression. </p>
+<pre data-language="go">type BinaryExpr struct {
+ X Expr // left operand
+ OpPos token.Pos // position of Op
+ Op token.Token // operator
+ Y Expr // right operand
+}
+</pre> <h3 id="BinaryExpr.End">func (*BinaryExpr) <span>End</span> </h3> <pre data-language="go">func (x *BinaryExpr) End() token.Pos</pre> <h3 id="BinaryExpr.Pos">func (*BinaryExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *BinaryExpr) Pos() token.Pos</pre> <h2 id="BlockStmt">type <span>BlockStmt</span> </h2> <p>A BlockStmt node represents a braced statement list. </p>
+<pre data-language="go">type BlockStmt struct {
+ Lbrace token.Pos // position of "{"
+ List []Stmt
+ Rbrace token.Pos // position of "}", if any (may be absent due to syntax error)
+}
+</pre> <h3 id="BlockStmt.End">func (*BlockStmt) <span>End</span> </h3> <pre data-language="go">func (s *BlockStmt) End() token.Pos</pre> <h3 id="BlockStmt.Pos">func (*BlockStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *BlockStmt) Pos() token.Pos</pre> <h2 id="BranchStmt">type <span>BranchStmt</span> </h2> <p>A BranchStmt node represents a break, continue, goto, or fallthrough statement. </p>
+<pre data-language="go">type BranchStmt struct {
+ TokPos token.Pos // position of Tok
+ Tok token.Token // keyword token (BREAK, CONTINUE, GOTO, FALLTHROUGH)
+ Label *Ident // label name; or nil
+}
+</pre> <h3 id="BranchStmt.End">func (*BranchStmt) <span>End</span> </h3> <pre data-language="go">func (s *BranchStmt) End() token.Pos</pre> <h3 id="BranchStmt.Pos">func (*BranchStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *BranchStmt) Pos() token.Pos</pre> <h2 id="CallExpr">type <span>CallExpr</span> </h2> <p>A CallExpr node represents an expression followed by an argument list. </p>
+<pre data-language="go">type CallExpr struct {
+ Fun Expr // function expression
+ Lparen token.Pos // position of "("
+ Args []Expr // function arguments; or nil
+ Ellipsis token.Pos // position of "..." (token.NoPos if there is no "...")
+ Rparen token.Pos // position of ")"
+}
+</pre> <h3 id="CallExpr.End">func (*CallExpr) <span>End</span> </h3> <pre data-language="go">func (x *CallExpr) End() token.Pos</pre> <h3 id="CallExpr.Pos">func (*CallExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *CallExpr) Pos() token.Pos</pre> <h2 id="CaseClause">type <span>CaseClause</span> </h2> <p>A CaseClause represents a case of an expression or type switch statement. </p>
+<pre data-language="go">type CaseClause struct {
+ Case token.Pos // position of "case" or "default" keyword
+ List []Expr // list of expressions or types; nil means default case
+ Colon token.Pos // position of ":"
+ Body []Stmt // statement list; or nil
+}
+</pre> <h3 id="CaseClause.End">func (*CaseClause) <span>End</span> </h3> <pre data-language="go">func (s *CaseClause) End() token.Pos</pre> <h3 id="CaseClause.Pos">func (*CaseClause) <span>Pos</span> </h3> <pre data-language="go">func (s *CaseClause) Pos() token.Pos</pre> <h2 id="ChanDir">type <span>ChanDir</span> </h2> <p>The direction of a channel type is indicated by a bit mask including one or both of the following constants. </p>
+<pre data-language="go">type ChanDir int</pre> <pre data-language="go">const (
+ SEND ChanDir = 1 &lt;&lt; iota
+ RECV
+)</pre> <h2 id="ChanType">type <span>ChanType</span> </h2> <p>A ChanType node represents a channel type. </p>
+<pre data-language="go">type ChanType struct {
+ Begin token.Pos // position of "chan" keyword or "&lt;-" (whichever comes first)
+ Arrow token.Pos // position of "&lt;-" (token.NoPos if there is no "&lt;-"); added in Go 1.1
+ Dir ChanDir // channel direction
+ Value Expr // value type
+}
+</pre> <h3 id="ChanType.End">func (*ChanType) <span>End</span> </h3> <pre data-language="go">func (x *ChanType) End() token.Pos</pre> <h3 id="ChanType.Pos">func (*ChanType) <span>Pos</span> </h3> <pre data-language="go">func (x *ChanType) Pos() token.Pos</pre> <h2 id="CommClause">type <span>CommClause</span> </h2> <p>A CommClause node represents a case of a select statement. </p>
+<pre data-language="go">type CommClause struct {
+ Case token.Pos // position of "case" or "default" keyword
+ Comm Stmt // send or receive statement; nil means default case
+ Colon token.Pos // position of ":"
+ Body []Stmt // statement list; or nil
+}
+</pre> <h3 id="CommClause.End">func (*CommClause) <span>End</span> </h3> <pre data-language="go">func (s *CommClause) End() token.Pos</pre> <h3 id="CommClause.Pos">func (*CommClause) <span>Pos</span> </h3> <pre data-language="go">func (s *CommClause) Pos() token.Pos</pre> <h2 id="Comment">type <span>Comment</span> </h2> <p>A Comment node represents a single //-style or /*-style comment. </p>
+<p>The Text field contains the comment text without carriage returns (\r) that may have been present in the source. Because a comment's end position is computed using len(Text), the position reported by <a href="#Comment.End">Comment.End</a> does not match the true source end position for comments containing carriage returns. </p>
+<pre data-language="go">type Comment struct {
+ Slash token.Pos // position of "/" starting the comment
+ Text string // comment text (excluding '\n' for //-style comments)
+}
+</pre> <h3 id="Comment.End">func (*Comment) <span>End</span> </h3> <pre data-language="go">func (c *Comment) End() token.Pos</pre> <h3 id="Comment.Pos">func (*Comment) <span>Pos</span> </h3> <pre data-language="go">func (c *Comment) Pos() token.Pos</pre> <h2 id="CommentGroup">type <span>CommentGroup</span> </h2> <p>A CommentGroup represents a sequence of comments with no other tokens and no empty lines between. </p>
+<pre data-language="go">type CommentGroup struct {
+ List []*Comment // len(List) &gt; 0
+}
+</pre> <h3 id="CommentGroup.End">func (*CommentGroup) <span>End</span> </h3> <pre data-language="go">func (g *CommentGroup) End() token.Pos</pre> <h3 id="CommentGroup.Pos">func (*CommentGroup) <span>Pos</span> </h3> <pre data-language="go">func (g *CommentGroup) Pos() token.Pos</pre> <h3 id="CommentGroup.Text">func (*CommentGroup) <span>Text</span> </h3> <pre data-language="go">func (g *CommentGroup) Text() string</pre> <p>Text returns the text of the comment. Comment markers (//, /*, and */), the first space of a line comment, and leading and trailing empty lines are removed. Comment directives like "//line" and "//go:noinline" are also removed. Multiple empty lines are reduced to one, and trailing space on lines is trimmed. Unless the result is empty, it is newline-terminated. </p>
+<h2 id="CommentMap">type <span>CommentMap</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>A CommentMap maps an AST node to a list of comment groups associated with it. See <a href="#NewCommentMap">NewCommentMap</a> for a description of the association. </p>
+<pre data-language="go">type CommentMap map[Node][]*CommentGroup</pre> <h4 id="example_CommentMap"> <span class="text">Example</span>
+</h4> <p>This example illustrates how to remove a variable declaration in a Go program while maintaining correct comment association using an ast.CommentMap. </p> <p>Code:</p> <pre class="code" data-language="go">// src is the input for which we create the AST that we
+// are going to manipulate.
+src := `
+// This is the package comment.
+package main
+
+// This comment is associated with the hello constant.
+const hello = "Hello, World!" // line comment 1
+
+// This comment is associated with the foo variable.
+var foo = hello // line comment 2
+
+// This comment is associated with the main function.
+func main() {
+ fmt.Println(hello) // line comment 3
+}
+`
+
+// Create the AST by parsing src.
+fset := token.NewFileSet() // positions are relative to fset
+f, err := parser.ParseFile(fset, "src.go", src, parser.ParseComments)
+if err != nil {
+ panic(err)
+}
+
+// Create an ast.CommentMap from the ast.File's comments.
+// This helps keeping the association between comments
+// and AST nodes.
+cmap := ast.NewCommentMap(fset, f, f.Comments)
+
+// Remove the first variable declaration from the list of declarations.
+for i, decl := range f.Decls {
+ if gen, ok := decl.(*ast.GenDecl); ok &amp;&amp; gen.Tok == token.VAR {
+ copy(f.Decls[i:], f.Decls[i+1:])
+ f.Decls = f.Decls[:len(f.Decls)-1]
+ break
+ }
+}
+
+// Use the comment map to filter comments that don't belong anymore
+// (the comments associated with the variable declaration), and create
+// the new comments list.
+f.Comments = cmap.Filter(f).Comments()
+
+// Print the modified AST.
+var buf strings.Builder
+if err := format.Node(&amp;buf, fset, f); err != nil {
+ panic(err)
+}
+fmt.Printf("%s", buf.String())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">// This is the package comment.
+package main
+
+// This comment is associated with the hello constant.
+const hello = "Hello, World!" // line comment 1
+
+// This comment is associated with the main function.
+func main() {
+ fmt.Println(hello) // line comment 3
+}
+</pre> <h3 id="NewCommentMap">func <span>NewCommentMap</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap</pre> <p>NewCommentMap creates a new comment map by associating comment groups of the comments list with the nodes of the AST specified by node. </p>
+<p>A comment group g is associated with a node n if: </p>
+<ul> <li>g starts on the same line as n ends </li>
+<li>g starts on the line immediately following n, and there is at least one empty line after g and before the next node </li>
+<li>g starts before n and is not associated to the node before n via the previous rules </li>
+</ul> <p>NewCommentMap tries to associate a comment group to the "largest" node possible: For instance, if the comment is a line comment trailing an assignment, the comment is associated with the entire assignment rather than just the last operand in the assignment. </p>
+<h3 id="CommentMap.Comments">func (CommentMap) <span>Comments</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (cmap CommentMap) Comments() []*CommentGroup</pre> <p>Comments returns the list of comment groups in the comment map. The result is sorted in source order. </p>
+<h3 id="CommentMap.Filter">func (CommentMap) <span>Filter</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (cmap CommentMap) Filter(node Node) CommentMap</pre> <p>Filter returns a new comment map consisting of only those entries of cmap for which a corresponding node exists in the AST specified by node. </p>
+<h3 id="CommentMap.String">func (CommentMap) <span>String</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (cmap CommentMap) String() string</pre> <h3 id="CommentMap.Update">func (CommentMap) <span>Update</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (cmap CommentMap) Update(old, new Node) Node</pre> <p>Update replaces an old node in the comment map with the new node and returns the new node. Comments that were associated with the old node are associated with the new node. </p>
+<h2 id="CompositeLit">type <span>CompositeLit</span> </h2> <p>A CompositeLit node represents a composite literal. </p>
+<pre data-language="go">type CompositeLit struct {
+ Type Expr // literal type; or nil
+ Lbrace token.Pos // position of "{"
+ Elts []Expr // list of composite elements; or nil
+ Rbrace token.Pos // position of "}"
+ Incomplete bool // true if (source) expressions are missing in the Elts list; added in Go 1.11
+}
+</pre> <h3 id="CompositeLit.End">func (*CompositeLit) <span>End</span> </h3> <pre data-language="go">func (x *CompositeLit) End() token.Pos</pre> <h3 id="CompositeLit.Pos">func (*CompositeLit) <span>Pos</span> </h3> <pre data-language="go">func (x *CompositeLit) Pos() token.Pos</pre> <h2 id="Decl">type <span>Decl</span> </h2> <p>All declaration nodes implement the Decl interface. </p>
+<pre data-language="go">type Decl interface {
+ Node
+ // contains filtered or unexported methods
+}</pre> <h2 id="DeclStmt">type <span>DeclStmt</span> </h2> <p>A DeclStmt node represents a declaration in a statement list. </p>
+<pre data-language="go">type DeclStmt struct {
+ Decl Decl // *GenDecl with CONST, TYPE, or VAR token
+}
+</pre> <h3 id="DeclStmt.End">func (*DeclStmt) <span>End</span> </h3> <pre data-language="go">func (s *DeclStmt) End() token.Pos</pre> <h3 id="DeclStmt.Pos">func (*DeclStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *DeclStmt) Pos() token.Pos</pre> <h2 id="DeferStmt">type <span>DeferStmt</span> </h2> <p>A DeferStmt node represents a defer statement. </p>
+<pre data-language="go">type DeferStmt struct {
+ Defer token.Pos // position of "defer" keyword
+ Call *CallExpr
+}
+</pre> <h3 id="DeferStmt.End">func (*DeferStmt) <span>End</span> </h3> <pre data-language="go">func (s *DeferStmt) End() token.Pos</pre> <h3 id="DeferStmt.Pos">func (*DeferStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *DeferStmt) Pos() token.Pos</pre> <h2 id="Ellipsis">type <span>Ellipsis</span> </h2> <p>An Ellipsis node stands for the "..." type in a parameter list or the "..." length in an array type. </p>
+<pre data-language="go">type Ellipsis struct {
+ Ellipsis token.Pos // position of "..."
+ Elt Expr // ellipsis element type (parameter lists only); or nil
+}
+</pre> <h3 id="Ellipsis.End">func (*Ellipsis) <span>End</span> </h3> <pre data-language="go">func (x *Ellipsis) End() token.Pos</pre> <h3 id="Ellipsis.Pos">func (*Ellipsis) <span>Pos</span> </h3> <pre data-language="go">func (x *Ellipsis) Pos() token.Pos</pre> <h2 id="EmptyStmt">type <span>EmptyStmt</span> </h2> <p>An EmptyStmt node represents an empty statement. The "position" of the empty statement is the position of the immediately following (explicit or implicit) semicolon. </p>
+<pre data-language="go">type EmptyStmt struct {
+ Semicolon token.Pos // position of following ";"
+ Implicit bool // if set, ";" was omitted in the source; added in Go 1.5
+}
+</pre> <h3 id="EmptyStmt.End">func (*EmptyStmt) <span>End</span> </h3> <pre data-language="go">func (s *EmptyStmt) End() token.Pos</pre> <h3 id="EmptyStmt.Pos">func (*EmptyStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *EmptyStmt) Pos() token.Pos</pre> <h2 id="Expr">type <span>Expr</span> </h2> <p>All expression nodes implement the Expr interface. </p>
+<pre data-language="go">type Expr interface {
+ Node
+ // contains filtered or unexported methods
+}</pre> <h3 id="Unparen">func <span>Unparen</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func Unparen(e Expr) Expr</pre> <p>Unparen returns the expression with any enclosing parentheses removed. </p>
+<h2 id="ExprStmt">type <span>ExprStmt</span> </h2> <p>An ExprStmt node represents a (stand-alone) expression in a statement list. </p>
+<pre data-language="go">type ExprStmt struct {
+ X Expr // expression
+}
+</pre> <h3 id="ExprStmt.End">func (*ExprStmt) <span>End</span> </h3> <pre data-language="go">func (s *ExprStmt) End() token.Pos</pre> <h3 id="ExprStmt.Pos">func (*ExprStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *ExprStmt) Pos() token.Pos</pre> <h2 id="Field">type <span>Field</span> </h2> <p>A Field represents a Field declaration list in a struct type, a method list in an interface type, or a parameter/result declaration in a signature. [Field.Names] is nil for unnamed parameters (parameter lists which only contain types) and embedded struct fields. In the latter case, the field name is the type name. </p>
+<pre data-language="go">type Field struct {
+ Doc *CommentGroup // associated documentation; or nil
+ Names []*Ident // field/method/(type) parameter names; or nil
+ Type Expr // field/method/parameter type; or nil
+ Tag *BasicLit // field tag; or nil
+ Comment *CommentGroup // line comments; or nil
+}
+</pre> <h3 id="Field.End">func (*Field) <span>End</span> </h3> <pre data-language="go">func (f *Field) End() token.Pos</pre> <h3 id="Field.Pos">func (*Field) <span>Pos</span> </h3> <pre data-language="go">func (f *Field) Pos() token.Pos</pre> <h2 id="FieldFilter">type <span>FieldFilter</span> </h2> <p>A FieldFilter may be provided to <a href="#Fprint">Fprint</a> to control the output. </p>
+<pre data-language="go">type FieldFilter func(name string, value reflect.Value) bool</pre> <h2 id="FieldList">type <span>FieldList</span> </h2> <p>A FieldList represents a list of Fields, enclosed by parentheses, curly braces, or square brackets. </p>
+<pre data-language="go">type FieldList struct {
+ Opening token.Pos // position of opening parenthesis/brace/bracket, if any
+ List []*Field // field list; or nil
+ Closing token.Pos // position of closing parenthesis/brace/bracket, if any
+}
+</pre> <h3 id="FieldList.End">func (*FieldList) <span>End</span> </h3> <pre data-language="go">func (f *FieldList) End() token.Pos</pre> <h3 id="FieldList.NumFields">func (*FieldList) <span>NumFields</span> </h3> <pre data-language="go">func (f *FieldList) NumFields() int</pre> <p>NumFields returns the number of parameters or struct fields represented by a <a href="#FieldList">FieldList</a>. </p>
+<h3 id="FieldList.Pos">func (*FieldList) <span>Pos</span> </h3> <pre data-language="go">func (f *FieldList) Pos() token.Pos</pre> <h2 id="File">type <span>File</span> </h2> <p>A File node represents a Go source file. </p>
+<p>The Comments list contains all comments in the source file in order of appearance, including the comments that are pointed to from other nodes via Doc and Comment fields. </p>
+<p>For correct printing of source code containing comments (using packages go/format and go/printer), special care must be taken to update comments when a File's syntax tree is modified: For printing, comments are interspersed between tokens based on their position. If syntax tree nodes are removed or moved, relevant comments in their vicinity must also be removed (from the [File.Comments] list) or moved accordingly (by updating their positions). A <a href="#CommentMap">CommentMap</a> may be used to facilitate some of these operations. </p>
+<p>Whether and how a comment is associated with a node depends on the interpretation of the syntax tree by the manipulating program: Except for Doc and <a href="#Comment">Comment</a> comments directly associated with nodes, the remaining comments are "free-floating" (see also issues #18593, #20744). </p>
+<pre data-language="go">type File struct {
+ Doc *CommentGroup // associated documentation; or nil
+ Package token.Pos // position of "package" keyword
+ Name *Ident // package name
+ Decls []Decl // top-level declarations; or nil
+
+ FileStart, FileEnd token.Pos // start and end of entire file; added in Go 1.20
+ Scope *Scope // package scope (this file only). Deprecated: see Object
+ Imports []*ImportSpec // imports in this file
+ Unresolved []*Ident // unresolved identifiers in this file. Deprecated: see Object
+ Comments []*CommentGroup // list of all comments in the source file
+ GoVersion string // minimum Go version required by //go:build or // +build directives; added in Go 1.21
+}
+</pre> <h3 id="MergePackageFiles">func <span>MergePackageFiles</span> </h3> <pre data-language="go">func MergePackageFiles(pkg *Package, mode MergeMode) *File</pre> <p>MergePackageFiles creates a file AST by merging the ASTs of the files belonging to a package. The mode flags control merging behavior. </p>
+<h3 id="File.End">func (*File) <span>End</span> </h3> <pre data-language="go">func (f *File) End() token.Pos</pre> <p>End returns the end of the last declaration in the file. (Use FileEnd for the end of the entire file.) </p>
+<h3 id="File.Pos">func (*File) <span>Pos</span> </h3> <pre data-language="go">func (f *File) Pos() token.Pos</pre> <p>Pos returns the position of the package declaration. (Use FileStart for the start of the entire file.) </p>
+<h2 id="Filter">type <span>Filter</span> </h2> <pre data-language="go">type Filter func(string) bool</pre> <h2 id="ForStmt">type <span>ForStmt</span> </h2> <p>A ForStmt represents a for statement. </p>
+<pre data-language="go">type ForStmt struct {
+ For token.Pos // position of "for" keyword
+ Init Stmt // initialization statement; or nil
+ Cond Expr // condition; or nil
+ Post Stmt // post iteration statement; or nil
+ Body *BlockStmt
+}
+</pre> <h3 id="ForStmt.End">func (*ForStmt) <span>End</span> </h3> <pre data-language="go">func (s *ForStmt) End() token.Pos</pre> <h3 id="ForStmt.Pos">func (*ForStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *ForStmt) Pos() token.Pos</pre> <h2 id="FuncDecl">type <span>FuncDecl</span> </h2> <p>A FuncDecl node represents a function declaration. </p>
+<pre data-language="go">type FuncDecl struct {
+ Doc *CommentGroup // associated documentation; or nil
+ Recv *FieldList // receiver (methods); or nil (functions)
+ Name *Ident // function/method name
+ Type *FuncType // function signature: type and value parameters, results, and position of "func" keyword
+ Body *BlockStmt // function body; or nil for external (non-Go) function
+}
+</pre> <h3 id="FuncDecl.End">func (*FuncDecl) <span>End</span> </h3> <pre data-language="go">func (d *FuncDecl) End() token.Pos</pre> <h3 id="FuncDecl.Pos">func (*FuncDecl) <span>Pos</span> </h3> <pre data-language="go">func (d *FuncDecl) Pos() token.Pos</pre> <h2 id="FuncLit">type <span>FuncLit</span> </h2> <p>A FuncLit node represents a function literal. </p>
+<pre data-language="go">type FuncLit struct {
+ Type *FuncType // function type
+ Body *BlockStmt // function body
+}
+</pre> <h3 id="FuncLit.End">func (*FuncLit) <span>End</span> </h3> <pre data-language="go">func (x *FuncLit) End() token.Pos</pre> <h3 id="FuncLit.Pos">func (*FuncLit) <span>Pos</span> </h3> <pre data-language="go">func (x *FuncLit) Pos() token.Pos</pre> <h2 id="FuncType">type <span>FuncType</span> </h2> <p>A FuncType node represents a function type. </p>
+<pre data-language="go">type FuncType struct {
+ Func token.Pos // position of "func" keyword (token.NoPos if there is no "func")
+ TypeParams *FieldList // type parameters; or nil; added in Go 1.18
+ Params *FieldList // (incoming) parameters; non-nil
+ Results *FieldList // (outgoing) results; or nil
+}
+</pre> <h3 id="FuncType.End">func (*FuncType) <span>End</span> </h3> <pre data-language="go">func (x *FuncType) End() token.Pos</pre> <h3 id="FuncType.Pos">func (*FuncType) <span>Pos</span> </h3> <pre data-language="go">func (x *FuncType) Pos() token.Pos</pre> <h2 id="GenDecl">type <span>GenDecl</span> </h2> <p>A GenDecl node (generic declaration node) represents an import, constant, type or variable declaration. A valid Lparen position (Lparen.IsValid()) indicates a parenthesized declaration. </p>
+<p>Relationship between Tok value and Specs element type: </p>
+<pre data-language="go">token.IMPORT *ImportSpec
+token.CONST *ValueSpec
+token.TYPE *TypeSpec
+token.VAR *ValueSpec
+</pre> <pre data-language="go">type GenDecl struct {
+ Doc *CommentGroup // associated documentation; or nil
+ TokPos token.Pos // position of Tok
+ Tok token.Token // IMPORT, CONST, TYPE, or VAR
+ Lparen token.Pos // position of '(', if any
+ Specs []Spec
+ Rparen token.Pos // position of ')', if any
+}
+</pre> <h3 id="GenDecl.End">func (*GenDecl) <span>End</span> </h3> <pre data-language="go">func (d *GenDecl) End() token.Pos</pre> <h3 id="GenDecl.Pos">func (*GenDecl) <span>Pos</span> </h3> <pre data-language="go">func (d *GenDecl) Pos() token.Pos</pre> <h2 id="GoStmt">type <span>GoStmt</span> </h2> <p>A GoStmt node represents a go statement. </p>
+<pre data-language="go">type GoStmt struct {
+ Go token.Pos // position of "go" keyword
+ Call *CallExpr
+}
+</pre> <h3 id="GoStmt.End">func (*GoStmt) <span>End</span> </h3> <pre data-language="go">func (s *GoStmt) End() token.Pos</pre> <h3 id="GoStmt.Pos">func (*GoStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *GoStmt) Pos() token.Pos</pre> <h2 id="Ident">type <span>Ident</span> </h2> <p>An Ident node represents an identifier. </p>
+<pre data-language="go">type Ident struct {
+ NamePos token.Pos // identifier position
+ Name string // identifier name
+ Obj *Object // denoted object, or nil. Deprecated: see Object.
+}
+</pre> <h3 id="NewIdent">func <span>NewIdent</span> </h3> <pre data-language="go">func NewIdent(name string) *Ident</pre> <p>NewIdent creates a new <a href="#Ident">Ident</a> without position. Useful for ASTs generated by code other than the Go parser. </p>
+<h3 id="Ident.End">func (*Ident) <span>End</span> </h3> <pre data-language="go">func (x *Ident) End() token.Pos</pre> <h3 id="Ident.IsExported">func (*Ident) <span>IsExported</span> </h3> <pre data-language="go">func (id *Ident) IsExported() bool</pre> <p>IsExported reports whether id starts with an upper-case letter. </p>
+<h3 id="Ident.Pos">func (*Ident) <span>Pos</span> </h3> <pre data-language="go">func (x *Ident) Pos() token.Pos</pre> <h3 id="Ident.String">func (*Ident) <span>String</span> </h3> <pre data-language="go">func (id *Ident) String() string</pre> <h2 id="IfStmt">type <span>IfStmt</span> </h2> <p>An IfStmt node represents an if statement. </p>
+<pre data-language="go">type IfStmt struct {
+ If token.Pos // position of "if" keyword
+ Init Stmt // initialization statement; or nil
+ Cond Expr // condition
+ Body *BlockStmt
+ Else Stmt // else branch; or nil
+}
+</pre> <h3 id="IfStmt.End">func (*IfStmt) <span>End</span> </h3> <pre data-language="go">func (s *IfStmt) End() token.Pos</pre> <h3 id="IfStmt.Pos">func (*IfStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *IfStmt) Pos() token.Pos</pre> <h2 id="ImportSpec">type <span>ImportSpec</span> </h2> <p>An ImportSpec node represents a single package import. </p>
+<pre data-language="go">type ImportSpec struct {
+ Doc *CommentGroup // associated documentation; or nil
+ Name *Ident // local package name (including "."); or nil
+ Path *BasicLit // import path
+ Comment *CommentGroup // line comments; or nil
+ EndPos token.Pos // end of spec (overrides Path.Pos if nonzero)
+}
+</pre> <h3 id="ImportSpec.End">func (*ImportSpec) <span>End</span> </h3> <pre data-language="go">func (s *ImportSpec) End() token.Pos</pre> <h3 id="ImportSpec.Pos">func (*ImportSpec) <span>Pos</span> </h3> <pre data-language="go">func (s *ImportSpec) Pos() token.Pos</pre> <h2 id="Importer">type <span>Importer</span> </h2> <p>An Importer resolves import paths to package Objects. The imports map records the packages already imported, indexed by package id (canonical import path). An Importer must determine the canonical import path and check the map to see if it is already present in the imports map. If so, the Importer can return the map entry. Otherwise, the Importer should load the package data for the given path into a new *<a href="#Object">Object</a> (pkg), record pkg in the imports map, and then return pkg. </p>
+<p>Deprecated: use the type checker <span>go/types</span> instead; see <a href="#Object">Object</a>. </p>
+<pre data-language="go">type Importer func(imports map[string]*Object, path string) (pkg *Object, err error)</pre> <h2 id="IncDecStmt">type <span>IncDecStmt</span> </h2> <p>An IncDecStmt node represents an increment or decrement statement. </p>
+<pre data-language="go">type IncDecStmt struct {
+ X Expr
+ TokPos token.Pos // position of Tok
+ Tok token.Token // INC or DEC
+}
+</pre> <h3 id="IncDecStmt.End">func (*IncDecStmt) <span>End</span> </h3> <pre data-language="go">func (s *IncDecStmt) End() token.Pos</pre> <h3 id="IncDecStmt.Pos">func (*IncDecStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *IncDecStmt) Pos() token.Pos</pre> <h2 id="IndexExpr">type <span>IndexExpr</span> </h2> <p>An IndexExpr node represents an expression followed by an index. </p>
+<pre data-language="go">type IndexExpr struct {
+ X Expr // expression
+ Lbrack token.Pos // position of "["
+ Index Expr // index expression
+ Rbrack token.Pos // position of "]"
+}
+</pre> <h3 id="IndexExpr.End">func (*IndexExpr) <span>End</span> </h3> <pre data-language="go">func (x *IndexExpr) End() token.Pos</pre> <h3 id="IndexExpr.Pos">func (*IndexExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *IndexExpr) Pos() token.Pos</pre> <h2 id="IndexListExpr">type <span>IndexListExpr</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>An IndexListExpr node represents an expression followed by multiple indices. </p>
+<pre data-language="go">type IndexListExpr struct {
+ X Expr // expression
+ Lbrack token.Pos // position of "["
+ Indices []Expr // index expressions
+ Rbrack token.Pos // position of "]"
+}
+</pre> <h3 id="IndexListExpr.End">func (*IndexListExpr) <span>End</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (x *IndexListExpr) End() token.Pos</pre> <h3 id="IndexListExpr.Pos">func (*IndexListExpr) <span>Pos</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (x *IndexListExpr) Pos() token.Pos</pre> <h2 id="InterfaceType">type <span>InterfaceType</span> </h2> <p>An InterfaceType node represents an interface type. </p>
+<pre data-language="go">type InterfaceType struct {
+ Interface token.Pos // position of "interface" keyword
+ Methods *FieldList // list of embedded interfaces, methods, or types
+ Incomplete bool // true if (source) methods or types are missing in the Methods list
+}
+</pre> <h3 id="InterfaceType.End">func (*InterfaceType) <span>End</span> </h3> <pre data-language="go">func (x *InterfaceType) End() token.Pos</pre> <h3 id="InterfaceType.Pos">func (*InterfaceType) <span>Pos</span> </h3> <pre data-language="go">func (x *InterfaceType) Pos() token.Pos</pre> <h2 id="KeyValueExpr">type <span>KeyValueExpr</span> </h2> <p>A KeyValueExpr node represents (key : value) pairs in composite literals. </p>
+<pre data-language="go">type KeyValueExpr struct {
+ Key Expr
+ Colon token.Pos // position of ":"
+ Value Expr
+}
+</pre> <h3 id="KeyValueExpr.End">func (*KeyValueExpr) <span>End</span> </h3> <pre data-language="go">func (x *KeyValueExpr) End() token.Pos</pre> <h3 id="KeyValueExpr.Pos">func (*KeyValueExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *KeyValueExpr) Pos() token.Pos</pre> <h2 id="LabeledStmt">type <span>LabeledStmt</span> </h2> <p>A LabeledStmt node represents a labeled statement. </p>
+<pre data-language="go">type LabeledStmt struct {
+ Label *Ident
+ Colon token.Pos // position of ":"
+ Stmt Stmt
+}
+</pre> <h3 id="LabeledStmt.End">func (*LabeledStmt) <span>End</span> </h3> <pre data-language="go">func (s *LabeledStmt) End() token.Pos</pre> <h3 id="LabeledStmt.Pos">func (*LabeledStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *LabeledStmt) Pos() token.Pos</pre> <h2 id="MapType">type <span>MapType</span> </h2> <p>A MapType node represents a map type. </p>
+<pre data-language="go">type MapType struct {
+ Map token.Pos // position of "map" keyword
+ Key Expr
+ Value Expr
+}
+</pre> <h3 id="MapType.End">func (*MapType) <span>End</span> </h3> <pre data-language="go">func (x *MapType) End() token.Pos</pre> <h3 id="MapType.Pos">func (*MapType) <span>Pos</span> </h3> <pre data-language="go">func (x *MapType) Pos() token.Pos</pre> <h2 id="MergeMode">type <span>MergeMode</span> </h2> <p>The MergeMode flags control the behavior of <a href="#MergePackageFiles">MergePackageFiles</a>. </p>
+<pre data-language="go">type MergeMode uint</pre> <pre data-language="go">const (
+ // If set, duplicate function declarations are excluded.
+ FilterFuncDuplicates MergeMode = 1 &lt;&lt; iota
+ // If set, comments that are not associated with a specific
+ // AST node (as Doc or Comment) are excluded.
+ FilterUnassociatedComments
+ // If set, duplicate import declarations are excluded.
+ FilterImportDuplicates
+)</pre> <h2 id="Node">type <span>Node</span> </h2> <p>All node types implement the Node interface. </p>
+<pre data-language="go">type Node interface {
+ Pos() token.Pos // position of first character belonging to the node
+ End() token.Pos // position of first character immediately after the node
+}</pre> <h2 id="ObjKind">type <span>ObjKind</span> </h2> <p>ObjKind describes what an object represents. </p>
+<pre data-language="go">type ObjKind int</pre> <p>The list of possible Object kinds. </p>
+<pre data-language="go">const (
+ Bad ObjKind = iota // for error handling
+ Pkg // package
+ Con // constant
+ Typ // type
+ Var // variable
+ Fun // function or method
+ Lbl // label
+)</pre> <h3 id="ObjKind.String">func (ObjKind) <span>String</span> </h3> <pre data-language="go">func (kind ObjKind) String() string</pre> <h2 id="Object">type <span>Object</span> </h2> <p>An Object describes a named language entity such as a package, constant, type, variable, function (incl. methods), or label. </p>
+<p>The Data fields contains object-specific data: </p>
+<pre data-language="go">Kind Data type Data value
+Pkg *Scope package scope
+Con int iota for the respective declaration
+</pre> <p>Deprecated: The relationship between Idents and Objects cannot be correctly computed without type information. For example, the expression T{K: 0} may denote a struct, map, slice, or array literal, depending on the type of T. If T is a struct, then K refers to a field of T, whereas for the other types it refers to a value in the environment. </p>
+<p>New programs should set the [parser.SkipObjectResolution] parser flag to disable syntactic object resolution (which also saves CPU and memory), and instead use the type checker <span>go/types</span> if object resolution is desired. See the Defs, Uses, and Implicits fields of the [types.Info] struct for details. </p>
+<pre data-language="go">type Object struct {
+ Kind ObjKind
+ Name string // declared name
+ Decl any // corresponding Field, XxxSpec, FuncDecl, LabeledStmt, AssignStmt, Scope; or nil
+ Data any // object-specific data; or nil
+ Type any // placeholder for type information; may be nil
+}
+</pre> <h3 id="NewObj">func <span>NewObj</span> </h3> <pre data-language="go">func NewObj(kind ObjKind, name string) *Object</pre> <p>NewObj creates a new object of a given kind and name. </p>
+<h3 id="Object.Pos">func (*Object) <span>Pos</span> </h3> <pre data-language="go">func (obj *Object) Pos() token.Pos</pre> <p>Pos computes the source position of the declaration of an object name. The result may be an invalid position if it cannot be computed (obj.Decl may be nil or not correct). </p>
+<h2 id="Package">type <span>Package</span> </h2> <p>A Package node represents a set of source files collectively building a Go package. </p>
+<p>Deprecated: use the type checker <span>go/types</span> instead; see <a href="#Object">Object</a>. </p>
+<pre data-language="go">type Package struct {
+ Name string // package name
+ Scope *Scope // package scope across all files
+ Imports map[string]*Object // map of package id -&gt; package object
+ Files map[string]*File // Go source files by filename
+}
+</pre> <h3 id="NewPackage">func <span>NewPackage</span> </h3> <pre data-language="go">func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error)</pre> <p>NewPackage creates a new <a href="#Package">Package</a> node from a set of <a href="#File">File</a> nodes. It resolves unresolved identifiers across files and updates each file's Unresolved list accordingly. If a non-nil importer and universe scope are provided, they are used to resolve identifiers not declared in any of the package files. Any remaining unresolved identifiers are reported as undeclared. If the files belong to different packages, one package name is selected and files with different package names are reported and then ignored. The result is a package node and a <span>scanner.ErrorList</span> if there were errors. </p>
+<p>Deprecated: use the type checker <span>go/types</span> instead; see <a href="#Object">Object</a>. </p>
+<h3 id="Package.End">func (*Package) <span>End</span> </h3> <pre data-language="go">func (p *Package) End() token.Pos</pre> <h3 id="Package.Pos">func (*Package) <span>Pos</span> </h3> <pre data-language="go">func (p *Package) Pos() token.Pos</pre> <h2 id="ParenExpr">type <span>ParenExpr</span> </h2> <p>A ParenExpr node represents a parenthesized expression. </p>
+<pre data-language="go">type ParenExpr struct {
+ Lparen token.Pos // position of "("
+ X Expr // parenthesized expression
+ Rparen token.Pos // position of ")"
+}
+</pre> <h3 id="ParenExpr.End">func (*ParenExpr) <span>End</span> </h3> <pre data-language="go">func (x *ParenExpr) End() token.Pos</pre> <h3 id="ParenExpr.Pos">func (*ParenExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *ParenExpr) Pos() token.Pos</pre> <h2 id="RangeStmt">type <span>RangeStmt</span> </h2> <p>A RangeStmt represents a for statement with a range clause. </p>
+<pre data-language="go">type RangeStmt struct {
+ For token.Pos // position of "for" keyword
+ Key, Value Expr // Key, Value may be nil
+ TokPos token.Pos // position of Tok; invalid if Key == nil
+ Tok token.Token // ILLEGAL if Key == nil, ASSIGN, DEFINE
+ Range token.Pos // position of "range" keyword; added in Go 1.20
+ X Expr // value to range over
+ Body *BlockStmt
+}
+</pre> <h3 id="RangeStmt.End">func (*RangeStmt) <span>End</span> </h3> <pre data-language="go">func (s *RangeStmt) End() token.Pos</pre> <h3 id="RangeStmt.Pos">func (*RangeStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *RangeStmt) Pos() token.Pos</pre> <h2 id="ReturnStmt">type <span>ReturnStmt</span> </h2> <p>A ReturnStmt node represents a return statement. </p>
+<pre data-language="go">type ReturnStmt struct {
+ Return token.Pos // position of "return" keyword
+ Results []Expr // result expressions; or nil
+}
+</pre> <h3 id="ReturnStmt.End">func (*ReturnStmt) <span>End</span> </h3> <pre data-language="go">func (s *ReturnStmt) End() token.Pos</pre> <h3 id="ReturnStmt.Pos">func (*ReturnStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *ReturnStmt) Pos() token.Pos</pre> <h2 id="Scope">type <span>Scope</span> </h2> <p>A Scope maintains the set of named language entities declared in the scope and a link to the immediately surrounding (outer) scope. </p>
+<p>Deprecated: use the type checker <span>go/types</span> instead; see <a href="#Object">Object</a>. </p>
+<pre data-language="go">type Scope struct {
+ Outer *Scope
+ Objects map[string]*Object
+}
+</pre> <h3 id="NewScope">func <span>NewScope</span> </h3> <pre data-language="go">func NewScope(outer *Scope) *Scope</pre> <p>NewScope creates a new scope nested in the outer scope. </p>
+<h3 id="Scope.Insert">func (*Scope) <span>Insert</span> </h3> <pre data-language="go">func (s *Scope) Insert(obj *Object) (alt *Object)</pre> <p>Insert attempts to insert a named object obj into the scope s. If the scope already contains an object alt with the same name, Insert leaves the scope unchanged and returns alt. Otherwise it inserts obj and returns nil. </p>
+<h3 id="Scope.Lookup">func (*Scope) <span>Lookup</span> </h3> <pre data-language="go">func (s *Scope) Lookup(name string) *Object</pre> <p>Lookup returns the object with the given name if it is found in scope s, otherwise it returns nil. Outer scopes are ignored. </p>
+<h3 id="Scope.String">func (*Scope) <span>String</span> </h3> <pre data-language="go">func (s *Scope) String() string</pre> <p>Debugging support </p>
+<h2 id="SelectStmt">type <span>SelectStmt</span> </h2> <p>A SelectStmt node represents a select statement. </p>
+<pre data-language="go">type SelectStmt struct {
+ Select token.Pos // position of "select" keyword
+ Body *BlockStmt // CommClauses only
+}
+</pre> <h3 id="SelectStmt.End">func (*SelectStmt) <span>End</span> </h3> <pre data-language="go">func (s *SelectStmt) End() token.Pos</pre> <h3 id="SelectStmt.Pos">func (*SelectStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *SelectStmt) Pos() token.Pos</pre> <h2 id="SelectorExpr">type <span>SelectorExpr</span> </h2> <p>A SelectorExpr node represents an expression followed by a selector. </p>
+<pre data-language="go">type SelectorExpr struct {
+ X Expr // expression
+ Sel *Ident // field selector
+}
+</pre> <h3 id="SelectorExpr.End">func (*SelectorExpr) <span>End</span> </h3> <pre data-language="go">func (x *SelectorExpr) End() token.Pos</pre> <h3 id="SelectorExpr.Pos">func (*SelectorExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *SelectorExpr) Pos() token.Pos</pre> <h2 id="SendStmt">type <span>SendStmt</span> </h2> <p>A SendStmt node represents a send statement. </p>
+<pre data-language="go">type SendStmt struct {
+ Chan Expr
+ Arrow token.Pos // position of "&lt;-"
+ Value Expr
+}
+</pre> <h3 id="SendStmt.End">func (*SendStmt) <span>End</span> </h3> <pre data-language="go">func (s *SendStmt) End() token.Pos</pre> <h3 id="SendStmt.Pos">func (*SendStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *SendStmt) Pos() token.Pos</pre> <h2 id="SliceExpr">type <span>SliceExpr</span> </h2> <p>A SliceExpr node represents an expression followed by slice indices. </p>
+<pre data-language="go">type SliceExpr struct {
+ X Expr // expression
+ Lbrack token.Pos // position of "["
+ Low Expr // begin of slice range; or nil
+ High Expr // end of slice range; or nil
+ Max Expr // maximum capacity of slice; or nil; added in Go 1.2
+ Slice3 bool // true if 3-index slice (2 colons present); added in Go 1.2
+ Rbrack token.Pos // position of "]"
+}
+</pre> <h3 id="SliceExpr.End">func (*SliceExpr) <span>End</span> </h3> <pre data-language="go">func (x *SliceExpr) End() token.Pos</pre> <h3 id="SliceExpr.Pos">func (*SliceExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *SliceExpr) Pos() token.Pos</pre> <h2 id="Spec">type <span>Spec</span> </h2> <p>The Spec type stands for any of *ImportSpec, *ValueSpec, and *TypeSpec. </p>
+<pre data-language="go">type Spec interface {
+ Node
+ // contains filtered or unexported methods
+}</pre> <h2 id="StarExpr">type <span>StarExpr</span> </h2> <p>A StarExpr node represents an expression of the form "*" Expression. Semantically it could be a unary "*" expression, or a pointer type. </p>
+<pre data-language="go">type StarExpr struct {
+ Star token.Pos // position of "*"
+ X Expr // operand
+}
+</pre> <h3 id="StarExpr.End">func (*StarExpr) <span>End</span> </h3> <pre data-language="go">func (x *StarExpr) End() token.Pos</pre> <h3 id="StarExpr.Pos">func (*StarExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *StarExpr) Pos() token.Pos</pre> <h2 id="Stmt">type <span>Stmt</span> </h2> <p>All statement nodes implement the Stmt interface. </p>
+<pre data-language="go">type Stmt interface {
+ Node
+ // contains filtered or unexported methods
+}</pre> <h2 id="StructType">type <span>StructType</span> </h2> <p>A StructType node represents a struct type. </p>
+<pre data-language="go">type StructType struct {
+ Struct token.Pos // position of "struct" keyword
+ Fields *FieldList // list of field declarations
+ Incomplete bool // true if (source) fields are missing in the Fields list
+}
+</pre> <h3 id="StructType.End">func (*StructType) <span>End</span> </h3> <pre data-language="go">func (x *StructType) End() token.Pos</pre> <h3 id="StructType.Pos">func (*StructType) <span>Pos</span> </h3> <pre data-language="go">func (x *StructType) Pos() token.Pos</pre> <h2 id="SwitchStmt">type <span>SwitchStmt</span> </h2> <p>A SwitchStmt node represents an expression switch statement. </p>
+<pre data-language="go">type SwitchStmt struct {
+ Switch token.Pos // position of "switch" keyword
+ Init Stmt // initialization statement; or nil
+ Tag Expr // tag expression; or nil
+ Body *BlockStmt // CaseClauses only
+}
+</pre> <h3 id="SwitchStmt.End">func (*SwitchStmt) <span>End</span> </h3> <pre data-language="go">func (s *SwitchStmt) End() token.Pos</pre> <h3 id="SwitchStmt.Pos">func (*SwitchStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *SwitchStmt) Pos() token.Pos</pre> <h2 id="TypeAssertExpr">type <span>TypeAssertExpr</span> </h2> <p>A TypeAssertExpr node represents an expression followed by a type assertion. </p>
+<pre data-language="go">type TypeAssertExpr struct {
+ X Expr // expression
+ Lparen token.Pos // position of "("; added in Go 1.2
+ Type Expr // asserted type; nil means type switch X.(type)
+ Rparen token.Pos // position of ")"; added in Go 1.2
+}
+</pre> <h3 id="TypeAssertExpr.End">func (*TypeAssertExpr) <span>End</span> </h3> <pre data-language="go">func (x *TypeAssertExpr) End() token.Pos</pre> <h3 id="TypeAssertExpr.Pos">func (*TypeAssertExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *TypeAssertExpr) Pos() token.Pos</pre> <h2 id="TypeSpec">type <span>TypeSpec</span> </h2> <p>A TypeSpec node represents a type declaration (TypeSpec production). </p>
+<pre data-language="go">type TypeSpec struct {
+ Doc *CommentGroup // associated documentation; or nil
+ Name *Ident // type name
+ TypeParams *FieldList // type parameters; or nil; added in Go 1.18
+ Assign token.Pos // position of '=', if any; added in Go 1.9
+ Type Expr // *Ident, *ParenExpr, *SelectorExpr, *StarExpr, or any of the *XxxTypes
+ Comment *CommentGroup // line comments; or nil
+}
+</pre> <h3 id="TypeSpec.End">func (*TypeSpec) <span>End</span> </h3> <pre data-language="go">func (s *TypeSpec) End() token.Pos</pre> <h3 id="TypeSpec.Pos">func (*TypeSpec) <span>Pos</span> </h3> <pre data-language="go">func (s *TypeSpec) Pos() token.Pos</pre> <h2 id="TypeSwitchStmt">type <span>TypeSwitchStmt</span> </h2> <p>A TypeSwitchStmt node represents a type switch statement. </p>
+<pre data-language="go">type TypeSwitchStmt struct {
+ Switch token.Pos // position of "switch" keyword
+ Init Stmt // initialization statement; or nil
+ Assign Stmt // x := y.(type) or y.(type)
+ Body *BlockStmt // CaseClauses only
+}
+</pre> <h3 id="TypeSwitchStmt.End">func (*TypeSwitchStmt) <span>End</span> </h3> <pre data-language="go">func (s *TypeSwitchStmt) End() token.Pos</pre> <h3 id="TypeSwitchStmt.Pos">func (*TypeSwitchStmt) <span>Pos</span> </h3> <pre data-language="go">func (s *TypeSwitchStmt) Pos() token.Pos</pre> <h2 id="UnaryExpr">type <span>UnaryExpr</span> </h2> <p>A UnaryExpr node represents a unary expression. Unary "*" expressions are represented via StarExpr nodes. </p>
+<pre data-language="go">type UnaryExpr struct {
+ OpPos token.Pos // position of Op
+ Op token.Token // operator
+ X Expr // operand
+}
+</pre> <h3 id="UnaryExpr.End">func (*UnaryExpr) <span>End</span> </h3> <pre data-language="go">func (x *UnaryExpr) End() token.Pos</pre> <h3 id="UnaryExpr.Pos">func (*UnaryExpr) <span>Pos</span> </h3> <pre data-language="go">func (x *UnaryExpr) Pos() token.Pos</pre> <h2 id="ValueSpec">type <span>ValueSpec</span> </h2> <p>A ValueSpec node represents a constant or variable declaration (ConstSpec or VarSpec production). </p>
+<pre data-language="go">type ValueSpec struct {
+ Doc *CommentGroup // associated documentation; or nil
+ Names []*Ident // value names (len(Names) &gt; 0)
+ Type Expr // value type; or nil
+ Values []Expr // initial values; or nil
+ Comment *CommentGroup // line comments; or nil
+}
+</pre> <h3 id="ValueSpec.End">func (*ValueSpec) <span>End</span> </h3> <pre data-language="go">func (s *ValueSpec) End() token.Pos</pre> <h3 id="ValueSpec.Pos">func (*ValueSpec) <span>Pos</span> </h3> <pre data-language="go">func (s *ValueSpec) Pos() token.Pos</pre> <h2 id="Visitor">type <span>Visitor</span> </h2> <p>A Visitor's Visit method is invoked for each node encountered by <a href="#Walk">Walk</a>. If the result visitor w is not nil, <a href="#Walk">Walk</a> visits each of the children of node with the visitor w, followed by a call of w.Visit(nil). </p>
+<pre data-language="go">type Visitor interface {
+ Visit(node Node) (w Visitor)
+}</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/ast/" class="_attribution-link">http://golang.org/pkg/go/ast/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fbuild%2Fconstraint%2Findex.html b/devdocs/go/go%2Fbuild%2Fconstraint%2Findex.html
new file mode 100644
index 00000000..1a648460
--- /dev/null
+++ b/devdocs/go/go%2Fbuild%2Fconstraint%2Findex.html
@@ -0,0 +1,88 @@
+<h1> Package constraint </h1> <ul id="short-nav">
+<li><code>import "go/build/constraint"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package constraint implements parsing and evaluation of build constraint lines. See <a href="https://golang.org/cmd/go/#hdr-Build_constraints">https://golang.org/cmd/go/#hdr-Build_constraints</a> for documentation about build constraints themselves. </p>
+<p>This package parses both the original “// +build” syntax and the “//go:build” syntax that was added in Go 1.17. See <a href="https://golang.org/design/draft-gobuild">https://golang.org/design/draft-gobuild</a> for details about the “//go:build” syntax. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#GoVersion">func GoVersion(x Expr) string</a></li>
+<li><a href="#IsGoBuild">func IsGoBuild(line string) bool</a></li>
+<li><a href="#IsPlusBuild">func IsPlusBuild(line string) bool</a></li>
+<li><a href="#PlusBuildLines">func PlusBuildLines(x Expr) ([]string, error)</a></li>
+<li><a href="#AndExpr">type AndExpr</a></li>
+<li> <a href="#AndExpr.Eval">func (x *AndExpr) Eval(ok func(tag string) bool) bool</a>
+</li>
+<li> <a href="#AndExpr.String">func (x *AndExpr) String() string</a>
+</li>
+<li><a href="#Expr">type Expr</a></li>
+<li> <a href="#Parse">func Parse(line string) (Expr, error)</a>
+</li>
+<li><a href="#NotExpr">type NotExpr</a></li>
+<li> <a href="#NotExpr.Eval">func (x *NotExpr) Eval(ok func(tag string) bool) bool</a>
+</li>
+<li> <a href="#NotExpr.String">func (x *NotExpr) String() string</a>
+</li>
+<li><a href="#OrExpr">type OrExpr</a></li>
+<li> <a href="#OrExpr.Eval">func (x *OrExpr) Eval(ok func(tag string) bool) bool</a>
+</li>
+<li> <a href="#OrExpr.String">func (x *OrExpr) String() string</a>
+</li>
+<li><a href="#SyntaxError">type SyntaxError</a></li>
+<li> <a href="#SyntaxError.Error">func (e *SyntaxError) Error() string</a>
+</li>
+<li><a href="#TagExpr">type TagExpr</a></li>
+<li> <a href="#TagExpr.Eval">func (x *TagExpr) Eval(ok func(tag string) bool) bool</a>
+</li>
+<li> <a href="#TagExpr.String">func (x *TagExpr) String() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>expr.go</span> <span>vers.go</span> </p> <h2 id="GoVersion">func <span>GoVersion</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func GoVersion(x Expr) string</pre> <p>GoVersion returns the minimum Go version implied by a given build expression. If the expression can be satisfied without any Go version tags, GoVersion returns an empty string. </p>
+<p>For example: </p>
+<pre data-language="go">GoVersion(linux &amp;&amp; go1.22) = "go1.22"
+GoVersion((linux &amp;&amp; go1.22) || (windows &amp;&amp; go1.20)) = "go1.20" =&gt; go1.20
+GoVersion(linux) = ""
+GoVersion(linux || (windows &amp;&amp; go1.22)) = ""
+GoVersion(!go1.22) = ""
+</pre> <p>GoVersion assumes that any tag or negated tag may independently be true, so that its analysis can be purely structural, without SAT solving. “Impossible” subexpressions may therefore affect the result. </p>
+<p>For example: </p>
+<pre data-language="go">GoVersion((linux &amp;&amp; !linux &amp;&amp; go1.20) || go1.21) = "go1.20"
+</pre> <h2 id="IsGoBuild">func <span>IsGoBuild</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func IsGoBuild(line string) bool</pre> <p>IsGoBuild reports whether the line of text is a “//go:build” constraint. It only checks the prefix of the text, not that the expression itself parses. </p>
+<h2 id="IsPlusBuild">func <span>IsPlusBuild</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func IsPlusBuild(line string) bool</pre> <p>IsPlusBuild reports whether the line of text is a “// +build” constraint. It only checks the prefix of the text, not that the expression itself parses. </p>
+<h2 id="PlusBuildLines">func <span>PlusBuildLines</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func PlusBuildLines(x Expr) ([]string, error)</pre> <p>PlusBuildLines returns a sequence of “// +build” lines that evaluate to the build expression x. If the expression is too complex to convert directly to “// +build” lines, PlusBuildLines returns an error. </p>
+<h2 id="AndExpr">type <span>AndExpr</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>An AndExpr represents the expression X &amp;&amp; Y. </p>
+<pre data-language="go">type AndExpr struct {
+ X, Y Expr
+}
+</pre> <h3 id="AndExpr.Eval">func (*AndExpr) <span>Eval</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (x *AndExpr) Eval(ok func(tag string) bool) bool</pre> <h3 id="AndExpr.String">func (*AndExpr) <span>String</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (x *AndExpr) String() string</pre> <h2 id="Expr">type <span>Expr</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>An Expr is a build tag constraint expression. The underlying concrete type is *<a href="#AndExpr">AndExpr</a>, *<a href="#OrExpr">OrExpr</a>, *<a href="#NotExpr">NotExpr</a>, or *<a href="#TagExpr">TagExpr</a>. </p>
+<pre data-language="go">type Expr interface {
+ // String returns the string form of the expression,
+ // using the boolean syntax used in //go:build lines.
+ String() string
+
+ // Eval reports whether the expression evaluates to true.
+ // It calls ok(tag) as needed to find out whether a given build tag
+ // is satisfied by the current build configuration.
+ Eval(ok func(tag string) bool) bool
+ // contains filtered or unexported methods
+}</pre> <h3 id="Parse">func <span>Parse</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func Parse(line string) (Expr, error)</pre> <p>Parse parses a single build constraint line of the form “//go:build ...” or “// +build ...” and returns the corresponding boolean expression. </p>
+<h2 id="NotExpr">type <span>NotExpr</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A NotExpr represents the expression !X (the negation of X). </p>
+<pre data-language="go">type NotExpr struct {
+ X Expr
+}
+</pre> <h3 id="NotExpr.Eval">func (*NotExpr) <span>Eval</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (x *NotExpr) Eval(ok func(tag string) bool) bool</pre> <h3 id="NotExpr.String">func (*NotExpr) <span>String</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (x *NotExpr) String() string</pre> <h2 id="OrExpr">type <span>OrExpr</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>An OrExpr represents the expression X || Y. </p>
+<pre data-language="go">type OrExpr struct {
+ X, Y Expr
+}
+</pre> <h3 id="OrExpr.Eval">func (*OrExpr) <span>Eval</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (x *OrExpr) Eval(ok func(tag string) bool) bool</pre> <h3 id="OrExpr.String">func (*OrExpr) <span>String</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (x *OrExpr) String() string</pre> <h2 id="SyntaxError">type <span>SyntaxError</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A SyntaxError reports a syntax error in a parsed build expression. </p>
+<pre data-language="go">type SyntaxError struct {
+ Offset int // byte offset in input where error was detected
+ Err string // description of error
+}
+</pre> <h3 id="SyntaxError.Error">func (*SyntaxError) <span>Error</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (e *SyntaxError) Error() string</pre> <h2 id="TagExpr">type <span>TagExpr</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A TagExpr is an <a href="#Expr">Expr</a> for the single tag Tag. </p>
+<pre data-language="go">type TagExpr struct {
+ Tag string // for example, “linux” or “cgo”
+}
+</pre> <h3 id="TagExpr.Eval">func (*TagExpr) <span>Eval</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (x *TagExpr) Eval(ok func(tag string) bool) bool</pre> <h3 id="TagExpr.String">func (*TagExpr) <span>String</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (x *TagExpr) String() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/build/constraint/" class="_attribution-link">http://golang.org/pkg/go/build/constraint/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fbuild%2Findex.html b/devdocs/go/go%2Fbuild%2Findex.html
new file mode 100644
index 00000000..68a204ff
--- /dev/null
+++ b/devdocs/go/go%2Fbuild%2Findex.html
@@ -0,0 +1,293 @@
+<h1> Package build </h1> <ul id="short-nav">
+<li><code>import "go/build"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package build gathers information about Go packages. </p>
+<h3 id="hdr-Go_Path">Go Path</h3> <p>The Go path is a list of directory trees containing Go source code. It is consulted to resolve imports that cannot be found in the standard Go tree. The default path is the value of the GOPATH environment variable, interpreted as a path list appropriate to the operating system (on Unix, the variable is a colon-separated string; on Windows, a semicolon-separated string; on Plan 9, a list). </p>
+<p>Each directory listed in the Go path must have a prescribed structure: </p>
+<p>The src/ directory holds source code. The path below 'src' determines the import path or executable name. </p>
+<p>The pkg/ directory holds installed package objects. As in the Go tree, each target operating system and architecture pair has its own subdirectory of pkg (pkg/GOOS_GOARCH). </p>
+<p>If DIR is a directory listed in the Go path, a package with source in DIR/src/foo/bar can be imported as "foo/bar" and has its compiled form installed to "DIR/pkg/GOOS_GOARCH/foo/bar.a" (or, for gccgo, "DIR/pkg/gccgo/foo/libbar.a"). </p>
+<p>The bin/ directory holds compiled commands. Each command is named for its source directory, but only using the final element, not the entire path. That is, the command with source in DIR/src/foo/quux is installed into DIR/bin/quux, not DIR/bin/foo/quux. The foo/ is stripped so that you can add DIR/bin to your PATH to get at the installed commands. </p>
+<p>Here's an example directory layout: </p>
+<pre data-language="go">GOPATH=/home/user/gocode
+
+/home/user/gocode/
+ src/
+ foo/
+ bar/ (go code in package bar)
+ x.go
+ quux/ (go code in package main)
+ y.go
+ bin/
+ quux (installed command)
+ pkg/
+ linux_amd64/
+ foo/
+ bar.a (installed package object)
+</pre> <h3 id="hdr-Build_Constraints">Build Constraints</h3> <p>A build constraint, also known as a build tag, is a condition under which a file should be included in the package. Build constraints are given by a line comment that begins </p>
+<pre data-language="go">//go:build
+</pre> <p>Build constraints may also be part of a file's name (for example, source_windows.go will only be included if the target operating system is windows). </p>
+<p>See 'go help buildconstraint' (<a href="https://golang.org/cmd/go/#hdr-Build_constraints">https://golang.org/cmd/go/#hdr-Build_constraints</a>) for details. </p>
+<h3 id="hdr-Binary_Only_Packages">Binary-Only Packages</h3> <p>In Go 1.12 and earlier, it was possible to distribute packages in binary form without including the source code used for compiling the package. The package was distributed with a source file not excluded by build constraints and containing a "//go:binary-only-package" comment. Like a build constraint, this comment appeared at the top of a file, preceded only by blank lines and other line comments and with a blank line following the comment, to separate it from the package documentation. Unlike build constraints, this comment is only recognized in non-test Go source files. </p>
+<p>The minimal source code for a binary-only package was therefore: </p>
+<pre data-language="go">//go:binary-only-package
+
+package mypkg
+</pre> <p>The source code could include additional Go code. That code was never compiled but would be processed by tools like godoc and might be useful as end-user documentation. </p>
+<p>"go build" and other commands no longer support binary-only-packages. <a href="#Import">Import</a> and <a href="#ImportDir">ImportDir</a> will still set the BinaryOnly flag in packages containing these comments for use in tools and error messages. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#ArchChar">func ArchChar(goarch string) (string, error)</a></li>
+<li><a href="#IsLocalImport">func IsLocalImport(path string) bool</a></li>
+<li><a href="#Context">type Context</a></li>
+<li> <a href="#Context.Import">func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Package, error)</a>
+</li>
+<li> <a href="#Context.ImportDir">func (ctxt *Context) ImportDir(dir string, mode ImportMode) (*Package, error)</a>
+</li>
+<li> <a href="#Context.MatchFile">func (ctxt *Context) MatchFile(dir, name string) (match bool, err error)</a>
+</li>
+<li> <a href="#Context.SrcDirs">func (ctxt *Context) SrcDirs() []string</a>
+</li>
+<li><a href="#Directive">type Directive</a></li>
+<li><a href="#ImportMode">type ImportMode</a></li>
+<li><a href="#MultiplePackageError">type MultiplePackageError</a></li>
+<li> <a href="#MultiplePackageError.Error">func (e *MultiplePackageError) Error() string</a>
+</li>
+<li><a href="#NoGoError">type NoGoError</a></li>
+<li> <a href="#NoGoError.Error">func (e *NoGoError) Error() string</a>
+</li>
+<li><a href="#Package">type Package</a></li>
+<li> <a href="#Import">func Import(path, srcDir string, mode ImportMode) (*Package, error)</a>
+</li>
+<li> <a href="#ImportDir">func ImportDir(dir string, mode ImportMode) (*Package, error)</a>
+</li>
+<li> <a href="#Package.IsCommand">func (p *Package) IsCommand() bool</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>build.go</span> <span>doc.go</span> <span>gc.go</span> <span>read.go</span> <span>syslist.go</span> <span>zcgo.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ToolDir is the directory containing build tools. </p>
+<pre data-language="go">var ToolDir = getToolDir()</pre> <h2 id="ArchChar">func <span>ArchChar</span> </h2> <pre data-language="go">func ArchChar(goarch string) (string, error)</pre> <p>ArchChar returns "?" and an error. In earlier versions of Go, the returned string was used to derive the compiler and linker tool names, the default object file suffix, and the default linker output name. As of Go 1.5, those strings no longer vary by architecture; they are compile, link, .o, and a.out, respectively. </p>
+<h2 id="IsLocalImport">func <span>IsLocalImport</span> </h2> <pre data-language="go">func IsLocalImport(path string) bool</pre> <p>IsLocalImport reports whether the import path is a local import path, like ".", "..", "./foo", or "../foo". </p>
+<h2 id="Context">type <span>Context</span> </h2> <p>A Context specifies the supporting context for a build. </p>
+<pre data-language="go">type Context struct {
+ GOARCH string // target architecture
+ GOOS string // target operating system
+ GOROOT string // Go root
+ GOPATH string // Go paths
+
+ // Dir is the caller's working directory, or the empty string to use
+ // the current directory of the running process. In module mode, this is used
+ // to locate the main module.
+ //
+ // If Dir is non-empty, directories passed to Import and ImportDir must
+ // be absolute.
+ Dir string // Go 1.14
+
+ CgoEnabled bool // whether cgo files are included
+ UseAllFiles bool // use files regardless of go:build lines, file names
+ Compiler string // compiler to assume when computing target paths
+
+ // The build, tool, and release tags specify build constraints
+ // that should be considered satisfied when processing go:build lines.
+ // Clients creating a new context may customize BuildTags, which
+ // defaults to empty, but it is usually an error to customize ToolTags or ReleaseTags.
+ // ToolTags defaults to build tags appropriate to the current Go toolchain configuration.
+ // ReleaseTags defaults to the list of Go releases the current release is compatible with.
+ // BuildTags is not set for the Default build Context.
+ // In addition to the BuildTags, ToolTags, and ReleaseTags, build constraints
+ // consider the values of GOARCH and GOOS as satisfied tags.
+ // The last element in ReleaseTags is assumed to be the current release.
+ BuildTags []string
+ ToolTags []string // Go 1.17
+ ReleaseTags []string // Go 1.1
+
+ // The install suffix specifies a suffix to use in the name of the installation
+ // directory. By default it is empty, but custom builds that need to keep
+ // their outputs separate can set InstallSuffix to do so. For example, when
+ // using the race detector, the go command uses InstallSuffix = "race", so
+ // that on a Linux/386 system, packages are written to a directory named
+ // "linux_386_race" instead of the usual "linux_386".
+ InstallSuffix string // Go 1.1
+
+ // JoinPath joins the sequence of path fragments into a single path.
+ // If JoinPath is nil, Import uses filepath.Join.
+ JoinPath func(elem ...string) string
+
+ // SplitPathList splits the path list into a slice of individual paths.
+ // If SplitPathList is nil, Import uses filepath.SplitList.
+ SplitPathList func(list string) []string
+
+ // IsAbsPath reports whether path is an absolute path.
+ // If IsAbsPath is nil, Import uses filepath.IsAbs.
+ IsAbsPath func(path string) bool
+
+ // IsDir reports whether the path names a directory.
+ // If IsDir is nil, Import calls os.Stat and uses the result's IsDir method.
+ IsDir func(path string) bool
+
+ // HasSubdir reports whether dir is lexically a subdirectory of
+ // root, perhaps multiple levels below. It does not try to check
+ // whether dir exists.
+ // If so, HasSubdir sets rel to a slash-separated path that
+ // can be joined to root to produce a path equivalent to dir.
+ // If HasSubdir is nil, Import uses an implementation built on
+ // filepath.EvalSymlinks.
+ HasSubdir func(root, dir string) (rel string, ok bool)
+
+ // ReadDir returns a slice of fs.FileInfo, sorted by Name,
+ // describing the content of the named directory.
+ // If ReadDir is nil, Import uses os.ReadDir.
+ ReadDir func(dir string) ([]fs.FileInfo, error)
+
+ // OpenFile opens a file (not a directory) for reading.
+ // If OpenFile is nil, Import uses os.Open.
+ OpenFile func(path string) (io.ReadCloser, error)
+}
+</pre> <p>Default is the default Context for builds. It uses the GOARCH, GOOS, GOROOT, and GOPATH environment variables if set, or else the compiled code's GOARCH, GOOS, and GOROOT. </p>
+<pre data-language="go">var Default Context = defaultContext()</pre> <h3 id="Context.Import">func (*Context) <span>Import</span> </h3> <pre data-language="go">func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Package, error)</pre> <p>Import returns details about the Go package named by the import path, interpreting local import paths relative to the srcDir directory. If the path is a local import path naming a package that can be imported using a standard import path, the returned package will set p.ImportPath to that path. </p>
+<p>In the directory containing the package, .go, .c, .h, and .s files are considered part of the package except for: </p>
+<ul> <li>.go files in package documentation </li>
+<li>files starting with _ or . (likely editor temporary files) </li>
+<li>files with build constraints not satisfied by the context </li>
+</ul> <p>If an error occurs, Import returns a non-nil error and a non-nil *<a href="#Package">Package</a> containing partial information. </p>
+<h3 id="Context.ImportDir">func (*Context) <span>ImportDir</span> </h3> <pre data-language="go">func (ctxt *Context) ImportDir(dir string, mode ImportMode) (*Package, error)</pre> <p>ImportDir is like <a href="#Import">Import</a> but processes the Go package found in the named directory. </p>
+<h3 id="Context.MatchFile">func (*Context) <span>MatchFile</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (ctxt *Context) MatchFile(dir, name string) (match bool, err error)</pre> <p>MatchFile reports whether the file with the given name in the given directory matches the context and would be included in a <a href="#Package">Package</a> created by <a href="#ImportDir">ImportDir</a> of that directory. </p>
+<p>MatchFile considers the name of the file and may use ctxt.OpenFile to read some or all of the file's content. </p>
+<h3 id="Context.SrcDirs">func (*Context) <span>SrcDirs</span> </h3> <pre data-language="go">func (ctxt *Context) SrcDirs() []string</pre> <p>SrcDirs returns a list of package source root directories. It draws from the current Go root and Go path but omits directories that do not exist. </p>
+<h2 id="Directive">type <span>Directive</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A Directive is a Go directive comment (//go:zzz...) found in a source file. </p>
+<pre data-language="go">type Directive struct {
+ Text string // full line comment including leading slashes
+ Pos token.Position // position of comment
+}
+</pre> <h2 id="ImportMode">type <span>ImportMode</span> </h2> <p>An ImportMode controls the behavior of the Import method. </p>
+<pre data-language="go">type ImportMode uint</pre> <pre data-language="go">const (
+ // If FindOnly is set, Import stops after locating the directory
+ // that should contain the sources for a package. It does not
+ // read any files in the directory.
+ FindOnly ImportMode = 1 &lt;&lt; iota
+
+ // If AllowBinary is set, Import can be satisfied by a compiled
+ // package object without corresponding sources.
+ //
+ // Deprecated:
+ // The supported way to create a compiled-only package is to
+ // write source code containing a //go:binary-only-package comment at
+ // the top of the file. Such a package will be recognized
+ // regardless of this flag setting (because it has source code)
+ // and will have BinaryOnly set to true in the returned Package.
+ AllowBinary
+
+ // If ImportComment is set, parse import comments on package statements.
+ // Import returns an error if it finds a comment it cannot understand
+ // or finds conflicting comments in multiple source files.
+ // See golang.org/s/go14customimport for more information.
+ ImportComment
+
+ // By default, Import searches vendor directories
+ // that apply in the given source directory before searching
+ // the GOROOT and GOPATH roots.
+ // If an Import finds and returns a package using a vendor
+ // directory, the resulting ImportPath is the complete path
+ // to the package, including the path elements leading up
+ // to and including "vendor".
+ // For example, if Import("y", "x/subdir", 0) finds
+ // "x/vendor/y", the returned package's ImportPath is "x/vendor/y",
+ // not plain "y".
+ // See golang.org/s/go15vendor for more information.
+ //
+ // Setting IgnoreVendor ignores vendor directories.
+ //
+ // In contrast to the package's ImportPath,
+ // the returned package's Imports, TestImports, and XTestImports
+ // are always the exact import paths from the source files:
+ // Import makes no attempt to resolve or check those paths.
+ IgnoreVendor
+)</pre> <h2 id="MultiplePackageError">type <span>MultiplePackageError</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>MultiplePackageError describes a directory containing multiple buildable Go source files for multiple packages. </p>
+<pre data-language="go">type MultiplePackageError struct {
+ Dir string // directory containing files
+ Packages []string // package names found
+ Files []string // corresponding files: Files[i] declares package Packages[i]
+}
+</pre> <h3 id="MultiplePackageError.Error">func (*MultiplePackageError) <span>Error</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (e *MultiplePackageError) Error() string</pre> <h2 id="NoGoError">type <span>NoGoError</span> </h2> <p>NoGoError is the error used by <a href="#Import">Import</a> to describe a directory containing no buildable Go source files. (It may still contain test files, files hidden by build tags, and so on.) </p>
+<pre data-language="go">type NoGoError struct {
+ Dir string
+}
+</pre> <h3 id="NoGoError.Error">func (*NoGoError) <span>Error</span> </h3> <pre data-language="go">func (e *NoGoError) Error() string</pre> <h2 id="Package">type <span>Package</span> </h2> <p>A Package describes the Go package found in a directory. </p>
+<pre data-language="go">type Package struct {
+ Dir string // directory containing package sources
+ Name string // package name
+ ImportComment string // path in import comment on package statement; added in Go 1.4
+ Doc string // documentation synopsis
+ ImportPath string // import path of package ("" if unknown)
+ Root string // root of Go tree where this package lives
+ SrcRoot string // package source root directory ("" if unknown)
+ PkgRoot string // package install root directory ("" if unknown)
+ PkgTargetRoot string // architecture dependent install root directory ("" if unknown); added in Go 1.5
+ BinDir string // command install directory ("" if unknown)
+ Goroot bool // package found in Go root
+ PkgObj string // installed .a file
+ AllTags []string // tags that can influence file selection in this directory; added in Go 1.2
+ ConflictDir string // this directory shadows Dir in $GOPATH; added in Go 1.2
+ BinaryOnly bool // cannot be rebuilt from source (has //go:binary-only-package comment); added in Go 1.7
+
+ // Source files
+ GoFiles []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles)
+ CgoFiles []string // .go source files that import "C"
+ IgnoredGoFiles []string // .go source files ignored for this build (including ignored _test.go files); added in Go 1.1
+ InvalidGoFiles []string // .go source files with detected problems (parse error, wrong package name, and so on); added in Go 1.6
+ IgnoredOtherFiles []string // non-.go source files ignored for this build; added in Go 1.16
+ CFiles []string // .c source files
+ CXXFiles []string // .cc, .cpp and .cxx source files; added in Go 1.2
+ MFiles []string // .m (Objective-C) source files; added in Go 1.3
+ HFiles []string // .h, .hh, .hpp and .hxx source files
+ FFiles []string // .f, .F, .for and .f90 Fortran source files; added in Go 1.7
+ SFiles []string // .s source files
+ SwigFiles []string // .swig files; added in Go 1.1
+ SwigCXXFiles []string // .swigcxx files; added in Go 1.1
+ SysoFiles []string // .syso system object files to add to archive
+
+ // Cgo directives
+ CgoCFLAGS []string // Cgo CFLAGS directives
+ CgoCPPFLAGS []string // Cgo CPPFLAGS directives; added in Go 1.2
+ CgoCXXFLAGS []string // Cgo CXXFLAGS directives; added in Go 1.2
+ CgoFFLAGS []string // Cgo FFLAGS directives; added in Go 1.7
+ CgoLDFLAGS []string // Cgo LDFLAGS directives
+ CgoPkgConfig []string // Cgo pkg-config directives
+
+ // Test information
+ TestGoFiles []string // _test.go files in package
+ XTestGoFiles []string // _test.go files outside package
+
+ // Go directive comments (//go:zzz...) found in source files.
+ Directives []Directive // Go 1.21
+ TestDirectives []Directive // Go 1.21
+ XTestDirectives []Directive // Go 1.21
+
+ // Dependency information
+ Imports []string // import paths from GoFiles, CgoFiles
+ ImportPos map[string][]token.Position // line information for Imports
+ TestImports []string // import paths from TestGoFiles
+ TestImportPos map[string][]token.Position // line information for TestImports
+ XTestImports []string // import paths from XTestGoFiles
+ XTestImportPos map[string][]token.Position // line information for XTestImports
+
+ // //go:embed patterns found in Go source files
+ // For example, if a source file says
+ // //go:embed a* b.c
+ // then the list will contain those two strings as separate entries.
+ // (See package embed for more details about //go:embed.)
+ EmbedPatterns []string // patterns from GoFiles, CgoFiles; added in Go 1.16
+ EmbedPatternPos map[string][]token.Position // line information for EmbedPatterns; added in Go 1.16
+ TestEmbedPatterns []string // patterns from TestGoFiles; added in Go 1.16
+ TestEmbedPatternPos map[string][]token.Position // line information for TestEmbedPatterns; added in Go 1.16
+ XTestEmbedPatterns []string // patterns from XTestGoFiles; added in Go 1.16
+ XTestEmbedPatternPos map[string][]token.Position // line information for XTestEmbedPatternPos; added in Go 1.16
+}
+</pre> <h3 id="Import">func <span>Import</span> </h3> <pre data-language="go">func Import(path, srcDir string, mode ImportMode) (*Package, error)</pre> <p>Import is shorthand for Default.Import. </p>
+<h3 id="ImportDir">func <span>ImportDir</span> </h3> <pre data-language="go">func ImportDir(dir string, mode ImportMode) (*Package, error)</pre> <p>ImportDir is shorthand for Default.ImportDir. </p>
+<h3 id="Package.IsCommand">func (*Package) <span>IsCommand</span> </h3> <pre data-language="go">func (p *Package) IsCommand() bool</pre> <p>IsCommand reports whether the package is considered a command to be installed (not just a library). Packages named "main" are treated as commands. </p>
+<h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="constraint/index">constraint</a> </td> <td class="pkg-synopsis"> Package constraint implements parsing and evaluation of build constraint lines. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/build/" class="_attribution-link">http://golang.org/pkg/go/build/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fconstant%2Findex.html b/devdocs/go/go%2Fconstant%2Findex.html
new file mode 100644
index 00000000..817a4dcc
--- /dev/null
+++ b/devdocs/go/go%2Fconstant%2Findex.html
@@ -0,0 +1,290 @@
+<h1> Package constant </h1> <ul id="short-nav">
+<li><code>import "go/constant"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package constant implements Values representing untyped Go constants and their corresponding operations. </p>
+<p>A special Unknown value may be used when a value is unknown due to an error. Operations on unknown values produce unknown values unless specified otherwise. </p> <h4 id="example__complexNumbers"> <span class="text">Example (ComplexNumbers)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Create the complex number 2.3 + 5i.
+ar := constant.MakeFloat64(2.3)
+ai := constant.MakeImag(constant.MakeInt64(5))
+a := constant.BinaryOp(ar, token.ADD, ai)
+
+// Compute (2.3 + 5i) * 11.
+b := constant.MakeUint64(11)
+c := constant.BinaryOp(a, token.MUL, b)
+
+// Convert c into a complex128.
+Ar, exact := constant.Float64Val(constant.Real(c))
+if !exact {
+ fmt.Printf("Could not represent real part %s exactly as float64\n", constant.Real(c))
+}
+Ai, exact := constant.Float64Val(constant.Imag(c))
+if !exact {
+ fmt.Printf("Could not represent imaginary part %s as exactly as float64\n", constant.Imag(c))
+}
+C := complex(Ar, Ai)
+
+fmt.Println("literal", 25.3+55i)
+fmt.Println("go/constant", c)
+fmt.Println("complex128", C)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">
+Could not represent real part 25.3 exactly as float64
+literal (25.3+55i)
+go/constant (25.3 + 55i)
+complex128 (25.299999999999997+55i)
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#BitLen">func BitLen(x Value) int</a></li>
+<li><a href="#BoolVal">func BoolVal(x Value) bool</a></li>
+<li><a href="#Bytes">func Bytes(x Value) []byte</a></li>
+<li><a href="#Compare">func Compare(x_ Value, op token.Token, y_ Value) bool</a></li>
+<li><a href="#Float32Val">func Float32Val(x Value) (float32, bool)</a></li>
+<li><a href="#Float64Val">func Float64Val(x Value) (float64, bool)</a></li>
+<li><a href="#Int64Val">func Int64Val(x Value) (int64, bool)</a></li>
+<li><a href="#Sign">func Sign(x Value) int</a></li>
+<li><a href="#StringVal">func StringVal(x Value) string</a></li>
+<li><a href="#Uint64Val">func Uint64Val(x Value) (uint64, bool)</a></li>
+<li><a href="#Val">func Val(x Value) any</a></li>
+<li><a href="#Kind">type Kind</a></li>
+<li> <a href="#Kind.String">func (i Kind) String() string</a>
+</li>
+<li><a href="#Value">type Value</a></li>
+<li> <a href="#BinaryOp">func BinaryOp(x_ Value, op token.Token, y_ Value) Value</a>
+</li>
+<li> <a href="#Denom">func Denom(x Value) Value</a>
+</li>
+<li> <a href="#Imag">func Imag(x Value) Value</a>
+</li>
+<li> <a href="#Make">func Make(x any) Value</a>
+</li>
+<li> <a href="#MakeBool">func MakeBool(b bool) Value</a>
+</li>
+<li> <a href="#MakeFloat64">func MakeFloat64(x float64) Value</a>
+</li>
+<li> <a href="#MakeFromBytes">func MakeFromBytes(bytes []byte) Value</a>
+</li>
+<li> <a href="#MakeFromLiteral">func MakeFromLiteral(lit string, tok token.Token, zero uint) Value</a>
+</li>
+<li> <a href="#MakeImag">func MakeImag(x Value) Value</a>
+</li>
+<li> <a href="#MakeInt64">func MakeInt64(x int64) Value</a>
+</li>
+<li> <a href="#MakeString">func MakeString(s string) Value</a>
+</li>
+<li> <a href="#MakeUint64">func MakeUint64(x uint64) Value</a>
+</li>
+<li> <a href="#MakeUnknown">func MakeUnknown() Value</a>
+</li>
+<li> <a href="#Num">func Num(x Value) Value</a>
+</li>
+<li> <a href="#Real">func Real(x Value) Value</a>
+</li>
+<li> <a href="#Shift">func Shift(x Value, op token.Token, s uint) Value</a>
+</li>
+<li> <a href="#ToComplex">func ToComplex(x Value) Value</a>
+</li>
+<li> <a href="#ToFloat">func ToFloat(x Value) Value</a>
+</li>
+<li> <a href="#ToInt">func ToInt(x Value) Value</a>
+</li>
+<li> <a href="#UnaryOp">func UnaryOp(op token.Token, y Value, prec uint) Value</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_BinaryOp">BinaryOp</a></dd> <dd><a class="exampleLink" href="#example_Compare">Compare</a></dd> <dd><a class="exampleLink" href="#example_Sign">Sign</a></dd> <dd><a class="exampleLink" href="#example_UnaryOp">UnaryOp</a></dd> <dd><a class="exampleLink" href="#example_Val">Val</a></dd> <dd><a class="exampleLink" href="#example__complexNumbers">Package (ComplexNumbers)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>kind_string.go</span> <span>value.go</span> </p> <h2 id="BitLen">func <span>BitLen</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func BitLen(x Value) int</pre> <p>BitLen returns the number of bits required to represent the absolute value x in binary representation; x must be an <a href="#Int">Int</a> or an <a href="#Unknown">Unknown</a>. If x is <a href="#Unknown">Unknown</a>, the result is 0. </p>
+<h2 id="BoolVal">func <span>BoolVal</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func BoolVal(x Value) bool</pre> <p>BoolVal returns the Go boolean value of x, which must be a <a href="#Bool">Bool</a> or an <a href="#Unknown">Unknown</a>. If x is <a href="#Unknown">Unknown</a>, the result is false. </p>
+<h2 id="Bytes">func <span>Bytes</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Bytes(x Value) []byte</pre> <p>Bytes returns the bytes for the absolute value of x in little- endian binary representation; x must be an <a href="#Int">Int</a>. </p>
+<h2 id="Compare">func <span>Compare</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Compare(x_ Value, op token.Token, y_ Value) bool</pre> <p>Compare returns the result of the comparison x op y. The comparison must be defined for the operands. If one of the operands is <a href="#Unknown">Unknown</a>, the result is false. </p> <h4 id="example_Compare"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">vs := []constant.Value{
+ constant.MakeString("Z"),
+ constant.MakeString("bacon"),
+ constant.MakeString("go"),
+ constant.MakeString("Frame"),
+ constant.MakeString("defer"),
+ constant.MakeFromLiteral(`"a"`, token.STRING, 0),
+}
+
+sort.Slice(vs, func(i, j int) bool {
+ // Equivalent to vs[i] &lt;= vs[j].
+ return constant.Compare(vs[i], token.LEQ, vs[j])
+})
+
+for _, v := range vs {
+ fmt.Println(constant.StringVal(v))
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">
+Frame
+Z
+a
+bacon
+defer
+go
+</pre> <h2 id="Float32Val">func <span>Float32Val</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Float32Val(x Value) (float32, bool)</pre> <p>Float32Val is like <a href="#Float64Val">Float64Val</a> but for float32 instead of float64. </p>
+<h2 id="Float64Val">func <span>Float64Val</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Float64Val(x Value) (float64, bool)</pre> <p>Float64Val returns the nearest Go float64 value of x and whether the result is exact; x must be numeric or an <a href="#Unknown">Unknown</a>, but not <a href="#Complex">Complex</a>. For values too small (too close to 0) to represent as float64, <a href="#Float64Val">Float64Val</a> silently underflows to 0. The result sign always matches the sign of x, even for 0. If x is <a href="#Unknown">Unknown</a>, the result is (0, false). </p>
+<h2 id="Int64Val">func <span>Int64Val</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Int64Val(x Value) (int64, bool)</pre> <p>Int64Val returns the Go int64 value of x and whether the result is exact; x must be an <a href="#Int">Int</a> or an <a href="#Unknown">Unknown</a>. If the result is not exact, its value is undefined. If x is <a href="#Unknown">Unknown</a>, the result is (0, false). </p>
+<h2 id="Sign">func <span>Sign</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Sign(x Value) int</pre> <p>Sign returns -1, 0, or 1 depending on whether x &lt; 0, x == 0, or x &gt; 0; x must be numeric or <a href="#Unknown">Unknown</a>. For complex values x, the sign is 0 if x == 0, otherwise it is != 0. If x is <a href="#Unknown">Unknown</a>, the result is 1. </p> <h4 id="example_Sign"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">zero := constant.MakeInt64(0)
+one := constant.MakeInt64(1)
+negOne := constant.MakeInt64(-1)
+
+mkComplex := func(a, b constant.Value) constant.Value {
+ b = constant.MakeImag(b)
+ return constant.BinaryOp(a, token.ADD, b)
+}
+
+vs := []constant.Value{
+ negOne,
+ mkComplex(zero, negOne),
+ mkComplex(one, negOne),
+ mkComplex(negOne, one),
+ mkComplex(negOne, negOne),
+ zero,
+ mkComplex(zero, zero),
+ one,
+ mkComplex(zero, one),
+ mkComplex(one, one),
+}
+
+for _, v := range vs {
+ fmt.Printf("% d %s\n", constant.Sign(v), v)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">
+-1 -1
+-1 (0 + -1i)
+-1 (1 + -1i)
+-1 (-1 + 1i)
+-1 (-1 + -1i)
+ 0 0
+ 0 (0 + 0i)
+ 1 1
+ 1 (0 + 1i)
+ 1 (1 + 1i)
+</pre> <h2 id="StringVal">func <span>StringVal</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func StringVal(x Value) string</pre> <p>StringVal returns the Go string value of x, which must be a <a href="#String">String</a> or an <a href="#Unknown">Unknown</a>. If x is <a href="#Unknown">Unknown</a>, the result is "". </p>
+<h2 id="Uint64Val">func <span>Uint64Val</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Uint64Val(x Value) (uint64, bool)</pre> <p>Uint64Val returns the Go uint64 value of x and whether the result is exact; x must be an <a href="#Int">Int</a> or an <a href="#Unknown">Unknown</a>. If the result is not exact, its value is undefined. If x is <a href="#Unknown">Unknown</a>, the result is (0, false). </p>
+<h2 id="Val">func <span>Val</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func Val(x Value) any</pre> <p>Val returns the underlying value for a given constant. Since it returns an interface, it is up to the caller to type assert the result to the expected type. The possible dynamic return types are: </p>
+<pre data-language="go">x Kind type of result
+-----------------------------------------
+Bool bool
+String string
+Int int64 or *big.Int
+Float *big.Float or *big.Rat
+everything else nil
+</pre> <h4 id="example_Val"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">maxint := constant.MakeInt64(math.MaxInt64)
+fmt.Printf("%v\n", constant.Val(maxint))
+
+e := constant.MakeFloat64(math.E)
+fmt.Printf("%v\n", constant.Val(e))
+
+b := constant.MakeBool(true)
+fmt.Printf("%v\n", constant.Val(b))
+
+b = constant.Make(false)
+fmt.Printf("%v\n", constant.Val(b))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">
+9223372036854775807
+6121026514868073/2251799813685248
+true
+false
+</pre> <h2 id="Kind">type <span>Kind</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>Kind specifies the kind of value represented by a <a href="#Value">Value</a>. </p>
+<pre data-language="go">type Kind int</pre> <pre data-language="go">const (
+ // unknown values
+ Unknown Kind = iota
+
+ // non-numeric values
+ Bool
+ String
+
+ // numeric values
+ Int
+ Float
+ Complex
+)</pre> <h3 id="Kind.String">func (Kind) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (i Kind) String() string</pre> <h2 id="Value">type <span>Value</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Value represents the value of a Go constant. </p>
+<pre data-language="go">type Value interface {
+ // Kind returns the value kind.
+ Kind() Kind
+
+ // String returns a short, quoted (human-readable) form of the value.
+ // For numeric values, the result may be an approximation;
+ // for String values the result may be a shortened string.
+ // Use ExactString for a string representing a value exactly.
+ String() string
+
+ // ExactString returns an exact, quoted (human-readable) form of the value.
+ // If the Value is of Kind String, use StringVal to obtain the unquoted string.
+ ExactString() string
+ // contains filtered or unexported methods
+}</pre> <h3 id="BinaryOp">func <span>BinaryOp</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func BinaryOp(x_ Value, op token.Token, y_ Value) Value</pre> <p>BinaryOp returns the result of the binary expression x op y. The operation must be defined for the operands. If one of the operands is <a href="#Unknown">Unknown</a>, the result is <a href="#Unknown">Unknown</a>. BinaryOp doesn't handle comparisons or shifts; use <a href="#Compare">Compare</a> or <a href="#Shift">Shift</a> instead. </p>
+<p>To force integer division of <a href="#Int">Int</a> operands, use op == <span>token.QUO_ASSIGN</span> instead of <span>token.QUO</span>; the result is guaranteed to be <a href="#Int">Int</a> in this case. Division by zero leads to a run-time panic. </p> <h4 id="example_BinaryOp"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// 11 / 0.5
+a := constant.MakeUint64(11)
+b := constant.MakeFloat64(0.5)
+c := constant.BinaryOp(a, token.QUO, b)
+fmt.Println(c)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">22
+</pre> <h3 id="Denom">func <span>Denom</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func Denom(x Value) Value</pre> <p>Denom returns the denominator of x; x must be <a href="#Int">Int</a>, <a href="#Float">Float</a>, or <a href="#Unknown">Unknown</a>. If x is <a href="#Unknown">Unknown</a>, or if it is too large or small to represent as a fraction, the result is <a href="#Unknown">Unknown</a>. Otherwise the result is an <a href="#Int">Int</a> &gt;= 1. </p>
+<h3 id="Imag">func <span>Imag</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func Imag(x Value) Value</pre> <p>Imag returns the imaginary part of x, which must be a numeric or unknown value. If x is <a href="#Unknown">Unknown</a>, the result is <a href="#Unknown">Unknown</a>. </p>
+<h3 id="Make">func <span>Make</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func Make(x any) Value</pre> <p>Make returns the <a href="#Value">Value</a> for x. </p>
+<pre data-language="go">type of x result Kind
+----------------------------
+bool Bool
+string String
+int64 Int
+*big.Int Int
+*big.Float Float
+*big.Rat Float
+anything else Unknown
+</pre> <h3 id="MakeBool">func <span>MakeBool</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MakeBool(b bool) Value</pre> <p>MakeBool returns the <a href="#Bool">Bool</a> value for b. </p>
+<h3 id="MakeFloat64">func <span>MakeFloat64</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MakeFloat64(x float64) Value</pre> <p>MakeFloat64 returns the <a href="#Float">Float</a> value for x. If x is -0.0, the result is 0.0. If x is not finite, the result is an <a href="#Unknown">Unknown</a>. </p>
+<h3 id="MakeFromBytes">func <span>MakeFromBytes</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MakeFromBytes(bytes []byte) Value</pre> <p>MakeFromBytes returns the <a href="#Int">Int</a> value given the bytes of its little-endian binary representation. An empty byte slice argument represents 0. </p>
+<h3 id="MakeFromLiteral">func <span>MakeFromLiteral</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MakeFromLiteral(lit string, tok token.Token, zero uint) Value</pre> <p>MakeFromLiteral returns the corresponding integer, floating-point, imaginary, character, or string value for a Go literal string. The tok value must be one of <span>token.INT</span>, <span>token.FLOAT</span>, <span>token.IMAG</span>, <span>token.CHAR</span>, or <span>token.STRING</span>. The final argument must be zero. If the literal string syntax is invalid, the result is an <a href="#Unknown">Unknown</a>. </p>
+<h3 id="MakeImag">func <span>MakeImag</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MakeImag(x Value) Value</pre> <p>MakeImag returns the <a href="#Complex">Complex</a> value x*i; x must be <a href="#Int">Int</a>, <a href="#Float">Float</a>, or <a href="#Unknown">Unknown</a>. If x is <a href="#Unknown">Unknown</a>, the result is <a href="#Unknown">Unknown</a>. </p>
+<h3 id="MakeInt64">func <span>MakeInt64</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MakeInt64(x int64) Value</pre> <p>MakeInt64 returns the <a href="#Int">Int</a> value for x. </p>
+<h3 id="MakeString">func <span>MakeString</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MakeString(s string) Value</pre> <p>MakeString returns the <a href="#String">String</a> value for s. </p>
+<h3 id="MakeUint64">func <span>MakeUint64</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MakeUint64(x uint64) Value</pre> <p>MakeUint64 returns the <a href="#Int">Int</a> value for x. </p>
+<h3 id="MakeUnknown">func <span>MakeUnknown</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MakeUnknown() Value</pre> <p>MakeUnknown returns the <a href="#Unknown">Unknown</a> value. </p>
+<h3 id="Num">func <span>Num</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func Num(x Value) Value</pre> <p>Num returns the numerator of x; x must be <a href="#Int">Int</a>, <a href="#Float">Float</a>, or <a href="#Unknown">Unknown</a>. If x is <a href="#Unknown">Unknown</a>, or if it is too large or small to represent as a fraction, the result is <a href="#Unknown">Unknown</a>. Otherwise the result is an <a href="#Int">Int</a> with the same sign as x. </p>
+<h3 id="Real">func <span>Real</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func Real(x Value) Value</pre> <p>Real returns the real part of x, which must be a numeric or unknown value. If x is <a href="#Unknown">Unknown</a>, the result is <a href="#Unknown">Unknown</a>. </p>
+<h3 id="Shift">func <span>Shift</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func Shift(x Value, op token.Token, s uint) Value</pre> <p>Shift returns the result of the shift expression x op s with op == <span>token.SHL</span> or <span>token.SHR</span> (&lt;&lt; or &gt;&gt;). x must be an <a href="#Int">Int</a> or an <a href="#Unknown">Unknown</a>. If x is <a href="#Unknown">Unknown</a>, the result is x. </p>
+<h3 id="ToComplex">func <span>ToComplex</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func ToComplex(x Value) Value</pre> <p>ToComplex converts x to a <a href="#Complex">Complex</a> value if x is representable as a <a href="#Complex">Complex</a>. Otherwise it returns an <a href="#Unknown">Unknown</a>. </p>
+<h3 id="ToFloat">func <span>ToFloat</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func ToFloat(x Value) Value</pre> <p>ToFloat converts x to a <a href="#Float">Float</a> value if x is representable as a <a href="#Float">Float</a>. Otherwise it returns an <a href="#Unknown">Unknown</a>. </p>
+<h3 id="ToInt">func <span>ToInt</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func ToInt(x Value) Value</pre> <p>ToInt converts x to an <a href="#Int">Int</a> value if x is representable as an <a href="#Int">Int</a>. Otherwise it returns an <a href="#Unknown">Unknown</a>. </p>
+<h3 id="UnaryOp">func <span>UnaryOp</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func UnaryOp(op token.Token, y Value, prec uint) Value</pre> <p>UnaryOp returns the result of the unary expression op y. The operation must be defined for the operand. If prec &gt; 0 it specifies the ^ (xor) result size in bits. If y is <a href="#Unknown">Unknown</a>, the result is <a href="#Unknown">Unknown</a>. </p> <h4 id="example_UnaryOp"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">vs := []constant.Value{
+ constant.MakeBool(true),
+ constant.MakeFloat64(2.7),
+ constant.MakeUint64(42),
+}
+
+for i, v := range vs {
+ switch v.Kind() {
+ case constant.Bool:
+ vs[i] = constant.UnaryOp(token.NOT, v, 0)
+
+ case constant.Float:
+ vs[i] = constant.UnaryOp(token.SUB, v, 0)
+
+ case constant.Int:
+ // Use 16-bit precision.
+ // This would be equivalent to ^uint16(v).
+ vs[i] = constant.UnaryOp(token.XOR, v, 16)
+ }
+}
+
+for _, v := range vs {
+ fmt.Println(v)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">
+false
+-2.7
+65493
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/constant/" class="_attribution-link">http://golang.org/pkg/go/constant/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fdoc%2Fcomment%2Findex.html b/devdocs/go/go%2Fdoc%2Fcomment%2Findex.html
new file mode 100644
index 00000000..00978525
--- /dev/null
+++ b/devdocs/go/go%2Fdoc%2Fcomment%2Findex.html
@@ -0,0 +1,256 @@
+<h1> Package comment </h1> <ul id="short-nav">
+<li><code>import "go/doc/comment"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package comment implements parsing and reformatting of Go doc comments, (documentation comments), which are comments that immediately precede a top-level declaration of a package, const, func, type, or var. </p>
+<p>Go doc comment syntax is a simplified subset of Markdown that supports links, headings, paragraphs, lists (without nesting), and preformatted text blocks. The details of the syntax are documented at <a href="https://go.dev/doc/comment">https://go.dev/doc/comment</a>. </p>
+<p>To parse the text associated with a doc comment (after removing comment markers), use a <a href="#Parser">Parser</a>: </p>
+<pre data-language="go">var p comment.Parser
+doc := p.Parse(text)
+</pre> <p>The result is a <a href="#Doc">*Doc</a>. To reformat it as a doc comment, HTML, Markdown, or plain text, use a <a href="#Printer">Printer</a>: </p>
+<pre data-language="go">var pr comment.Printer
+os.Stdout.Write(pr.Text(doc))
+</pre> <p>The <a href="#Parser">Parser</a> and <a href="#Printer">Printer</a> types are structs whose fields can be modified to customize the operations. For details, see the documentation for those types. </p>
+<p>Use cases that need additional control over reformatting can implement their own logic by inspecting the parsed syntax itself. See the documentation for <a href="#Doc">Doc</a>, <a href="#Block">Block</a>, <a href="#Text">Text</a> for an overview and links to additional types. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#DefaultLookupPackage">func DefaultLookupPackage(name string) (importPath string, ok bool)</a></li>
+<li><a href="#Block">type Block</a></li>
+<li><a href="#Code">type Code</a></li>
+<li><a href="#Doc">type Doc</a></li>
+<li><a href="#DocLink">type DocLink</a></li>
+<li> <a href="#DocLink.DefaultURL">func (l *DocLink) DefaultURL(baseURL string) string</a>
+</li>
+<li><a href="#Heading">type Heading</a></li>
+<li> <a href="#Heading.DefaultID">func (h *Heading) DefaultID() string</a>
+</li>
+<li><a href="#Italic">type Italic</a></li>
+<li><a href="#Link">type Link</a></li>
+<li><a href="#LinkDef">type LinkDef</a></li>
+<li><a href="#List">type List</a></li>
+<li> <a href="#List.BlankBefore">func (l *List) BlankBefore() bool</a>
+</li>
+<li> <a href="#List.BlankBetween">func (l *List) BlankBetween() bool</a>
+</li>
+<li><a href="#ListItem">type ListItem</a></li>
+<li><a href="#Paragraph">type Paragraph</a></li>
+<li><a href="#Parser">type Parser</a></li>
+<li> <a href="#Parser.Parse">func (p *Parser) Parse(text string) *Doc</a>
+</li>
+<li><a href="#Plain">type Plain</a></li>
+<li><a href="#Printer">type Printer</a></li>
+<li> <a href="#Printer.Comment">func (p *Printer) Comment(d *Doc) []byte</a>
+</li>
+<li> <a href="#Printer.HTML">func (p *Printer) HTML(d *Doc) []byte</a>
+</li>
+<li> <a href="#Printer.Markdown">func (p *Printer) Markdown(d *Doc) []byte</a>
+</li>
+<li> <a href="#Printer.Text">func (p *Printer) Text(d *Doc) []byte</a>
+</li>
+<li><a href="#Text">type Text</a></li>
+</ul> <h3>Package files</h3> <p> <span>doc.go</span> <span>html.go</span> <span>markdown.go</span> <span>parse.go</span> <span>print.go</span> <span>std.go</span> <span>text.go</span> </p> <h2 id="DefaultLookupPackage">func <span>DefaultLookupPackage</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func DefaultLookupPackage(name string) (importPath string, ok bool)</pre> <p>DefaultLookupPackage is the default package lookup function, used when [Parser.LookupPackage] is nil. It recognizes names of the packages from the standard library with single-element import paths, such as math, which would otherwise be impossible to name. </p>
+<p>Note that the go/doc package provides a more sophisticated lookup based on the imports used in the current package. </p>
+<h2 id="Block">type <span>Block</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Block is block-level content in a doc comment, one of <a href="#Code">*Code</a>, <a href="#Heading">*Heading</a>, <a href="#List">*List</a>, or <a href="#Paragraph">*Paragraph</a>. </p>
+<pre data-language="go">type Block interface {
+ // contains filtered or unexported methods
+}</pre> <h2 id="Code">type <span>Code</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Code is a preformatted code block. </p>
+<pre data-language="go">type Code struct {
+ // Text is the preformatted text, ending with a newline character.
+ // It may be multiple lines, each of which ends with a newline character.
+ // It is never empty, nor does it start or end with a blank line.
+ Text string
+}
+</pre> <h2 id="Doc">type <span>Doc</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Doc is a parsed Go doc comment. </p>
+<pre data-language="go">type Doc struct {
+ // Content is the sequence of content blocks in the comment.
+ Content []Block
+
+ // Links is the link definitions in the comment.
+ Links []*LinkDef
+}
+</pre> <h2 id="DocLink">type <span>DocLink</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A DocLink is a link to documentation for a Go package or symbol. </p>
+<pre data-language="go">type DocLink struct {
+ Text []Text // text of link
+
+ // ImportPath, Recv, and Name identify the Go package or symbol
+ // that is the link target. The potential combinations of
+ // non-empty fields are:
+ // - ImportPath: a link to another package
+ // - ImportPath, Name: a link to a const, func, type, or var in another package
+ // - ImportPath, Recv, Name: a link to a method in another package
+ // - Name: a link to a const, func, type, or var in this package
+ // - Recv, Name: a link to a method in this package
+ ImportPath string // import path
+ Recv string // receiver type, without any pointer star, for methods
+ Name string // const, func, type, var, or method name
+}
+</pre> <h3 id="DocLink.DefaultURL">func (*DocLink) <span>DefaultURL</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (l *DocLink) DefaultURL(baseURL string) string</pre> <p>DefaultURL constructs and returns the documentation URL for l, using baseURL as a prefix for links to other packages. </p>
+<p>The possible forms returned by DefaultURL are: </p>
+<ul> <li>baseURL/ImportPath, for a link to another package </li>
+<li>baseURL/ImportPath#Name, for a link to a const, func, type, or var in another package </li>
+<li>baseURL/ImportPath#Recv.Name, for a link to a method in another package </li>
+<li>#Name, for a link to a const, func, type, or var in this package </li>
+<li>#Recv.Name, for a link to a method in this package </li>
+</ul> <p>If baseURL ends in a trailing slash, then DefaultURL inserts a slash between ImportPath and # in the anchored forms. For example, here are some baseURL values and URLs they can generate: </p>
+<pre data-language="go">"/pkg/" → "/pkg/math/#Sqrt"
+"/pkg" → "/pkg/math#Sqrt"
+"/" → "/math/#Sqrt"
+"" → "/math#Sqrt"
+</pre> <h2 id="Heading">type <span>Heading</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Heading is a doc comment heading. </p>
+<pre data-language="go">type Heading struct {
+ Text []Text // the heading text
+}
+</pre> <h3 id="Heading.DefaultID">func (*Heading) <span>DefaultID</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (h *Heading) DefaultID() string</pre> <p>DefaultID returns the default anchor ID for the heading h. </p>
+<p>The default anchor ID is constructed by converting every rune that is not alphanumeric ASCII to an underscore and then adding the prefix “hdr-”. For example, if the heading text is “Go Doc Comments”, the default ID is “hdr-Go_Doc_Comments”. </p>
+<h2 id="Italic">type <span>Italic</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>An Italic is a string rendered as italicized text. </p>
+<pre data-language="go">type Italic string</pre> <h2 id="Link">type <span>Link</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Link is a link to a specific URL. </p>
+<pre data-language="go">type Link struct {
+ Auto bool // is this an automatic (implicit) link of a literal URL?
+ Text []Text // text of link
+ URL string // target URL of link
+}
+</pre> <h2 id="LinkDef">type <span>LinkDef</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A LinkDef is a single link definition. </p>
+<pre data-language="go">type LinkDef struct {
+ Text string // the link text
+ URL string // the link URL
+ Used bool // whether the comment uses the definition
+}
+</pre> <h2 id="List">type <span>List</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A List is a numbered or bullet list. Lists are always non-empty: len(Items) &gt; 0. In a numbered list, every Items[i].Number is a non-empty string. In a bullet list, every Items[i].Number is an empty string. </p>
+<pre data-language="go">type List struct {
+ // Items is the list items.
+ Items []*ListItem
+
+ // ForceBlankBefore indicates that the list must be
+ // preceded by a blank line when reformatting the comment,
+ // overriding the usual conditions. See the BlankBefore method.
+ //
+ // The comment parser sets ForceBlankBefore for any list
+ // that is preceded by a blank line, to make sure
+ // the blank line is preserved when printing.
+ ForceBlankBefore bool
+
+ // ForceBlankBetween indicates that list items must be
+ // separated by blank lines when reformatting the comment,
+ // overriding the usual conditions. See the BlankBetween method.
+ //
+ // The comment parser sets ForceBlankBetween for any list
+ // that has a blank line between any two of its items, to make sure
+ // the blank lines are preserved when printing.
+ ForceBlankBetween bool
+}
+</pre> <h3 id="List.BlankBefore">func (*List) <span>BlankBefore</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (l *List) BlankBefore() bool</pre> <p>BlankBefore reports whether a reformatting of the comment should include a blank line before the list. The default rule is the same as for [BlankBetween]: if the list item content contains any blank lines (meaning at least one item has multiple paragraphs) then the list itself must be preceded by a blank line. A preceding blank line can be forced by setting <a href="#List">List</a>.ForceBlankBefore. </p>
+<h3 id="List.BlankBetween">func (*List) <span>BlankBetween</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (l *List) BlankBetween() bool</pre> <p>BlankBetween reports whether a reformatting of the comment should include a blank line between each pair of list items. The default rule is that if the list item content contains any blank lines (meaning at least one item has multiple paragraphs) then list items must themselves be separated by blank lines. Blank line separators can be forced by setting <a href="#List">List</a>.ForceBlankBetween. </p>
+<h2 id="ListItem">type <span>ListItem</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A ListItem is a single item in a numbered or bullet list. </p>
+<pre data-language="go">type ListItem struct {
+ // Number is a decimal string in a numbered list
+ // or an empty string in a bullet list.
+ Number string // "1", "2", ...; "" for bullet list
+
+ // Content is the list content.
+ // Currently, restrictions in the parser and printer
+ // require every element of Content to be a *Paragraph.
+ Content []Block // Content of this item.
+}
+</pre> <h2 id="Paragraph">type <span>Paragraph</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Paragraph is a paragraph of text. </p>
+<pre data-language="go">type Paragraph struct {
+ Text []Text
+}
+</pre> <h2 id="Parser">type <span>Parser</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Parser is a doc comment parser. The fields in the struct can be filled in before calling <a href="#Parser.Parse">Parser.Parse</a> in order to customize the details of the parsing process. </p>
+<pre data-language="go">type Parser struct {
+ // Words is a map of Go identifier words that
+ // should be italicized and potentially linked.
+ // If Words[w] is the empty string, then the word w
+ // is only italicized. Otherwise it is linked, using
+ // Words[w] as the link target.
+ // Words corresponds to the [go/doc.ToHTML] words parameter.
+ Words map[string]string
+
+ // LookupPackage resolves a package name to an import path.
+ //
+ // If LookupPackage(name) returns ok == true, then [name]
+ // (or [name.Sym] or [name.Sym.Method])
+ // is considered a documentation link to importPath's package docs.
+ // It is valid to return "", true, in which case name is considered
+ // to refer to the current package.
+ //
+ // If LookupPackage(name) returns ok == false,
+ // then [name] (or [name.Sym] or [name.Sym.Method])
+ // will not be considered a documentation link,
+ // except in the case where name is the full (but single-element) import path
+ // of a package in the standard library, such as in [math] or [io.Reader].
+ // LookupPackage is still called for such names,
+ // in order to permit references to imports of other packages
+ // with the same package names.
+ //
+ // Setting LookupPackage to nil is equivalent to setting it to
+ // a function that always returns "", false.
+ LookupPackage func(name string) (importPath string, ok bool)
+
+ // LookupSym reports whether a symbol name or method name
+ // exists in the current package.
+ //
+ // If LookupSym("", "Name") returns true, then [Name]
+ // is considered a documentation link for a const, func, type, or var.
+ //
+ // Similarly, if LookupSym("Recv", "Name") returns true,
+ // then [Recv.Name] is considered a documentation link for
+ // type Recv's method Name.
+ //
+ // Setting LookupSym to nil is equivalent to setting it to a function
+ // that always returns false.
+ LookupSym func(recv, name string) (ok bool)
+}
+</pre> <h3 id="Parser.Parse">func (*Parser) <span>Parse</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Parser) Parse(text string) *Doc</pre> <p>Parse parses the doc comment text and returns the *<a href="#Doc">Doc</a> form. Comment markers (/* // and */) in the text must have already been removed. </p>
+<h2 id="Plain">type <span>Plain</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Plain is a string rendered as plain text (not italicized). </p>
+<pre data-language="go">type Plain string</pre> <h2 id="Printer">type <span>Printer</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Printer is a doc comment printer. The fields in the struct can be filled in before calling any of the printing methods in order to customize the details of the printing process. </p>
+<pre data-language="go">type Printer struct {
+ // HeadingLevel is the nesting level used for
+ // HTML and Markdown headings.
+ // If HeadingLevel is zero, it defaults to level 3,
+ // meaning to use &lt;h3&gt; and ###.
+ HeadingLevel int
+
+ // HeadingID is a function that computes the heading ID
+ // (anchor tag) to use for the heading h when generating
+ // HTML and Markdown. If HeadingID returns an empty string,
+ // then the heading ID is omitted.
+ // If HeadingID is nil, h.DefaultID is used.
+ HeadingID func(h *Heading) string
+
+ // DocLinkURL is a function that computes the URL for the given DocLink.
+ // If DocLinkURL is nil, then link.DefaultURL(p.DocLinkBaseURL) is used.
+ DocLinkURL func(link *DocLink) string
+
+ // DocLinkBaseURL is used when DocLinkURL is nil,
+ // passed to [DocLink.DefaultURL] to construct a DocLink's URL.
+ // See that method's documentation for details.
+ DocLinkBaseURL string
+
+ // TextPrefix is a prefix to print at the start of every line
+ // when generating text output using the Text method.
+ TextPrefix string
+
+ // TextCodePrefix is the prefix to print at the start of each
+ // preformatted (code block) line when generating text output,
+ // instead of (not in addition to) TextPrefix.
+ // If TextCodePrefix is the empty string, it defaults to TextPrefix+"\t".
+ TextCodePrefix string
+
+ // TextWidth is the maximum width text line to generate,
+ // measured in Unicode code points,
+ // excluding TextPrefix and the newline character.
+ // If TextWidth is zero, it defaults to 80 minus the number of code points in TextPrefix.
+ // If TextWidth is negative, there is no limit.
+ TextWidth int
+}
+</pre> <h3 id="Printer.Comment">func (*Printer) <span>Comment</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Printer) Comment(d *Doc) []byte</pre> <p>Comment returns the standard Go formatting of the <a href="#Doc">Doc</a>, without any comment markers. </p>
+<h3 id="Printer.HTML">func (*Printer) <span>HTML</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Printer) HTML(d *Doc) []byte</pre> <p>HTML returns an HTML formatting of the <a href="#Doc">Doc</a>. See the <a href="#Printer">Printer</a> documentation for ways to customize the HTML output. </p>
+<h3 id="Printer.Markdown">func (*Printer) <span>Markdown</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Printer) Markdown(d *Doc) []byte</pre> <p>Markdown returns a Markdown formatting of the Doc. See the <a href="#Printer">Printer</a> documentation for ways to customize the Markdown output. </p>
+<h3 id="Printer.Text">func (*Printer) <span>Text</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Printer) Text(d *Doc) []byte</pre> <p>Text returns a textual formatting of the <a href="#Doc">Doc</a>. See the <a href="#Printer">Printer</a> documentation for ways to customize the text output. </p>
+<h2 id="Text">type <span>Text</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Text is text-level content in a doc comment, one of <a href="#Plain">Plain</a>, <a href="#Italic">Italic</a>, <a href="#Link">*Link</a>, or <a href="#DocLink">*DocLink</a>. </p>
+<pre data-language="go">type Text interface {
+ // contains filtered or unexported methods
+}</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/doc/comment/" class="_attribution-link">http://golang.org/pkg/go/doc/comment/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fdoc%2Findex.html b/devdocs/go/go%2Fdoc%2Findex.html
new file mode 100644
index 00000000..1402067d
--- /dev/null
+++ b/devdocs/go/go%2Fdoc%2Findex.html
@@ -0,0 +1,237 @@
+<h1> Package doc </h1> <ul id="short-nav">
+<li><code>import "go/doc"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package doc extracts source code documentation from a Go AST. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#IsPredeclared">func IsPredeclared(s string) bool</a></li>
+<li><a href="#Synopsis">func Synopsis(text string) string</a></li>
+<li><a href="#ToHTML">func ToHTML(w io.Writer, text string, words map[string]string)</a></li>
+<li><a href="#ToText">func ToText(w io.Writer, text string, prefix, codePrefix string, width int)</a></li>
+<li><a href="#Example">type Example</a></li>
+<li> <a href="#Examples">func Examples(testFiles ...*ast.File) []*Example</a>
+</li>
+<li><a href="#Filter">type Filter</a></li>
+<li><a href="#Func">type Func</a></li>
+<li><a href="#Mode">type Mode</a></li>
+<li><a href="#Note">type Note</a></li>
+<li><a href="#Package">type Package</a></li>
+<li> <a href="#New">func New(pkg *ast.Package, importPath string, mode Mode) *Package</a>
+</li>
+<li> <a href="#NewFromFiles">func NewFromFiles(fset *token.FileSet, files []*ast.File, importPath string, opts ...any) (*Package, error)</a>
+</li>
+<li> <a href="#Package.Filter">func (p *Package) Filter(f Filter)</a>
+</li>
+<li> <a href="#Package.HTML">func (p *Package) HTML(text string) []byte</a>
+</li>
+<li> <a href="#Package.Markdown">func (p *Package) Markdown(text string) []byte</a>
+</li>
+<li> <a href="#Package.Parser">func (p *Package) Parser() *comment.Parser</a>
+</li>
+<li> <a href="#Package.Printer">func (p *Package) Printer() *comment.Printer</a>
+</li>
+<li> <a href="#Package.Synopsis">func (p *Package) Synopsis(text string) string</a>
+</li>
+<li> <a href="#Package.Text">func (p *Package) Text(text string) []byte</a>
+</li>
+<li><a href="#Type">type Type</a></li>
+<li><a href="#Value">type Value</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_NewFromFiles">NewFromFiles</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>comment.go</span> <span>doc.go</span> <span>example.go</span> <span>exports.go</span> <span>filter.go</span> <span>reader.go</span> <span>synopsis.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>IllegalPrefixes is a list of lower-case prefixes that identify a comment as not being a doc comment. This helps to avoid misinterpreting the common mistake of a copyright notice immediately before a package statement as being a doc comment. </p>
+<pre data-language="go">var IllegalPrefixes = []string{
+ "copyright",
+ "all rights",
+ "author",
+}</pre> <h2 id="IsPredeclared">func <span>IsPredeclared</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func IsPredeclared(s string) bool</pre> <p>IsPredeclared reports whether s is a predeclared identifier. </p>
+<h2 id="Synopsis">func <span>Synopsis</span> </h2> <pre data-language="go">func Synopsis(text string) string</pre> <p>Synopsis returns a cleaned version of the first sentence in text. </p>
+<p>Deprecated: New programs should use <a href="#Package.Synopsis">Package.Synopsis</a> instead, which handles links in text properly. </p>
+<h2 id="ToHTML">func <span>ToHTML</span> </h2> <pre data-language="go">func ToHTML(w io.Writer, text string, words map[string]string)</pre> <p>ToHTML converts comment text to formatted HTML. </p>
+<p>Deprecated: ToHTML cannot identify documentation links in the doc comment, because they depend on knowing what package the text came from, which is not included in this API. </p>
+<p>Given the *<a href="#Package">doc.Package</a> p where text was found, ToHTML(w, text, nil) can be replaced by: </p>
+<pre data-language="go">w.Write(p.HTML(text))
+</pre> <p>which is in turn shorthand for: </p>
+<pre data-language="go">w.Write(p.Printer().HTML(p.Parser().Parse(text)))
+</pre> <p>If words may be non-nil, the longer replacement is: </p>
+<pre data-language="go">parser := p.Parser()
+parser.Words = words
+w.Write(p.Printer().HTML(parser.Parse(d)))
+</pre> <h2 id="ToText">func <span>ToText</span> </h2> <pre data-language="go">func ToText(w io.Writer, text string, prefix, codePrefix string, width int)</pre> <p>ToText converts comment text to formatted text. </p>
+<p>Deprecated: ToText cannot identify documentation links in the doc comment, because they depend on knowing what package the text came from, which is not included in this API. </p>
+<p>Given the *<a href="#Package">doc.Package</a> p where text was found, ToText(w, text, "", "\t", 80) can be replaced by: </p>
+<pre data-language="go">w.Write(p.Text(text))
+</pre> <p>In the general case, ToText(w, text, prefix, codePrefix, width) can be replaced by: </p>
+<pre data-language="go">d := p.Parser().Parse(text)
+pr := p.Printer()
+pr.TextPrefix = prefix
+pr.TextCodePrefix = codePrefix
+pr.TextWidth = width
+w.Write(pr.Text(d))
+</pre> <p>See the documentation for <a href="#Package.Text">Package.Text</a> and <span>comment.Printer.Text</span> for more details. </p>
+<h2 id="Example">type <span>Example</span> </h2> <p>An Example represents an example function found in a test source file. </p>
+<pre data-language="go">type Example struct {
+ Name string // name of the item being exemplified (including optional suffix)
+ Suffix string // example suffix, without leading '_' (only populated by NewFromFiles); added in Go 1.14
+ Doc string // example function doc string
+ Code ast.Node
+ Play *ast.File // a whole program version of the example; added in Go 1.1
+ Comments []*ast.CommentGroup
+ Output string // expected output
+ Unordered bool // Go 1.7
+ EmptyOutput bool // expect empty output; added in Go 1.1
+ Order int // original source code order; added in Go 1.1
+}
+</pre> <h3 id="Examples">func <span>Examples</span> </h3> <pre data-language="go">func Examples(testFiles ...*ast.File) []*Example</pre> <p>Examples returns the examples found in testFiles, sorted by Name field. The Order fields record the order in which the examples were encountered. The Suffix field is not populated when Examples is called directly, it is only populated by <a href="#NewFromFiles">NewFromFiles</a> for examples it finds in _test.go files. </p>
+<p>Playable Examples must be in a package whose name ends in "_test". An Example is "playable" (the Play field is non-nil) in either of these circumstances: </p>
+<ul> <li>The example function is self-contained: the function references only identifiers from other packages (or predeclared identifiers, such as "int") and the test file does not include a dot import. </li>
+<li>The entire test file is the example: the file contains exactly one example function, zero test, fuzz test, or benchmark function, and at least one top-level function, type, variable, or constant declaration other than the example function. </li>
+</ul> <h2 id="Filter">type <span>Filter</span> </h2> <pre data-language="go">type Filter func(string) bool</pre> <h2 id="Func">type <span>Func</span> </h2> <p>Func is the documentation for a func declaration. </p>
+<pre data-language="go">type Func struct {
+ Doc string
+ Name string
+ Decl *ast.FuncDecl
+
+ // methods
+ // (for functions, these fields have the respective zero value)
+ Recv string // actual receiver "T" or "*T" possibly followed by type parameters [P1, ..., Pn]
+ Orig string // original receiver "T" or "*T"
+ Level int // embedding level; 0 means not embedded
+
+ // Examples is a sorted list of examples associated with this
+ // function or method. Examples are extracted from _test.go files
+ // provided to NewFromFiles.
+ Examples []*Example // Go 1.14
+}
+</pre> <h2 id="Mode">type <span>Mode</span> </h2> <p>Mode values control the operation of <a href="#New">New</a> and <a href="#NewFromFiles">NewFromFiles</a>. </p>
+<pre data-language="go">type Mode int</pre> <pre data-language="go">const (
+ // AllDecls says to extract documentation for all package-level
+ // declarations, not just exported ones.
+ AllDecls Mode = 1 &lt;&lt; iota
+
+ // AllMethods says to show all embedded methods, not just the ones of
+ // invisible (unexported) anonymous fields.
+ AllMethods
+
+ // PreserveAST says to leave the AST unmodified. Originally, pieces of
+ // the AST such as function bodies were nil-ed out to save memory in
+ // godoc, but not all programs want that behavior.
+ PreserveAST
+)</pre> <h2 id="Note">type <span>Note</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>A Note represents a marked comment starting with "MARKER(uid): note body". Any note with a marker of 2 or more upper case [A-Z] letters and a uid of at least one character is recognized. The ":" following the uid is optional. Notes are collected in the Package.Notes map indexed by the notes marker. </p>
+<pre data-language="go">type Note struct {
+ Pos, End token.Pos // position range of the comment containing the marker
+ UID string // uid found with the marker
+ Body string // note body text
+}
+</pre> <h2 id="Package">type <span>Package</span> </h2> <p>Package is the documentation for an entire package. </p>
+<pre data-language="go">type Package struct {
+ Doc string
+ Name string
+ ImportPath string
+ Imports []string
+ Filenames []string
+ Notes map[string][]*Note // Go 1.1
+
+ // Deprecated: For backward compatibility Bugs is still populated,
+ // but all new code should use Notes instead.
+ Bugs []string
+
+ // declarations
+ Consts []*Value
+ Types []*Type
+ Vars []*Value
+ Funcs []*Func
+
+ // Examples is a sorted list of examples associated with
+ // the package. Examples are extracted from _test.go files
+ // provided to NewFromFiles.
+ Examples []*Example // Go 1.14
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(pkg *ast.Package, importPath string, mode Mode) *Package</pre> <p>New computes the package documentation for the given package AST. New takes ownership of the AST pkg and may edit or overwrite it. To have the <a href="#Examples">Examples</a> fields populated, use <a href="#NewFromFiles">NewFromFiles</a> and include the package's _test.go files. </p>
+<h3 id="NewFromFiles">func <span>NewFromFiles</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func NewFromFiles(fset *token.FileSet, files []*ast.File, importPath string, opts ...any) (*Package, error)</pre> <p>NewFromFiles computes documentation for a package. </p>
+<p>The package is specified by a list of *ast.Files and corresponding file set, which must not be nil. NewFromFiles uses all provided files when computing documentation, so it is the caller's responsibility to provide only the files that match the desired build context. "go/build".Context.MatchFile can be used for determining whether a file matches a build context with the desired GOOS and GOARCH values, and other build constraints. The import path of the package is specified by importPath. </p>
+<p>Examples found in _test.go files are associated with the corresponding type, function, method, or the package, based on their name. If the example has a suffix in its name, it is set in the [Example.Suffix] field. <a href="#Examples">Examples</a> with malformed names are skipped. </p>
+<p>Optionally, a single extra argument of type <a href="#Mode">Mode</a> can be provided to control low-level aspects of the documentation extraction behavior. </p>
+<p>NewFromFiles takes ownership of the AST files and may edit them, unless the PreserveAST Mode bit is on. </p> <h4 id="example_NewFromFiles"> <span class="text">Example</span>
+</h4> <p>This example illustrates how to use NewFromFiles to compute package documentation with examples. </p> <p>Code:</p> <pre class="code" data-language="go">// src and test are two source files that make up
+// a package whose documentation will be computed.
+const src = `
+// This is the package comment.
+package p
+
+import "fmt"
+
+// This comment is associated with the Greet function.
+func Greet(who string) {
+ fmt.Printf("Hello, %s!\n", who)
+}
+`
+const test = `
+package p_test
+
+// This comment is associated with the ExampleGreet_world example.
+func ExampleGreet_world() {
+ Greet("world")
+}
+`
+
+// Create the AST by parsing src and test.
+fset := token.NewFileSet()
+files := []*ast.File{
+ mustParse(fset, "src.go", src),
+ mustParse(fset, "src_test.go", test),
+}
+
+// Compute package documentation with examples.
+p, err := doc.NewFromFiles(fset, files, "example.com/p")
+if err != nil {
+ panic(err)
+}
+
+fmt.Printf("package %s - %s", p.Name, p.Doc)
+fmt.Printf("func %s - %s", p.Funcs[0].Name, p.Funcs[0].Doc)
+fmt.Printf(" ⤷ example with suffix %q - %s", p.Funcs[0].Examples[0].Suffix, p.Funcs[0].Examples[0].Doc)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">package p - This is the package comment.
+func Greet - This comment is associated with the Greet function.
+ ⤷ example with suffix "world" - This comment is associated with the ExampleGreet_world example.
+</pre> <h3 id="Package.Filter">func (*Package) <span>Filter</span> </h3> <pre data-language="go">func (p *Package) Filter(f Filter)</pre> <p>Filter eliminates documentation for names that don't pass through the filter f. TODO(gri): Recognize "Type.Method" as a name. </p>
+<h3 id="Package.HTML">func (*Package) <span>HTML</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Package) HTML(text string) []byte</pre> <p>HTML returns formatted HTML for the doc comment text. </p>
+<p>To customize details of the HTML, use <a href="#Package.Printer">Package.Printer</a> to obtain a <span>comment.Printer</span>, and configure it before calling its HTML method. </p>
+<h3 id="Package.Markdown">func (*Package) <span>Markdown</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Package) Markdown(text string) []byte</pre> <p>Markdown returns formatted Markdown for the doc comment text. </p>
+<p>To customize details of the Markdown, use <a href="#Package.Printer">Package.Printer</a> to obtain a <span>comment.Printer</span>, and configure it before calling its Markdown method. </p>
+<h3 id="Package.Parser">func (*Package) <span>Parser</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Package) Parser() *comment.Parser</pre> <p>Parser returns a doc comment parser configured for parsing doc comments from package p. Each call returns a new parser, so that the caller may customize it before use. </p>
+<h3 id="Package.Printer">func (*Package) <span>Printer</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Package) Printer() *comment.Printer</pre> <p>Printer returns a doc comment printer configured for printing doc comments from package p. Each call returns a new printer, so that the caller may customize it before use. </p>
+<h3 id="Package.Synopsis">func (*Package) <span>Synopsis</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Package) Synopsis(text string) string</pre> <p>Synopsis returns a cleaned version of the first sentence in text. That sentence ends after the first period followed by space and not preceded by exactly one uppercase letter, or at the first paragraph break. The result string has no \n, \r, or \t characters and uses only single spaces between words. If text starts with any of the <a href="#IllegalPrefixes">IllegalPrefixes</a>, the result is the empty string. </p>
+<h3 id="Package.Text">func (*Package) <span>Text</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (p *Package) Text(text string) []byte</pre> <p>Text returns formatted text for the doc comment text, wrapped to 80 Unicode code points and using tabs for code block indentation. </p>
+<p>To customize details of the formatting, use <a href="#Package.Printer">Package.Printer</a> to obtain a <span>comment.Printer</span>, and configure it before calling its Text method. </p>
+<h2 id="Type">type <span>Type</span> </h2> <p>Type is the documentation for a type declaration. </p>
+<pre data-language="go">type Type struct {
+ Doc string
+ Name string
+ Decl *ast.GenDecl
+
+ // associated declarations
+ Consts []*Value // sorted list of constants of (mostly) this type
+ Vars []*Value // sorted list of variables of (mostly) this type
+ Funcs []*Func // sorted list of functions returning this type
+ Methods []*Func // sorted list of methods (including embedded ones) of this type
+
+ // Examples is a sorted list of examples associated with
+ // this type. Examples are extracted from _test.go files
+ // provided to NewFromFiles.
+ Examples []*Example // Go 1.14
+}
+</pre> <h2 id="Value">type <span>Value</span> </h2> <p>Value is the documentation for a (possibly grouped) var or const declaration. </p>
+<pre data-language="go">type Value struct {
+ Doc string
+ Names []string // var or const names in declaration order
+ Decl *ast.GenDecl
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="comment/index">comment</a> </td> <td class="pkg-synopsis"> Package comment implements parsing and reformatting of Go doc comments, (documentation comments), which are comments that immediately precede a top-level declaration of a package, const, func, type, or var. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/doc/" class="_attribution-link">http://golang.org/pkg/go/doc/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fformat%2Findex.html b/devdocs/go/go%2Fformat%2Findex.html
new file mode 100644
index 00000000..bda6f84d
--- /dev/null
+++ b/devdocs/go/go%2Fformat%2Findex.html
@@ -0,0 +1,42 @@
+<h1> Package format </h1> <ul id="short-nav">
+<li><code>import "go/format"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package format implements standard formatting of Go source. </p>
+<p>Note that formatting of Go source code changes over time, so tools relying on consistent formatting should execute a specific version of the gofmt binary instead of using this package. That way, the formatting will be stable, and the tools won't need to be recompiled each time gofmt changes. </p>
+<p>For example, pre-submit checks that use this package directly would behave differently depending on what Go version each developer uses, causing the check to be inherently fragile. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Node">func Node(dst io.Writer, fset *token.FileSet, node any) error</a></li>
+<li><a href="#Source">func Source(src []byte) ([]byte, error)</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Node">Node</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>format.go</span> <span>internal.go</span> </p> <h2 id="Node">func <span>Node</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func Node(dst io.Writer, fset *token.FileSet, node any) error</pre> <p>Node formats node in canonical gofmt style and writes the result to dst. </p>
+<p>The node type must be *<span>ast.File</span>, *<span>printer.CommentedNode</span>, []<span>ast.Decl</span>, []<span>ast.Stmt</span>, or assignment-compatible to <span>ast.Expr</span>, <span>ast.Decl</span>, <span>ast.Spec</span>, or <span>ast.Stmt</span>. Node does not modify node. Imports are not sorted for nodes representing partial source files (for instance, if the node is not an *<span>ast.File</span> or a *<span>printer.CommentedNode</span> not wrapping an *<span>ast.File</span>). </p>
+<p>The function may return early (before the entire result is written) and return a formatting error, for instance due to an incorrect AST. </p> <h4 id="example_Node"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const expr = "(6+2*3)/4"
+
+// parser.ParseExpr parses the argument and returns the
+// corresponding ast.Node.
+node, err := parser.ParseExpr(expr)
+if err != nil {
+ log.Fatal(err)
+}
+
+// Create a FileSet for node. Since the node does not come
+// from a real source file, fset will be empty.
+fset := token.NewFileSet()
+
+var buf bytes.Buffer
+err = format.Node(&amp;buf, fset, node)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Println(buf.String())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">(6 + 2*3) / 4
+</pre> <h2 id="Source">func <span>Source</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func Source(src []byte) ([]byte, error)</pre> <p>Source formats src in canonical gofmt style and returns the result or an (I/O or syntax) error. src is expected to be a syntactically correct Go source file, or a list of Go declarations or statements. </p>
+<p>If src is a partial source file, the leading and trailing space of src is applied to the result (such that it has the same leading and trailing space as src), and the result is indented by the same amount as the first line of src containing code. Imports are not sorted for partial source files. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/format/" class="_attribution-link">http://golang.org/pkg/go/format/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fimporter%2Findex.html b/devdocs/go/go%2Fimporter%2Findex.html
new file mode 100644
index 00000000..57e52794
--- /dev/null
+++ b/devdocs/go/go%2Fimporter%2Findex.html
@@ -0,0 +1,22 @@
+<h1> Package importer </h1> <ul id="short-nav">
+<li><code>import "go/importer"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package importer provides access to export data importers. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Default">func Default() types.Importer</a></li>
+<li><a href="#For">func For(compiler string, lookup Lookup) types.Importer</a></li>
+<li><a href="#ForCompiler">func ForCompiler(fset *token.FileSet, compiler string, lookup Lookup) types.Importer</a></li>
+<li><a href="#Lookup">type Lookup</a></li>
+</ul> <h3>Package files</h3> <p> <span>importer.go</span> </p> <h2 id="Default">func <span>Default</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Default() types.Importer</pre> <p>Default returns an Importer for the compiler that built the running binary. If available, the result implements <span>types.ImporterFrom</span>. </p>
+<h2 id="For">func <span>For</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func For(compiler string, lookup Lookup) types.Importer</pre> <p>For calls <a href="#ForCompiler">ForCompiler</a> with a new FileSet. </p>
+<p>Deprecated: Use <a href="#ForCompiler">ForCompiler</a>, which populates a FileSet with the positions of objects created by the importer. </p>
+<h2 id="ForCompiler">func <span>ForCompiler</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func ForCompiler(fset *token.FileSet, compiler string, lookup Lookup) types.Importer</pre> <p>ForCompiler returns an Importer for importing from installed packages for the compilers "gc" and "gccgo", or for importing directly from the source if the compiler argument is "source". In this latter case, importing may fail under circumstances where the exported API is not entirely defined in pure Go source code (if the package API depends on cgo-defined entities, the type checker won't have access to those). </p>
+<p>The lookup function is called each time the resulting importer needs to resolve an import path. In this mode the importer can only be invoked with canonical import paths (not relative or absolute ones); it is assumed that the translation to canonical import paths is being done by the client of the importer. </p>
+<p>A lookup function must be provided for correct module-aware operation. Deprecated: If lookup is nil, for backwards-compatibility, the importer will attempt to resolve imports in the $GOPATH workspace. </p>
+<h2 id="Lookup">type <span>Lookup</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Lookup function returns a reader to access package data for a given import path, or an error if no matching package is found. </p>
+<pre data-language="go">type Lookup func(path string) (io.ReadCloser, error)</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/importer/" class="_attribution-link">http://golang.org/pkg/go/importer/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fparser%2Findex.html b/devdocs/go/go%2Fparser%2Findex.html
new file mode 100644
index 00000000..8a527fed
--- /dev/null
+++ b/devdocs/go/go%2Fparser%2Findex.html
@@ -0,0 +1,68 @@
+<h1> Package parser </h1> <ul id="short-nav">
+<li><code>import "go/parser"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package parser implements a parser for Go source files. Input may be provided in a variety of forms (see the various Parse* functions); the output is an abstract syntax tree (AST) representing the Go source. The parser is invoked through one of the Parse* functions. </p>
+<p>The parser accepts a larger language than is syntactically permitted by the Go spec, for simplicity, and for improved robustness in the presence of syntax errors. For instance, in method declarations, the receiver is treated like an ordinary parameter list and thus may contain multiple entries where the spec permits exactly one. Consequently, the corresponding field in the AST (ast.FuncDecl.Recv) field is not restricted to one entry. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#ParseDir">func ParseDir(fset *token.FileSet, path string, filter func(fs.FileInfo) bool, mode Mode) (pkgs map[string]*ast.Package, first error)</a></li>
+<li><a href="#ParseExpr">func ParseExpr(x string) (ast.Expr, error)</a></li>
+<li><a href="#ParseExprFrom">func ParseExprFrom(fset *token.FileSet, filename string, src any, mode Mode) (expr ast.Expr, err error)</a></li>
+<li><a href="#ParseFile">func ParseFile(fset *token.FileSet, filename string, src any, mode Mode) (f *ast.File, err error)</a></li>
+<li><a href="#Mode">type Mode</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_ParseFile">ParseFile</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>interface.go</span> <span>parser.go</span> <span>resolver.go</span> </p> <h2 id="ParseDir">func <span>ParseDir</span> </h2> <pre data-language="go">func ParseDir(fset *token.FileSet, path string, filter func(fs.FileInfo) bool, mode Mode) (pkgs map[string]*ast.Package, first error)</pre> <p>ParseDir calls <a href="#ParseFile">ParseFile</a> for all files with names ending in ".go" in the directory specified by path and returns a map of package name -&gt; package AST with all the packages found. </p>
+<p>If filter != nil, only the files with <span>fs.FileInfo</span> entries passing through the filter (and ending in ".go") are considered. The mode bits are passed to <a href="#ParseFile">ParseFile</a> unchanged. Position information is recorded in fset, which must not be nil. </p>
+<p>If the directory couldn't be read, a nil map and the respective error are returned. If a parse error occurred, a non-nil but incomplete map and the first error encountered are returned. </p>
+<h2 id="ParseExpr">func <span>ParseExpr</span> </h2> <pre data-language="go">func ParseExpr(x string) (ast.Expr, error)</pre> <p>ParseExpr is a convenience function for obtaining the AST of an expression x. The position information recorded in the AST is undefined. The filename used in error messages is the empty string. </p>
+<p>If syntax errors were found, the result is a partial AST (with <span>ast.Bad</span>* nodes representing the fragments of erroneous source code). Multiple errors are returned via a scanner.ErrorList which is sorted by source position. </p>
+<h2 id="ParseExprFrom">func <span>ParseExprFrom</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func ParseExprFrom(fset *token.FileSet, filename string, src any, mode Mode) (expr ast.Expr, err error)</pre> <p>ParseExprFrom is a convenience function for parsing an expression. The arguments have the same meaning as for <a href="#ParseFile">ParseFile</a>, but the source must be a valid Go (type or value) expression. Specifically, fset must not be nil. </p>
+<p>If the source couldn't be read, the returned AST is nil and the error indicates the specific failure. If the source was read but syntax errors were found, the result is a partial AST (with <span>ast.Bad</span>* nodes representing the fragments of erroneous source code). Multiple errors are returned via a scanner.ErrorList which is sorted by source position. </p>
+<h2 id="ParseFile">func <span>ParseFile</span> </h2> <pre data-language="go">func ParseFile(fset *token.FileSet, filename string, src any, mode Mode) (f *ast.File, err error)</pre> <p>ParseFile parses the source code of a single Go source file and returns the corresponding <span>ast.File</span> node. The source code may be provided via the filename of the source file, or via the src parameter. </p>
+<p>If src != nil, ParseFile parses the source from src and the filename is only used when recording position information. The type of the argument for the src parameter must be string, []byte, or <span>io.Reader</span>. If src == nil, ParseFile parses the file specified by filename. </p>
+<p>The mode parameter controls the amount of source text parsed and other optional parser functionality. If the <a href="#SkipObjectResolution">SkipObjectResolution</a> mode bit is set (recommended), the object resolution phase of parsing will be skipped, causing File.Scope, File.Unresolved, and all Ident.Obj fields to be nil. Those fields are deprecated; see <span>ast.Object</span> for details. </p>
+<p>Position information is recorded in the file set fset, which must not be nil. </p>
+<p>If the source couldn't be read, the returned AST is nil and the error indicates the specific failure. If the source was read but syntax errors were found, the result is a partial AST (with <span>ast.Bad</span>* nodes representing the fragments of erroneous source code). Multiple errors are returned via a scanner.ErrorList which is sorted by source position. </p> <h4 id="example_ParseFile"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fset := token.NewFileSet() // positions are relative to fset
+
+src := `package foo
+
+import (
+ "fmt"
+ "time"
+)
+
+func bar() {
+ fmt.Println(time.Now())
+}`
+
+// Parse src but stop after processing the imports.
+f, err := parser.ParseFile(fset, "", src, parser.ImportsOnly)
+if err != nil {
+ fmt.Println(err)
+ return
+}
+
+// Print the imports from the file's AST.
+for _, s := range f.Imports {
+ fmt.Println(s.Path.Value)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">
+"fmt"
+"time"
+</pre> <h2 id="Mode">type <span>Mode</span> </h2> <p>A Mode value is a set of flags (or 0). They control the amount of source code parsed and other optional parser functionality. </p>
+<pre data-language="go">type Mode uint</pre> <pre data-language="go">const (
+ PackageClauseOnly Mode = 1 &lt;&lt; iota // stop parsing after package clause
+ ImportsOnly // stop parsing after import declarations
+ ParseComments // parse comments and add them to AST
+ Trace // print a trace of parsed productions
+ DeclarationErrors // report declaration errors
+ SpuriousErrors // same as AllErrors, for backward-compatibility
+ SkipObjectResolution // skip deprecated identifier resolution; see ParseFile
+ AllErrors = SpuriousErrors // report all errors (not just the first 10 on different lines)
+)</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/parser/" class="_attribution-link">http://golang.org/pkg/go/parser/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fprinter%2Findex.html b/devdocs/go/go%2Fprinter%2Findex.html
new file mode 100644
index 00000000..b801c989
--- /dev/null
+++ b/devdocs/go/go%2Fprinter%2Findex.html
@@ -0,0 +1,100 @@
+<h1> Package printer </h1> <ul id="short-nav">
+<li><code>import "go/printer"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package printer implements printing of AST nodes. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Fprint">func Fprint(output io.Writer, fset *token.FileSet, node any) error</a></li>
+<li><a href="#CommentedNode">type CommentedNode</a></li>
+<li><a href="#Config">type Config</a></li>
+<li> <a href="#Config.Fprint">func (cfg *Config) Fprint(output io.Writer, fset *token.FileSet, node any) error</a>
+</li>
+<li><a href="#Mode">type Mode</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Fprint">Fprint</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>comment.go</span> <span>gobuild.go</span> <span>nodes.go</span> <span>printer.go</span> </p> <h2 id="Fprint">func <span>Fprint</span> </h2> <pre data-language="go">func Fprint(output io.Writer, fset *token.FileSet, node any) error</pre> <p>Fprint "pretty-prints" an AST node to output. It calls <a href="#Config.Fprint">Config.Fprint</a> with default settings. Note that gofmt uses tabs for indentation but spaces for alignment; use format.Node (package go/format) for output that matches gofmt. </p> <h4 id="example_Fprint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package printer_test
+
+import (
+ "bytes"
+ "fmt"
+ "go/ast"
+ "go/parser"
+ "go/printer"
+ "go/token"
+ "strings"
+)
+
+func parseFunc(filename, functionname string) (fun *ast.FuncDecl, fset *token.FileSet) {
+ fset = token.NewFileSet()
+ if file, err := parser.ParseFile(fset, filename, nil, 0); err == nil {
+ for _, d := range file.Decls {
+ if f, ok := d.(*ast.FuncDecl); ok &amp;&amp; f.Name.Name == functionname {
+ fun = f
+ return
+ }
+ }
+ }
+ panic("function not found")
+}
+
+func printSelf() {
+ // Parse source file and extract the AST without comments for
+ // this function, with position information referring to the
+ // file set fset.
+ funcAST, fset := parseFunc("example_test.go", "printSelf")
+
+ // Print the function body into buffer buf.
+ // The file set is provided to the printer so that it knows
+ // about the original source formatting and can add additional
+ // line breaks where they were present in the source.
+ var buf bytes.Buffer
+ printer.Fprint(&amp;buf, fset, funcAST.Body)
+
+ // Remove braces {} enclosing the function body, unindent,
+ // and trim leading and trailing white space.
+ s := buf.String()
+ s = s[1 : len(s)-1]
+ s = strings.TrimSpace(strings.ReplaceAll(s, "\n\t", "\n"))
+
+ // Print the cleaned-up body text to stdout.
+ fmt.Println(s)
+}
+
+func ExampleFprint() {
+ printSelf()
+
+ // Output:
+ // funcAST, fset := parseFunc("example_test.go", "printSelf")
+ //
+ // var buf bytes.Buffer
+ // printer.Fprint(&amp;buf, fset, funcAST.Body)
+ //
+ // s := buf.String()
+ // s = s[1 : len(s)-1]
+ // s = strings.TrimSpace(strings.ReplaceAll(s, "\n\t", "\n"))
+ //
+ // fmt.Println(s)
+}
+</pre> <h2 id="CommentedNode">type <span>CommentedNode</span> </h2> <p>A CommentedNode bundles an AST node and corresponding comments. It may be provided as argument to any of the <a href="#Fprint">Fprint</a> functions. </p>
+<pre data-language="go">type CommentedNode struct {
+ Node any // *ast.File, or ast.Expr, ast.Decl, ast.Spec, or ast.Stmt
+ Comments []*ast.CommentGroup
+}
+</pre> <h2 id="Config">type <span>Config</span> </h2> <p>A Config node controls the output of Fprint. </p>
+<pre data-language="go">type Config struct {
+ Mode Mode // default: 0
+ Tabwidth int // default: 8
+ Indent int // default: 0 (all code is indented at least by this much); added in Go 1.1
+}
+</pre> <h3 id="Config.Fprint">func (*Config) <span>Fprint</span> </h3> <pre data-language="go">func (cfg *Config) Fprint(output io.Writer, fset *token.FileSet, node any) error</pre> <p>Fprint "pretty-prints" an AST node to output for a given configuration cfg. Position information is interpreted relative to the file set fset. The node type must be *<span>ast.File</span>, *<a href="#CommentedNode">CommentedNode</a>, []<span>ast.Decl</span>, []<span>ast.Stmt</span>, or assignment-compatible to <span>ast.Expr</span>, <span>ast.Decl</span>, <span>ast.Spec</span>, or <span>ast.Stmt</span>. </p>
+<h2 id="Mode">type <span>Mode</span> </h2> <p>A Mode value is a set of flags (or 0). They control printing. </p>
+<pre data-language="go">type Mode uint</pre> <pre data-language="go">const (
+ RawFormat Mode = 1 &lt;&lt; iota // do not use a tabwriter; if set, UseSpaces is ignored
+ TabIndent // use tabs for indentation independent of UseSpaces
+ UseSpaces // use spaces instead of tabs for alignment
+ SourcePos // emit //line directives to preserve original source positions
+)</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/printer/" class="_attribution-link">http://golang.org/pkg/go/printer/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fscanner%2Findex.html b/devdocs/go/go%2Fscanner%2Findex.html
new file mode 100644
index 00000000..1b6566bc
--- /dev/null
+++ b/devdocs/go/go%2Fscanner%2Findex.html
@@ -0,0 +1,111 @@
+<h1> Package scanner </h1> <ul id="short-nav">
+<li><code>import "go/scanner"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package scanner implements a scanner for Go source text. It takes a []byte as source which can then be tokenized through repeated calls to the Scan method. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#PrintError">func PrintError(w io.Writer, err error)</a></li>
+<li><a href="#Error">type Error</a></li>
+<li> <a href="#Error.Error">func (e Error) Error() string</a>
+</li>
+<li><a href="#ErrorHandler">type ErrorHandler</a></li>
+<li><a href="#ErrorList">type ErrorList</a></li>
+<li> <a href="#ErrorList.Add">func (p *ErrorList) Add(pos token.Position, msg string)</a>
+</li>
+<li> <a href="#ErrorList.Err">func (p ErrorList) Err() error</a>
+</li>
+<li> <a href="#ErrorList.Error">func (p ErrorList) Error() string</a>
+</li>
+<li> <a href="#ErrorList.Len">func (p ErrorList) Len() int</a>
+</li>
+<li> <a href="#ErrorList.Less">func (p ErrorList) Less(i, j int) bool</a>
+</li>
+<li> <a href="#ErrorList.RemoveMultiples">func (p *ErrorList) RemoveMultiples()</a>
+</li>
+<li> <a href="#ErrorList.Reset">func (p *ErrorList) Reset()</a>
+</li>
+<li> <a href="#ErrorList.Sort">func (p ErrorList) Sort()</a>
+</li>
+<li> <a href="#ErrorList.Swap">func (p ErrorList) Swap(i, j int)</a>
+</li>
+<li><a href="#Mode">type Mode</a></li>
+<li><a href="#Scanner">type Scanner</a></li>
+<li> <a href="#Scanner.Init">func (s *Scanner) Init(file *token.File, src []byte, err ErrorHandler, mode Mode)</a>
+</li>
+<li> <a href="#Scanner.Scan">func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Scanner_Scan">Scanner.Scan</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>errors.go</span> <span>scanner.go</span> </p> <h2 id="PrintError">func <span>PrintError</span> </h2> <pre data-language="go">func PrintError(w io.Writer, err error)</pre> <p>PrintError is a utility function that prints a list of errors to w, one error per line, if the err parameter is an <a href="#ErrorList">ErrorList</a>. Otherwise it prints the err string. </p>
+<h2 id="Error">type <span>Error</span> </h2> <p>In an <a href="#ErrorList">ErrorList</a>, an error is represented by an *Error. The position Pos, if valid, points to the beginning of the offending token, and the error condition is described by Msg. </p>
+<pre data-language="go">type Error struct {
+ Pos token.Position
+ Msg string
+}
+</pre> <h3 id="Error.Error">func (Error) <span>Error</span> </h3> <pre data-language="go">func (e Error) Error() string</pre> <p>Error implements the error interface. </p>
+<h2 id="ErrorHandler">type <span>ErrorHandler</span> </h2> <p>An ErrorHandler may be provided to <a href="#Scanner.Init">Scanner.Init</a>. If a syntax error is encountered and a handler was installed, the handler is called with a position and an error message. The position points to the beginning of the offending token. </p>
+<pre data-language="go">type ErrorHandler func(pos token.Position, msg string)</pre> <h2 id="ErrorList">type <span>ErrorList</span> </h2> <p>ErrorList is a list of *Errors. The zero value for an ErrorList is an empty ErrorList ready to use. </p>
+<pre data-language="go">type ErrorList []*Error</pre> <h3 id="ErrorList.Add">func (*ErrorList) <span>Add</span> </h3> <pre data-language="go">func (p *ErrorList) Add(pos token.Position, msg string)</pre> <p>Add adds an <a href="#Error">Error</a> with given position and error message to an <a href="#ErrorList">ErrorList</a>. </p>
+<h3 id="ErrorList.Err">func (ErrorList) <span>Err</span> </h3> <pre data-language="go">func (p ErrorList) Err() error</pre> <p>Err returns an error equivalent to this error list. If the list is empty, Err returns nil. </p>
+<h3 id="ErrorList.Error">func (ErrorList) <span>Error</span> </h3> <pre data-language="go">func (p ErrorList) Error() string</pre> <p>An <a href="#ErrorList">ErrorList</a> implements the error interface. </p>
+<h3 id="ErrorList.Len">func (ErrorList) <span>Len</span> </h3> <pre data-language="go">func (p ErrorList) Len() int</pre> <p><a href="#ErrorList">ErrorList</a> implements the sort Interface. </p>
+<h3 id="ErrorList.Less">func (ErrorList) <span>Less</span> </h3> <pre data-language="go">func (p ErrorList) Less(i, j int) bool</pre> <h3 id="ErrorList.RemoveMultiples">func (*ErrorList) <span>RemoveMultiples</span> </h3> <pre data-language="go">func (p *ErrorList) RemoveMultiples()</pre> <p>RemoveMultiples sorts an <a href="#ErrorList">ErrorList</a> and removes all but the first error per line. </p>
+<h3 id="ErrorList.Reset">func (*ErrorList) <span>Reset</span> </h3> <pre data-language="go">func (p *ErrorList) Reset()</pre> <p>Reset resets an <a href="#ErrorList">ErrorList</a> to no errors. </p>
+<h3 id="ErrorList.Sort">func (ErrorList) <span>Sort</span> </h3> <pre data-language="go">func (p ErrorList) Sort()</pre> <p>Sort sorts an <a href="#ErrorList">ErrorList</a>. *<a href="#Error">Error</a> entries are sorted by position, other errors are sorted by error message, and before any *<a href="#Error">Error</a> entry. </p>
+<h3 id="ErrorList.Swap">func (ErrorList) <span>Swap</span> </h3> <pre data-language="go">func (p ErrorList) Swap(i, j int)</pre> <h2 id="Mode">type <span>Mode</span> </h2> <p>A mode value is a set of flags (or 0). They control scanner behavior. </p>
+<pre data-language="go">type Mode uint</pre> <pre data-language="go">const (
+ ScanComments Mode = 1 &lt;&lt; iota // return comments as COMMENT tokens
+
+)</pre> <h2 id="Scanner">type <span>Scanner</span> </h2> <p>A Scanner holds the scanner's internal state while processing a given text. It can be allocated as part of another data structure but must be initialized via <a href="#Scanner.Init">Scanner.Init</a> before use. </p>
+<pre data-language="go">type Scanner struct {
+
+ // public state - ok to modify
+ ErrorCount int // number of errors encountered
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Scanner.Init">func (*Scanner) <span>Init</span> </h3> <pre data-language="go">func (s *Scanner) Init(file *token.File, src []byte, err ErrorHandler, mode Mode)</pre> <p>Init prepares the scanner s to tokenize the text src by setting the scanner at the beginning of src. The scanner uses the file set file for position information and it adds line information for each line. It is ok to re-use the same file when re-scanning the same file as line information which is already present is ignored. Init causes a panic if the file size does not match the src size. </p>
+<p>Calls to <a href="#Scanner.Scan">Scanner.Scan</a> will invoke the error handler err if they encounter a syntax error and err is not nil. Also, for each error encountered, the <a href="#Scanner">Scanner</a> field ErrorCount is incremented by one. The mode parameter determines how comments are handled. </p>
+<p>Note that Init may call err if there is an error in the first character of the file. </p>
+<h3 id="Scanner.Scan">func (*Scanner) <span>Scan</span> </h3> <pre data-language="go">func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string)</pre> <p>Scan scans the next token and returns the token position, the token, and its literal string if applicable. The source end is indicated by <span>token.EOF</span>. </p>
+<p>If the returned token is a literal (<span>token.IDENT</span>, <span>token.INT</span>, <span>token.FLOAT</span>, <span>token.IMAG</span>, <span>token.CHAR</span>, <span>token.STRING</span>) or <span>token.COMMENT</span>, the literal string has the corresponding value. </p>
+<p>If the returned token is a keyword, the literal string is the keyword. </p>
+<p>If the returned token is <span>token.SEMICOLON</span>, the corresponding literal string is ";" if the semicolon was present in the source, and "\n" if the semicolon was inserted because of a newline or at EOF. </p>
+<p>If the returned token is <span>token.ILLEGAL</span>, the literal string is the offending character. </p>
+<p>In all other cases, Scan returns an empty literal string. </p>
+<p>For more tolerant parsing, Scan will return a valid token if possible even if a syntax error was encountered. Thus, even if the resulting token sequence contains no illegal tokens, a client may not assume that no error occurred. Instead it must check the scanner's ErrorCount or the number of calls of the error handler, if there was one installed. </p>
+<p>Scan adds line information to the file added to the file set with Init. Token positions are relative to that file and thus relative to the file set. </p> <h4 id="example_Scanner_Scan"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// src is the input that we want to tokenize.
+src := []byte("cos(x) + 1i*sin(x) // Euler")
+
+// Initialize the scanner.
+var s scanner.Scanner
+fset := token.NewFileSet() // positions are relative to fset
+file := fset.AddFile("", fset.Base(), len(src)) // register input "file"
+s.Init(file, src, nil /* no error handler */, scanner.ScanComments)
+
+// Repeated calls to Scan yield the token sequence found in the input.
+for {
+ pos, tok, lit := s.Scan()
+ if tok == token.EOF {
+ break
+ }
+ fmt.Printf("%s\t%s\t%q\n", fset.Position(pos), tok, lit)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1:1 IDENT "cos"
+1:4 ( ""
+1:5 IDENT "x"
+1:6 ) ""
+1:8 + ""
+1:10 IMAG "1i"
+1:12 * ""
+1:13 IDENT "sin"
+1:16 ( ""
+1:17 IDENT "x"
+1:18 ) ""
+1:20 COMMENT "// Euler"
+1:28 ; "\n"
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/scanner/" class="_attribution-link">http://golang.org/pkg/go/scanner/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Ftoken%2Findex.html b/devdocs/go/go%2Ftoken%2Findex.html
new file mode 100644
index 00000000..0140e91b
--- /dev/null
+++ b/devdocs/go/go%2Ftoken%2Findex.html
@@ -0,0 +1,339 @@
+<h1> Package token </h1> <ul id="short-nav">
+<li><code>import "go/token"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package token defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates). </p> <h4 id="example__retrievePositionInfo"> <span class="text">Example (RetrievePositionInfo)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fset := token.NewFileSet()
+
+const src = `package main
+
+import "fmt"
+
+import "go/token"
+
+
+type p = token.Pos
+
+const bad = token.NoPos
+
+
+func ok(pos p) bool {
+ return pos != bad
+}
+
+/*line :7:9*/func main() {
+ fmt.Println(ok(bad) == bad.IsValid())
+}
+`
+
+f, err := parser.ParseFile(fset, "main.go", src, 0)
+if err != nil {
+ fmt.Println(err)
+ return
+}
+
+// Print the location and kind of each declaration in f.
+for _, decl := range f.Decls {
+ // Get the filename, line, and column back via the file set.
+ // We get both the relative and absolute position.
+ // The relative position is relative to the last line directive.
+ // The absolute position is the exact position in the source.
+ pos := decl.Pos()
+ relPosition := fset.Position(pos)
+ absPosition := fset.PositionFor(pos, false)
+
+ // Either a FuncDecl or GenDecl, since we exit on error.
+ kind := "func"
+ if gen, ok := decl.(*ast.GenDecl); ok {
+ kind = gen.Tok.String()
+ }
+
+ // If the relative and absolute positions differ, show both.
+ fmtPosition := relPosition.String()
+ if relPosition != absPosition {
+ fmtPosition += "[" + absPosition.String() + "]"
+ }
+
+ fmt.Printf("%s: %s\n", fmtPosition, kind)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">
+main.go:3:1: import
+main.go:5:1: import
+main.go:1:5[main.go:8:1]: type
+main.go:3:1[main.go:10:1]: const
+fake.go:42:11[main.go:13:1]: func
+fake.go:7:9[main.go:17:14]: func
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#IsExported">func IsExported(name string) bool</a></li>
+<li><a href="#IsIdentifier">func IsIdentifier(name string) bool</a></li>
+<li><a href="#IsKeyword">func IsKeyword(name string) bool</a></li>
+<li><a href="#File">type File</a></li>
+<li> <a href="#File.AddLine">func (f *File) AddLine(offset int)</a>
+</li>
+<li> <a href="#File.AddLineColumnInfo">func (f *File) AddLineColumnInfo(offset int, filename string, line, column int)</a>
+</li>
+<li> <a href="#File.AddLineInfo">func (f *File) AddLineInfo(offset int, filename string, line int)</a>
+</li>
+<li> <a href="#File.Base">func (f *File) Base() int</a>
+</li>
+<li> <a href="#File.Line">func (f *File) Line(p Pos) int</a>
+</li>
+<li> <a href="#File.LineCount">func (f *File) LineCount() int</a>
+</li>
+<li> <a href="#File.LineStart">func (f *File) LineStart(line int) Pos</a>
+</li>
+<li> <a href="#File.Lines">func (f *File) Lines() []int</a>
+</li>
+<li> <a href="#File.MergeLine">func (f *File) MergeLine(line int)</a>
+</li>
+<li> <a href="#File.Name">func (f *File) Name() string</a>
+</li>
+<li> <a href="#File.Offset">func (f *File) Offset(p Pos) int</a>
+</li>
+<li> <a href="#File.Pos">func (f *File) Pos(offset int) Pos</a>
+</li>
+<li> <a href="#File.Position">func (f *File) Position(p Pos) (pos Position)</a>
+</li>
+<li> <a href="#File.PositionFor">func (f *File) PositionFor(p Pos, adjusted bool) (pos Position)</a>
+</li>
+<li> <a href="#File.SetLines">func (f *File) SetLines(lines []int) bool</a>
+</li>
+<li> <a href="#File.SetLinesForContent">func (f *File) SetLinesForContent(content []byte)</a>
+</li>
+<li> <a href="#File.Size">func (f *File) Size() int</a>
+</li>
+<li><a href="#FileSet">type FileSet</a></li>
+<li> <a href="#NewFileSet">func NewFileSet() *FileSet</a>
+</li>
+<li> <a href="#FileSet.AddFile">func (s *FileSet) AddFile(filename string, base, size int) *File</a>
+</li>
+<li> <a href="#FileSet.Base">func (s *FileSet) Base() int</a>
+</li>
+<li> <a href="#FileSet.File">func (s *FileSet) File(p Pos) (f *File)</a>
+</li>
+<li> <a href="#FileSet.Iterate">func (s *FileSet) Iterate(f func(*File) bool)</a>
+</li>
+<li> <a href="#FileSet.Position">func (s *FileSet) Position(p Pos) (pos Position)</a>
+</li>
+<li> <a href="#FileSet.PositionFor">func (s *FileSet) PositionFor(p Pos, adjusted bool) (pos Position)</a>
+</li>
+<li> <a href="#FileSet.Read">func (s *FileSet) Read(decode func(any) error) error</a>
+</li>
+<li> <a href="#FileSet.RemoveFile">func (s *FileSet) RemoveFile(file *File)</a>
+</li>
+<li> <a href="#FileSet.Write">func (s *FileSet) Write(encode func(any) error) error</a>
+</li>
+<li><a href="#Pos">type Pos</a></li>
+<li> <a href="#Pos.IsValid">func (p Pos) IsValid() bool</a>
+</li>
+<li><a href="#Position">type Position</a></li>
+<li> <a href="#Position.IsValid">func (pos *Position) IsValid() bool</a>
+</li>
+<li> <a href="#Position.String">func (pos Position) String() string</a>
+</li>
+<li><a href="#Token">type Token</a></li>
+<li> <a href="#Lookup">func Lookup(ident string) Token</a>
+</li>
+<li> <a href="#Token.IsKeyword">func (tok Token) IsKeyword() bool</a>
+</li>
+<li> <a href="#Token.IsLiteral">func (tok Token) IsLiteral() bool</a>
+</li>
+<li> <a href="#Token.IsOperator">func (tok Token) IsOperator() bool</a>
+</li>
+<li> <a href="#Token.Precedence">func (op Token) Precedence() int</a>
+</li>
+<li> <a href="#Token.String">func (tok Token) String() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example__retrievePositionInfo">Package (RetrievePositionInfo)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>position.go</span> <span>serialize.go</span> <span>token.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>A set of constants for precedence-based expression parsing. Non-operators have lowest precedence, followed by operators starting with precedence 1 up to unary operators. The highest precedence serves as "catch-all" precedence for selector, indexing, and other operator and delimiter tokens. </p>
+<pre data-language="go">const (
+ LowestPrec = 0 // non-operators
+ UnaryPrec = 6
+ HighestPrec = 7
+)</pre> <h2 id="IsExported">func <span>IsExported</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func IsExported(name string) bool</pre> <p>IsExported reports whether name starts with an upper-case letter. </p>
+<h2 id="IsIdentifier">func <span>IsIdentifier</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func IsIdentifier(name string) bool</pre> <p>IsIdentifier reports whether name is a Go identifier, that is, a non-empty string made up of letters, digits, and underscores, where the first character is not a digit. Keywords are not identifiers. </p>
+<h2 id="IsKeyword">func <span>IsKeyword</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func IsKeyword(name string) bool</pre> <p>IsKeyword reports whether name is a Go keyword, such as "func" or "return". </p>
+<h2 id="File">type <span>File</span> </h2> <p>A File is a handle for a file belonging to a <a href="#FileSet">FileSet</a>. A File has a name, size, and line offset table. </p>
+<pre data-language="go">type File struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="File.AddLine">func (*File) <span>AddLine</span> </h3> <pre data-language="go">func (f *File) AddLine(offset int)</pre> <p>AddLine adds the line offset for a new line. The line offset must be larger than the offset for the previous line and smaller than the file size; otherwise the line offset is ignored. </p>
+<h3 id="File.AddLineColumnInfo">func (*File) <span>AddLineColumnInfo</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (f *File) AddLineColumnInfo(offset int, filename string, line, column int)</pre> <p>AddLineColumnInfo adds alternative file, line, and column number information for a given file offset. The offset must be larger than the offset for the previously added alternative line info and smaller than the file size; otherwise the information is ignored. </p>
+<p>AddLineColumnInfo is typically used to register alternative position information for line directives such as //line filename:line:column. </p>
+<h3 id="File.AddLineInfo">func (*File) <span>AddLineInfo</span> </h3> <pre data-language="go">func (f *File) AddLineInfo(offset int, filename string, line int)</pre> <p>AddLineInfo is like <a href="#File.AddLineColumnInfo">File.AddLineColumnInfo</a> with a column = 1 argument. It is here for backward-compatibility for code prior to Go 1.11. </p>
+<h3 id="File.Base">func (*File) <span>Base</span> </h3> <pre data-language="go">func (f *File) Base() int</pre> <p>Base returns the base offset of file f as registered with AddFile. </p>
+<h3 id="File.Line">func (*File) <span>Line</span> </h3> <pre data-language="go">func (f *File) Line(p Pos) int</pre> <p>Line returns the line number for the given file position p; p must be a <a href="#Pos">Pos</a> value in that file or <a href="#NoPos">NoPos</a>. </p>
+<h3 id="File.LineCount">func (*File) <span>LineCount</span> </h3> <pre data-language="go">func (f *File) LineCount() int</pre> <p>LineCount returns the number of lines in file f. </p>
+<h3 id="File.LineStart">func (*File) <span>LineStart</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (f *File) LineStart(line int) Pos</pre> <p>LineStart returns the <a href="#Pos">Pos</a> value of the start of the specified line. It ignores any alternative positions set using <a href="#File.AddLineColumnInfo">File.AddLineColumnInfo</a>. LineStart panics if the 1-based line number is invalid. </p>
+<h3 id="File.Lines">func (*File) <span>Lines</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (f *File) Lines() []int</pre> <p>Lines returns the effective line offset table of the form described by <a href="#File.SetLines">File.SetLines</a>. Callers must not mutate the result. </p>
+<h3 id="File.MergeLine">func (*File) <span>MergeLine</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (f *File) MergeLine(line int)</pre> <p>MergeLine merges a line with the following line. It is akin to replacing the newline character at the end of the line with a space (to not change the remaining offsets). To obtain the line number, consult e.g. [Position.Line]. MergeLine will panic if given an invalid line number. </p>
+<h3 id="File.Name">func (*File) <span>Name</span> </h3> <pre data-language="go">func (f *File) Name() string</pre> <p>Name returns the file name of file f as registered with AddFile. </p>
+<h3 id="File.Offset">func (*File) <span>Offset</span> </h3> <pre data-language="go">func (f *File) Offset(p Pos) int</pre> <p>Offset returns the offset for the given file position p; p must be a valid <a href="#Pos">Pos</a> value in that file. f.Offset(f.Pos(offset)) == offset. </p>
+<h3 id="File.Pos">func (*File) <span>Pos</span> </h3> <pre data-language="go">func (f *File) Pos(offset int) Pos</pre> <p>Pos returns the Pos value for the given file offset; the offset must be &lt;= f.Size(). f.Pos(f.Offset(p)) == p. </p>
+<h3 id="File.Position">func (*File) <span>Position</span> </h3> <pre data-language="go">func (f *File) Position(p Pos) (pos Position)</pre> <p>Position returns the Position value for the given file position p. Calling f.Position(p) is equivalent to calling f.PositionFor(p, true). </p>
+<h3 id="File.PositionFor">func (*File) <span>PositionFor</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (f *File) PositionFor(p Pos, adjusted bool) (pos Position)</pre> <p>PositionFor returns the Position value for the given file position p. If adjusted is set, the position may be adjusted by position-altering //line comments; otherwise those comments are ignored. p must be a Pos value in f or NoPos. </p>
+<h3 id="File.SetLines">func (*File) <span>SetLines</span> </h3> <pre data-language="go">func (f *File) SetLines(lines []int) bool</pre> <p>SetLines sets the line offsets for a file and reports whether it succeeded. The line offsets are the offsets of the first character of each line; for instance for the content "ab\nc\n" the line offsets are {0, 3}. An empty file has an empty line offset table. Each line offset must be larger than the offset for the previous line and smaller than the file size; otherwise SetLines fails and returns false. Callers must not mutate the provided slice after SetLines returns. </p>
+<h3 id="File.SetLinesForContent">func (*File) <span>SetLinesForContent</span> </h3> <pre data-language="go">func (f *File) SetLinesForContent(content []byte)</pre> <p>SetLinesForContent sets the line offsets for the given file content. It ignores position-altering //line comments. </p>
+<h3 id="File.Size">func (*File) <span>Size</span> </h3> <pre data-language="go">func (f *File) Size() int</pre> <p>Size returns the size of file f as registered with AddFile. </p>
+<h2 id="FileSet">type <span>FileSet</span> </h2> <p>A FileSet represents a set of source files. Methods of file sets are synchronized; multiple goroutines may invoke them concurrently. </p>
+<p>The byte offsets for each file in a file set are mapped into distinct (integer) intervals, one interval [base, base+size] per file. <a href="#FileSet.Base">FileSet.Base</a> represents the first byte in the file, and size is the corresponding file size. A <a href="#Pos">Pos</a> value is a value in such an interval. By determining the interval a <a href="#Pos">Pos</a> value belongs to, the file, its file base, and thus the byte offset (position) the <a href="#Pos">Pos</a> value is representing can be computed. </p>
+<p>When adding a new file, a file base must be provided. That can be any integer value that is past the end of any interval of any file already in the file set. For convenience, <a href="#FileSet.Base">FileSet.Base</a> provides such a value, which is simply the end of the Pos interval of the most recently added file, plus one. Unless there is a need to extend an interval later, using the <a href="#FileSet.Base">FileSet.Base</a> should be used as argument for <a href="#FileSet.AddFile">FileSet.AddFile</a>. </p>
+<p>A <a href="#File">File</a> may be removed from a FileSet when it is no longer needed. This may reduce memory usage in a long-running application. </p>
+<pre data-language="go">type FileSet struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFileSet">func <span>NewFileSet</span> </h3> <pre data-language="go">func NewFileSet() *FileSet</pre> <p>NewFileSet creates a new file set. </p>
+<h3 id="FileSet.AddFile">func (*FileSet) <span>AddFile</span> </h3> <pre data-language="go">func (s *FileSet) AddFile(filename string, base, size int) *File</pre> <p>AddFile adds a new file with a given filename, base offset, and file size to the file set s and returns the file. Multiple files may have the same name. The base offset must not be smaller than the <a href="#FileSet.Base">FileSet.Base</a>, and size must not be negative. As a special case, if a negative base is provided, the current value of the <a href="#FileSet.Base">FileSet.Base</a> is used instead. </p>
+<p>Adding the file will set the file set's <a href="#FileSet.Base">FileSet.Base</a> value to base + size + 1 as the minimum base value for the next file. The following relationship exists between a <a href="#Pos">Pos</a> value p for a given file offset offs: </p>
+<pre data-language="go">int(p) = base + offs
+</pre> <p>with offs in the range [0, size] and thus p in the range [base, base+size]. For convenience, <a href="#File.Pos">File.Pos</a> may be used to create file-specific position values from a file offset. </p>
+<h3 id="FileSet.Base">func (*FileSet) <span>Base</span> </h3> <pre data-language="go">func (s *FileSet) Base() int</pre> <p>Base returns the minimum base offset that must be provided to <a href="#FileSet.AddFile">FileSet.AddFile</a> when adding the next file. </p>
+<h3 id="FileSet.File">func (*FileSet) <span>File</span> </h3> <pre data-language="go">func (s *FileSet) File(p Pos) (f *File)</pre> <p>File returns the file that contains the position p. If no such file is found (for instance for p == <a href="#NoPos">NoPos</a>), the result is nil. </p>
+<h3 id="FileSet.Iterate">func (*FileSet) <span>Iterate</span> </h3> <pre data-language="go">func (s *FileSet) Iterate(f func(*File) bool)</pre> <p>Iterate calls f for the files in the file set in the order they were added until f returns false. </p>
+<h3 id="FileSet.Position">func (*FileSet) <span>Position</span> </h3> <pre data-language="go">func (s *FileSet) Position(p Pos) (pos Position)</pre> <p>Position converts a <a href="#Pos">Pos</a> p in the fileset into a Position value. Calling s.Position(p) is equivalent to calling s.PositionFor(p, true). </p>
+<h3 id="FileSet.PositionFor">func (*FileSet) <span>PositionFor</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (s *FileSet) PositionFor(p Pos, adjusted bool) (pos Position)</pre> <p>PositionFor converts a <a href="#Pos">Pos</a> p in the fileset into a <a href="#Position">Position</a> value. If adjusted is set, the position may be adjusted by position-altering //line comments; otherwise those comments are ignored. p must be a <a href="#Pos">Pos</a> value in s or <a href="#NoPos">NoPos</a>. </p>
+<h3 id="FileSet.Read">func (*FileSet) <span>Read</span> </h3> <pre data-language="go">func (s *FileSet) Read(decode func(any) error) error</pre> <p>Read calls decode to deserialize a file set into s; s must not be nil. </p>
+<h3 id="FileSet.RemoveFile">func (*FileSet) <span>RemoveFile</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (s *FileSet) RemoveFile(file *File)</pre> <p>RemoveFile removes a file from the <a href="#FileSet">FileSet</a> so that subsequent queries for its <a href="#Pos">Pos</a> interval yield a negative result. This reduces the memory usage of a long-lived <a href="#FileSet">FileSet</a> that encounters an unbounded stream of files. </p>
+<p>Removing a file that does not belong to the set has no effect. </p>
+<h3 id="FileSet.Write">func (*FileSet) <span>Write</span> </h3> <pre data-language="go">func (s *FileSet) Write(encode func(any) error) error</pre> <p>Write calls encode to serialize the file set s. </p>
+<h2 id="Pos">type <span>Pos</span> </h2> <p>Pos is a compact encoding of a source position within a file set. It can be converted into a <a href="#Position">Position</a> for a more convenient, but much larger, representation. </p>
+<p>The Pos value for a given file is a number in the range [base, base+size], where base and size are specified when a file is added to the file set. The difference between a Pos value and the corresponding file base corresponds to the byte offset of that position (represented by the Pos value) from the beginning of the file. Thus, the file base offset is the Pos value representing the first byte in the file. </p>
+<p>To create the Pos value for a specific source offset (measured in bytes), first add the respective file to the current file set using <a href="#FileSet.AddFile">FileSet.AddFile</a> and then call <a href="#File.Pos">File.Pos</a>(offset) for that file. Given a Pos value p for a specific file set fset, the corresponding <a href="#Position">Position</a> value is obtained by calling fset.Position(p). </p>
+<p>Pos values can be compared directly with the usual comparison operators: If two Pos values p and q are in the same file, comparing p and q is equivalent to comparing the respective source file offsets. If p and q are in different files, p &lt; q is true if the file implied by p was added to the respective file set before the file implied by q. </p>
+<pre data-language="go">type Pos int</pre> <p>The zero value for <a href="#Pos">Pos</a> is NoPos; there is no file and line information associated with it, and NoPos.IsValid() is false. NoPos is always smaller than any other <a href="#Pos">Pos</a> value. The corresponding <a href="#Position">Position</a> value for NoPos is the zero value for <a href="#Position">Position</a>. </p>
+<pre data-language="go">const NoPos Pos = 0</pre> <h3 id="Pos.IsValid">func (Pos) <span>IsValid</span> </h3> <pre data-language="go">func (p Pos) IsValid() bool</pre> <p>IsValid reports whether the position is valid. </p>
+<h2 id="Position">type <span>Position</span> </h2> <p>Position describes an arbitrary source position including the file, line, and column location. A Position is valid if the line number is &gt; 0. </p>
+<pre data-language="go">type Position struct {
+ Filename string // filename, if any
+ Offset int // offset, starting at 0
+ Line int // line number, starting at 1
+ Column int // column number, starting at 1 (byte count)
+}
+</pre> <h3 id="Position.IsValid">func (*Position) <span>IsValid</span> </h3> <pre data-language="go">func (pos *Position) IsValid() bool</pre> <p>IsValid reports whether the position is valid. </p>
+<h3 id="Position.String">func (Position) <span>String</span> </h3> <pre data-language="go">func (pos Position) String() string</pre> <p>String returns a string in one of several forms: </p>
+<pre data-language="go">file:line:column valid position with file name
+file:line valid position with file name but no column (column == 0)
+line:column valid position without file name
+line valid position without file name and no column (column == 0)
+file invalid position with file name
+- invalid position without file name
+</pre> <h2 id="Token">type <span>Token</span> </h2> <p>Token is the set of lexical tokens of the Go programming language. </p>
+<pre data-language="go">type Token int</pre> <p>The list of tokens. </p>
+<pre data-language="go">const (
+ // Special tokens
+ ILLEGAL Token = iota
+ EOF
+ COMMENT
+
+ // Identifiers and basic type literals
+ // (these tokens stand for classes of literals)
+ IDENT // main
+ INT // 12345
+ FLOAT // 123.45
+ IMAG // 123.45i
+ CHAR // 'a'
+ STRING // "abc"
+
+ // Operators and delimiters
+ ADD // +
+ SUB // -
+ MUL // *
+ QUO // /
+ REM // %
+
+ AND // &amp;
+ OR // |
+ XOR // ^
+ SHL // &lt;&lt;
+ SHR // &gt;&gt;
+ AND_NOT // &amp;^
+
+ ADD_ASSIGN // +=
+ SUB_ASSIGN // -=
+ MUL_ASSIGN // *=
+ QUO_ASSIGN // /=
+ REM_ASSIGN // %=
+
+ AND_ASSIGN // &amp;=
+ OR_ASSIGN // |=
+ XOR_ASSIGN // ^=
+ SHL_ASSIGN // &lt;&lt;=
+ SHR_ASSIGN // &gt;&gt;=
+ AND_NOT_ASSIGN // &amp;^=
+
+ LAND // &amp;&amp;
+ LOR // ||
+ ARROW // &lt;-
+ INC // ++
+ DEC // --
+
+ EQL // ==
+ LSS // &lt;
+ GTR // &gt;
+ ASSIGN // =
+ NOT // !
+
+ NEQ // !=
+ LEQ // &lt;=
+ GEQ // &gt;=
+ DEFINE // :=
+ ELLIPSIS // ...
+
+ LPAREN // (
+ LBRACK // [
+ LBRACE // {
+ COMMA // ,
+ PERIOD // .
+
+ RPAREN // )
+ RBRACK // ]
+ RBRACE // }
+ SEMICOLON // ;
+ COLON // :
+
+ // Keywords
+ BREAK
+ CASE
+ CHAN
+ CONST
+ CONTINUE
+
+ DEFAULT
+ DEFER
+ ELSE
+ FALLTHROUGH
+ FOR
+
+ FUNC
+ GO
+ GOTO
+ IF
+ IMPORT
+
+ INTERFACE
+ MAP
+ PACKAGE
+ RANGE
+ RETURN
+
+ SELECT
+ STRUCT
+ SWITCH
+ TYPE
+ VAR
+
+ // additional tokens, handled in an ad-hoc manner
+ TILDE
+)</pre> <h3 id="Lookup">func <span>Lookup</span> </h3> <pre data-language="go">func Lookup(ident string) Token</pre> <p>Lookup maps an identifier to its keyword token or <a href="#IDENT">IDENT</a> (if not a keyword). </p>
+<h3 id="Token.IsKeyword">func (Token) <span>IsKeyword</span> </h3> <pre data-language="go">func (tok Token) IsKeyword() bool</pre> <p>IsKeyword returns true for tokens corresponding to keywords; it returns false otherwise. </p>
+<h3 id="Token.IsLiteral">func (Token) <span>IsLiteral</span> </h3> <pre data-language="go">func (tok Token) IsLiteral() bool</pre> <p>IsLiteral returns true for tokens corresponding to identifiers and basic type literals; it returns false otherwise. </p>
+<h3 id="Token.IsOperator">func (Token) <span>IsOperator</span> </h3> <pre data-language="go">func (tok Token) IsOperator() bool</pre> <p>IsOperator returns true for tokens corresponding to operators and delimiters; it returns false otherwise. </p>
+<h3 id="Token.Precedence">func (Token) <span>Precedence</span> </h3> <pre data-language="go">func (op Token) Precedence() int</pre> <p>Precedence returns the operator precedence of the binary operator op. If op is not a binary operator, the result is LowestPrecedence. </p>
+<h3 id="Token.String">func (Token) <span>String</span> </h3> <pre data-language="go">func (tok Token) String() string</pre> <p>String returns the string corresponding to the token tok. For operators, delimiters, and keywords the string is the actual token character sequence (e.g., for the token <a href="#ADD">ADD</a>, the string is "+"). For all other tokens the string corresponds to the token constant name (e.g. for the token <a href="#IDENT">IDENT</a>, the string is "IDENT"). </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/token/" class="_attribution-link">http://golang.org/pkg/go/token/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Ftypes%2Findex.html b/devdocs/go/go%2Ftypes%2Findex.html
new file mode 100644
index 00000000..fed28de7
--- /dev/null
+++ b/devdocs/go/go%2Ftypes%2Findex.html
@@ -0,0 +1,1630 @@
+<h1> Package types </h1> <ul id="short-nav">
+<li><code>import "go/types"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package types declares the data types and implements the algorithms for type-checking of Go packages. Use <a href="#Config.Check">Config.Check</a> to invoke the type checker for a package. Alternatively, create a new type checker with <a href="#NewChecker">NewChecker</a> and invoke it incrementally by calling <a href="#Checker.Files">Checker.Files</a>. </p>
+<p>Type-checking consists of several interdependent phases: </p>
+<p>Name resolution maps each identifier (ast.Ident) in the program to the language object (<a href="#Object">Object</a>) it denotes. Use <a href="#Info">Info</a>.{Defs,Uses,Implicits} for the results of name resolution. </p>
+<p>Constant folding computes the exact constant value (constant.Value) for every expression (ast.Expr) that is a compile-time constant. Use Info.Types[expr].Value for the results of constant folding. </p>
+<p><a href="#Type">Type</a> inference computes the type (<a href="#Type">Type</a>) of every expression (<span>ast.Expr</span>) and checks for compliance with the language specification. Use [Info.Types][expr].Type for the results of type inference. </p>
+<p>For a tutorial, see <a href="https://golang.org/s/types-tutorial">https://golang.org/s/types-tutorial</a>. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#AssertableTo">func AssertableTo(V *Interface, T Type) bool</a></li>
+<li><a href="#AssignableTo">func AssignableTo(V, T Type) bool</a></li>
+<li><a href="#CheckExpr">func CheckExpr(fset *token.FileSet, pkg *Package, pos token.Pos, expr ast.Expr, info *Info) (err error)</a></li>
+<li><a href="#Comparable">func Comparable(T Type) bool</a></li>
+<li><a href="#ConvertibleTo">func ConvertibleTo(V, T Type) bool</a></li>
+<li><a href="#DefPredeclaredTestFuncs">func DefPredeclaredTestFuncs()</a></li>
+<li><a href="#ExprString">func ExprString(x ast.Expr) string</a></li>
+<li><a href="#Id">func Id(pkg *Package, name string) string</a></li>
+<li><a href="#Identical">func Identical(x, y Type) bool</a></li>
+<li><a href="#IdenticalIgnoreTags">func IdenticalIgnoreTags(x, y Type) bool</a></li>
+<li><a href="#Implements">func Implements(V Type, T *Interface) bool</a></li>
+<li><a href="#IsInterface">func IsInterface(t Type) bool</a></li>
+<li><a href="#ObjectString">func ObjectString(obj Object, qf Qualifier) string</a></li>
+<li><a href="#Satisfies">func Satisfies(V Type, T *Interface) bool</a></li>
+<li><a href="#SelectionString">func SelectionString(s *Selection, qf Qualifier) string</a></li>
+<li><a href="#TypeString">func TypeString(typ Type, qf Qualifier) string</a></li>
+<li><a href="#WriteExpr">func WriteExpr(buf *bytes.Buffer, x ast.Expr)</a></li>
+<li><a href="#WriteSignature">func WriteSignature(buf *bytes.Buffer, sig *Signature, qf Qualifier)</a></li>
+<li><a href="#WriteType">func WriteType(buf *bytes.Buffer, typ Type, qf Qualifier)</a></li>
+<li><a href="#Alias">type Alias</a></li>
+<li> <a href="#NewAlias">func NewAlias(obj *TypeName, rhs Type) *Alias</a>
+</li>
+<li> <a href="#Alias.Obj">func (a *Alias) Obj() *TypeName</a>
+</li>
+<li> <a href="#Alias.String">func (a *Alias) String() string</a>
+</li>
+<li> <a href="#Alias.Underlying">func (a *Alias) Underlying() Type</a>
+</li>
+<li><a href="#ArgumentError">type ArgumentError</a></li>
+<li> <a href="#ArgumentError.Error">func (e *ArgumentError) Error() string</a>
+</li>
+<li> <a href="#ArgumentError.Unwrap">func (e *ArgumentError) Unwrap() error</a>
+</li>
+<li><a href="#Array">type Array</a></li>
+<li> <a href="#NewArray">func NewArray(elem Type, len int64) *Array</a>
+</li>
+<li> <a href="#Array.Elem">func (a *Array) Elem() Type</a>
+</li>
+<li> <a href="#Array.Len">func (a *Array) Len() int64</a>
+</li>
+<li> <a href="#Array.String">func (a *Array) String() string</a>
+</li>
+<li> <a href="#Array.Underlying">func (a *Array) Underlying() Type</a>
+</li>
+<li><a href="#Basic">type Basic</a></li>
+<li> <a href="#Basic.Info">func (b *Basic) Info() BasicInfo</a>
+</li>
+<li> <a href="#Basic.Kind">func (b *Basic) Kind() BasicKind</a>
+</li>
+<li> <a href="#Basic.Name">func (b *Basic) Name() string</a>
+</li>
+<li> <a href="#Basic.String">func (b *Basic) String() string</a>
+</li>
+<li> <a href="#Basic.Underlying">func (b *Basic) Underlying() Type</a>
+</li>
+<li><a href="#BasicInfo">type BasicInfo</a></li>
+<li><a href="#BasicKind">type BasicKind</a></li>
+<li><a href="#Builtin">type Builtin</a></li>
+<li> <a href="#Builtin.Exported">func (obj *Builtin) Exported() bool</a>
+</li>
+<li> <a href="#Builtin.Id">func (obj *Builtin) Id() string</a>
+</li>
+<li> <a href="#Builtin.Name">func (obj *Builtin) Name() string</a>
+</li>
+<li> <a href="#Builtin.Parent">func (obj *Builtin) Parent() *Scope</a>
+</li>
+<li> <a href="#Builtin.Pkg">func (obj *Builtin) Pkg() *Package</a>
+</li>
+<li> <a href="#Builtin.Pos">func (obj *Builtin) Pos() token.Pos</a>
+</li>
+<li> <a href="#Builtin.String">func (obj *Builtin) String() string</a>
+</li>
+<li> <a href="#Builtin.Type">func (obj *Builtin) Type() Type</a>
+</li>
+<li><a href="#Chan">type Chan</a></li>
+<li> <a href="#NewChan">func NewChan(dir ChanDir, elem Type) *Chan</a>
+</li>
+<li> <a href="#Chan.Dir">func (c *Chan) Dir() ChanDir</a>
+</li>
+<li> <a href="#Chan.Elem">func (c *Chan) Elem() Type</a>
+</li>
+<li> <a href="#Chan.String">func (c *Chan) String() string</a>
+</li>
+<li> <a href="#Chan.Underlying">func (c *Chan) Underlying() Type</a>
+</li>
+<li><a href="#ChanDir">type ChanDir</a></li>
+<li><a href="#Checker">type Checker</a></li>
+<li> <a href="#NewChecker">func NewChecker(conf *Config, fset *token.FileSet, pkg *Package, info *Info) *Checker</a>
+</li>
+<li> <a href="#Checker.Files">func (check *Checker) Files(files []*ast.File) error</a>
+</li>
+<li><a href="#Config">type Config</a></li>
+<li> <a href="#Config.Check">func (conf *Config) Check(path string, fset *token.FileSet, files []*ast.File, info *Info) (*Package, error)</a>
+</li>
+<li><a href="#Const">type Const</a></li>
+<li> <a href="#NewConst">func NewConst(pos token.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const</a>
+</li>
+<li> <a href="#Const.Exported">func (obj *Const) Exported() bool</a>
+</li>
+<li> <a href="#Const.Id">func (obj *Const) Id() string</a>
+</li>
+<li> <a href="#Const.Name">func (obj *Const) Name() string</a>
+</li>
+<li> <a href="#Const.Parent">func (obj *Const) Parent() *Scope</a>
+</li>
+<li> <a href="#Const.Pkg">func (obj *Const) Pkg() *Package</a>
+</li>
+<li> <a href="#Const.Pos">func (obj *Const) Pos() token.Pos</a>
+</li>
+<li> <a href="#Const.String">func (obj *Const) String() string</a>
+</li>
+<li> <a href="#Const.Type">func (obj *Const) Type() Type</a>
+</li>
+<li> <a href="#Const.Val">func (obj *Const) Val() constant.Value</a>
+</li>
+<li><a href="#Context">type Context</a></li>
+<li> <a href="#NewContext">func NewContext() *Context</a>
+</li>
+<li><a href="#Error">type Error</a></li>
+<li> <a href="#Error.Error">func (err Error) Error() string</a>
+</li>
+<li><a href="#Func">type Func</a></li>
+<li> <a href="#MissingMethod">func MissingMethod(V Type, T *Interface, static bool) (method *Func, wrongType bool)</a>
+</li>
+<li> <a href="#NewFunc">func NewFunc(pos token.Pos, pkg *Package, name string, sig *Signature) *Func</a>
+</li>
+<li> <a href="#Func.Exported">func (obj *Func) Exported() bool</a>
+</li>
+<li> <a href="#Func.FullName">func (obj *Func) FullName() string</a>
+</li>
+<li> <a href="#Func.Id">func (obj *Func) Id() string</a>
+</li>
+<li> <a href="#Func.Name">func (obj *Func) Name() string</a>
+</li>
+<li> <a href="#Func.Origin">func (obj *Func) Origin() *Func</a>
+</li>
+<li> <a href="#Func.Parent">func (obj *Func) Parent() *Scope</a>
+</li>
+<li> <a href="#Func.Pkg">func (obj *Func) Pkg() *Package</a>
+</li>
+<li> <a href="#Func.Pos">func (obj *Func) Pos() token.Pos</a>
+</li>
+<li> <a href="#Func.Scope">func (obj *Func) Scope() *Scope</a>
+</li>
+<li> <a href="#Func.String">func (obj *Func) String() string</a>
+</li>
+<li> <a href="#Func.Type">func (obj *Func) Type() Type</a>
+</li>
+<li><a href="#ImportMode">type ImportMode</a></li>
+<li><a href="#Importer">type Importer</a></li>
+<li><a href="#ImporterFrom">type ImporterFrom</a></li>
+<li><a href="#Info">type Info</a></li>
+<li> <a href="#Info.ObjectOf">func (info *Info) ObjectOf(id *ast.Ident) Object</a>
+</li>
+<li> <a href="#Info.PkgNameOf">func (info *Info) PkgNameOf(imp *ast.ImportSpec) *PkgName</a>
+</li>
+<li> <a href="#Info.TypeOf">func (info *Info) TypeOf(e ast.Expr) Type</a>
+</li>
+<li><a href="#Initializer">type Initializer</a></li>
+<li> <a href="#Initializer.String">func (init *Initializer) String() string</a>
+</li>
+<li><a href="#Instance">type Instance</a></li>
+<li><a href="#Interface">type Interface</a></li>
+<li> <a href="#NewInterface">func NewInterface(methods []*Func, embeddeds []*Named) *Interface</a>
+</li>
+<li> <a href="#NewInterfaceType">func NewInterfaceType(methods []*Func, embeddeds []Type) *Interface</a>
+</li>
+<li> <a href="#Interface.Complete">func (t *Interface) Complete() *Interface</a>
+</li>
+<li> <a href="#Interface.Embedded">func (t *Interface) Embedded(i int) *Named</a>
+</li>
+<li> <a href="#Interface.EmbeddedType">func (t *Interface) EmbeddedType(i int) Type</a>
+</li>
+<li> <a href="#Interface.Empty">func (t *Interface) Empty() bool</a>
+</li>
+<li> <a href="#Interface.ExplicitMethod">func (t *Interface) ExplicitMethod(i int) *Func</a>
+</li>
+<li> <a href="#Interface.IsComparable">func (t *Interface) IsComparable() bool</a>
+</li>
+<li> <a href="#Interface.IsImplicit">func (t *Interface) IsImplicit() bool</a>
+</li>
+<li> <a href="#Interface.IsMethodSet">func (t *Interface) IsMethodSet() bool</a>
+</li>
+<li> <a href="#Interface.MarkImplicit">func (t *Interface) MarkImplicit()</a>
+</li>
+<li> <a href="#Interface.Method">func (t *Interface) Method(i int) *Func</a>
+</li>
+<li> <a href="#Interface.NumEmbeddeds">func (t *Interface) NumEmbeddeds() int</a>
+</li>
+<li> <a href="#Interface.NumExplicitMethods">func (t *Interface) NumExplicitMethods() int</a>
+</li>
+<li> <a href="#Interface.NumMethods">func (t *Interface) NumMethods() int</a>
+</li>
+<li> <a href="#Interface.String">func (t *Interface) String() string</a>
+</li>
+<li> <a href="#Interface.Underlying">func (t *Interface) Underlying() Type</a>
+</li>
+<li><a href="#Label">type Label</a></li>
+<li> <a href="#NewLabel">func NewLabel(pos token.Pos, pkg *Package, name string) *Label</a>
+</li>
+<li> <a href="#Label.Exported">func (obj *Label) Exported() bool</a>
+</li>
+<li> <a href="#Label.Id">func (obj *Label) Id() string</a>
+</li>
+<li> <a href="#Label.Name">func (obj *Label) Name() string</a>
+</li>
+<li> <a href="#Label.Parent">func (obj *Label) Parent() *Scope</a>
+</li>
+<li> <a href="#Label.Pkg">func (obj *Label) Pkg() *Package</a>
+</li>
+<li> <a href="#Label.Pos">func (obj *Label) Pos() token.Pos</a>
+</li>
+<li> <a href="#Label.String">func (obj *Label) String() string</a>
+</li>
+<li> <a href="#Label.Type">func (obj *Label) Type() Type</a>
+</li>
+<li><a href="#Map">type Map</a></li>
+<li> <a href="#NewMap">func NewMap(key, elem Type) *Map</a>
+</li>
+<li> <a href="#Map.Elem">func (m *Map) Elem() Type</a>
+</li>
+<li> <a href="#Map.Key">func (m *Map) Key() Type</a>
+</li>
+<li> <a href="#Map.String">func (t *Map) String() string</a>
+</li>
+<li> <a href="#Map.Underlying">func (t *Map) Underlying() Type</a>
+</li>
+<li><a href="#MethodSet">type MethodSet</a></li>
+<li> <a href="#NewMethodSet">func NewMethodSet(T Type) *MethodSet</a>
+</li>
+<li> <a href="#MethodSet.At">func (s *MethodSet) At(i int) *Selection</a>
+</li>
+<li> <a href="#MethodSet.Len">func (s *MethodSet) Len() int</a>
+</li>
+<li> <a href="#MethodSet.Lookup">func (s *MethodSet) Lookup(pkg *Package, name string) *Selection</a>
+</li>
+<li> <a href="#MethodSet.String">func (s *MethodSet) String() string</a>
+</li>
+<li><a href="#Named">type Named</a></li>
+<li> <a href="#NewNamed">func NewNamed(obj *TypeName, underlying Type, methods []*Func) *Named</a>
+</li>
+<li> <a href="#Named.AddMethod">func (t *Named) AddMethod(m *Func)</a>
+</li>
+<li> <a href="#Named.Method">func (t *Named) Method(i int) *Func</a>
+</li>
+<li> <a href="#Named.NumMethods">func (t *Named) NumMethods() int</a>
+</li>
+<li> <a href="#Named.Obj">func (t *Named) Obj() *TypeName</a>
+</li>
+<li> <a href="#Named.Origin">func (t *Named) Origin() *Named</a>
+</li>
+<li> <a href="#Named.SetTypeParams">func (t *Named) SetTypeParams(tparams []*TypeParam)</a>
+</li>
+<li> <a href="#Named.SetUnderlying">func (t *Named) SetUnderlying(underlying Type)</a>
+</li>
+<li> <a href="#Named.String">func (t *Named) String() string</a>
+</li>
+<li> <a href="#Named.TypeArgs">func (t *Named) TypeArgs() *TypeList</a>
+</li>
+<li> <a href="#Named.TypeParams">func (t *Named) TypeParams() *TypeParamList</a>
+</li>
+<li> <a href="#Named.Underlying">func (t *Named) Underlying() Type</a>
+</li>
+<li><a href="#Nil">type Nil</a></li>
+<li> <a href="#Nil.Exported">func (obj *Nil) Exported() bool</a>
+</li>
+<li> <a href="#Nil.Id">func (obj *Nil) Id() string</a>
+</li>
+<li> <a href="#Nil.Name">func (obj *Nil) Name() string</a>
+</li>
+<li> <a href="#Nil.Parent">func (obj *Nil) Parent() *Scope</a>
+</li>
+<li> <a href="#Nil.Pkg">func (obj *Nil) Pkg() *Package</a>
+</li>
+<li> <a href="#Nil.Pos">func (obj *Nil) Pos() token.Pos</a>
+</li>
+<li> <a href="#Nil.String">func (obj *Nil) String() string</a>
+</li>
+<li> <a href="#Nil.Type">func (obj *Nil) Type() Type</a>
+</li>
+<li><a href="#Object">type Object</a></li>
+<li> <a href="#LookupFieldOrMethod">func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (obj Object, index []int, indirect bool)</a>
+</li>
+<li><a href="#Package">type Package</a></li>
+<li> <a href="#NewPackage">func NewPackage(path, name string) *Package</a>
+</li>
+<li> <a href="#Package.Complete">func (pkg *Package) Complete() bool</a>
+</li>
+<li> <a href="#Package.GoVersion">func (pkg *Package) GoVersion() string</a>
+</li>
+<li> <a href="#Package.Imports">func (pkg *Package) Imports() []*Package</a>
+</li>
+<li> <a href="#Package.MarkComplete">func (pkg *Package) MarkComplete()</a>
+</li>
+<li> <a href="#Package.Name">func (pkg *Package) Name() string</a>
+</li>
+<li> <a href="#Package.Path">func (pkg *Package) Path() string</a>
+</li>
+<li> <a href="#Package.Scope">func (pkg *Package) Scope() *Scope</a>
+</li>
+<li> <a href="#Package.SetImports">func (pkg *Package) SetImports(list []*Package)</a>
+</li>
+<li> <a href="#Package.SetName">func (pkg *Package) SetName(name string)</a>
+</li>
+<li> <a href="#Package.String">func (pkg *Package) String() string</a>
+</li>
+<li><a href="#PkgName">type PkgName</a></li>
+<li> <a href="#NewPkgName">func NewPkgName(pos token.Pos, pkg *Package, name string, imported *Package) *PkgName</a>
+</li>
+<li> <a href="#PkgName.Exported">func (obj *PkgName) Exported() bool</a>
+</li>
+<li> <a href="#PkgName.Id">func (obj *PkgName) Id() string</a>
+</li>
+<li> <a href="#PkgName.Imported">func (obj *PkgName) Imported() *Package</a>
+</li>
+<li> <a href="#PkgName.Name">func (obj *PkgName) Name() string</a>
+</li>
+<li> <a href="#PkgName.Parent">func (obj *PkgName) Parent() *Scope</a>
+</li>
+<li> <a href="#PkgName.Pkg">func (obj *PkgName) Pkg() *Package</a>
+</li>
+<li> <a href="#PkgName.Pos">func (obj *PkgName) Pos() token.Pos</a>
+</li>
+<li> <a href="#PkgName.String">func (obj *PkgName) String() string</a>
+</li>
+<li> <a href="#PkgName.Type">func (obj *PkgName) Type() Type</a>
+</li>
+<li><a href="#Pointer">type Pointer</a></li>
+<li> <a href="#NewPointer">func NewPointer(elem Type) *Pointer</a>
+</li>
+<li> <a href="#Pointer.Elem">func (p *Pointer) Elem() Type</a>
+</li>
+<li> <a href="#Pointer.String">func (p *Pointer) String() string</a>
+</li>
+<li> <a href="#Pointer.Underlying">func (p *Pointer) Underlying() Type</a>
+</li>
+<li><a href="#Qualifier">type Qualifier</a></li>
+<li> <a href="#RelativeTo">func RelativeTo(pkg *Package) Qualifier</a>
+</li>
+<li><a href="#Scope">type Scope</a></li>
+<li> <a href="#NewScope">func NewScope(parent *Scope, pos, end token.Pos, comment string) *Scope</a>
+</li>
+<li> <a href="#Scope.Child">func (s *Scope) Child(i int) *Scope</a>
+</li>
+<li> <a href="#Scope.Contains">func (s *Scope) Contains(pos token.Pos) bool</a>
+</li>
+<li> <a href="#Scope.End">func (s *Scope) End() token.Pos</a>
+</li>
+<li> <a href="#Scope.Innermost">func (s *Scope) Innermost(pos token.Pos) *Scope</a>
+</li>
+<li> <a href="#Scope.Insert">func (s *Scope) Insert(obj Object) Object</a>
+</li>
+<li> <a href="#Scope.Len">func (s *Scope) Len() int</a>
+</li>
+<li> <a href="#Scope.Lookup">func (s *Scope) Lookup(name string) Object</a>
+</li>
+<li> <a href="#Scope.LookupParent">func (s *Scope) LookupParent(name string, pos token.Pos) (*Scope, Object)</a>
+</li>
+<li> <a href="#Scope.Names">func (s *Scope) Names() []string</a>
+</li>
+<li> <a href="#Scope.NumChildren">func (s *Scope) NumChildren() int</a>
+</li>
+<li> <a href="#Scope.Parent">func (s *Scope) Parent() *Scope</a>
+</li>
+<li> <a href="#Scope.Pos">func (s *Scope) Pos() token.Pos</a>
+</li>
+<li> <a href="#Scope.String">func (s *Scope) String() string</a>
+</li>
+<li> <a href="#Scope.WriteTo">func (s *Scope) WriteTo(w io.Writer, n int, recurse bool)</a>
+</li>
+<li><a href="#Selection">type Selection</a></li>
+<li> <a href="#Selection.Index">func (s *Selection) Index() []int</a>
+</li>
+<li> <a href="#Selection.Indirect">func (s *Selection) Indirect() bool</a>
+</li>
+<li> <a href="#Selection.Kind">func (s *Selection) Kind() SelectionKind</a>
+</li>
+<li> <a href="#Selection.Obj">func (s *Selection) Obj() Object</a>
+</li>
+<li> <a href="#Selection.Recv">func (s *Selection) Recv() Type</a>
+</li>
+<li> <a href="#Selection.String">func (s *Selection) String() string</a>
+</li>
+<li> <a href="#Selection.Type">func (s *Selection) Type() Type</a>
+</li>
+<li><a href="#SelectionKind">type SelectionKind</a></li>
+<li><a href="#Signature">type Signature</a></li>
+<li> <a href="#NewSignature">func NewSignature(recv *Var, params, results *Tuple, variadic bool) *Signature</a>
+</li>
+<li> <a href="#NewSignatureType">func NewSignatureType(recv *Var, recvTypeParams, typeParams []*TypeParam, params, results *Tuple, variadic bool) *Signature</a>
+</li>
+<li> <a href="#Signature.Params">func (s *Signature) Params() *Tuple</a>
+</li>
+<li> <a href="#Signature.Recv">func (s *Signature) Recv() *Var</a>
+</li>
+<li> <a href="#Signature.RecvTypeParams">func (s *Signature) RecvTypeParams() *TypeParamList</a>
+</li>
+<li> <a href="#Signature.Results">func (s *Signature) Results() *Tuple</a>
+</li>
+<li> <a href="#Signature.String">func (t *Signature) String() string</a>
+</li>
+<li> <a href="#Signature.TypeParams">func (s *Signature) TypeParams() *TypeParamList</a>
+</li>
+<li> <a href="#Signature.Underlying">func (t *Signature) Underlying() Type</a>
+</li>
+<li> <a href="#Signature.Variadic">func (s *Signature) Variadic() bool</a>
+</li>
+<li><a href="#Sizes">type Sizes</a></li>
+<li> <a href="#SizesFor">func SizesFor(compiler, arch string) Sizes</a>
+</li>
+<li><a href="#Slice">type Slice</a></li>
+<li> <a href="#NewSlice">func NewSlice(elem Type) *Slice</a>
+</li>
+<li> <a href="#Slice.Elem">func (s *Slice) Elem() Type</a>
+</li>
+<li> <a href="#Slice.String">func (s *Slice) String() string</a>
+</li>
+<li> <a href="#Slice.Underlying">func (s *Slice) Underlying() Type</a>
+</li>
+<li><a href="#StdSizes">type StdSizes</a></li>
+<li> <a href="#StdSizes.Alignof">func (s *StdSizes) Alignof(T Type) (result int64)</a>
+</li>
+<li> <a href="#StdSizes.Offsetsof">func (s *StdSizes) Offsetsof(fields []*Var) []int64</a>
+</li>
+<li> <a href="#StdSizes.Sizeof">func (s *StdSizes) Sizeof(T Type) int64</a>
+</li>
+<li><a href="#Struct">type Struct</a></li>
+<li> <a href="#NewStruct">func NewStruct(fields []*Var, tags []string) *Struct</a>
+</li>
+<li> <a href="#Struct.Field">func (s *Struct) Field(i int) *Var</a>
+</li>
+<li> <a href="#Struct.NumFields">func (s *Struct) NumFields() int</a>
+</li>
+<li> <a href="#Struct.String">func (t *Struct) String() string</a>
+</li>
+<li> <a href="#Struct.Tag">func (s *Struct) Tag(i int) string</a>
+</li>
+<li> <a href="#Struct.Underlying">func (t *Struct) Underlying() Type</a>
+</li>
+<li><a href="#Term">type Term</a></li>
+<li> <a href="#NewTerm">func NewTerm(tilde bool, typ Type) *Term</a>
+</li>
+<li> <a href="#Term.String">func (t *Term) String() string</a>
+</li>
+<li> <a href="#Term.Tilde">func (t *Term) Tilde() bool</a>
+</li>
+<li> <a href="#Term.Type">func (t *Term) Type() Type</a>
+</li>
+<li><a href="#Tuple">type Tuple</a></li>
+<li> <a href="#NewTuple">func NewTuple(x ...*Var) *Tuple</a>
+</li>
+<li> <a href="#Tuple.At">func (t *Tuple) At(i int) *Var</a>
+</li>
+<li> <a href="#Tuple.Len">func (t *Tuple) Len() int</a>
+</li>
+<li> <a href="#Tuple.String">func (t *Tuple) String() string</a>
+</li>
+<li> <a href="#Tuple.Underlying">func (t *Tuple) Underlying() Type</a>
+</li>
+<li><a href="#Type">type Type</a></li>
+<li> <a href="#Default">func Default(t Type) Type</a>
+</li>
+<li> <a href="#Instantiate">func Instantiate(ctxt *Context, orig Type, targs []Type, validate bool) (Type, error)</a>
+</li>
+<li> <a href="#Unalias">func Unalias(t Type) Type</a>
+</li>
+<li><a href="#TypeAndValue">type TypeAndValue</a></li>
+<li> <a href="#Eval">func Eval(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (_ TypeAndValue, err error)</a>
+</li>
+<li> <a href="#TypeAndValue.Addressable">func (tv TypeAndValue) Addressable() bool</a>
+</li>
+<li> <a href="#TypeAndValue.Assignable">func (tv TypeAndValue) Assignable() bool</a>
+</li>
+<li> <a href="#TypeAndValue.HasOk">func (tv TypeAndValue) HasOk() bool</a>
+</li>
+<li> <a href="#TypeAndValue.IsBuiltin">func (tv TypeAndValue) IsBuiltin() bool</a>
+</li>
+<li> <a href="#TypeAndValue.IsNil">func (tv TypeAndValue) IsNil() bool</a>
+</li>
+<li> <a href="#TypeAndValue.IsType">func (tv TypeAndValue) IsType() bool</a>
+</li>
+<li> <a href="#TypeAndValue.IsValue">func (tv TypeAndValue) IsValue() bool</a>
+</li>
+<li> <a href="#TypeAndValue.IsVoid">func (tv TypeAndValue) IsVoid() bool</a>
+</li>
+<li><a href="#TypeList">type TypeList</a></li>
+<li> <a href="#TypeList.At">func (l *TypeList) At(i int) Type</a>
+</li>
+<li> <a href="#TypeList.Len">func (l *TypeList) Len() int</a>
+</li>
+<li><a href="#TypeName">type TypeName</a></li>
+<li> <a href="#NewTypeName">func NewTypeName(pos token.Pos, pkg *Package, name string, typ Type) *TypeName</a>
+</li>
+<li> <a href="#TypeName.Exported">func (obj *TypeName) Exported() bool</a>
+</li>
+<li> <a href="#TypeName.Id">func (obj *TypeName) Id() string</a>
+</li>
+<li> <a href="#TypeName.IsAlias">func (obj *TypeName) IsAlias() bool</a>
+</li>
+<li> <a href="#TypeName.Name">func (obj *TypeName) Name() string</a>
+</li>
+<li> <a href="#TypeName.Parent">func (obj *TypeName) Parent() *Scope</a>
+</li>
+<li> <a href="#TypeName.Pkg">func (obj *TypeName) Pkg() *Package</a>
+</li>
+<li> <a href="#TypeName.Pos">func (obj *TypeName) Pos() token.Pos</a>
+</li>
+<li> <a href="#TypeName.String">func (obj *TypeName) String() string</a>
+</li>
+<li> <a href="#TypeName.Type">func (obj *TypeName) Type() Type</a>
+</li>
+<li><a href="#TypeParam">type TypeParam</a></li>
+<li> <a href="#NewTypeParam">func NewTypeParam(obj *TypeName, constraint Type) *TypeParam</a>
+</li>
+<li> <a href="#TypeParam.Constraint">func (t *TypeParam) Constraint() Type</a>
+</li>
+<li> <a href="#TypeParam.Index">func (t *TypeParam) Index() int</a>
+</li>
+<li> <a href="#TypeParam.Obj">func (t *TypeParam) Obj() *TypeName</a>
+</li>
+<li> <a href="#TypeParam.SetConstraint">func (t *TypeParam) SetConstraint(bound Type)</a>
+</li>
+<li> <a href="#TypeParam.String">func (t *TypeParam) String() string</a>
+</li>
+<li> <a href="#TypeParam.Underlying">func (t *TypeParam) Underlying() Type</a>
+</li>
+<li><a href="#TypeParamList">type TypeParamList</a></li>
+<li> <a href="#TypeParamList.At">func (l *TypeParamList) At(i int) *TypeParam</a>
+</li>
+<li> <a href="#TypeParamList.Len">func (l *TypeParamList) Len() int</a>
+</li>
+<li><a href="#Union">type Union</a></li>
+<li> <a href="#NewUnion">func NewUnion(terms []*Term) *Union</a>
+</li>
+<li> <a href="#Union.Len">func (u *Union) Len() int</a>
+</li>
+<li> <a href="#Union.String">func (u *Union) String() string</a>
+</li>
+<li> <a href="#Union.Term">func (u *Union) Term(i int) *Term</a>
+</li>
+<li> <a href="#Union.Underlying">func (u *Union) Underlying() Type</a>
+</li>
+<li><a href="#Var">type Var</a></li>
+<li> <a href="#NewField">func NewField(pos token.Pos, pkg *Package, name string, typ Type, embedded bool) *Var</a>
+</li>
+<li> <a href="#NewParam">func NewParam(pos token.Pos, pkg *Package, name string, typ Type) *Var</a>
+</li>
+<li> <a href="#NewVar">func NewVar(pos token.Pos, pkg *Package, name string, typ Type) *Var</a>
+</li>
+<li> <a href="#Var.Anonymous">func (obj *Var) Anonymous() bool</a>
+</li>
+<li> <a href="#Var.Embedded">func (obj *Var) Embedded() bool</a>
+</li>
+<li> <a href="#Var.Exported">func (obj *Var) Exported() bool</a>
+</li>
+<li> <a href="#Var.Id">func (obj *Var) Id() string</a>
+</li>
+<li> <a href="#Var.IsField">func (obj *Var) IsField() bool</a>
+</li>
+<li> <a href="#Var.Name">func (obj *Var) Name() string</a>
+</li>
+<li> <a href="#Var.Origin">func (obj *Var) Origin() *Var</a>
+</li>
+<li> <a href="#Var.Parent">func (obj *Var) Parent() *Scope</a>
+</li>
+<li> <a href="#Var.Pkg">func (obj *Var) Pkg() *Package</a>
+</li>
+<li> <a href="#Var.Pos">func (obj *Var) Pos() token.Pos</a>
+</li>
+<li> <a href="#Var.String">func (obj *Var) String() string</a>
+</li>
+<li> <a href="#Var.Type">func (obj *Var) Type() Type</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Info">Info</a></dd> <dd><a class="exampleLink" href="#example_MethodSet">MethodSet</a></dd> <dd><a class="exampleLink" href="#example_Scope">Scope</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>alias.go</span> <span>api.go</span> <span>api_predicates.go</span> <span>array.go</span> <span>assignments.go</span> <span>basic.go</span> <span>builtins.go</span> <span>call.go</span> <span>chan.go</span> <span>check.go</span> <span>const.go</span> <span>context.go</span> <span>conversions.go</span> <span>decl.go</span> <span>errors.go</span> <span>eval.go</span> <span>expr.go</span> <span>exprstring.go</span> <span>gccgosizes.go</span> <span>gcsizes.go</span> <span>generate.go</span> <span>index.go</span> <span>infer.go</span> <span>initorder.go</span> <span>instantiate.go</span> <span>interface.go</span> <span>labels.go</span> <span>lookup.go</span> <span>map.go</span> <span>methodset.go</span> <span>mono.go</span> <span>named.go</span> <span>object.go</span> <span>objset.go</span> <span>operand.go</span> <span>package.go</span> <span>pointer.go</span> <span>predicates.go</span> <span>resolver.go</span> <span>return.go</span> <span>scope.go</span> <span>selection.go</span> <span>signature.go</span> <span>sizes.go</span> <span>slice.go</span> <span>stmt.go</span> <span>struct.go</span> <span>subst.go</span> <span>termlist.go</span> <span>tuple.go</span> <span>type.go</span> <span>typelists.go</span> <span>typeparam.go</span> <span>typeset.go</span> <span>typestring.go</span> <span>typeterm.go</span> <span>typexpr.go</span> <span>under.go</span> <span>unify.go</span> <span>union.go</span> <span>universe.go</span> <span>util.go</span> <span>validtype.go</span> <span>version.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>Typ contains the predeclared *Basic types indexed by their corresponding BasicKind. </p>
+<p>The *Basic type for Typ[Byte] will have the name "uint8". Use Universe.Lookup("byte").Type() to obtain the specific alias basic type named "byte" (and analogous for "rune"). </p>
+<pre data-language="go">var Typ = []*Basic{
+ Invalid: {Invalid, 0, "invalid type"},
+
+ Bool: {Bool, IsBoolean, "bool"},
+ Int: {Int, IsInteger, "int"},
+ Int8: {Int8, IsInteger, "int8"},
+ Int16: {Int16, IsInteger, "int16"},
+ Int32: {Int32, IsInteger, "int32"},
+ Int64: {Int64, IsInteger, "int64"},
+ Uint: {Uint, IsInteger | IsUnsigned, "uint"},
+ Uint8: {Uint8, IsInteger | IsUnsigned, "uint8"},
+ Uint16: {Uint16, IsInteger | IsUnsigned, "uint16"},
+ Uint32: {Uint32, IsInteger | IsUnsigned, "uint32"},
+ Uint64: {Uint64, IsInteger | IsUnsigned, "uint64"},
+ Uintptr: {Uintptr, IsInteger | IsUnsigned, "uintptr"},
+ Float32: {Float32, IsFloat, "float32"},
+ Float64: {Float64, IsFloat, "float64"},
+ Complex64: {Complex64, IsComplex, "complex64"},
+ Complex128: {Complex128, IsComplex, "complex128"},
+ String: {String, IsString, "string"},
+ UnsafePointer: {UnsafePointer, 0, "Pointer"},
+
+ UntypedBool: {UntypedBool, IsBoolean | IsUntyped, "untyped bool"},
+ UntypedInt: {UntypedInt, IsInteger | IsUntyped, "untyped int"},
+ UntypedRune: {UntypedRune, IsInteger | IsUntyped, "untyped rune"},
+ UntypedFloat: {UntypedFloat, IsFloat | IsUntyped, "untyped float"},
+ UntypedComplex: {UntypedComplex, IsComplex | IsUntyped, "untyped complex"},
+ UntypedString: {UntypedString, IsString | IsUntyped, "untyped string"},
+ UntypedNil: {UntypedNil, IsUntyped, "untyped nil"},
+}</pre> <h2 id="AssertableTo">func <span>AssertableTo</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func AssertableTo(V *Interface, T Type) bool</pre> <p>AssertableTo reports whether a value of type V can be asserted to have type T. </p>
+<p>The behavior of AssertableTo is unspecified in three cases: </p>
+<ul> <li>if T is Typ[Invalid] </li>
+<li>if V is a generalized interface; i.e., an interface that may only be used as a type constraint in Go code </li>
+<li>if T is an uninstantiated generic type </li>
+</ul> <h2 id="AssignableTo">func <span>AssignableTo</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func AssignableTo(V, T Type) bool</pre> <p>AssignableTo reports whether a value of type V is assignable to a variable of type T. </p>
+<p>The behavior of AssignableTo is unspecified if V or T is Typ[Invalid] or an uninstantiated generic type. </p>
+<h2 id="CheckExpr">func <span>CheckExpr</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func CheckExpr(fset *token.FileSet, pkg *Package, pos token.Pos, expr ast.Expr, info *Info) (err error)</pre> <p>CheckExpr type checks the expression expr as if it had appeared at position pos of package pkg. <a href="#Type">Type</a> information about the expression is recorded in info. The expression may be an identifier denoting an uninstantiated generic function or type. </p>
+<p>If pkg == nil, the <a href="#Universe">Universe</a> scope is used and the provided position pos is ignored. If pkg != nil, and pos is invalid, the package scope is used. Otherwise, pos must belong to the package. </p>
+<p>An error is returned if pos is not within the package or if the node cannot be type-checked. </p>
+<p>Note: <a href="#Eval">Eval</a> and CheckExpr should not be used instead of running Check to compute types and values, but in addition to Check, as these functions ignore the context in which an expression is used (e.g., an assignment). Thus, top-level untyped constants will return an untyped type rather than the respective context-specific type. </p>
+<h2 id="Comparable">func <span>Comparable</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Comparable(T Type) bool</pre> <p>Comparable reports whether values of type T are comparable. </p>
+<h2 id="ConvertibleTo">func <span>ConvertibleTo</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func ConvertibleTo(V, T Type) bool</pre> <p>ConvertibleTo reports whether a value of type V is convertible to a value of type T. </p>
+<p>The behavior of ConvertibleTo is unspecified if V or T is Typ[Invalid] or an uninstantiated generic type. </p>
+<h2 id="DefPredeclaredTestFuncs">func <span>DefPredeclaredTestFuncs</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func DefPredeclaredTestFuncs()</pre> <p>DefPredeclaredTestFuncs defines the assert and trace built-ins. These built-ins are intended for debugging and testing of this package only. </p>
+<h2 id="ExprString">func <span>ExprString</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func ExprString(x ast.Expr) string</pre> <p>ExprString returns the (possibly shortened) string representation for x. Shortened representations are suitable for user interfaces but may not necessarily follow Go syntax. </p>
+<h2 id="Id">func <span>Id</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Id(pkg *Package, name string) string</pre> <p>Id returns name if it is exported, otherwise it returns the name qualified with the package path. </p>
+<h2 id="Identical">func <span>Identical</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Identical(x, y Type) bool</pre> <p>Identical reports whether x and y are identical types. Receivers of <a href="#Signature">Signature</a> types are ignored. </p>
+<h2 id="IdenticalIgnoreTags">func <span>IdenticalIgnoreTags</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func IdenticalIgnoreTags(x, y Type) bool</pre> <p>IdenticalIgnoreTags reports whether x and y are identical types if tags are ignored. Receivers of <a href="#Signature">Signature</a> types are ignored. </p>
+<h2 id="Implements">func <span>Implements</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Implements(V Type, T *Interface) bool</pre> <p>Implements reports whether type V implements interface T. </p>
+<p>The behavior of Implements is unspecified if V is Typ[Invalid] or an uninstantiated generic type. </p>
+<h2 id="IsInterface">func <span>IsInterface</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func IsInterface(t Type) bool</pre> <p>IsInterface reports whether t is an interface type. </p>
+<h2 id="ObjectString">func <span>ObjectString</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func ObjectString(obj Object, qf Qualifier) string</pre> <p>ObjectString returns the string form of obj. The Qualifier controls the printing of package-level objects, and may be nil. </p>
+<h2 id="Satisfies">func <span>Satisfies</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func Satisfies(V Type, T *Interface) bool</pre> <p>Satisfies reports whether type V satisfies the constraint T. </p>
+<p>The behavior of Satisfies is unspecified if V is Typ[Invalid] or an uninstantiated generic type. </p>
+<h2 id="SelectionString">func <span>SelectionString</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func SelectionString(s *Selection, qf Qualifier) string</pre> <p>SelectionString returns the string form of s. The Qualifier controls the printing of package-level objects, and may be nil. </p>
+<p>Examples: </p>
+<pre data-language="go">"field (T) f int"
+"method (T) f(X) Y"
+"method expr (T) f(X) Y"
+</pre> <h2 id="TypeString">func <span>TypeString</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func TypeString(typ Type, qf Qualifier) string</pre> <p>TypeString returns the string representation of typ. The <a href="#Qualifier">Qualifier</a> controls the printing of package-level objects, and may be nil. </p>
+<h2 id="WriteExpr">func <span>WriteExpr</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func WriteExpr(buf *bytes.Buffer, x ast.Expr)</pre> <p>WriteExpr writes the (possibly shortened) string representation for x to buf. Shortened representations are suitable for user interfaces but may not necessarily follow Go syntax. </p>
+<h2 id="WriteSignature">func <span>WriteSignature</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func WriteSignature(buf *bytes.Buffer, sig *Signature, qf Qualifier)</pre> <p>WriteSignature writes the representation of the signature sig to buf, without a leading "func" keyword. The <a href="#Qualifier">Qualifier</a> controls the printing of package-level objects, and may be nil. </p>
+<h2 id="WriteType">func <span>WriteType</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func WriteType(buf *bytes.Buffer, typ Type, qf Qualifier)</pre> <p>WriteType writes the string representation of typ to buf. The <a href="#Qualifier">Qualifier</a> controls the printing of package-level objects, and may be nil. </p>
+<h2 id="Alias">type <span>Alias</span> <span title="Added in Go 1.22">1.22</span> </h2> <p>An Alias represents an alias type. Whether or not Alias types are created is controlled by the gotypesalias setting with the GODEBUG environment variable. For gotypesalias=1, alias declarations produce an Alias type. Otherwise, the alias information is only in the type name, which points directly to the actual (aliased) type. </p>
+<pre data-language="go">type Alias struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewAlias">func <span>NewAlias</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func NewAlias(obj *TypeName, rhs Type) *Alias</pre> <p>NewAlias creates a new Alias type with the given type name and rhs. rhs must not be nil. </p>
+<h3 id="Alias.Obj">func (*Alias) <span>Obj</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (a *Alias) Obj() *TypeName</pre> <h3 id="Alias.String">func (*Alias) <span>String</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (a *Alias) String() string</pre> <h3 id="Alias.Underlying">func (*Alias) <span>Underlying</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (a *Alias) Underlying() Type</pre> <h2 id="ArgumentError">type <span>ArgumentError</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>An ArgumentError holds an error associated with an argument index. </p>
+<pre data-language="go">type ArgumentError struct {
+ Index int
+ Err error
+}
+</pre> <h3 id="ArgumentError.Error">func (*ArgumentError) <span>Error</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (e *ArgumentError) Error() string</pre> <h3 id="ArgumentError.Unwrap">func (*ArgumentError) <span>Unwrap</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (e *ArgumentError) Unwrap() error</pre> <h2 id="Array">type <span>Array</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>An Array represents an array type. </p>
+<pre data-language="go">type Array struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewArray">func <span>NewArray</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewArray(elem Type, len int64) *Array</pre> <p>NewArray returns a new array type for the given element type and length. A negative length indicates an unknown length. </p>
+<h3 id="Array.Elem">func (*Array) <span>Elem</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (a *Array) Elem() Type</pre> <p>Elem returns element type of array a. </p>
+<h3 id="Array.Len">func (*Array) <span>Len</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (a *Array) Len() int64</pre> <p>Len returns the length of array a. A negative result indicates an unknown length. </p>
+<h3 id="Array.String">func (*Array) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (a *Array) String() string</pre> <h3 id="Array.Underlying">func (*Array) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (a *Array) Underlying() Type</pre> <h2 id="Basic">type <span>Basic</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Basic represents a basic type. </p>
+<pre data-language="go">type Basic struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Basic.Info">func (*Basic) <span>Info</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (b *Basic) Info() BasicInfo</pre> <p>Info returns information about properties of basic type b. </p>
+<h3 id="Basic.Kind">func (*Basic) <span>Kind</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (b *Basic) Kind() BasicKind</pre> <p>Kind returns the kind of basic type b. </p>
+<h3 id="Basic.Name">func (*Basic) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (b *Basic) Name() string</pre> <p>Name returns the name of basic type b. </p>
+<h3 id="Basic.String">func (*Basic) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (b *Basic) String() string</pre> <h3 id="Basic.Underlying">func (*Basic) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (b *Basic) Underlying() Type</pre> <h2 id="BasicInfo">type <span>BasicInfo</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>BasicInfo is a set of flags describing properties of a basic type. </p>
+<pre data-language="go">type BasicInfo int</pre> <p>Properties of basic types. </p>
+<pre data-language="go">const (
+ IsBoolean BasicInfo = 1 &lt;&lt; iota
+ IsInteger
+ IsUnsigned
+ IsFloat
+ IsComplex
+ IsString
+ IsUntyped
+
+ IsOrdered = IsInteger | IsFloat | IsString
+ IsNumeric = IsInteger | IsFloat | IsComplex
+ IsConstType = IsBoolean | IsNumeric | IsString
+)</pre> <h2 id="BasicKind">type <span>BasicKind</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>BasicKind describes the kind of basic type. </p>
+<pre data-language="go">type BasicKind int</pre> <pre data-language="go">const (
+ Invalid BasicKind = iota // type is invalid
+
+ // predeclared types
+ Bool
+ Int
+ Int8
+ Int16
+ Int32
+ Int64
+ Uint
+ Uint8
+ Uint16
+ Uint32
+ Uint64
+ Uintptr
+ Float32
+ Float64
+ Complex64
+ Complex128
+ String
+ UnsafePointer
+
+ // types for untyped values
+ UntypedBool
+ UntypedInt
+ UntypedRune
+ UntypedFloat
+ UntypedComplex
+ UntypedString
+ UntypedNil
+
+ // aliases
+ Byte = Uint8
+ Rune = Int32
+)</pre> <h2 id="Builtin">type <span>Builtin</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Builtin represents a built-in function. Builtins don't have a valid type. </p>
+<pre data-language="go">type Builtin struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Builtin.Exported">func (*Builtin) <span>Exported</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Builtin) Exported() bool</pre> <p>Exported reports whether the object is exported (starts with a capital letter). It doesn't take into account whether the object is in a local (function) scope or not. </p>
+<h3 id="Builtin.Id">func (*Builtin) <span>Id</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Builtin) Id() string</pre> <p>Id is a wrapper for Id(obj.Pkg(), obj.Name()). </p>
+<h3 id="Builtin.Name">func (*Builtin) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Builtin) Name() string</pre> <p>Name returns the object's (package-local, unqualified) name. </p>
+<h3 id="Builtin.Parent">func (*Builtin) <span>Parent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Builtin) Parent() *Scope</pre> <p>Parent returns the scope in which the object is declared. The result is nil for methods and struct fields. </p>
+<h3 id="Builtin.Pkg">func (*Builtin) <span>Pkg</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Builtin) Pkg() *Package</pre> <p>Pkg returns the package to which the object belongs. The result is nil for labels and objects in the Universe scope. </p>
+<h3 id="Builtin.Pos">func (*Builtin) <span>Pos</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Builtin) Pos() token.Pos</pre> <p>Pos returns the declaration position of the object's identifier. </p>
+<h3 id="Builtin.String">func (*Builtin) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Builtin) String() string</pre> <h3 id="Builtin.Type">func (*Builtin) <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Builtin) Type() Type</pre> <p>Type returns the object's type. </p>
+<h2 id="Chan">type <span>Chan</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Chan represents a channel type. </p>
+<pre data-language="go">type Chan struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewChan">func <span>NewChan</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewChan(dir ChanDir, elem Type) *Chan</pre> <p>NewChan returns a new channel type for the given direction and element type. </p>
+<h3 id="Chan.Dir">func (*Chan) <span>Dir</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (c *Chan) Dir() ChanDir</pre> <p>Dir returns the direction of channel c. </p>
+<h3 id="Chan.Elem">func (*Chan) <span>Elem</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (c *Chan) Elem() Type</pre> <p>Elem returns the element type of channel c. </p>
+<h3 id="Chan.String">func (*Chan) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (c *Chan) String() string</pre> <h3 id="Chan.Underlying">func (*Chan) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (c *Chan) Underlying() Type</pre> <h2 id="ChanDir">type <span>ChanDir</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A ChanDir value indicates a channel direction. </p>
+<pre data-language="go">type ChanDir int</pre> <p>The direction of a channel is indicated by one of these constants. </p>
+<pre data-language="go">const (
+ SendRecv ChanDir = iota
+ SendOnly
+ RecvOnly
+)</pre> <h2 id="Checker">type <span>Checker</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Checker maintains the state of the type checker. It must be created with <a href="#NewChecker">NewChecker</a>. </p>
+<pre data-language="go">type Checker struct {
+ *Info
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewChecker">func <span>NewChecker</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewChecker(conf *Config, fset *token.FileSet, pkg *Package, info *Info) *Checker</pre> <p>NewChecker returns a new <a href="#Checker">Checker</a> instance for a given package. <a href="#Package">Package</a> files may be added incrementally via checker.Files. </p>
+<h3 id="Checker.Files">func (*Checker) <span>Files</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (check *Checker) Files(files []*ast.File) error</pre> <p>Files checks the provided files as part of the checker's package. </p>
+<h2 id="Config">type <span>Config</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Config specifies the configuration for type checking. The zero value for Config is a ready-to-use default configuration. </p>
+<pre data-language="go">type Config struct {
+ // Context is the context used for resolving global identifiers. If nil, the
+ // type checker will initialize this field with a newly created context.
+ Context *Context // Go 1.18
+
+ // GoVersion describes the accepted Go language version. The string must
+ // start with a prefix of the form "go%d.%d" (e.g. "go1.20", "go1.21rc1", or
+ // "go1.21.0") or it must be empty; an empty string disables Go language
+ // version checks. If the format is invalid, invoking the type checker will
+ // result in an error.
+ GoVersion string // Go 1.18
+
+ // If IgnoreFuncBodies is set, function bodies are not
+ // type-checked.
+ IgnoreFuncBodies bool
+
+ // If FakeImportC is set, `import "C"` (for packages requiring Cgo)
+ // declares an empty "C" package and errors are omitted for qualified
+ // identifiers referring to package C (which won't find an object).
+ // This feature is intended for the standard library cmd/api tool.
+ //
+ // Caution: Effects may be unpredictable due to follow-on errors.
+ // Do not use casually!
+ FakeImportC bool
+
+ // If Error != nil, it is called with each error found
+ // during type checking; err has dynamic type Error.
+ // Secondary errors (for instance, to enumerate all types
+ // involved in an invalid recursive type declaration) have
+ // error strings that start with a '\t' character.
+ // If Error == nil, type-checking stops with the first
+ // error found.
+ Error func(err error)
+
+ // An importer is used to import packages referred to from
+ // import declarations.
+ // If the installed importer implements ImporterFrom, the type
+ // checker calls ImportFrom instead of Import.
+ // The type checker reports an error if an importer is needed
+ // but none was installed.
+ Importer Importer
+
+ // If Sizes != nil, it provides the sizing functions for package unsafe.
+ // Otherwise SizesFor("gc", "amd64") is used instead.
+ Sizes Sizes
+
+ // If DisableUnusedImportCheck is set, packages are not checked
+ // for unused imports.
+ DisableUnusedImportCheck bool
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Config.Check">func (*Config) <span>Check</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (conf *Config) Check(path string, fset *token.FileSet, files []*ast.File, info *Info) (*Package, error)</pre> <p>Check type-checks a package and returns the resulting package object and the first error if any. Additionally, if info != nil, Check populates each of the non-nil maps in the <a href="#Info">Info</a> struct. </p>
+<p>The package is marked as complete if no errors occurred, otherwise it is incomplete. See [Config.Error] for controlling behavior in the presence of errors. </p>
+<p>The package is specified by a list of *ast.Files and corresponding file set, and the package path the package is identified with. The clean path must not be empty or dot ("."). </p>
+<h2 id="Const">type <span>Const</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Const represents a declared constant. </p>
+<pre data-language="go">type Const struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewConst">func <span>NewConst</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewConst(pos token.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const</pre> <p>NewConst returns a new constant with value val. The remaining arguments set the attributes found with all Objects. </p>
+<h3 id="Const.Exported">func (*Const) <span>Exported</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Const) Exported() bool</pre> <p>Exported reports whether the object is exported (starts with a capital letter). It doesn't take into account whether the object is in a local (function) scope or not. </p>
+<h3 id="Const.Id">func (*Const) <span>Id</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Const) Id() string</pre> <p>Id is a wrapper for Id(obj.Pkg(), obj.Name()). </p>
+<h3 id="Const.Name">func (*Const) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Const) Name() string</pre> <p>Name returns the object's (package-local, unqualified) name. </p>
+<h3 id="Const.Parent">func (*Const) <span>Parent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Const) Parent() *Scope</pre> <p>Parent returns the scope in which the object is declared. The result is nil for methods and struct fields. </p>
+<h3 id="Const.Pkg">func (*Const) <span>Pkg</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Const) Pkg() *Package</pre> <p>Pkg returns the package to which the object belongs. The result is nil for labels and objects in the Universe scope. </p>
+<h3 id="Const.Pos">func (*Const) <span>Pos</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Const) Pos() token.Pos</pre> <p>Pos returns the declaration position of the object's identifier. </p>
+<h3 id="Const.String">func (*Const) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Const) String() string</pre> <h3 id="Const.Type">func (*Const) <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Const) Type() Type</pre> <p>Type returns the object's type. </p>
+<h3 id="Const.Val">func (*Const) <span>Val</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Const) Val() constant.Value</pre> <p>Val returns the constant's value. </p>
+<h2 id="Context">type <span>Context</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>A Context is an opaque type checking context. It may be used to share identical type instances across type-checked packages or calls to Instantiate. Contexts are safe for concurrent use. </p>
+<p>The use of a shared context does not guarantee that identical instances are deduplicated in all cases. </p>
+<pre data-language="go">type Context struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewContext">func <span>NewContext</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func NewContext() *Context</pre> <p>NewContext creates a new Context. </p>
+<h2 id="Error">type <span>Error</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>An Error describes a type-checking error; it implements the error interface. A "soft" error is an error that still permits a valid interpretation of a package (such as "unused variable"); "hard" errors may lead to unpredictable behavior if ignored. </p>
+<pre data-language="go">type Error struct {
+ Fset *token.FileSet // file set for interpretation of Pos
+ Pos token.Pos // error position
+ Msg string // error message
+ Soft bool // if set, error is "soft"
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Error.Error">func (Error) <span>Error</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (err Error) Error() string</pre> <p>Error returns an error string formatted as follows: filename:line:column: message </p>
+<h2 id="Func">type <span>Func</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Func represents a declared function, concrete method, or abstract (interface) method. Its Type() is always a *Signature. An abstract method may belong to many interfaces due to embedding. </p>
+<pre data-language="go">type Func struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="MissingMethod">func <span>MissingMethod</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func MissingMethod(V Type, T *Interface, static bool) (method *Func, wrongType bool)</pre> <p>MissingMethod returns (nil, false) if V implements T, otherwise it returns a missing method required by T and whether it is missing or just has the wrong type: either a pointer receiver or wrong signature. </p>
+<p>For non-interface types V, or if static is set, V implements T if all methods of T are present in V. Otherwise (V is an interface and static is not set), MissingMethod only checks that methods of T which are also present in V have matching types (e.g., for a type assertion x.(T) where x is of interface type V). </p>
+<h3 id="NewFunc">func <span>NewFunc</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewFunc(pos token.Pos, pkg *Package, name string, sig *Signature) *Func</pre> <p>NewFunc returns a new function with the given signature, representing the function's type. </p>
+<h3 id="Func.Exported">func (*Func) <span>Exported</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) Exported() bool</pre> <p>Exported reports whether the object is exported (starts with a capital letter). It doesn't take into account whether the object is in a local (function) scope or not. </p>
+<h3 id="Func.FullName">func (*Func) <span>FullName</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) FullName() string</pre> <p>FullName returns the package- or receiver-type-qualified name of function or method obj. </p>
+<h3 id="Func.Id">func (*Func) <span>Id</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) Id() string</pre> <p>Id is a wrapper for Id(obj.Pkg(), obj.Name()). </p>
+<h3 id="Func.Name">func (*Func) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) Name() string</pre> <p>Name returns the object's (package-local, unqualified) name. </p>
+<h3 id="Func.Origin">func (*Func) <span>Origin</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (obj *Func) Origin() *Func</pre> <p>Origin returns the canonical Func for its receiver, i.e. the Func object recorded in Info.Defs. </p>
+<p>For synthetic functions created during instantiation (such as methods on an instantiated Named type or interface methods that depend on type arguments), this will be the corresponding Func on the generic (uninstantiated) type. For all other Funcs Origin returns the receiver. </p>
+<h3 id="Func.Parent">func (*Func) <span>Parent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) Parent() *Scope</pre> <p>Parent returns the scope in which the object is declared. The result is nil for methods and struct fields. </p>
+<h3 id="Func.Pkg">func (*Func) <span>Pkg</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) Pkg() *Package</pre> <p>Pkg returns the package to which the function belongs. </p>
+<p>The result is nil for methods of types in the Universe scope, like method Error of the error built-in interface type. </p>
+<h3 id="Func.Pos">func (*Func) <span>Pos</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) Pos() token.Pos</pre> <p>Pos returns the declaration position of the object's identifier. </p>
+<h3 id="Func.Scope">func (*Func) <span>Scope</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) Scope() *Scope</pre> <p>Scope returns the scope of the function's body block. The result is nil for imported or instantiated functions and methods (but there is also no mechanism to get to an instantiated function). </p>
+<h3 id="Func.String">func (*Func) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) String() string</pre> <h3 id="Func.Type">func (*Func) <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Func) Type() Type</pre> <p>Type returns the object's type. </p>
+<h2 id="ImportMode">type <span>ImportMode</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>ImportMode is reserved for future use. </p>
+<pre data-language="go">type ImportMode int</pre> <h2 id="Importer">type <span>Importer</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>An Importer resolves import paths to Packages. </p>
+<p>CAUTION: This interface does not support the import of locally vendored packages. See <a href="https://golang.org/s/go15vendor">https://golang.org/s/go15vendor</a>. If possible, external implementations should implement <a href="#ImporterFrom">ImporterFrom</a>. </p>
+<pre data-language="go">type Importer interface {
+ // Import returns the imported package for the given import path.
+ // The semantics is like for ImporterFrom.ImportFrom except that
+ // dir and mode are ignored (since they are not present).
+ Import(path string) (*Package, error)
+}</pre> <h2 id="ImporterFrom">type <span>ImporterFrom</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>An ImporterFrom resolves import paths to packages; it supports vendoring per <a href="https://golang.org/s/go15vendor">https://golang.org/s/go15vendor</a>. Use go/importer to obtain an ImporterFrom implementation. </p>
+<pre data-language="go">type ImporterFrom interface {
+ // Importer is present for backward-compatibility. Calling
+ // Import(path) is the same as calling ImportFrom(path, "", 0);
+ // i.e., locally vendored packages may not be found.
+ // The types package does not call Import if an ImporterFrom
+ // is present.
+ Importer
+
+ // ImportFrom returns the imported package for the given import
+ // path when imported by a package file located in dir.
+ // If the import failed, besides returning an error, ImportFrom
+ // is encouraged to cache and return a package anyway, if one
+ // was created. This will reduce package inconsistencies and
+ // follow-on type checker errors due to the missing package.
+ // The mode value must be 0; it is reserved for future use.
+ // Two calls to ImportFrom with the same path and dir must
+ // return the same package.
+ ImportFrom(path, dir string, mode ImportMode) (*Package, error)
+}</pre> <h2 id="Info">type <span>Info</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>Info holds result type information for a type-checked package. Only the information for which a map is provided is collected. If the package has type errors, the collected information may be incomplete. </p>
+<pre data-language="go">type Info struct {
+ // Types maps expressions to their types, and for constant
+ // expressions, also their values. Invalid expressions are
+ // omitted.
+ //
+ // For (possibly parenthesized) identifiers denoting built-in
+ // functions, the recorded signatures are call-site specific:
+ // if the call result is not a constant, the recorded type is
+ // an argument-specific signature. Otherwise, the recorded type
+ // is invalid.
+ //
+ // The Types map does not record the type of every identifier,
+ // only those that appear where an arbitrary expression is
+ // permitted. For instance, the identifier f in a selector
+ // expression x.f is found only in the Selections map, the
+ // identifier z in a variable declaration 'var z int' is found
+ // only in the Defs map, and identifiers denoting packages in
+ // qualified identifiers are collected in the Uses map.
+ Types map[ast.Expr]TypeAndValue
+
+ // Instances maps identifiers denoting generic types or functions to their
+ // type arguments and instantiated type.
+ //
+ // For example, Instances will map the identifier for 'T' in the type
+ // instantiation T[int, string] to the type arguments [int, string] and
+ // resulting instantiated *Named type. Given a generic function
+ // func F[A any](A), Instances will map the identifier for 'F' in the call
+ // expression F(int(1)) to the inferred type arguments [int], and resulting
+ // instantiated *Signature.
+ //
+ // Invariant: Instantiating Uses[id].Type() with Instances[id].TypeArgs
+ // results in an equivalent of Instances[id].Type.
+ Instances map[*ast.Ident]Instance // Go 1.18
+
+ // Defs maps identifiers to the objects they define (including
+ // package names, dots "." of dot-imports, and blank "_" identifiers).
+ // For identifiers that do not denote objects (e.g., the package name
+ // in package clauses, or symbolic variables t in t := x.(type) of
+ // type switch headers), the corresponding objects are nil.
+ //
+ // For an embedded field, Defs returns the field *Var it defines.
+ //
+ // Invariant: Defs[id] == nil || Defs[id].Pos() == id.Pos()
+ Defs map[*ast.Ident]Object
+
+ // Uses maps identifiers to the objects they denote.
+ //
+ // For an embedded field, Uses returns the *TypeName it denotes.
+ //
+ // Invariant: Uses[id].Pos() != id.Pos()
+ Uses map[*ast.Ident]Object
+
+ // Implicits maps nodes to their implicitly declared objects, if any.
+ // The following node and object types may appear:
+ //
+ // node declared object
+ //
+ // *ast.ImportSpec *PkgName for imports without renames
+ // *ast.CaseClause type-specific *Var for each type switch case clause (incl. default)
+ // *ast.Field anonymous parameter *Var (incl. unnamed results)
+ //
+ Implicits map[ast.Node]Object
+
+ // Selections maps selector expressions (excluding qualified identifiers)
+ // to their corresponding selections.
+ Selections map[*ast.SelectorExpr]*Selection
+
+ // Scopes maps ast.Nodes to the scopes they define. Package scopes are not
+ // associated with a specific node but with all files belonging to a package.
+ // Thus, the package scope can be found in the type-checked Package object.
+ // Scopes nest, with the Universe scope being the outermost scope, enclosing
+ // the package scope, which contains (one or more) files scopes, which enclose
+ // function scopes which in turn enclose statement and function literal scopes.
+ // Note that even though package-level functions are declared in the package
+ // scope, the function scopes are embedded in the file scope of the file
+ // containing the function declaration.
+ //
+ // The Scope of a function contains the declarations of any
+ // type parameters, parameters, and named results, plus any
+ // local declarations in the body block.
+ // It is coextensive with the complete extent of the
+ // function's syntax ([*ast.FuncDecl] or [*ast.FuncLit]).
+ // The Scopes mapping does not contain an entry for the
+ // function body ([*ast.BlockStmt]); the function's scope is
+ // associated with the [*ast.FuncType].
+ //
+ // The following node types may appear in Scopes:
+ //
+ // *ast.File
+ // *ast.FuncType
+ // *ast.TypeSpec
+ // *ast.BlockStmt
+ // *ast.IfStmt
+ // *ast.SwitchStmt
+ // *ast.TypeSwitchStmt
+ // *ast.CaseClause
+ // *ast.CommClause
+ // *ast.ForStmt
+ // *ast.RangeStmt
+ //
+ Scopes map[ast.Node]*Scope
+
+ // InitOrder is the list of package-level initializers in the order in which
+ // they must be executed. Initializers referring to variables related by an
+ // initialization dependency appear in topological order, the others appear
+ // in source order. Variables without an initialization expression do not
+ // appear in this list.
+ InitOrder []*Initializer
+
+ // FileVersions maps a file to its Go version string.
+ // If the file doesn't specify a version, the reported
+ // string is Config.GoVersion.
+ // Version strings begin with “go”, like “go1.21”, and
+ // are suitable for use with the [go/version] package.
+ FileVersions map[*ast.File]string // Go 1.22
+}
+</pre> <h4 id="example_Info"> <span class="text">Example</span>
+</h4> <p>ExampleInfo prints various facts recorded by the type checker in a types.Info struct: definitions of and references to each named object, and the type, value, and mode of every expression in the package. </p> <p>Code:</p> <pre class="code" data-language="go">// Parse a single source file.
+const input = `
+package fib
+
+type S string
+
+var a, b, c = len(b), S(c), "hello"
+
+func fib(x int) int {
+ if x &lt; 2 {
+ return x
+ }
+ return fib(x-1) - fib(x-2)
+}`
+// We need a specific fileset in this test below for positions.
+// Cannot use typecheck helper.
+fset := token.NewFileSet()
+f := mustParse(fset, input)
+
+// Type-check the package.
+// We create an empty map for each kind of input
+// we're interested in, and Check populates them.
+info := types.Info{
+ Types: make(map[ast.Expr]types.TypeAndValue),
+ Defs: make(map[*ast.Ident]types.Object),
+ Uses: make(map[*ast.Ident]types.Object),
+}
+var conf types.Config
+pkg, err := conf.Check("fib", fset, []*ast.File{f}, &amp;info)
+if err != nil {
+ log.Fatal(err)
+}
+
+// Print package-level variables in initialization order.
+fmt.Printf("InitOrder: %v\n\n", info.InitOrder)
+
+// For each named object, print the line and
+// column of its definition and each of its uses.
+fmt.Println("Defs and Uses of each named object:")
+usesByObj := make(map[types.Object][]string)
+for id, obj := range info.Uses {
+ posn := fset.Position(id.Pos())
+ lineCol := fmt.Sprintf("%d:%d", posn.Line, posn.Column)
+ usesByObj[obj] = append(usesByObj[obj], lineCol)
+}
+var items []string
+for obj, uses := range usesByObj {
+ sort.Strings(uses)
+ item := fmt.Sprintf("%s:\n defined at %s\n used at %s",
+ types.ObjectString(obj, types.RelativeTo(pkg)),
+ fset.Position(obj.Pos()),
+ strings.Join(uses, ", "))
+ items = append(items, item)
+}
+sort.Strings(items) // sort by line:col, in effect
+fmt.Println(strings.Join(items, "\n"))
+fmt.Println()
+
+fmt.Println("Types and Values of each expression:")
+items = nil
+for expr, tv := range info.Types {
+ var buf strings.Builder
+ posn := fset.Position(expr.Pos())
+ tvstr := tv.Type.String()
+ if tv.Value != nil {
+ tvstr += " = " + tv.Value.String()
+ }
+ // line:col | expr | mode : type = value
+ fmt.Fprintf(&amp;buf, "%2d:%2d | %-19s | %-7s : %s",
+ posn.Line, posn.Column, exprString(fset, expr),
+ mode(tv), tvstr)
+ items = append(items, buf.String())
+}
+sort.Strings(items)
+fmt.Println(strings.Join(items, "\n"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">InitOrder: [c = "hello" b = S(c) a = len(b)]
+
+Defs and Uses of each named object:
+builtin len:
+ defined at -
+ used at 6:15
+func fib(x int) int:
+ defined at fib:8:6
+ used at 12:20, 12:9
+type S string:
+ defined at fib:4:6
+ used at 6:23
+type int:
+ defined at -
+ used at 8:12, 8:17
+type string:
+ defined at -
+ used at 4:8
+var b S:
+ defined at fib:6:8
+ used at 6:19
+var c string:
+ defined at fib:6:11
+ used at 6:25
+var x int:
+ defined at fib:8:10
+ used at 10:10, 12:13, 12:24, 9:5
+
+Types and Values of each expression:
+ 4: 8 | string | type : string
+ 6:15 | len | builtin : func(fib.S) int
+ 6:15 | len(b) | value : int
+ 6:19 | b | var : fib.S
+ 6:23 | S | type : fib.S
+ 6:23 | S(c) | value : fib.S
+ 6:25 | c | var : string
+ 6:29 | "hello" | value : string = "hello"
+ 8:12 | int | type : int
+ 8:17 | int | type : int
+ 9: 5 | x | var : int
+ 9: 5 | x &lt; 2 | value : untyped bool
+ 9: 9 | 2 | value : int = 2
+10:10 | x | var : int
+12: 9 | fib | value : func(x int) int
+12: 9 | fib(x - 1) | value : int
+12: 9 | fib(x-1) - fib(x-2) | value : int
+12:13 | x | var : int
+12:13 | x - 1 | value : int
+12:15 | 1 | value : int = 1
+12:20 | fib | value : func(x int) int
+12:20 | fib(x - 2) | value : int
+12:24 | x | var : int
+12:24 | x - 2 | value : int
+12:26 | 2 | value : int = 2
+</pre> <h3 id="Info.ObjectOf">func (*Info) <span>ObjectOf</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (info *Info) ObjectOf(id *ast.Ident) Object</pre> <p>ObjectOf returns the object denoted by the specified id, or nil if not found. </p>
+<p>If id is an embedded struct field, <a href="#Info.ObjectOf">Info.ObjectOf</a> returns the field (*<a href="#Var">Var</a>) it defines, not the type (*<a href="#TypeName">TypeName</a>) it uses. </p>
+<p>Precondition: the Uses and Defs maps are populated. </p>
+<h3 id="Info.PkgNameOf">func (*Info) <span>PkgNameOf</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (info *Info) PkgNameOf(imp *ast.ImportSpec) *PkgName</pre> <p>PkgNameOf returns the local package name defined by the import, or nil if not found. </p>
+<p>For dot-imports, the package name is ".". </p>
+<p>Precondition: the Defs and Implicts maps are populated. </p>
+<h3 id="Info.TypeOf">func (*Info) <span>TypeOf</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (info *Info) TypeOf(e ast.Expr) Type</pre> <p>TypeOf returns the type of expression e, or nil if not found. Precondition: the Types, Uses and Defs maps are populated. </p>
+<h2 id="Initializer">type <span>Initializer</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>An Initializer describes a package-level variable, or a list of variables in case of a multi-valued initialization expression, and the corresponding initialization expression. </p>
+<pre data-language="go">type Initializer struct {
+ Lhs []*Var // var Lhs = Rhs
+ Rhs ast.Expr
+}
+</pre> <h3 id="Initializer.String">func (*Initializer) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (init *Initializer) String() string</pre> <h2 id="Instance">type <span>Instance</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>Instance reports the type arguments and instantiated type for type and function instantiations. For type instantiations, <a href="#Type">Type</a> will be of dynamic type *<a href="#Named">Named</a>. For function instantiations, <a href="#Type">Type</a> will be of dynamic type *Signature. </p>
+<pre data-language="go">type Instance struct {
+ TypeArgs *TypeList
+ Type Type
+}
+</pre> <h2 id="Interface">type <span>Interface</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>An Interface represents an interface type. </p>
+<pre data-language="go">type Interface struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewInterface">func <span>NewInterface</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewInterface(methods []*Func, embeddeds []*Named) *Interface</pre> <p>NewInterface returns a new interface for the given methods and embedded types. NewInterface takes ownership of the provided methods and may modify their types by setting missing receivers. </p>
+<p>Deprecated: Use NewInterfaceType instead which allows arbitrary embedded types. </p>
+<h3 id="NewInterfaceType">func <span>NewInterfaceType</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func NewInterfaceType(methods []*Func, embeddeds []Type) *Interface</pre> <p>NewInterfaceType returns a new interface for the given methods and embedded types. NewInterfaceType takes ownership of the provided methods and may modify their types by setting missing receivers. </p>
+<p>To avoid race conditions, the interface's type set should be computed before concurrent use of the interface, by explicitly calling Complete. </p>
+<h3 id="Interface.Complete">func (*Interface) <span>Complete</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) Complete() *Interface</pre> <p>Complete computes the interface's type set. It must be called by users of <a href="#NewInterfaceType">NewInterfaceType</a> and <a href="#NewInterface">NewInterface</a> after the interface's embedded types are fully defined and before using the interface type in any way other than to form other types. The interface must not contain duplicate methods or a panic occurs. Complete returns the receiver. </p>
+<p>Interface types that have been completed are safe for concurrent use. </p>
+<h3 id="Interface.Embedded">func (*Interface) <span>Embedded</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) Embedded(i int) *Named</pre> <p>Embedded returns the i'th embedded defined (*<a href="#Named">Named</a>) type of interface t for 0 &lt;= i &lt; t.NumEmbeddeds(). The result is nil if the i'th embedded type is not a defined type. </p>
+<p>Deprecated: Use <a href="#Interface.EmbeddedType">Interface.EmbeddedType</a> which is not restricted to defined (*<a href="#Named">Named</a>) types. </p>
+<h3 id="Interface.EmbeddedType">func (*Interface) <span>EmbeddedType</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (t *Interface) EmbeddedType(i int) Type</pre> <p>EmbeddedType returns the i'th embedded type of interface t for 0 &lt;= i &lt; t.NumEmbeddeds(). </p>
+<h3 id="Interface.Empty">func (*Interface) <span>Empty</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) Empty() bool</pre> <p>Empty reports whether t is the empty interface. </p>
+<h3 id="Interface.ExplicitMethod">func (*Interface) <span>ExplicitMethod</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) ExplicitMethod(i int) *Func</pre> <p>ExplicitMethod returns the i'th explicitly declared method of interface t for 0 &lt;= i &lt; t.NumExplicitMethods(). The methods are ordered by their unique <a href="#Id">Id</a>. </p>
+<h3 id="Interface.IsComparable">func (*Interface) <span>IsComparable</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Interface) IsComparable() bool</pre> <p>IsComparable reports whether each type in interface t's type set is comparable. </p>
+<h3 id="Interface.IsImplicit">func (*Interface) <span>IsImplicit</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Interface) IsImplicit() bool</pre> <p>IsImplicit reports whether the interface t is a wrapper for a type set literal. </p>
+<h3 id="Interface.IsMethodSet">func (*Interface) <span>IsMethodSet</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Interface) IsMethodSet() bool</pre> <p>IsMethodSet reports whether the interface t is fully described by its method set. </p>
+<h3 id="Interface.MarkImplicit">func (*Interface) <span>MarkImplicit</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Interface) MarkImplicit()</pre> <p>MarkImplicit marks the interface t as implicit, meaning this interface corresponds to a constraint literal such as ~T or A|B without explicit interface embedding. MarkImplicit should be called before any concurrent use of implicit interfaces. </p>
+<h3 id="Interface.Method">func (*Interface) <span>Method</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) Method(i int) *Func</pre> <p>Method returns the i'th method of interface t for 0 &lt;= i &lt; t.NumMethods(). The methods are ordered by their unique Id. </p>
+<h3 id="Interface.NumEmbeddeds">func (*Interface) <span>NumEmbeddeds</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) NumEmbeddeds() int</pre> <p>NumEmbeddeds returns the number of embedded types in interface t. </p>
+<h3 id="Interface.NumExplicitMethods">func (*Interface) <span>NumExplicitMethods</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) NumExplicitMethods() int</pre> <p>NumExplicitMethods returns the number of explicitly declared methods of interface t. </p>
+<h3 id="Interface.NumMethods">func (*Interface) <span>NumMethods</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) NumMethods() int</pre> <p>NumMethods returns the total number of methods of interface t. </p>
+<h3 id="Interface.String">func (*Interface) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) String() string</pre> <h3 id="Interface.Underlying">func (*Interface) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Interface) Underlying() Type</pre> <h2 id="Label">type <span>Label</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Label represents a declared label. Labels don't have a type. </p>
+<pre data-language="go">type Label struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewLabel">func <span>NewLabel</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewLabel(pos token.Pos, pkg *Package, name string) *Label</pre> <p>NewLabel returns a new label. </p>
+<h3 id="Label.Exported">func (*Label) <span>Exported</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Label) Exported() bool</pre> <p>Exported reports whether the object is exported (starts with a capital letter). It doesn't take into account whether the object is in a local (function) scope or not. </p>
+<h3 id="Label.Id">func (*Label) <span>Id</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Label) Id() string</pre> <p>Id is a wrapper for Id(obj.Pkg(), obj.Name()). </p>
+<h3 id="Label.Name">func (*Label) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Label) Name() string</pre> <p>Name returns the object's (package-local, unqualified) name. </p>
+<h3 id="Label.Parent">func (*Label) <span>Parent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Label) Parent() *Scope</pre> <p>Parent returns the scope in which the object is declared. The result is nil for methods and struct fields. </p>
+<h3 id="Label.Pkg">func (*Label) <span>Pkg</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Label) Pkg() *Package</pre> <p>Pkg returns the package to which the object belongs. The result is nil for labels and objects in the Universe scope. </p>
+<h3 id="Label.Pos">func (*Label) <span>Pos</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Label) Pos() token.Pos</pre> <p>Pos returns the declaration position of the object's identifier. </p>
+<h3 id="Label.String">func (*Label) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Label) String() string</pre> <h3 id="Label.Type">func (*Label) <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Label) Type() Type</pre> <p>Type returns the object's type. </p>
+<h2 id="Map">type <span>Map</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Map represents a map type. </p>
+<pre data-language="go">type Map struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewMap">func <span>NewMap</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewMap(key, elem Type) *Map</pre> <p>NewMap returns a new map for the given key and element types. </p>
+<h3 id="Map.Elem">func (*Map) <span>Elem</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (m *Map) Elem() Type</pre> <p>Elem returns the element type of map m. </p>
+<h3 id="Map.Key">func (*Map) <span>Key</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (m *Map) Key() Type</pre> <p>Key returns the key type of map m. </p>
+<h3 id="Map.String">func (*Map) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Map) String() string</pre> <h3 id="Map.Underlying">func (*Map) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Map) Underlying() Type</pre> <h2 id="MethodSet">type <span>MethodSet</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A MethodSet is an ordered set of concrete or abstract (interface) methods; a method is a <a href="#MethodVal">MethodVal</a> selection, and they are ordered by ascending m.Obj().Id(). The zero value for a MethodSet is a ready-to-use empty method set. </p>
+<pre data-language="go">type MethodSet struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_MethodSet"> <span class="text">Example</span>
+</h4> <p>ExampleMethodSet prints the method sets of various types. </p> <p>Code:</p> <pre class="code" data-language="go">// Parse a single source file.
+const input = `
+package temperature
+import "fmt"
+type Celsius float64
+func (c Celsius) String() string { return fmt.Sprintf("%g°C", c) }
+func (c *Celsius) SetF(f float64) { *c = Celsius(f - 32 / 9 * 5) }
+
+type S struct { I; m int }
+type I interface { m() byte }
+`
+fset := token.NewFileSet()
+f, err := parser.ParseFile(fset, "celsius.go", input, 0)
+if err != nil {
+ log.Fatal(err)
+}
+
+// Type-check a package consisting of this file.
+// Type information for the imported packages
+// comes from $GOROOT/pkg/$GOOS_$GOOARCH/fmt.a.
+conf := types.Config{Importer: importer.Default()}
+pkg, err := conf.Check("temperature", fset, []*ast.File{f}, nil)
+if err != nil {
+ log.Fatal(err)
+}
+
+// Print the method sets of Celsius and *Celsius.
+celsius := pkg.Scope().Lookup("Celsius").Type()
+for _, t := range []types.Type{celsius, types.NewPointer(celsius)} {
+ fmt.Printf("Method set of %s:\n", t)
+ mset := types.NewMethodSet(t)
+ for i := 0; i &lt; mset.Len(); i++ {
+ fmt.Println(mset.At(i))
+ }
+ fmt.Println()
+}
+
+// Print the method set of S.
+styp := pkg.Scope().Lookup("S").Type()
+fmt.Printf("Method set of %s:\n", styp)
+fmt.Println(types.NewMethodSet(styp))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Method set of temperature.Celsius:
+method (temperature.Celsius) String() string
+
+Method set of *temperature.Celsius:
+method (*temperature.Celsius) SetF(f float64)
+method (*temperature.Celsius) String() string
+
+Method set of temperature.S:
+MethodSet {}
+</pre> <h3 id="NewMethodSet">func <span>NewMethodSet</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewMethodSet(T Type) *MethodSet</pre> <p>NewMethodSet returns the method set for the given type T. It always returns a non-nil method set, even if it is empty. </p>
+<h3 id="MethodSet.At">func (*MethodSet) <span>At</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *MethodSet) At(i int) *Selection</pre> <p>At returns the i'th method in s for 0 &lt;= i &lt; s.Len(). </p>
+<h3 id="MethodSet.Len">func (*MethodSet) <span>Len</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *MethodSet) Len() int</pre> <p>Len returns the number of methods in s. </p>
+<h3 id="MethodSet.Lookup">func (*MethodSet) <span>Lookup</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *MethodSet) Lookup(pkg *Package, name string) *Selection</pre> <p>Lookup returns the method with matching package and name, or nil if not found. </p>
+<h3 id="MethodSet.String">func (*MethodSet) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *MethodSet) String() string</pre> <h2 id="Named">type <span>Named</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Named represents a named (defined) type. </p>
+<pre data-language="go">type Named struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewNamed">func <span>NewNamed</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewNamed(obj *TypeName, underlying Type, methods []*Func) *Named</pre> <p>NewNamed returns a new named type for the given type name, underlying type, and associated methods. If the given type name obj doesn't have a type yet, its type is set to the returned named type. The underlying type must not be a *Named. </p>
+<h3 id="Named.AddMethod">func (*Named) <span>AddMethod</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Named) AddMethod(m *Func)</pre> <p>AddMethod adds method m unless it is already in the method list. t must not have type arguments. </p>
+<h3 id="Named.Method">func (*Named) <span>Method</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Named) Method(i int) *Func</pre> <p>Method returns the i'th method of named type t for 0 &lt;= i &lt; t.NumMethods(). </p>
+<p>For an ordinary or instantiated type t, the receiver base type of this method is the named type t. For an uninstantiated generic type t, each method receiver is instantiated with its receiver type parameters. </p>
+<h3 id="Named.NumMethods">func (*Named) <span>NumMethods</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Named) NumMethods() int</pre> <p>NumMethods returns the number of explicit methods defined for t. </p>
+<h3 id="Named.Obj">func (*Named) <span>Obj</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Named) Obj() *TypeName</pre> <p>Obj returns the type name for the declaration defining the named type t. For instantiated types, this is same as the type name of the origin type. </p>
+<h3 id="Named.Origin">func (*Named) <span>Origin</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Named) Origin() *Named</pre> <p>Origin returns the generic type from which the named type t is instantiated. If t is not an instantiated type, the result is t. </p>
+<h3 id="Named.SetTypeParams">func (*Named) <span>SetTypeParams</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Named) SetTypeParams(tparams []*TypeParam)</pre> <p>SetTypeParams sets the type parameters of the named type t. t must not have type arguments. </p>
+<h3 id="Named.SetUnderlying">func (*Named) <span>SetUnderlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Named) SetUnderlying(underlying Type)</pre> <p>SetUnderlying sets the underlying type and marks t as complete. t must not have type arguments. </p>
+<h3 id="Named.String">func (*Named) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Named) String() string</pre> <h3 id="Named.TypeArgs">func (*Named) <span>TypeArgs</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Named) TypeArgs() *TypeList</pre> <p>TypeArgs returns the type arguments used to instantiate the named type t. </p>
+<h3 id="Named.TypeParams">func (*Named) <span>TypeParams</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Named) TypeParams() *TypeParamList</pre> <p>TypeParams returns the type parameters of the named type t, or nil. The result is non-nil for an (originally) generic type even if it is instantiated. </p>
+<h3 id="Named.Underlying">func (*Named) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Named) Underlying() Type</pre> <p>TODO(gri) Investigate if Unalias can be moved to where underlying is set. </p>
+<h2 id="Nil">type <span>Nil</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>Nil represents the predeclared value nil. </p>
+<pre data-language="go">type Nil struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Nil.Exported">func (*Nil) <span>Exported</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Nil) Exported() bool</pre> <p>Exported reports whether the object is exported (starts with a capital letter). It doesn't take into account whether the object is in a local (function) scope or not. </p>
+<h3 id="Nil.Id">func (*Nil) <span>Id</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Nil) Id() string</pre> <p>Id is a wrapper for Id(obj.Pkg(), obj.Name()). </p>
+<h3 id="Nil.Name">func (*Nil) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Nil) Name() string</pre> <p>Name returns the object's (package-local, unqualified) name. </p>
+<h3 id="Nil.Parent">func (*Nil) <span>Parent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Nil) Parent() *Scope</pre> <p>Parent returns the scope in which the object is declared. The result is nil for methods and struct fields. </p>
+<h3 id="Nil.Pkg">func (*Nil) <span>Pkg</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Nil) Pkg() *Package</pre> <p>Pkg returns the package to which the object belongs. The result is nil for labels and objects in the Universe scope. </p>
+<h3 id="Nil.Pos">func (*Nil) <span>Pos</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Nil) Pos() token.Pos</pre> <p>Pos returns the declaration position of the object's identifier. </p>
+<h3 id="Nil.String">func (*Nil) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Nil) String() string</pre> <h3 id="Nil.Type">func (*Nil) <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Nil) Type() Type</pre> <p>Type returns the object's type. </p>
+<h2 id="Object">type <span>Object</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>An Object describes a named language entity such as a package, constant, type, variable, function (incl. methods), or label. All objects implement the Object interface. </p>
+<pre data-language="go">type Object interface {
+ Parent() *Scope // scope in which this object is declared; nil for methods and struct fields
+ Pos() token.Pos // position of object identifier in declaration
+ Pkg() *Package // package to which this object belongs; nil for labels and objects in the Universe scope
+ Name() string // package local object name
+ Type() Type // object type
+ Exported() bool // reports whether the name starts with a capital letter
+ Id() string // object name if exported, qualified name if not exported (see func Id)
+
+ // String returns a human-readable string of the object.
+ String() string
+ // contains filtered or unexported methods
+}</pre> <h3 id="LookupFieldOrMethod">func <span>LookupFieldOrMethod</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (obj Object, index []int, indirect bool)</pre> <p>LookupFieldOrMethod looks up a field or method with given package and name in T and returns the corresponding *Var or *Func, an index sequence, and a bool indicating if there were any pointer indirections on the path to the field or method. If addressable is set, T is the type of an addressable variable (only matters for method lookups). T must not be nil. </p>
+<p>The last index entry is the field or method index in the (possibly embedded) type where the entry was found, either: </p>
+<ol> <li>the list of declared methods of a named type; or </li>
+<li>the list of all methods (method set) of an interface type; or </li>
+<li>the list of fields of a struct type. </li>
+</ol> <p>The earlier index entries are the indices of the embedded struct fields traversed to get to the found entry, starting at depth 0. </p>
+<p>If no entry is found, a nil object is returned. In this case, the returned index and indirect values have the following meaning: </p>
+<ul> <li><p>If index != nil, the index sequence points to an ambiguous entry (the same name appeared more than once at the same embedding level). </p></li>
+<li><p>If indirect is set, a method with a pointer receiver type was found but there was no pointer on the path from the actual receiver type to the method's formal receiver base type, nor was the receiver addressable. </p></li>
+</ul> <h2 id="Package">type <span>Package</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Package describes a Go package. </p>
+<pre data-language="go">type Package struct {
+ // contains filtered or unexported fields
+}
+</pre> <p>The Unsafe package is the package returned by an importer for the import path "unsafe". </p>
+<pre data-language="go">var Unsafe *Package</pre> <h3 id="NewPackage">func <span>NewPackage</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewPackage(path, name string) *Package</pre> <p>NewPackage returns a new Package for the given package path and name. The package is not complete and contains no explicit imports. </p>
+<h3 id="Package.Complete">func (*Package) <span>Complete</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (pkg *Package) Complete() bool</pre> <p>A package is complete if its scope contains (at least) all exported objects; otherwise it is incomplete. </p>
+<h3 id="Package.GoVersion">func (*Package) <span>GoVersion</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (pkg *Package) GoVersion() string</pre> <p>GoVersion returns the minimum Go version required by this package. If the minimum version is unknown, GoVersion returns the empty string. Individual source files may specify a different minimum Go version, as reported in the <span>go/ast.File.GoVersion</span> field. </p>
+<h3 id="Package.Imports">func (*Package) <span>Imports</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (pkg *Package) Imports() []*Package</pre> <p>Imports returns the list of packages directly imported by pkg; the list is in source order. </p>
+<p>If pkg was loaded from export data, Imports includes packages that provide package-level objects referenced by pkg. This may be more or less than the set of packages directly imported by pkg's source code. </p>
+<p>If pkg uses cgo and the FakeImportC configuration option was enabled, the imports list may contain a fake "C" package. </p>
+<h3 id="Package.MarkComplete">func (*Package) <span>MarkComplete</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (pkg *Package) MarkComplete()</pre> <p>MarkComplete marks a package as complete. </p>
+<h3 id="Package.Name">func (*Package) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (pkg *Package) Name() string</pre> <p>Name returns the package name. </p>
+<h3 id="Package.Path">func (*Package) <span>Path</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (pkg *Package) Path() string</pre> <p>Path returns the package path. </p>
+<h3 id="Package.Scope">func (*Package) <span>Scope</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (pkg *Package) Scope() *Scope</pre> <p>Scope returns the (complete or incomplete) package scope holding the objects declared at package level (TypeNames, Consts, Vars, and Funcs). For a nil pkg receiver, Scope returns the Universe scope. </p>
+<h3 id="Package.SetImports">func (*Package) <span>SetImports</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (pkg *Package) SetImports(list []*Package)</pre> <p>SetImports sets the list of explicitly imported packages to list. It is the caller's responsibility to make sure list elements are unique. </p>
+<h3 id="Package.SetName">func (*Package) <span>SetName</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (pkg *Package) SetName(name string)</pre> <p>SetName sets the package name. </p>
+<h3 id="Package.String">func (*Package) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (pkg *Package) String() string</pre> <h2 id="PkgName">type <span>PkgName</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A PkgName represents an imported Go package. PkgNames don't have a type. </p>
+<pre data-language="go">type PkgName struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewPkgName">func <span>NewPkgName</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewPkgName(pos token.Pos, pkg *Package, name string, imported *Package) *PkgName</pre> <p>NewPkgName returns a new PkgName object representing an imported package. The remaining arguments set the attributes found with all Objects. </p>
+<h3 id="PkgName.Exported">func (*PkgName) <span>Exported</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *PkgName) Exported() bool</pre> <p>Exported reports whether the object is exported (starts with a capital letter). It doesn't take into account whether the object is in a local (function) scope or not. </p>
+<h3 id="PkgName.Id">func (*PkgName) <span>Id</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *PkgName) Id() string</pre> <p>Id is a wrapper for Id(obj.Pkg(), obj.Name()). </p>
+<h3 id="PkgName.Imported">func (*PkgName) <span>Imported</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *PkgName) Imported() *Package</pre> <p>Imported returns the package that was imported. It is distinct from Pkg(), which is the package containing the import statement. </p>
+<h3 id="PkgName.Name">func (*PkgName) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *PkgName) Name() string</pre> <p>Name returns the object's (package-local, unqualified) name. </p>
+<h3 id="PkgName.Parent">func (*PkgName) <span>Parent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *PkgName) Parent() *Scope</pre> <p>Parent returns the scope in which the object is declared. The result is nil for methods and struct fields. </p>
+<h3 id="PkgName.Pkg">func (*PkgName) <span>Pkg</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *PkgName) Pkg() *Package</pre> <p>Pkg returns the package to which the object belongs. The result is nil for labels and objects in the Universe scope. </p>
+<h3 id="PkgName.Pos">func (*PkgName) <span>Pos</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *PkgName) Pos() token.Pos</pre> <p>Pos returns the declaration position of the object's identifier. </p>
+<h3 id="PkgName.String">func (*PkgName) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *PkgName) String() string</pre> <h3 id="PkgName.Type">func (*PkgName) <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *PkgName) Type() Type</pre> <p>Type returns the object's type. </p>
+<h2 id="Pointer">type <span>Pointer</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Pointer represents a pointer type. </p>
+<pre data-language="go">type Pointer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewPointer">func <span>NewPointer</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewPointer(elem Type) *Pointer</pre> <p>NewPointer returns a new pointer type for the given element (base) type. </p>
+<h3 id="Pointer.Elem">func (*Pointer) <span>Elem</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *Pointer) Elem() Type</pre> <p>Elem returns the element type for the given pointer p. </p>
+<h3 id="Pointer.String">func (*Pointer) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *Pointer) String() string</pre> <h3 id="Pointer.Underlying">func (*Pointer) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *Pointer) Underlying() Type</pre> <h2 id="Qualifier">type <span>Qualifier</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Qualifier controls how named package-level objects are printed in calls to <a href="#TypeString">TypeString</a>, <a href="#ObjectString">ObjectString</a>, and <a href="#SelectionString">SelectionString</a>. </p>
+<p>These three formatting routines call the Qualifier for each package-level object O, and if the Qualifier returns a non-empty string p, the object is printed in the form p.O. If it returns an empty string, only the object name O is printed. </p>
+<p>Using a nil Qualifier is equivalent to using (*<a href="#Package">Package</a>).Path: the object is qualified by the import path, e.g., "encoding/json.Marshal". </p>
+<pre data-language="go">type Qualifier func(*Package) string</pre> <h3 id="RelativeTo">func <span>RelativeTo</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func RelativeTo(pkg *Package) Qualifier</pre> <p>RelativeTo returns a <a href="#Qualifier">Qualifier</a> that fully qualifies members of all packages other than pkg. </p>
+<h2 id="Scope">type <span>Scope</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Scope maintains a set of objects and links to its containing (parent) and contained (children) scopes. Objects may be inserted and looked up by name. The zero value for Scope is a ready-to-use empty scope. </p>
+<pre data-language="go">type Scope struct {
+ // contains filtered or unexported fields
+}
+</pre> <p>The Universe scope contains all predeclared objects of Go. It is the outermost scope of any chain of nested scopes. </p>
+<pre data-language="go">var Universe *Scope</pre> <h4 id="example_Scope"> <span class="text">Example</span>
+</h4> <p>ExampleScope prints the tree of Scopes of a package created from a set of parsed files. </p> <p>Code:</p> <pre class="code" data-language="go">// Parse the source files for a package.
+fset := token.NewFileSet()
+var files []*ast.File
+for _, src := range []string{
+ `package main
+import "fmt"
+func main() {
+ freezing := FToC(-18)
+ fmt.Println(freezing, Boiling) }
+`,
+ `package main
+import "fmt"
+type Celsius float64
+func (c Celsius) String() string { return fmt.Sprintf("%g°C", c) }
+func FToC(f float64) Celsius { return Celsius(f - 32 / 9 * 5) }
+const Boiling Celsius = 100
+func Unused() { {}; {{ var x int; _ = x }} } // make sure empty block scopes get printed
+`,
+} {
+ files = append(files, mustParse(fset, src))
+}
+
+// Type-check a package consisting of these files.
+// Type information for the imported "fmt" package
+// comes from $GOROOT/pkg/$GOOS_$GOOARCH/fmt.a.
+conf := types.Config{Importer: importer.Default()}
+pkg, err := conf.Check("temperature", fset, files, nil)
+if err != nil {
+ log.Fatal(err)
+}
+
+// Print the tree of scopes.
+// For determinism, we redact addresses.
+var buf strings.Builder
+pkg.Scope().WriteTo(&amp;buf, 0, true)
+rx := regexp.MustCompile(` 0x[a-fA-F\d]*`)
+fmt.Println(rx.ReplaceAllString(buf.String(), ""))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">package "temperature" scope {
+. const temperature.Boiling temperature.Celsius
+. type temperature.Celsius float64
+. func temperature.FToC(f float64) temperature.Celsius
+. func temperature.Unused()
+. func temperature.main()
+. main scope {
+. . package fmt
+. . function scope {
+. . . var freezing temperature.Celsius
+. . }
+. }
+. main scope {
+. . package fmt
+. . function scope {
+. . . var c temperature.Celsius
+. . }
+. . function scope {
+. . . var f float64
+. . }
+. . function scope {
+. . . block scope {
+. . . }
+. . . block scope {
+. . . . block scope {
+. . . . . var x int
+. . . . }
+. . . }
+. . }
+. }
+}
+</pre> <h3 id="NewScope">func <span>NewScope</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewScope(parent *Scope, pos, end token.Pos, comment string) *Scope</pre> <p>NewScope returns a new, empty scope contained in the given parent scope, if any. The comment is for debugging only. </p>
+<h3 id="Scope.Child">func (*Scope) <span>Child</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) Child(i int) *Scope</pre> <p>Child returns the i'th child scope for 0 &lt;= i &lt; NumChildren(). </p>
+<h3 id="Scope.Contains">func (*Scope) <span>Contains</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) Contains(pos token.Pos) bool</pre> <p>Contains reports whether pos is within the scope's extent. The result is guaranteed to be valid only if the type-checked AST has complete position information. </p>
+<h3 id="Scope.End">func (*Scope) <span>End</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) End() token.Pos</pre> <h3 id="Scope.Innermost">func (*Scope) <span>Innermost</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) Innermost(pos token.Pos) *Scope</pre> <p>Innermost returns the innermost (child) scope containing pos. If pos is not within any scope, the result is nil. The result is also nil for the Universe scope. The result is guaranteed to be valid only if the type-checked AST has complete position information. </p>
+<h3 id="Scope.Insert">func (*Scope) <span>Insert</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) Insert(obj Object) Object</pre> <p>Insert attempts to insert an object obj into scope s. If s already contains an alternative object alt with the same name, Insert leaves s unchanged and returns alt. Otherwise it inserts obj, sets the object's parent scope if not already set, and returns nil. </p>
+<h3 id="Scope.Len">func (*Scope) <span>Len</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) Len() int</pre> <p>Len returns the number of scope elements. </p>
+<h3 id="Scope.Lookup">func (*Scope) <span>Lookup</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) Lookup(name string) Object</pre> <p>Lookup returns the object in scope s with the given name if such an object exists; otherwise the result is nil. </p>
+<h3 id="Scope.LookupParent">func (*Scope) <span>LookupParent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) LookupParent(name string, pos token.Pos) (*Scope, Object)</pre> <p>LookupParent follows the parent chain of scopes starting with s until it finds a scope where Lookup(name) returns a non-nil object, and then returns that scope and object. If a valid position pos is provided, only objects that were declared at or before pos are considered. If no such scope and object exists, the result is (nil, nil). </p>
+<p>Note that obj.Parent() may be different from the returned scope if the object was inserted into the scope and already had a parent at that time (see Insert). This can only happen for dot-imported objects whose scope is the scope of the package that exported them. </p>
+<h3 id="Scope.Names">func (*Scope) <span>Names</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) Names() []string</pre> <p>Names returns the scope's element names in sorted order. </p>
+<h3 id="Scope.NumChildren">func (*Scope) <span>NumChildren</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) NumChildren() int</pre> <p>NumChildren returns the number of scopes nested in s. </p>
+<h3 id="Scope.Parent">func (*Scope) <span>Parent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) Parent() *Scope</pre> <p>Parent returns the scope's containing (parent) scope. </p>
+<h3 id="Scope.Pos">func (*Scope) <span>Pos</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) Pos() token.Pos</pre> <p>Pos and End describe the scope's source code extent [pos, end). The results are guaranteed to be valid only if the type-checked AST has complete position information. The extent is undefined for Universe and package scopes. </p>
+<h3 id="Scope.String">func (*Scope) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) String() string</pre> <p>String returns a string representation of the scope, for debugging. </p>
+<h3 id="Scope.WriteTo">func (*Scope) <span>WriteTo</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Scope) WriteTo(w io.Writer, n int, recurse bool)</pre> <p>WriteTo writes a string representation of the scope to w, with the scope elements sorted by name. The level of indentation is controlled by n &gt;= 0, with n == 0 for no indentation. If recurse is set, it also writes nested (children) scopes. </p>
+<h2 id="Selection">type <span>Selection</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Selection describes a selector expression x.f. For the declarations: </p>
+<pre data-language="go">type T struct{ x int; E }
+type E struct{}
+func (e E) m() {}
+var p *T
+</pre> <p>the following relations exist: </p>
+<pre data-language="go">Selector Kind Recv Obj Type Index Indirect
+
+p.x FieldVal T x int {0} true
+p.m MethodVal *T m func() {1, 0} true
+T.m MethodExpr T m func(T) {1, 0} false
+</pre> <pre data-language="go">type Selection struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Selection.Index">func (*Selection) <span>Index</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Selection) Index() []int</pre> <p>Index describes the path from x to f in x.f. The last index entry is the field or method index of the type declaring f; either: </p>
+<ol> <li>the list of declared methods of a named type; or </li>
+<li>the list of methods of an interface type; or </li>
+<li>the list of fields of a struct type. </li>
+</ol> <p>The earlier index entries are the indices of the embedded fields implicitly traversed to get from (the type of) x to f, starting at embedding depth 0. </p>
+<h3 id="Selection.Indirect">func (*Selection) <span>Indirect</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Selection) Indirect() bool</pre> <p>Indirect reports whether any pointer indirection was required to get from x to f in x.f. </p>
+<p>Beware: Indirect spuriously returns true (Go issue #8353) for a MethodVal selection in which the receiver argument and parameter both have type *T so there is no indirection. Unfortunately, a fix is too risky. </p>
+<h3 id="Selection.Kind">func (*Selection) <span>Kind</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Selection) Kind() SelectionKind</pre> <p>Kind returns the selection kind. </p>
+<h3 id="Selection.Obj">func (*Selection) <span>Obj</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Selection) Obj() Object</pre> <p>Obj returns the object denoted by x.f; a *Var for a field selection, and a *Func in all other cases. </p>
+<h3 id="Selection.Recv">func (*Selection) <span>Recv</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Selection) Recv() Type</pre> <p>Recv returns the type of x in x.f. </p>
+<h3 id="Selection.String">func (*Selection) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Selection) String() string</pre> <h3 id="Selection.Type">func (*Selection) <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Selection) Type() Type</pre> <p>Type returns the type of x.f, which may be different from the type of f. See Selection for more information. </p>
+<h2 id="SelectionKind">type <span>SelectionKind</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>SelectionKind describes the kind of a selector expression x.f (excluding qualified identifiers). </p>
+<p>If x is a struct or *struct, a selector expression x.f may denote a sequence of selection operations x.a.b.c.f. The SelectionKind describes the kind of the final (explicit) operation; all the previous (implicit) operations are always field selections. Each element of Indices specifies an implicit field (a, b, c) by its index in the struct type of the field selection operand. </p>
+<p>For a FieldVal operation, the final selection refers to the field specified by Selection.Obj. </p>
+<p>For a MethodVal operation, the final selection refers to a method. If the "pointerness" of the method's declared receiver does not match that of the effective receiver after implicit field selection, then an &amp; or * operation is implicitly applied to the receiver variable or value. So, x.f denotes (&amp;x.a.b.c).f when f requires a pointer receiver but x.a.b.c is a non-pointer variable; and it denotes (*x.a.b.c).f when f requires a non-pointer receiver but x.a.b.c is a pointer value. </p>
+<p>All pointer indirections, whether due to implicit or explicit field selections or * operations inserted for "pointerness", panic if applied to a nil pointer, so a method call x.f() may panic even before the function call. </p>
+<p>By contrast, a MethodExpr operation T.f is essentially equivalent to a function literal of the form: </p>
+<pre data-language="go">func(x T, args) (results) { return x.f(args) }
+</pre> <p>Consequently, any implicit field selections and * operations inserted for "pointerness" are not evaluated until the function is called, so a T.f or (*T).f expression never panics. </p>
+<pre data-language="go">type SelectionKind int</pre> <pre data-language="go">const (
+ FieldVal SelectionKind = iota // x.f is a struct field selector
+ MethodVal // x.f is a method selector
+ MethodExpr // x.f is a method expression
+)</pre> <h2 id="Signature">type <span>Signature</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Signature represents a (non-builtin) function or method type. The receiver is ignored when comparing signatures for identity. </p>
+<pre data-language="go">type Signature struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewSignature">func <span>NewSignature</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewSignature(recv *Var, params, results *Tuple, variadic bool) *Signature</pre> <p>NewSignature returns a new function type for the given receiver, parameters, and results, either of which may be nil. If variadic is set, the function is variadic, it must have at least one parameter, and the last parameter must be of unnamed slice type. </p>
+<p>Deprecated: Use <a href="#NewSignatureType">NewSignatureType</a> instead which allows for type parameters. </p>
+<h3 id="NewSignatureType">func <span>NewSignatureType</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func NewSignatureType(recv *Var, recvTypeParams, typeParams []*TypeParam, params, results *Tuple, variadic bool) *Signature</pre> <p>NewSignatureType creates a new function type for the given receiver, receiver type parameters, type parameters, parameters, and results. If variadic is set, params must hold at least one parameter and the last parameter's core type must be of unnamed slice or bytestring type. If recv is non-nil, typeParams must be empty. If recvTypeParams is non-empty, recv must be non-nil. </p>
+<h3 id="Signature.Params">func (*Signature) <span>Params</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Signature) Params() *Tuple</pre> <p>Params returns the parameters of signature s, or nil. </p>
+<h3 id="Signature.Recv">func (*Signature) <span>Recv</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Signature) Recv() *Var</pre> <p>Recv returns the receiver of signature s (if a method), or nil if a function. It is ignored when comparing signatures for identity. </p>
+<p>For an abstract method, Recv returns the enclosing interface either as a *<a href="#Named">Named</a> or an *<a href="#Interface">Interface</a>. Due to embedding, an interface may contain methods whose receiver type is a different interface. </p>
+<h3 id="Signature.RecvTypeParams">func (*Signature) <span>RecvTypeParams</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (s *Signature) RecvTypeParams() *TypeParamList</pre> <p>RecvTypeParams returns the receiver type parameters of signature s, or nil. </p>
+<h3 id="Signature.Results">func (*Signature) <span>Results</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Signature) Results() *Tuple</pre> <p>Results returns the results of signature s, or nil. </p>
+<h3 id="Signature.String">func (*Signature) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Signature) String() string</pre> <h3 id="Signature.TypeParams">func (*Signature) <span>TypeParams</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (s *Signature) TypeParams() *TypeParamList</pre> <p>TypeParams returns the type parameters of signature s, or nil. </p>
+<h3 id="Signature.Underlying">func (*Signature) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Signature) Underlying() Type</pre> <h3 id="Signature.Variadic">func (*Signature) <span>Variadic</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Signature) Variadic() bool</pre> <p>Variadic reports whether the signature s is variadic. </p>
+<h2 id="Sizes">type <span>Sizes</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>Sizes defines the sizing functions for package unsafe. </p>
+<pre data-language="go">type Sizes interface {
+ // Alignof returns the alignment of a variable of type T.
+ // Alignof must implement the alignment guarantees required by the spec.
+ // The result must be &gt;= 1.
+ Alignof(T Type) int64
+
+ // Offsetsof returns the offsets of the given struct fields, in bytes.
+ // Offsetsof must implement the offset guarantees required by the spec.
+ // A negative entry in the result indicates that the struct is too large.
+ Offsetsof(fields []*Var) []int64
+
+ // Sizeof returns the size of a variable of type T.
+ // Sizeof must implement the size guarantees required by the spec.
+ // A negative result indicates that T is too large.
+ Sizeof(T Type) int64
+}</pre> <h3 id="SizesFor">func <span>SizesFor</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func SizesFor(compiler, arch string) Sizes</pre> <p>SizesFor returns the Sizes used by a compiler for an architecture. The result is nil if a compiler/architecture pair is not known. </p>
+<p>Supported architectures for compiler "gc": "386", "amd64", "amd64p32", "arm", "arm64", "loong64", "mips", "mipsle", "mips64", "mips64le", "ppc64", "ppc64le", "riscv64", "s390x", "sparc64", "wasm". </p>
+<h2 id="Slice">type <span>Slice</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Slice represents a slice type. </p>
+<pre data-language="go">type Slice struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewSlice">func <span>NewSlice</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewSlice(elem Type) *Slice</pre> <p>NewSlice returns a new slice type for the given element type. </p>
+<h3 id="Slice.Elem">func (*Slice) <span>Elem</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Slice) Elem() Type</pre> <p>Elem returns the element type of slice s. </p>
+<h3 id="Slice.String">func (*Slice) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Slice) String() string</pre> <h3 id="Slice.Underlying">func (*Slice) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Slice) Underlying() Type</pre> <h2 id="StdSizes">type <span>StdSizes</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>StdSizes is a convenience type for creating commonly used Sizes. It makes the following simplifying assumptions: </p>
+<ul> <li>The size of explicitly sized basic types (int16, etc.) is the specified size. </li>
+<li>The size of strings and interfaces is 2*WordSize. </li>
+<li>The size of slices is 3*WordSize. </li>
+<li>The size of an array of n elements corresponds to the size of a struct of n consecutive fields of the array's element type. </li>
+<li>The size of a struct is the offset of the last field plus that field's size. As with all element types, if the struct is used in an array its size must first be aligned to a multiple of the struct's alignment. </li>
+<li>All other types have size WordSize. </li>
+<li>Arrays and structs are aligned per spec definition; all other types are naturally aligned with a maximum alignment MaxAlign. </li>
+</ul> <p>*StdSizes implements Sizes. </p>
+<pre data-language="go">type StdSizes struct {
+ WordSize int64 // word size in bytes - must be &gt;= 4 (32bits)
+ MaxAlign int64 // maximum alignment in bytes - must be &gt;= 1
+}
+</pre> <h3 id="StdSizes.Alignof">func (*StdSizes) <span>Alignof</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *StdSizes) Alignof(T Type) (result int64)</pre> <h3 id="StdSizes.Offsetsof">func (*StdSizes) <span>Offsetsof</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *StdSizes) Offsetsof(fields []*Var) []int64</pre> <h3 id="StdSizes.Sizeof">func (*StdSizes) <span>Sizeof</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *StdSizes) Sizeof(T Type) int64</pre> <h2 id="Struct">type <span>Struct</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Struct represents a struct type. </p>
+<pre data-language="go">type Struct struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewStruct">func <span>NewStruct</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewStruct(fields []*Var, tags []string) *Struct</pre> <p>NewStruct returns a new struct with the given fields and corresponding field tags. If a field with index i has a tag, tags[i] must be that tag, but len(tags) may be only as long as required to hold the tag with the largest index i. Consequently, if no field has a tag, tags may be nil. </p>
+<h3 id="Struct.Field">func (*Struct) <span>Field</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Struct) Field(i int) *Var</pre> <p>Field returns the i'th field for 0 &lt;= i &lt; NumFields(). </p>
+<h3 id="Struct.NumFields">func (*Struct) <span>NumFields</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Struct) NumFields() int</pre> <p>NumFields returns the number of fields in the struct (including blank and embedded fields). </p>
+<h3 id="Struct.String">func (*Struct) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Struct) String() string</pre> <h3 id="Struct.Tag">func (*Struct) <span>Tag</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (s *Struct) Tag(i int) string</pre> <p>Tag returns the i'th field tag for 0 &lt;= i &lt; NumFields(). </p>
+<h3 id="Struct.Underlying">func (*Struct) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Struct) Underlying() Type</pre> <h2 id="Term">type <span>Term</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>A Term represents a term in a <a href="#Union">Union</a>. </p>
+<pre data-language="go">type Term term</pre> <h3 id="NewTerm">func <span>NewTerm</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func NewTerm(tilde bool, typ Type) *Term</pre> <p>NewTerm returns a new union term. </p>
+<h3 id="Term.String">func (*Term) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Term) String() string</pre> <h3 id="Term.Tilde">func (*Term) <span>Tilde</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Term) Tilde() bool</pre> <h3 id="Term.Type">func (*Term) <span>Type</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *Term) Type() Type</pre> <h2 id="Tuple">type <span>Tuple</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Tuple represents an ordered list of variables; a nil *Tuple is a valid (empty) tuple. Tuples are used as components of signatures and to represent the type of multiple assignments; they are not first class types of Go. </p>
+<pre data-language="go">type Tuple struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewTuple">func <span>NewTuple</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewTuple(x ...*Var) *Tuple</pre> <p>NewTuple returns a new tuple for the given variables. </p>
+<h3 id="Tuple.At">func (*Tuple) <span>At</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Tuple) At(i int) *Var</pre> <p>At returns the i'th variable of tuple t. </p>
+<h3 id="Tuple.Len">func (*Tuple) <span>Len</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Tuple) Len() int</pre> <p>Len returns the number variables of tuple t. </p>
+<h3 id="Tuple.String">func (*Tuple) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Tuple) String() string</pre> <h3 id="Tuple.Underlying">func (*Tuple) <span>Underlying</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Tuple) Underlying() Type</pre> <h2 id="Type">type <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Type represents a type of Go. All types implement the Type interface. </p>
+<pre data-language="go">type Type interface {
+ // Underlying returns the underlying type of a type.
+ Underlying() Type
+
+ // String returns a string representation of a type.
+ String() string
+}</pre> <h3 id="Default">func <span>Default</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func Default(t Type) Type</pre> <p>Default returns the default "typed" type for an "untyped" type; it returns the incoming type for all other types. The default type for untyped nil is untyped nil. </p>
+<h3 id="Instantiate">func <span>Instantiate</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func Instantiate(ctxt *Context, orig Type, targs []Type, validate bool) (Type, error)</pre> <p>Instantiate instantiates the type orig with the given type arguments targs. orig must be a *Named or a *Signature type. If there is no error, the resulting Type is an instantiated type of the same kind (either a *Named or a *Signature). Methods attached to a *Named type are also instantiated, and associated with a new *Func that has the same position as the original method, but nil function scope. </p>
+<p>If ctxt is non-nil, it may be used to de-duplicate the instance against previous instances with the same identity. As a special case, generic *Signature origin types are only considered identical if they are pointer equivalent, so that instantiating distinct (but possibly identical) signatures will yield different instances. The use of a shared context does not guarantee that identical instances are deduplicated in all cases. </p>
+<p>If validate is set, Instantiate verifies that the number of type arguments and parameters match, and that the type arguments satisfy their corresponding type constraints. If verification fails, the resulting error may wrap an *ArgumentError indicating which type argument did not satisfy its corresponding type parameter constraint, and why. </p>
+<p>If validate is not set, Instantiate does not verify the type argument count or whether the type arguments satisfy their constraints. Instantiate is guaranteed to not return an error, but may panic. Specifically, for *Signature types, Instantiate will panic immediately if the type argument count is incorrect; for *Named types, a panic may occur later inside the *Named API. </p>
+<h3 id="Unalias">func <span>Unalias</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func Unalias(t Type) Type</pre> <p>Unalias returns t if it is not an alias type; otherwise it follows t's alias chain until it reaches a non-alias type which is then returned. Consequently, the result is never an alias type. </p>
+<h2 id="TypeAndValue">type <span>TypeAndValue</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>TypeAndValue reports the type and value (for constants) of the corresponding expression. </p>
+<pre data-language="go">type TypeAndValue struct {
+ Type Type
+ Value constant.Value
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Eval">func <span>Eval</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func Eval(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (_ TypeAndValue, err error)</pre> <p>Eval returns the type and, if constant, the value for the expression expr, evaluated at position pos of package pkg, which must have been derived from type-checking an AST with complete position information relative to the provided file set. </p>
+<p>The meaning of the parameters fset, pkg, and pos is the same as in <a href="#CheckExpr">CheckExpr</a>. An error is returned if expr cannot be parsed successfully, or the resulting expr AST cannot be type-checked. </p>
+<h3 id="TypeAndValue.Addressable">func (TypeAndValue) <span>Addressable</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (tv TypeAndValue) Addressable() bool</pre> <p>Addressable reports whether the corresponding expression is addressable (<a href="https://golang.org/ref/spec#Address_operators">https://golang.org/ref/spec#Address_operators</a>). </p>
+<h3 id="TypeAndValue.Assignable">func (TypeAndValue) <span>Assignable</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (tv TypeAndValue) Assignable() bool</pre> <p>Assignable reports whether the corresponding expression is assignable to (provided a value of the right type). </p>
+<h3 id="TypeAndValue.HasOk">func (TypeAndValue) <span>HasOk</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (tv TypeAndValue) HasOk() bool</pre> <p>HasOk reports whether the corresponding expression may be used on the rhs of a comma-ok assignment. </p>
+<h3 id="TypeAndValue.IsBuiltin">func (TypeAndValue) <span>IsBuiltin</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (tv TypeAndValue) IsBuiltin() bool</pre> <p>IsBuiltin reports whether the corresponding expression denotes a (possibly parenthesized) built-in function. </p>
+<h3 id="TypeAndValue.IsNil">func (TypeAndValue) <span>IsNil</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (tv TypeAndValue) IsNil() bool</pre> <p>IsNil reports whether the corresponding expression denotes the predeclared value nil. </p>
+<h3 id="TypeAndValue.IsType">func (TypeAndValue) <span>IsType</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (tv TypeAndValue) IsType() bool</pre> <p>IsType reports whether the corresponding expression specifies a type. </p>
+<h3 id="TypeAndValue.IsValue">func (TypeAndValue) <span>IsValue</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (tv TypeAndValue) IsValue() bool</pre> <p>IsValue reports whether the corresponding expression is a value. Builtins are not considered values. Constant values have a non- nil Value. </p>
+<h3 id="TypeAndValue.IsVoid">func (TypeAndValue) <span>IsVoid</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (tv TypeAndValue) IsVoid() bool</pre> <p>IsVoid reports whether the corresponding expression is a function call without results. </p>
+<h2 id="TypeList">type <span>TypeList</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>TypeList holds a list of types. </p>
+<pre data-language="go">type TypeList struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="TypeList.At">func (*TypeList) <span>At</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (l *TypeList) At(i int) Type</pre> <p>At returns the i'th type in the list. </p>
+<h3 id="TypeList.Len">func (*TypeList) <span>Len</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (l *TypeList) Len() int</pre> <p>Len returns the number of types in the list. It is safe to call on a nil receiver. </p>
+<h2 id="TypeName">type <span>TypeName</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A TypeName represents a name for a (defined or alias) type. </p>
+<pre data-language="go">type TypeName struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewTypeName">func <span>NewTypeName</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewTypeName(pos token.Pos, pkg *Package, name string, typ Type) *TypeName</pre> <p>NewTypeName returns a new type name denoting the given typ. The remaining arguments set the attributes found with all Objects. </p>
+<p>The typ argument may be a defined (Named) type or an alias type. It may also be nil such that the returned TypeName can be used as argument for NewNamed, which will set the TypeName's type as a side- effect. </p>
+<h3 id="TypeName.Exported">func (*TypeName) <span>Exported</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *TypeName) Exported() bool</pre> <p>Exported reports whether the object is exported (starts with a capital letter). It doesn't take into account whether the object is in a local (function) scope or not. </p>
+<h3 id="TypeName.Id">func (*TypeName) <span>Id</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *TypeName) Id() string</pre> <p>Id is a wrapper for Id(obj.Pkg(), obj.Name()). </p>
+<h3 id="TypeName.IsAlias">func (*TypeName) <span>IsAlias</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (obj *TypeName) IsAlias() bool</pre> <p>IsAlias reports whether obj is an alias name for a type. </p>
+<h3 id="TypeName.Name">func (*TypeName) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *TypeName) Name() string</pre> <p>Name returns the object's (package-local, unqualified) name. </p>
+<h3 id="TypeName.Parent">func (*TypeName) <span>Parent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *TypeName) Parent() *Scope</pre> <p>Parent returns the scope in which the object is declared. The result is nil for methods and struct fields. </p>
+<h3 id="TypeName.Pkg">func (*TypeName) <span>Pkg</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *TypeName) Pkg() *Package</pre> <p>Pkg returns the package to which the object belongs. The result is nil for labels and objects in the Universe scope. </p>
+<h3 id="TypeName.Pos">func (*TypeName) <span>Pos</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *TypeName) Pos() token.Pos</pre> <p>Pos returns the declaration position of the object's identifier. </p>
+<h3 id="TypeName.String">func (*TypeName) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *TypeName) String() string</pre> <h3 id="TypeName.Type">func (*TypeName) <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *TypeName) Type() Type</pre> <p>Type returns the object's type. </p>
+<h2 id="TypeParam">type <span>TypeParam</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>A TypeParam represents a type parameter type. </p>
+<pre data-language="go">type TypeParam struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewTypeParam">func <span>NewTypeParam</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func NewTypeParam(obj *TypeName, constraint Type) *TypeParam</pre> <p>NewTypeParam returns a new TypeParam. Type parameters may be set on a Named or Signature type by calling SetTypeParams. Setting a type parameter on more than one type will result in a panic. </p>
+<p>The constraint argument can be nil, and set later via SetConstraint. If the constraint is non-nil, it must be fully defined. </p>
+<h3 id="TypeParam.Constraint">func (*TypeParam) <span>Constraint</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *TypeParam) Constraint() Type</pre> <p>Constraint returns the type constraint specified for t. </p>
+<h3 id="TypeParam.Index">func (*TypeParam) <span>Index</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *TypeParam) Index() int</pre> <p>Index returns the index of the type param within its param list, or -1 if the type parameter has not yet been bound to a type. </p>
+<h3 id="TypeParam.Obj">func (*TypeParam) <span>Obj</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *TypeParam) Obj() *TypeName</pre> <p>Obj returns the type name for the type parameter t. </p>
+<h3 id="TypeParam.SetConstraint">func (*TypeParam) <span>SetConstraint</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *TypeParam) SetConstraint(bound Type)</pre> <p>SetConstraint sets the type constraint for t. </p>
+<p>It must be called by users of NewTypeParam after the bound's underlying is fully defined, and before using the type parameter in any way other than to form other types. Once SetConstraint returns the receiver, t is safe for concurrent use. </p>
+<h3 id="TypeParam.String">func (*TypeParam) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *TypeParam) String() string</pre> <h3 id="TypeParam.Underlying">func (*TypeParam) <span>Underlying</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (t *TypeParam) Underlying() Type</pre> <h2 id="TypeParamList">type <span>TypeParamList</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>TypeParamList holds a list of type parameters. </p>
+<pre data-language="go">type TypeParamList struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="TypeParamList.At">func (*TypeParamList) <span>At</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (l *TypeParamList) At(i int) *TypeParam</pre> <p>At returns the i'th type parameter in the list. </p>
+<h3 id="TypeParamList.Len">func (*TypeParamList) <span>Len</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (l *TypeParamList) Len() int</pre> <p>Len returns the number of type parameters in the list. It is safe to call on a nil receiver. </p>
+<h2 id="Union">type <span>Union</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>A Union represents a union of terms embedded in an interface. </p>
+<pre data-language="go">type Union struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewUnion">func <span>NewUnion</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func NewUnion(terms []*Term) *Union</pre> <p>NewUnion returns a new <a href="#Union">Union</a> type with the given terms. It is an error to create an empty union; they are syntactically not possible. </p>
+<h3 id="Union.Len">func (*Union) <span>Len</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (u *Union) Len() int</pre> <h3 id="Union.String">func (*Union) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (u *Union) String() string</pre> <h3 id="Union.Term">func (*Union) <span>Term</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (u *Union) Term(i int) *Term</pre> <h3 id="Union.Underlying">func (*Union) <span>Underlying</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (u *Union) Underlying() Type</pre> <h2 id="Var">type <span>Var</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Variable represents a declared variable (including function parameters and results, and struct fields). </p>
+<pre data-language="go">type Var struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewField">func <span>NewField</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewField(pos token.Pos, pkg *Package, name string, typ Type, embedded bool) *Var</pre> <p>NewField returns a new variable representing a struct field. For embedded fields, the name is the unqualified type name under which the field is accessible. </p>
+<h3 id="NewParam">func <span>NewParam</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewParam(pos token.Pos, pkg *Package, name string, typ Type) *Var</pre> <p>NewParam returns a new variable representing a function parameter. </p>
+<h3 id="NewVar">func <span>NewVar</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewVar(pos token.Pos, pkg *Package, name string, typ Type) *Var</pre> <p>NewVar returns a new variable. The arguments set the attributes found with all Objects. </p>
+<h3 id="Var.Anonymous">func (*Var) <span>Anonymous</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) Anonymous() bool</pre> <p>Anonymous reports whether the variable is an embedded field. Same as Embedded; only present for backward-compatibility. </p>
+<h3 id="Var.Embedded">func (*Var) <span>Embedded</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (obj *Var) Embedded() bool</pre> <p>Embedded reports whether the variable is an embedded field. </p>
+<h3 id="Var.Exported">func (*Var) <span>Exported</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) Exported() bool</pre> <p>Exported reports whether the object is exported (starts with a capital letter). It doesn't take into account whether the object is in a local (function) scope or not. </p>
+<h3 id="Var.Id">func (*Var) <span>Id</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) Id() string</pre> <p>Id is a wrapper for Id(obj.Pkg(), obj.Name()). </p>
+<h3 id="Var.IsField">func (*Var) <span>IsField</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) IsField() bool</pre> <p>IsField reports whether the variable is a struct field. </p>
+<h3 id="Var.Name">func (*Var) <span>Name</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) Name() string</pre> <p>Name returns the object's (package-local, unqualified) name. </p>
+<h3 id="Var.Origin">func (*Var) <span>Origin</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (obj *Var) Origin() *Var</pre> <p>Origin returns the canonical Var for its receiver, i.e. the Var object recorded in Info.Defs. </p>
+<p>For synthetic Vars created during instantiation (such as struct fields or function parameters that depend on type arguments), this will be the corresponding Var on the generic (uninstantiated) type. For all other Vars Origin returns the receiver. </p>
+<h3 id="Var.Parent">func (*Var) <span>Parent</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) Parent() *Scope</pre> <p>Parent returns the scope in which the object is declared. The result is nil for methods and struct fields. </p>
+<h3 id="Var.Pkg">func (*Var) <span>Pkg</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) Pkg() *Package</pre> <p>Pkg returns the package to which the object belongs. The result is nil for labels and objects in the Universe scope. </p>
+<h3 id="Var.Pos">func (*Var) <span>Pos</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) Pos() token.Pos</pre> <p>Pos returns the declaration position of the object's identifier. </p>
+<h3 id="Var.String">func (*Var) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) String() string</pre> <h3 id="Var.Type">func (*Var) <span>Type</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (obj *Var) Type() Type</pre> <p>Type returns the object's type. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/types/" class="_attribution-link">http://golang.org/pkg/go/types/</a>
+ </p>
+</div>
diff --git a/devdocs/go/go%2Fversion%2Findex.html b/devdocs/go/go%2Fversion%2Findex.html
new file mode 100644
index 00000000..88e5dc66
--- /dev/null
+++ b/devdocs/go/go%2Fversion%2Findex.html
@@ -0,0 +1,23 @@
+<h1> Package version </h1> <ul id="short-nav">
+<li><code>import "go/version"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package version provides operations on <a href="https://go.dev/doc/toolchain#version">Go versions</a> in <a href="https://go.dev/doc/toolchain#name">Go toolchain name syntax</a>: strings like "go1.20", "go1.21.0", "go1.22rc2", and "go1.23.4-bigcorp". </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Compare">func Compare(x, y string) int</a></li>
+<li><a href="#IsValid">func IsValid(x string) bool</a></li>
+<li><a href="#Lang">func Lang(x string) string</a></li>
+</ul> <h3>Package files</h3> <p> <span>version.go</span> </p> <h2 id="Compare">func <span>Compare</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Compare(x, y string) int</pre> <p>Compare returns -1, 0, or +1 depending on whether x &lt; y, x == y, or x &gt; y, interpreted as Go versions. The versions x and y must begin with a "go" prefix: "go1.21" not "1.21". Invalid versions, including the empty string, compare less than valid versions and equal to each other. The language version "go1.21" compares less than the release candidate and eventual releases "go1.21rc1" and "go1.21.0". </p>
+<h2 id="IsValid">func <span>IsValid</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func IsValid(x string) bool</pre> <p>IsValid reports whether the version x is valid. </p>
+<h2 id="Lang">func <span>Lang</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Lang(x string) string</pre> <p>Lang returns the Go language version for version x. If x is not a valid version, Lang returns the empty string. For example: </p>
+<pre data-language="go">Lang("go1.21rc2") = "go1.21"
+Lang("go1.21.2") = "go1.21"
+Lang("go1.21") = "go1.21"
+Lang("go1") = "go1"
+Lang("bad") = ""
+Lang("1.21") = ""
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/go/version/" class="_attribution-link">http://golang.org/pkg/go/version/</a>
+ </p>
+</div>
diff --git a/devdocs/go/hash%2Fadler32%2Findex.html b/devdocs/go/hash%2Fadler32%2Findex.html
new file mode 100644
index 00000000..58786cdd
--- /dev/null
+++ b/devdocs/go/hash%2Fadler32%2Findex.html
@@ -0,0 +1,23 @@
+<h1> Package adler32 </h1> <ul id="short-nav">
+<li><code>import "hash/adler32"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package adler32 implements the Adler-32 checksum. </p>
+<p>It is defined in RFC 1950: </p>
+<pre data-language="go">Adler-32 is composed of two sums accumulated per byte: s1 is
+the sum of all bytes, s2 is the sum of all s1 values. Both sums
+are done modulo 65521. s1 is initialized to 1, s2 to zero. The
+Adler-32 checksum is stored as s2*65536 + s1 in most-
+significant-byte first (network) order.
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Checksum">func Checksum(data []byte) uint32</a></li>
+<li><a href="#New">func New() hash.Hash32</a></li>
+</ul> <h3>Package files</h3> <p> <span>adler32.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>The size of an Adler-32 checksum in bytes. </p>
+<pre data-language="go">const Size = 4</pre> <h2 id="Checksum">func <span>Checksum</span> </h2> <pre data-language="go">func Checksum(data []byte) uint32</pre> <p>Checksum returns the Adler-32 checksum of data. </p>
+<h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New() hash.Hash32</pre> <p>New returns a new hash.Hash32 computing the Adler-32 checksum. Its Sum method will lay the value out in big-endian byte order. The returned Hash32 also implements <span>encoding.BinaryMarshaler</span> and <span>encoding.BinaryUnmarshaler</span> to marshal and unmarshal the internal state of the hash. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/hash/adler32/" class="_attribution-link">http://golang.org/pkg/hash/adler32/</a>
+ </p>
+</div>
diff --git a/devdocs/go/hash%2Fcrc32%2Findex.html b/devdocs/go/hash%2Fcrc32%2Findex.html
new file mode 100644
index 00000000..65aed132
--- /dev/null
+++ b/devdocs/go/hash%2Fcrc32%2Findex.html
@@ -0,0 +1,62 @@
+<h1> Package crc32 </h1> <ul id="short-nav">
+<li><code>import "hash/crc32"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package crc32 implements the 32-bit cyclic redundancy check, or CRC-32, checksum. See <a href="https://en.wikipedia.org/wiki/Cyclic_redundancy_check">https://en.wikipedia.org/wiki/Cyclic_redundancy_check</a> for information. </p>
+<p>Polynomials are represented in LSB-first form also known as reversed representation. </p>
+<p>See <a href="https://en.wikipedia.org/wiki/Mathematics_of_cyclic_redundancy_checks#Reversed_representations_and_reciprocal_polynomials">https://en.wikipedia.org/wiki/Mathematics_of_cyclic_redundancy_checks#Reversed_representations_and_reciprocal_polynomials</a> for information. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Checksum">func Checksum(data []byte, tab *Table) uint32</a></li>
+<li><a href="#ChecksumIEEE">func ChecksumIEEE(data []byte) uint32</a></li>
+<li><a href="#New">func New(tab *Table) hash.Hash32</a></li>
+<li><a href="#NewIEEE">func NewIEEE() hash.Hash32</a></li>
+<li><a href="#Update">func Update(crc uint32, tab *Table, p []byte) uint32</a></li>
+<li><a href="#Table">type Table</a></li>
+<li> <a href="#MakeTable">func MakeTable(poly uint32) *Table</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_MakeTable">MakeTable</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>crc32.go</span> <span>crc32_amd64.go</span> <span>crc32_generic.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Predefined polynomials. </p>
+<pre data-language="go">const (
+ // IEEE is by far and away the most common CRC-32 polynomial.
+ // Used by ethernet (IEEE 802.3), v.42, fddi, gzip, zip, png, ...
+ IEEE = 0xedb88320
+
+ // Castagnoli's polynomial, used in iSCSI.
+ // Has better error detection characteristics than IEEE.
+ // https://dx.doi.org/10.1109/26.231911
+ Castagnoli = 0x82f63b78
+
+ // Koopman's polynomial.
+ // Also has better error detection characteristics than IEEE.
+ // https://dx.doi.org/10.1109/DSN.2002.1028931
+ Koopman = 0xeb31d82e
+)</pre> <p>The size of a CRC-32 checksum in bytes. </p>
+<pre data-language="go">const Size = 4</pre> <h2 id="pkg-variables">Variables</h2> <p>IEEETable is the table for the <a href="#IEEE">IEEE</a> polynomial. </p>
+<pre data-language="go">var IEEETable = simpleMakeTable(IEEE)</pre> <h2 id="Checksum">func <span>Checksum</span> </h2> <pre data-language="go">func Checksum(data []byte, tab *Table) uint32</pre> <p>Checksum returns the CRC-32 checksum of data using the polynomial represented by the <a href="#Table">Table</a>. </p>
+<h2 id="ChecksumIEEE">func <span>ChecksumIEEE</span> </h2> <pre data-language="go">func ChecksumIEEE(data []byte) uint32</pre> <p>ChecksumIEEE returns the CRC-32 checksum of data using the <a href="#IEEE">IEEE</a> polynomial. </p>
+<h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New(tab *Table) hash.Hash32</pre> <p>New creates a new <span>hash.Hash32</span> computing the CRC-32 checksum using the polynomial represented by the <a href="#Table">Table</a>. Its Sum method will lay the value out in big-endian byte order. The returned Hash32 also implements <span>encoding.BinaryMarshaler</span> and <span>encoding.BinaryUnmarshaler</span> to marshal and unmarshal the internal state of the hash. </p>
+<h2 id="NewIEEE">func <span>NewIEEE</span> </h2> <pre data-language="go">func NewIEEE() hash.Hash32</pre> <p>NewIEEE creates a new <span>hash.Hash32</span> computing the CRC-32 checksum using the <a href="#IEEE">IEEE</a> polynomial. Its Sum method will lay the value out in big-endian byte order. The returned Hash32 also implements <span>encoding.BinaryMarshaler</span> and <span>encoding.BinaryUnmarshaler</span> to marshal and unmarshal the internal state of the hash. </p>
+<h2 id="Update">func <span>Update</span> </h2> <pre data-language="go">func Update(crc uint32, tab *Table, p []byte) uint32</pre> <p>Update returns the result of adding the bytes in p to the crc. </p>
+<h2 id="Table">type <span>Table</span> </h2> <p>Table is a 256-word table representing the polynomial for efficient processing. </p>
+<pre data-language="go">type Table [256]uint32</pre> <h3 id="MakeTable">func <span>MakeTable</span> </h3> <pre data-language="go">func MakeTable(poly uint32) *Table</pre> <p>MakeTable returns a <a href="#Table">Table</a> constructed from the specified polynomial. The contents of this <a href="#Table">Table</a> must not be modified. </p> <h4 id="example_MakeTable"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// In this package, the CRC polynomial is represented in reversed notation,
+// or LSB-first representation.
+//
+// LSB-first representation is a hexadecimal number with n bits, in which the
+// most significant bit represents the coefficient of x⁰ and the least significant
+// bit represents the coefficient of xⁿ⁻¹ (the coefficient for xⁿ is implicit).
+//
+// For example, CRC32-Q, as defined by the following polynomial,
+// x³²+ x³¹+ x²⁴+ x²²+ x¹⁶+ x¹⁴+ x⁸+ x⁷+ x⁵+ x³+ x¹+ x⁰
+// has the reversed notation 0b11010101100000101000001010000001, so the value
+// that should be passed to MakeTable is 0xD5828281.
+crc32q := crc32.MakeTable(0xD5828281)
+fmt.Printf("%08x\n", crc32.Checksum([]byte("Hello world"), crc32q))
+</pre> <p>Output:</p> <pre class="output" data-language="go">2964d064
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/hash/crc32/" class="_attribution-link">http://golang.org/pkg/hash/crc32/</a>
+ </p>
+</div>
diff --git a/devdocs/go/hash%2Fcrc64%2Findex.html b/devdocs/go/hash%2Fcrc64%2Findex.html
new file mode 100644
index 00000000..2a4d782a
--- /dev/null
+++ b/devdocs/go/hash%2Fcrc64%2Findex.html
@@ -0,0 +1,30 @@
+<h1> Package crc64 </h1> <ul id="short-nav">
+<li><code>import "hash/crc64"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package crc64 implements the 64-bit cyclic redundancy check, or CRC-64, checksum. See <a href="https://en.wikipedia.org/wiki/Cyclic_redundancy_check">https://en.wikipedia.org/wiki/Cyclic_redundancy_check</a> for information. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Checksum">func Checksum(data []byte, tab *Table) uint64</a></li>
+<li><a href="#New">func New(tab *Table) hash.Hash64</a></li>
+<li><a href="#Update">func Update(crc uint64, tab *Table, p []byte) uint64</a></li>
+<li><a href="#Table">type Table</a></li>
+<li> <a href="#MakeTable">func MakeTable(poly uint64) *Table</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>crc64.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Predefined polynomials. </p>
+<pre data-language="go">const (
+ // The ISO polynomial, defined in ISO 3309 and used in HDLC.
+ ISO = 0xD800000000000000
+
+ // The ECMA polynomial, defined in ECMA 182.
+ ECMA = 0xC96C5795D7870F42
+)</pre> <p>The size of a CRC-64 checksum in bytes. </p>
+<pre data-language="go">const Size = 8</pre> <h2 id="Checksum">func <span>Checksum</span> </h2> <pre data-language="go">func Checksum(data []byte, tab *Table) uint64</pre> <p>Checksum returns the CRC-64 checksum of data using the polynomial represented by the <a href="#Table">Table</a>. </p>
+<h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New(tab *Table) hash.Hash64</pre> <p>New creates a new hash.Hash64 computing the CRC-64 checksum using the polynomial represented by the <a href="#Table">Table</a>. Its Sum method will lay the value out in big-endian byte order. The returned Hash64 also implements <span>encoding.BinaryMarshaler</span> and <span>encoding.BinaryUnmarshaler</span> to marshal and unmarshal the internal state of the hash. </p>
+<h2 id="Update">func <span>Update</span> </h2> <pre data-language="go">func Update(crc uint64, tab *Table, p []byte) uint64</pre> <p>Update returns the result of adding the bytes in p to the crc. </p>
+<h2 id="Table">type <span>Table</span> </h2> <p>Table is a 256-word table representing the polynomial for efficient processing. </p>
+<pre data-language="go">type Table [256]uint64</pre> <h3 id="MakeTable">func <span>MakeTable</span> </h3> <pre data-language="go">func MakeTable(poly uint64) *Table</pre> <p>MakeTable returns a <a href="#Table">Table</a> constructed from the specified polynomial. The contents of this <a href="#Table">Table</a> must not be modified. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/hash/crc64/" class="_attribution-link">http://golang.org/pkg/hash/crc64/</a>
+ </p>
+</div>
diff --git a/devdocs/go/hash%2Ffnv%2Findex.html b/devdocs/go/hash%2Ffnv%2Findex.html
new file mode 100644
index 00000000..cd5f2e27
--- /dev/null
+++ b/devdocs/go/hash%2Ffnv%2Findex.html
@@ -0,0 +1,23 @@
+<h1> Package fnv </h1> <ul id="short-nav">
+<li><code>import "hash/fnv"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package fnv implements FNV-1 and FNV-1a, non-cryptographic hash functions created by Glenn Fowler, Landon Curt Noll, and Phong Vo. See <a href="https://en.wikipedia.org/wiki/Fowler-Noll-Vo_hash_function">https://en.wikipedia.org/wiki/Fowler-Noll-Vo_hash_function</a>. </p>
+<p>All the hash.Hash implementations returned by this package also implement encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to marshal and unmarshal the internal state of the hash. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#New128">func New128() hash.Hash</a></li>
+<li><a href="#New128a">func New128a() hash.Hash</a></li>
+<li><a href="#New32">func New32() hash.Hash32</a></li>
+<li><a href="#New32a">func New32a() hash.Hash32</a></li>
+<li><a href="#New64">func New64() hash.Hash64</a></li>
+<li><a href="#New64a">func New64a() hash.Hash64</a></li>
+</ul> <h3>Package files</h3> <p> <span>fnv.go</span> </p> <h2 id="New128">func <span>New128</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func New128() hash.Hash</pre> <p>New128 returns a new 128-bit FNV-1 <span>hash.Hash</span>. Its Sum method will lay the value out in big-endian byte order. </p>
+<h2 id="New128a">func <span>New128a</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func New128a() hash.Hash</pre> <p>New128a returns a new 128-bit FNV-1a <span>hash.Hash</span>. Its Sum method will lay the value out in big-endian byte order. </p>
+<h2 id="New32">func <span>New32</span> </h2> <pre data-language="go">func New32() hash.Hash32</pre> <p>New32 returns a new 32-bit FNV-1 <span>hash.Hash</span>. Its Sum method will lay the value out in big-endian byte order. </p>
+<h2 id="New32a">func <span>New32a</span> </h2> <pre data-language="go">func New32a() hash.Hash32</pre> <p>New32a returns a new 32-bit FNV-1a <span>hash.Hash</span>. Its Sum method will lay the value out in big-endian byte order. </p>
+<h2 id="New64">func <span>New64</span> </h2> <pre data-language="go">func New64() hash.Hash64</pre> <p>New64 returns a new 64-bit FNV-1 <span>hash.Hash</span>. Its Sum method will lay the value out in big-endian byte order. </p>
+<h2 id="New64a">func <span>New64a</span> </h2> <pre data-language="go">func New64a() hash.Hash64</pre> <p>New64a returns a new 64-bit FNV-1a <span>hash.Hash</span>. Its Sum method will lay the value out in big-endian byte order. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/hash/fnv/" class="_attribution-link">http://golang.org/pkg/hash/fnv/</a>
+ </p>
+</div>
diff --git a/devdocs/go/hash%2Findex.html b/devdocs/go/hash%2Findex.html
new file mode 100644
index 00000000..778f1ee8
--- /dev/null
+++ b/devdocs/go/hash%2Findex.html
@@ -0,0 +1,82 @@
+<h1> Package hash </h1> <ul id="short-nav">
+<li><code>import "hash"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package hash provides interfaces for hash functions. </p> <h4 id="example__binaryMarshaler"> <span class="text">Example (BinaryMarshaler)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const (
+ input1 = "The tunneling gopher digs downwards, "
+ input2 = "unaware of what he will find."
+)
+
+first := sha256.New()
+first.Write([]byte(input1))
+
+marshaler, ok := first.(encoding.BinaryMarshaler)
+if !ok {
+ log.Fatal("first does not implement encoding.BinaryMarshaler")
+}
+state, err := marshaler.MarshalBinary()
+if err != nil {
+ log.Fatal("unable to marshal hash:", err)
+}
+
+second := sha256.New()
+
+unmarshaler, ok := second.(encoding.BinaryUnmarshaler)
+if !ok {
+ log.Fatal("second does not implement encoding.BinaryUnmarshaler")
+}
+if err := unmarshaler.UnmarshalBinary(state); err != nil {
+ log.Fatal("unable to unmarshal hash:", err)
+}
+
+first.Write([]byte(input2))
+second.Write([]byte(input2))
+
+fmt.Printf("%x\n", first.Sum(nil))
+fmt.Println(bytes.Equal(first.Sum(nil), second.Sum(nil)))
+</pre> <p>Output:</p> <pre class="output" data-language="go">57d51a066f3a39942649cd9a76c77e97ceab246756ff3888659e6aa5a07f4a52
+true
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Hash">type Hash</a></li>
+<li><a href="#Hash32">type Hash32</a></li>
+<li><a href="#Hash64">type Hash64</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example__binaryMarshaler">Package (BinaryMarshaler)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>hash.go</span> </p> <h2 id="Hash">type <span>Hash</span> </h2> <p>Hash is the common interface implemented by all hash functions. </p>
+<p>Hash implementations in the standard library (e.g. <span>hash/crc32</span> and <span>crypto/sha256</span>) implement the <span>encoding.BinaryMarshaler</span> and <span>encoding.BinaryUnmarshaler</span> interfaces. Marshaling a hash implementation allows its internal state to be saved and used for additional processing later, without having to re-write the data previously written to the hash. The hash state may contain portions of the input in its original form, which users are expected to handle for any possible security implications. </p>
+<p>Compatibility: Any future changes to hash or crypto packages will endeavor to maintain compatibility with state encoded using previous versions. That is, any released versions of the packages should be able to decode data written with any previously released version, subject to issues such as security fixes. See the Go compatibility document for background: <a href="https://golang.org/doc/go1compat">https://golang.org/doc/go1compat</a> </p>
+<pre data-language="go">type Hash interface {
+ // Write (via the embedded io.Writer interface) adds more data to the running hash.
+ // It never returns an error.
+ io.Writer
+
+ // Sum appends the current hash to b and returns the resulting slice.
+ // It does not change the underlying hash state.
+ Sum(b []byte) []byte
+
+ // Reset resets the Hash to its initial state.
+ Reset()
+
+ // Size returns the number of bytes Sum will return.
+ Size() int
+
+ // BlockSize returns the hash's underlying block size.
+ // The Write method must be able to accept any amount
+ // of data, but it may operate more efficiently if all writes
+ // are a multiple of the block size.
+ BlockSize() int
+}</pre> <h2 id="Hash32">type <span>Hash32</span> </h2> <p>Hash32 is the common interface implemented by all 32-bit hash functions. </p>
+<pre data-language="go">type Hash32 interface {
+ Hash
+ Sum32() uint32
+}</pre> <h2 id="Hash64">type <span>Hash64</span> </h2> <p>Hash64 is the common interface implemented by all 64-bit hash functions. </p>
+<pre data-language="go">type Hash64 interface {
+ Hash
+ Sum64() uint64
+}</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="adler32/index">adler32</a> </td> <td class="pkg-synopsis"> Package adler32 implements the Adler-32 checksum. </td> </tr> <tr> <td class="pkg-name"> <a href="crc32/index">crc32</a> </td> <td class="pkg-synopsis"> Package crc32 implements the 32-bit cyclic redundancy check, or CRC-32, checksum. </td> </tr> <tr> <td class="pkg-name"> <a href="crc64/index">crc64</a> </td> <td class="pkg-synopsis"> Package crc64 implements the 64-bit cyclic redundancy check, or CRC-64, checksum. </td> </tr> <tr> <td class="pkg-name"> <a href="fnv/index">fnv</a> </td> <td class="pkg-synopsis"> Package fnv implements FNV-1 and FNV-1a, non-cryptographic hash functions created by Glenn Fowler, Landon Curt Noll, and Phong Vo. </td> </tr> <tr> <td class="pkg-name"> <a href="maphash/index">maphash</a> </td> <td class="pkg-synopsis"> Package maphash provides hash functions on byte sequences. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/hash/" class="_attribution-link">http://golang.org/pkg/hash/</a>
+ </p>
+</div>
diff --git a/devdocs/go/hash%2Fmaphash%2Findex.html b/devdocs/go/hash%2Fmaphash%2Findex.html
new file mode 100644
index 00000000..290b0289
--- /dev/null
+++ b/devdocs/go/hash%2Fmaphash%2Findex.html
@@ -0,0 +1,106 @@
+<h1> Package maphash </h1> <ul id="short-nav">
+<li><code>import "hash/maphash"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package maphash provides hash functions on byte sequences. These hash functions are intended to be used to implement hash tables or other data structures that need to map arbitrary strings or byte sequences to a uniform distribution on unsigned 64-bit integers. Each different instance of a hash table or data structure should use its own <a href="#Seed">Seed</a>. </p>
+<p>The hash functions are not cryptographically secure. (See crypto/sha256 and crypto/sha512 for cryptographic use.) </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// The zero Hash value is valid and ready to use; setting an
+// initial seed is not necessary.
+var h maphash.Hash
+
+// Add a string to the hash, and print the current hash value.
+h.WriteString("hello, ")
+fmt.Printf("%#x\n", h.Sum64())
+
+// Append additional data (in the form of a byte array).
+h.Write([]byte{'w', 'o', 'r', 'l', 'd'})
+fmt.Printf("%#x\n", h.Sum64())
+
+// Reset discards all data previously added to the Hash, without
+// changing its seed.
+h.Reset()
+
+// Use SetSeed to create a new Hash h2 which will behave
+// identically to h.
+var h2 maphash.Hash
+h2.SetSeed(h.Seed())
+
+h.WriteString("same")
+h2.WriteString("same")
+fmt.Printf("%#x == %#x\n", h.Sum64(), h2.Sum64())
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Bytes">func Bytes(seed Seed, b []byte) uint64</a></li>
+<li><a href="#String">func String(seed Seed, s string) uint64</a></li>
+<li><a href="#Hash">type Hash</a></li>
+<li> <a href="#Hash.BlockSize">func (h *Hash) BlockSize() int</a>
+</li>
+<li> <a href="#Hash.Reset">func (h *Hash) Reset()</a>
+</li>
+<li> <a href="#Hash.Seed">func (h *Hash) Seed() Seed</a>
+</li>
+<li> <a href="#Hash.SetSeed">func (h *Hash) SetSeed(seed Seed)</a>
+</li>
+<li> <a href="#Hash.Size">func (h *Hash) Size() int</a>
+</li>
+<li> <a href="#Hash.Sum">func (h *Hash) Sum(b []byte) []byte</a>
+</li>
+<li> <a href="#Hash.Sum64">func (h *Hash) Sum64() uint64</a>
+</li>
+<li> <a href="#Hash.Write">func (h *Hash) Write(b []byte) (int, error)</a>
+</li>
+<li> <a href="#Hash.WriteByte">func (h *Hash) WriteByte(b byte) error</a>
+</li>
+<li> <a href="#Hash.WriteString">func (h *Hash) WriteString(s string) (int, error)</a>
+</li>
+<li><a href="#Seed">type Seed</a></li>
+<li> <a href="#MakeSeed">func MakeSeed() Seed</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>maphash.go</span> <span>maphash_runtime.go</span> </p> <h2 id="Bytes">func <span>Bytes</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func Bytes(seed Seed, b []byte) uint64</pre> <p>Bytes returns the hash of b with the given seed. </p>
+<p>Bytes is equivalent to, but more convenient and efficient than: </p>
+<pre data-language="go">var h Hash
+h.SetSeed(seed)
+h.Write(b)
+return h.Sum64()
+</pre> <h2 id="String">func <span>String</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func String(seed Seed, s string) uint64</pre> <p>String returns the hash of s with the given seed. </p>
+<p>String is equivalent to, but more convenient and efficient than: </p>
+<pre data-language="go">var h Hash
+h.SetSeed(seed)
+h.WriteString(s)
+return h.Sum64()
+</pre> <h2 id="Hash">type <span>Hash</span> <span title="Added in Go 1.14">1.14</span> </h2> <p>A Hash computes a seeded hash of a byte sequence. </p>
+<p>The zero Hash is a valid Hash ready to use. A zero Hash chooses a random seed for itself during the first call to a Reset, Write, Seed, or Sum64 method. For control over the seed, use SetSeed. </p>
+<p>The computed hash values depend only on the initial seed and the sequence of bytes provided to the Hash object, not on the way in which the bytes are provided. For example, the three sequences </p>
+<pre data-language="go">h.Write([]byte{'f','o','o'})
+h.WriteByte('f'); h.WriteByte('o'); h.WriteByte('o')
+h.WriteString("foo")
+</pre> <p>all have the same effect. </p>
+<p>Hashes are intended to be collision-resistant, even for situations where an adversary controls the byte sequences being hashed. </p>
+<p>A Hash is not safe for concurrent use by multiple goroutines, but a Seed is. If multiple goroutines must compute the same seeded hash, each can declare its own Hash and call SetSeed with a common Seed. </p>
+<pre data-language="go">type Hash struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Hash.BlockSize">func (*Hash) <span>BlockSize</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) BlockSize() int</pre> <p>BlockSize returns h's block size. </p>
+<h3 id="Hash.Reset">func (*Hash) <span>Reset</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) Reset()</pre> <p>Reset discards all bytes added to h. (The seed remains the same.) </p>
+<h3 id="Hash.Seed">func (*Hash) <span>Seed</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) Seed() Seed</pre> <p>Seed returns h's seed value. </p>
+<h3 id="Hash.SetSeed">func (*Hash) <span>SetSeed</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) SetSeed(seed Seed)</pre> <p>SetSeed sets h to use seed, which must have been returned by <a href="#MakeSeed">MakeSeed</a> or by another <a href="#Hash.Seed">Hash.Seed</a> method. Two <a href="#Hash">Hash</a> objects with the same seed behave identically. Two <a href="#Hash">Hash</a> objects with different seeds will very likely behave differently. Any bytes added to h before this call will be discarded. </p>
+<h3 id="Hash.Size">func (*Hash) <span>Size</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) Size() int</pre> <p>Size returns h's hash value size, 8 bytes. </p>
+<h3 id="Hash.Sum">func (*Hash) <span>Sum</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) Sum(b []byte) []byte</pre> <p>Sum appends the hash's current 64-bit value to b. It exists for implementing <span>hash.Hash</span>. For direct calls, it is more efficient to use <a href="#Hash.Sum64">Hash.Sum64</a>. </p>
+<h3 id="Hash.Sum64">func (*Hash) <span>Sum64</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) Sum64() uint64</pre> <p>Sum64 returns h's current 64-bit value, which depends on h's seed and the sequence of bytes added to h since the last call to <a href="#Hash.Reset">Hash.Reset</a> or <a href="#Hash.SetSeed">Hash.SetSeed</a>. </p>
+<p>All bits of the Sum64 result are close to uniformly and independently distributed, so it can be safely reduced by using bit masking, shifting, or modular arithmetic. </p>
+<h3 id="Hash.Write">func (*Hash) <span>Write</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) Write(b []byte) (int, error)</pre> <p>Write adds b to the sequence of bytes hashed by h. It always writes all of b and never fails; the count and error result are for implementing <span>io.Writer</span>. </p>
+<h3 id="Hash.WriteByte">func (*Hash) <span>WriteByte</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) WriteByte(b byte) error</pre> <p>WriteByte adds b to the sequence of bytes hashed by h. It never fails; the error result is for implementing <span>io.ByteWriter</span>. </p>
+<h3 id="Hash.WriteString">func (*Hash) <span>WriteString</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h *Hash) WriteString(s string) (int, error)</pre> <p>WriteString adds the bytes of s to the sequence of bytes hashed by h. It always writes all of s and never fails; the count and error result are for implementing <span>io.StringWriter</span>. </p>
+<h2 id="Seed">type <span>Seed</span> <span title="Added in Go 1.14">1.14</span> </h2> <p>A Seed is a random value that selects the specific hash function computed by a <a href="#Hash">Hash</a>. If two Hashes use the same Seeds, they will compute the same hash values for any given input. If two Hashes use different Seeds, they are very likely to compute distinct hash values for any given input. </p>
+<p>A Seed must be initialized by calling <a href="#MakeSeed">MakeSeed</a>. The zero seed is uninitialized and not valid for use with <a href="#Hash">Hash</a>'s SetSeed method. </p>
+<p>Each Seed value is local to a single process and cannot be serialized or otherwise recreated in a different process. </p>
+<pre data-language="go">type Seed struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="MakeSeed">func <span>MakeSeed</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func MakeSeed() Seed</pre> <p>MakeSeed returns a new random seed. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/hash/maphash/" class="_attribution-link">http://golang.org/pkg/hash/maphash/</a>
+ </p>
+</div>
diff --git a/devdocs/go/html%2Findex.html b/devdocs/go/html%2Findex.html
new file mode 100644
index 00000000..27643e64
--- /dev/null
+++ b/devdocs/go/html%2Findex.html
@@ -0,0 +1,23 @@
+<h1> Package html </h1> <ul id="short-nav">
+<li><code>import "html"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package html provides functions for escaping and unescaping HTML text. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#EscapeString">func EscapeString(s string) string</a></li>
+<li><a href="#UnescapeString">func UnescapeString(s string) string</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_EscapeString">EscapeString</a></dd> <dd><a class="exampleLink" href="#example_UnescapeString">UnescapeString</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>entity.go</span> <span>escape.go</span> </p> <h2 id="EscapeString">func <span>EscapeString</span> </h2> <pre data-language="go">func EscapeString(s string) string</pre> <p>EscapeString escapes special characters like "&lt;" to become "&amp;lt;". It escapes only five such characters: &lt;, &gt;, &amp;, ' and ". UnescapeString(EscapeString(s)) == s always holds, but the converse isn't always true. </p> <h4 id="example_EscapeString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const s = `"Fran &amp; Freddie's Diner" &lt;tasty@example.com&gt;`
+fmt.Println(html.EscapeString(s))
+</pre> <p>Output:</p> <pre class="output" data-language="go">&amp;#34;Fran &amp;amp; Freddie&amp;#39;s Diner&amp;#34; &amp;lt;tasty@example.com&amp;gt;
+</pre> <h2 id="UnescapeString">func <span>UnescapeString</span> </h2> <pre data-language="go">func UnescapeString(s string) string</pre> <p>UnescapeString unescapes entities like "&amp;lt;" to become "&lt;". It unescapes a larger range of entities than EscapeString escapes. For example, "&amp;aacute;" unescapes to "á", as does "&amp;#225;" and "&amp;#xE1;". UnescapeString(EscapeString(s)) == s always holds, but the converse isn't always true. </p> <h4 id="example_UnescapeString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const s = `&amp;quot;Fran &amp;amp; Freddie&amp;#39;s Diner&amp;quot; &amp;lt;tasty@example.com&amp;gt;`
+fmt.Println(html.UnescapeString(s))
+</pre> <p>Output:</p> <pre class="output" data-language="go">"Fran &amp; Freddie's Diner" &lt;tasty@example.com&gt;
+</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="template/index">template</a> </td> <td class="pkg-synopsis"> Package template (html/template) implements data-driven templates for generating HTML output safe against code injection. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/html/" class="_attribution-link">http://golang.org/pkg/html/</a>
+ </p>
+</div>
diff --git a/devdocs/go/html%2Ftemplate%2Findex.html b/devdocs/go/html%2Ftemplate%2Findex.html
new file mode 100644
index 00000000..c5a2b4af
--- /dev/null
+++ b/devdocs/go/html%2Ftemplate%2Findex.html
@@ -0,0 +1,773 @@
+<h1> Package template </h1> <ul id="short-nav">
+<li><code>import "html/template"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package template (html/template) implements data-driven templates for generating HTML output safe against code injection. It provides the same interface as <span>text/template</span> and should be used instead of <span>text/template</span> whenever the output is HTML. </p>
+<p>The documentation here focuses on the security features of the package. For information about how to program the templates themselves, see the documentation for <span>text/template</span>. </p>
+<h3 id="hdr-Introduction">Introduction</h3> <p>This package wraps <span>text/template</span> so you can share its template API to parse and execute HTML templates safely. </p>
+<pre data-language="go">tmpl, err := template.New("name").Parse(...)
+// Error checking elided
+err = tmpl.Execute(out, data)
+</pre> <p>If successful, tmpl will now be injection-safe. Otherwise, err is an error defined in the docs for ErrorCode. </p>
+<p>HTML templates treat data values as plain text which should be encoded so they can be safely embedded in an HTML document. The escaping is contextual, so actions can appear within JavaScript, CSS, and URI contexts. </p>
+<p>The security model used by this package assumes that template authors are trusted, while Execute's data parameter is not. More details are provided below. </p>
+<p>Example </p>
+<pre data-language="go">import "text/template"
+...
+t, err := template.New("foo").Parse(`{{define "T"}}Hello, {{.}}!{{end}}`)
+err = t.ExecuteTemplate(out, "T", "&lt;script&gt;alert('you have been pwned')&lt;/script&gt;")
+</pre> <p>produces </p>
+<pre data-language="go">Hello, &lt;script&gt;alert('you have been pwned')&lt;/script&gt;!
+</pre> <p>but the contextual autoescaping in html/template </p>
+<pre data-language="go">import "html/template"
+...
+t, err := template.New("foo").Parse(`{{define "T"}}Hello, {{.}}!{{end}}`)
+err = t.ExecuteTemplate(out, "T", "&lt;script&gt;alert('you have been pwned')&lt;/script&gt;")
+</pre> <p>produces safe, escaped HTML output </p>
+<pre data-language="go">Hello, &amp;lt;script&amp;gt;alert(&amp;#39;you have been pwned&amp;#39;)&amp;lt;/script&amp;gt;!
+</pre> <h3 id="hdr-Contexts">Contexts</h3> <p>This package understands HTML, CSS, JavaScript, and URIs. It adds sanitizing functions to each simple action pipeline, so given the excerpt </p>
+<pre data-language="go">&lt;a href="/search?q={{.}}"&gt;{{.}}&lt;/a&gt;
+</pre> <p>At parse time each {{.}} is overwritten to add escaping functions as necessary. In this case it becomes </p>
+<pre data-language="go">&lt;a href="/search?q={{. | urlescaper | attrescaper}}"&gt;{{. | htmlescaper}}&lt;/a&gt;
+</pre> <p>where urlescaper, attrescaper, and htmlescaper are aliases for internal escaping functions. </p>
+<p>For these internal escaping functions, if an action pipeline evaluates to a nil interface value, it is treated as though it were an empty string. </p>
+<h3 id="hdr-Namespaced_and_data__attributes">Namespaced and data- attributes</h3> <p>Attributes with a namespace are treated as if they had no namespace. Given the excerpt </p>
+<pre data-language="go">&lt;a my:href="{{.}}"&gt;&lt;/a&gt;
+</pre> <p>At parse time the attribute will be treated as if it were just "href". So at parse time the template becomes: </p>
+<pre data-language="go">&lt;a my:href="{{. | urlescaper | attrescaper}}"&gt;&lt;/a&gt;
+</pre> <p>Similarly to attributes with namespaces, attributes with a "data-" prefix are treated as if they had no "data-" prefix. So given </p>
+<pre data-language="go">&lt;a data-href="{{.}}"&gt;&lt;/a&gt;
+</pre> <p>At parse time this becomes </p>
+<pre data-language="go">&lt;a data-href="{{. | urlescaper | attrescaper}}"&gt;&lt;/a&gt;
+</pre> <p>If an attribute has both a namespace and a "data-" prefix, only the namespace will be removed when determining the context. For example </p>
+<pre data-language="go">&lt;a my:data-href="{{.}}"&gt;&lt;/a&gt;
+</pre> <p>This is handled as if "my:data-href" was just "data-href" and not "href" as it would be if the "data-" prefix were to be ignored too. Thus at parse time this becomes just </p>
+<pre data-language="go">&lt;a my:data-href="{{. | attrescaper}}"&gt;&lt;/a&gt;
+</pre> <p>As a special case, attributes with the namespace "xmlns" are always treated as containing URLs. Given the excerpts </p>
+<pre data-language="go">&lt;a xmlns:title="{{.}}"&gt;&lt;/a&gt;
+&lt;a xmlns:href="{{.}}"&gt;&lt;/a&gt;
+&lt;a xmlns:onclick="{{.}}"&gt;&lt;/a&gt;
+</pre> <p>At parse time they become: </p>
+<pre data-language="go">&lt;a xmlns:title="{{. | urlescaper | attrescaper}}"&gt;&lt;/a&gt;
+&lt;a xmlns:href="{{. | urlescaper | attrescaper}}"&gt;&lt;/a&gt;
+&lt;a xmlns:onclick="{{. | urlescaper | attrescaper}}"&gt;&lt;/a&gt;
+</pre> <h3 id="hdr-Errors">Errors</h3> <p>See the documentation of ErrorCode for details. </p>
+<h3 id="hdr-A_fuller_picture">A fuller picture</h3> <p>The rest of this package comment may be skipped on first reading; it includes details necessary to understand escaping contexts and error messages. Most users will not need to understand these details. </p>
+<h3 id="hdr-Contexts">Contexts</h3> <p>Assuming {{.}} is `O'Reilly: How are &lt;i&gt;you&lt;/i&gt;?`, the table below shows how {{.}} appears when used in the context to the left. </p>
+<pre data-language="go">Context {{.}} After
+{{.}} O'Reilly: How are &amp;lt;i&amp;gt;you&amp;lt;/i&amp;gt;?
+&lt;a title='{{.}}'&gt; O&amp;#39;Reilly: How are you?
+&lt;a href="/{{.}}"&gt; O&amp;#39;Reilly: How are %3ci%3eyou%3c/i%3e?
+&lt;a href="?q={{.}}"&gt; O&amp;#39;Reilly%3a%20How%20are%3ci%3e...%3f
+&lt;a onx='f("{{.}}")'&gt; O\x27Reilly: How are \x3ci\x3eyou...?
+&lt;a onx='f({{.}})'&gt; "O\x27Reilly: How are \x3ci\x3eyou...?"
+&lt;a onx='pattern = /{{.}}/;'&gt; O\x27Reilly: How are \x3ci\x3eyou...\x3f
+</pre> <p>If used in an unsafe context, then the value might be filtered out: </p>
+<pre data-language="go">Context {{.}} After
+&lt;a href="{{.}}"&gt; #ZgotmplZ
+</pre> <p>since "O'Reilly:" is not an allowed protocol like "http:". </p>
+<p>If {{.}} is the innocuous word, `left`, then it can appear more widely, </p>
+<pre data-language="go">Context {{.}} After
+{{.}} left
+&lt;a title='{{.}}'&gt; left
+&lt;a href='{{.}}'&gt; left
+&lt;a href='/{{.}}'&gt; left
+&lt;a href='?dir={{.}}'&gt; left
+&lt;a style="border-{{.}}: 4px"&gt; left
+&lt;a style="align: {{.}}"&gt; left
+&lt;a style="background: '{{.}}'&gt; left
+&lt;a style="background: url('{{.}}')&gt; left
+&lt;style&gt;p.{{.}} {color:red}&lt;/style&gt; left
+</pre> <p>Non-string values can be used in JavaScript contexts. If {{.}} is </p>
+<pre data-language="go">struct{A,B string}{ "foo", "bar" }
+</pre> <p>in the escaped template </p>
+<pre data-language="go">&lt;script&gt;var pair = {{.}};&lt;/script&gt;
+</pre> <p>then the template output is </p>
+<pre data-language="go">&lt;script&gt;var pair = {"A": "foo", "B": "bar"};&lt;/script&gt;
+</pre> <p>See package json to understand how non-string content is marshaled for embedding in JavaScript contexts. </p>
+<h3 id="hdr-Typed_Strings">Typed Strings</h3> <p>By default, this package assumes that all pipelines produce a plain text string. It adds escaping pipeline stages necessary to correctly and safely embed that plain text string in the appropriate context. </p>
+<p>When a data value is not plain text, you can make sure it is not over-escaped by marking it with its type. </p>
+<p>Types HTML, JS, URL, and others from content.go can carry safe content that is exempted from escaping. </p>
+<p>The template </p>
+<pre data-language="go">Hello, {{.}}!
+</pre> <p>can be invoked with </p>
+<pre data-language="go">tmpl.Execute(out, template.HTML(`&lt;b&gt;World&lt;/b&gt;`))
+</pre> <p>to produce </p>
+<pre data-language="go">Hello, &lt;b&gt;World&lt;/b&gt;!
+</pre> <p>instead of the </p>
+<pre data-language="go">Hello, &amp;lt;b&amp;gt;World&amp;lt;b&amp;gt;!
+</pre> <p>that would have been produced if {{.}} was a regular string. </p>
+<h3 id="hdr-Security_Model">Security Model</h3> <p><a href="https://rawgit.com/mikesamuel/sanitized-jquery-templates/trunk/safetemplate.html#problem_definition">https://rawgit.com/mikesamuel/sanitized-jquery-templates/trunk/safetemplate.html#problem_definition</a> defines "safe" as used by this package. </p>
+<p>This package assumes that template authors are trusted, that Execute's data parameter is not, and seeks to preserve the properties below in the face of untrusted data: </p>
+<p>Structure Preservation Property: "... when a template author writes an HTML tag in a safe templating language, the browser will interpret the corresponding portion of the output as a tag regardless of the values of untrusted data, and similarly for other structures such as attribute boundaries and JS and CSS string boundaries." </p>
+<p>Code Effect Property: "... only code specified by the template author should run as a result of injecting the template output into a page and all code specified by the template author should run as a result of the same." </p>
+<p>Least Surprise Property: "A developer (or code reviewer) familiar with HTML, CSS, and JavaScript, who knows that contextual autoescaping happens should be able to look at a {{.}} and correctly infer what sanitization happens." </p>
+<p>As a consequence of the Least Surprise Property, template actions within an ECMAScript 6 template literal are disabled by default. Handling string interpolation within these literals is rather complex resulting in no clear safe way to support it. To re-enable template actions within ECMAScript 6 template literals, use the GODEBUG=jstmpllitinterp=1 environment variable. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const tpl = `
+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+ &lt;head&gt;
+ &lt;meta charset="UTF-8"&gt;
+ &lt;title&gt;{{.Title}}&lt;/title&gt;
+ &lt;/head&gt;
+ &lt;body&gt;
+ {{range .Items}}&lt;div&gt;{{ . }}&lt;/div&gt;{{else}}&lt;div&gt;&lt;strong&gt;no rows&lt;/strong&gt;&lt;/div&gt;{{end}}
+ &lt;/body&gt;
+&lt;/html&gt;`
+
+check := func(err error) {
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+t, err := template.New("webpage").Parse(tpl)
+check(err)
+
+data := struct {
+ Title string
+ Items []string
+}{
+ Title: "My page",
+ Items: []string{
+ "My photos",
+ "My blog",
+ },
+}
+
+err = t.Execute(os.Stdout, data)
+check(err)
+
+noItems := struct {
+ Title string
+ Items []string
+}{
+ Title: "My another page",
+ Items: []string{},
+}
+
+err = t.Execute(os.Stdout, noItems)
+check(err)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+ &lt;head&gt;
+ &lt;meta charset="UTF-8"&gt;
+ &lt;title&gt;My page&lt;/title&gt;
+ &lt;/head&gt;
+ &lt;body&gt;
+ &lt;div&gt;My photos&lt;/div&gt;&lt;div&gt;My blog&lt;/div&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+ &lt;head&gt;
+ &lt;meta charset="UTF-8"&gt;
+ &lt;title&gt;My another page&lt;/title&gt;
+ &lt;/head&gt;
+ &lt;body&gt;
+ &lt;div&gt;&lt;strong&gt;no rows&lt;/strong&gt;&lt;/div&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
+</pre> <h4 id="example__autoescaping"> <span class="text">Example (Autoescaping)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">check := func(err error) {
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+t, err := template.New("foo").Parse(`{{define "T"}}Hello, {{.}}!{{end}}`)
+check(err)
+err = t.ExecuteTemplate(os.Stdout, "T", "&lt;script&gt;alert('you have been pwned')&lt;/script&gt;")
+check(err)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, &amp;lt;script&amp;gt;alert(&amp;#39;you have been pwned&amp;#39;)&amp;lt;/script&amp;gt;!
+</pre> <h4 id="example__escape"> <span class="text">Example (Escape)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const s = `"Fran &amp; Freddie's Diner" &lt;tasty@example.com&gt;`
+v := []any{`"Fran &amp; Freddie's Diner"`, ' ', `&lt;tasty@example.com&gt;`}
+
+fmt.Println(template.HTMLEscapeString(s))
+template.HTMLEscape(os.Stdout, []byte(s))
+fmt.Fprintln(os.Stdout, "")
+fmt.Println(template.HTMLEscaper(v...))
+
+fmt.Println(template.JSEscapeString(s))
+template.JSEscape(os.Stdout, []byte(s))
+fmt.Fprintln(os.Stdout, "")
+fmt.Println(template.JSEscaper(v...))
+
+fmt.Println(template.URLQueryEscaper(v...))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">&amp;#34;Fran &amp;amp; Freddie&amp;#39;s Diner&amp;#34; &amp;lt;tasty@example.com&amp;gt;
+&amp;#34;Fran &amp;amp; Freddie&amp;#39;s Diner&amp;#34; &amp;lt;tasty@example.com&amp;gt;
+&amp;#34;Fran &amp;amp; Freddie&amp;#39;s Diner&amp;#34;32&amp;lt;tasty@example.com&amp;gt;
+\"Fran \u0026 Freddie\'s Diner\" \u003Ctasty@example.com\u003E
+\"Fran \u0026 Freddie\'s Diner\" \u003Ctasty@example.com\u003E
+\"Fran \u0026 Freddie\'s Diner\"32\u003Ctasty@example.com\u003E
+%22Fran+%26+Freddie%27s+Diner%2232%3Ctasty%40example.com%3E
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#HTMLEscape">func HTMLEscape(w io.Writer, b []byte)</a></li>
+<li><a href="#HTMLEscapeString">func HTMLEscapeString(s string) string</a></li>
+<li><a href="#HTMLEscaper">func HTMLEscaper(args ...any) string</a></li>
+<li><a href="#IsTrue">func IsTrue(val any) (truth, ok bool)</a></li>
+<li><a href="#JSEscape">func JSEscape(w io.Writer, b []byte)</a></li>
+<li><a href="#JSEscapeString">func JSEscapeString(s string) string</a></li>
+<li><a href="#JSEscaper">func JSEscaper(args ...any) string</a></li>
+<li><a href="#URLQueryEscaper">func URLQueryEscaper(args ...any) string</a></li>
+<li><a href="#CSS">type CSS</a></li>
+<li><a href="#Error">type Error</a></li>
+<li> <a href="#Error.Error">func (e *Error) Error() string</a>
+</li>
+<li><a href="#ErrorCode">type ErrorCode</a></li>
+<li><a href="#FuncMap">type FuncMap</a></li>
+<li><a href="#HTML">type HTML</a></li>
+<li><a href="#HTMLAttr">type HTMLAttr</a></li>
+<li><a href="#JS">type JS</a></li>
+<li><a href="#JSStr">type JSStr</a></li>
+<li><a href="#Srcset">type Srcset</a></li>
+<li><a href="#Template">type Template</a></li>
+<li> <a href="#Must">func Must(t *Template, err error) *Template</a>
+</li>
+<li> <a href="#New">func New(name string) *Template</a>
+</li>
+<li> <a href="#ParseFS">func ParseFS(fs fs.FS, patterns ...string) (*Template, error)</a>
+</li>
+<li> <a href="#ParseFiles">func ParseFiles(filenames ...string) (*Template, error)</a>
+</li>
+<li> <a href="#ParseGlob">func ParseGlob(pattern string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.AddParseTree">func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error)</a>
+</li>
+<li> <a href="#Template.Clone">func (t *Template) Clone() (*Template, error)</a>
+</li>
+<li> <a href="#Template.DefinedTemplates">func (t *Template) DefinedTemplates() string</a>
+</li>
+<li> <a href="#Template.Delims">func (t *Template) Delims(left, right string) *Template</a>
+</li>
+<li> <a href="#Template.Execute">func (t *Template) Execute(wr io.Writer, data any) error</a>
+</li>
+<li> <a href="#Template.ExecuteTemplate">func (t *Template) ExecuteTemplate(wr io.Writer, name string, data any) error</a>
+</li>
+<li> <a href="#Template.Funcs">func (t *Template) Funcs(funcMap FuncMap) *Template</a>
+</li>
+<li> <a href="#Template.Lookup">func (t *Template) Lookup(name string) *Template</a>
+</li>
+<li> <a href="#Template.Name">func (t *Template) Name() string</a>
+</li>
+<li> <a href="#Template.New">func (t *Template) New(name string) *Template</a>
+</li>
+<li> <a href="#Template.Option">func (t *Template) Option(opt ...string) *Template</a>
+</li>
+<li> <a href="#Template.Parse">func (t *Template) Parse(text string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.ParseFS">func (t *Template) ParseFS(fs fs.FS, patterns ...string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.ParseFiles">func (t *Template) ParseFiles(filenames ...string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.ParseGlob">func (t *Template) ParseGlob(pattern string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.Templates">func (t *Template) Templates() []*Template</a>
+</li>
+<li><a href="#URL">type URL</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example_Template_Delims">Template.Delims</a></dd> <dd><a class="exampleLink" href="#example_Template_block">Template (Block)</a></dd> <dd><a class="exampleLink" href="#example_Template_glob">Template (Glob)</a></dd> <dd><a class="exampleLink" href="#example_Template_helpers">Template (Helpers)</a></dd> <dd><a class="exampleLink" href="#example_Template_parsefiles">Template (Parsefiles)</a></dd> <dd><a class="exampleLink" href="#example_Template_share">Template (Share)</a></dd> <dd><a class="exampleLink" href="#example__autoescaping">Package (Autoescaping)</a></dd> <dd><a class="exampleLink" href="#example__escape">Package (Escape)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>attr.go</span> <span>attr_string.go</span> <span>content.go</span> <span>context.go</span> <span>css.go</span> <span>delim_string.go</span> <span>doc.go</span> <span>element_string.go</span> <span>error.go</span> <span>escape.go</span> <span>html.go</span> <span>js.go</span> <span>jsctx_string.go</span> <span>state_string.go</span> <span>template.go</span> <span>transition.go</span> <span>url.go</span> <span>urlpart_string.go</span> </p> <h2 id="HTMLEscape">func <span>HTMLEscape</span> </h2> <pre data-language="go">func HTMLEscape(w io.Writer, b []byte)</pre> <p>HTMLEscape writes to w the escaped HTML equivalent of the plain text data b. </p>
+<h2 id="HTMLEscapeString">func <span>HTMLEscapeString</span> </h2> <pre data-language="go">func HTMLEscapeString(s string) string</pre> <p>HTMLEscapeString returns the escaped HTML equivalent of the plain text data s. </p>
+<h2 id="HTMLEscaper">func <span>HTMLEscaper</span> </h2> <pre data-language="go">func HTMLEscaper(args ...any) string</pre> <p>HTMLEscaper returns the escaped HTML equivalent of the textual representation of its arguments. </p>
+<h2 id="IsTrue">func <span>IsTrue</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">func IsTrue(val any) (truth, ok bool)</pre> <p>IsTrue reports whether the value is 'true', in the sense of not the zero of its type, and whether the value has a meaningful truth value. This is the definition of truth used by if and other such actions. </p>
+<h2 id="JSEscape">func <span>JSEscape</span> </h2> <pre data-language="go">func JSEscape(w io.Writer, b []byte)</pre> <p>JSEscape writes to w the escaped JavaScript equivalent of the plain text data b. </p>
+<h2 id="JSEscapeString">func <span>JSEscapeString</span> </h2> <pre data-language="go">func JSEscapeString(s string) string</pre> <p>JSEscapeString returns the escaped JavaScript equivalent of the plain text data s. </p>
+<h2 id="JSEscaper">func <span>JSEscaper</span> </h2> <pre data-language="go">func JSEscaper(args ...any) string</pre> <p>JSEscaper returns the escaped JavaScript equivalent of the textual representation of its arguments. </p>
+<h2 id="URLQueryEscaper">func <span>URLQueryEscaper</span> </h2> <pre data-language="go">func URLQueryEscaper(args ...any) string</pre> <p>URLQueryEscaper returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query. </p>
+<h2 id="CSS">type <span>CSS</span> </h2> <p>CSS encapsulates known safe content that matches any of: </p>
+<ol> <li>The CSS3 stylesheet production, such as `p { color: purple }`. </li>
+<li>The CSS3 rule production, such as `a[href=~"https:"].foo#bar`. </li>
+<li>CSS3 declaration productions, such as `color: red; margin: 2px`. </li>
+<li>The CSS3 value production, such as `rgba(0, 0, 255, 127)`. </li>
+</ol> <p>See <a href="https://www.w3.org/TR/css3-syntax/#parsing">https://www.w3.org/TR/css3-syntax/#parsing</a> and <a href="https://web.archive.org/web/20090211114933/http://w3.org/TR/css3-syntax#style">https://web.archive.org/web/20090211114933/http://w3.org/TR/css3-syntax#style</a> </p>
+<p>Use of this type presents a security risk: the encapsulated content should come from a trusted source, as it will be included verbatim in the template output. </p>
+<pre data-language="go">type CSS string</pre> <h2 id="Error">type <span>Error</span> </h2> <p>Error describes a problem encountered during template Escaping. </p>
+<pre data-language="go">type Error struct {
+ // ErrorCode describes the kind of error.
+ ErrorCode ErrorCode
+ // Node is the node that caused the problem, if known.
+ // If not nil, it overrides Name and Line.
+ Node parse.Node // Go 1.4
+ // Name is the name of the template in which the error was encountered.
+ Name string
+ // Line is the line number of the error in the template source or 0.
+ Line int
+ // Description is a human-readable description of the problem.
+ Description string
+}
+</pre> <h3 id="Error.Error">func (*Error) <span>Error</span> </h3> <pre data-language="go">func (e *Error) Error() string</pre> <h2 id="ErrorCode">type <span>ErrorCode</span> </h2> <p>ErrorCode is a code for a kind of error. </p>
+<pre data-language="go">type ErrorCode int</pre> <p>We define codes for each error that manifests while escaping templates, but escaped templates may also fail at runtime. </p>
+<p>Output: "ZgotmplZ" Example: </p>
+<pre data-language="go">&lt;img src="{{.X}}"&gt;
+where {{.X}} evaluates to `javascript:...`
+</pre> <p>Discussion: </p>
+<pre data-language="go">"ZgotmplZ" is a special value that indicates that unsafe content reached a
+CSS or URL context at runtime. The output of the example will be
+ &lt;img src="#ZgotmplZ"&gt;
+If the data comes from a trusted source, use content types to exempt it
+from filtering: URL(`javascript:...`).
+</pre> <pre data-language="go">const (
+ // OK indicates the lack of an error.
+ OK ErrorCode = iota
+
+ // ErrAmbigContext: "... appears in an ambiguous context within a URL"
+ // Example:
+ // &lt;a href="
+ // {{if .C}}
+ // /path/
+ // {{else}}
+ // /search?q=
+ // {{end}}
+ // {{.X}}
+ // "&gt;
+ // Discussion:
+ // {{.X}} is in an ambiguous URL context since, depending on {{.C}},
+ // it may be either a URL suffix or a query parameter.
+ // Moving {{.X}} into the condition removes the ambiguity:
+ // &lt;a href="{{if .C}}/path/{{.X}}{{else}}/search?q={{.X}}"&gt;
+ ErrAmbigContext
+
+ // ErrBadHTML: "expected space, attr name, or end of tag, but got ...",
+ // "... in unquoted attr", "... in attribute name"
+ // Example:
+ // &lt;a href = /search?q=foo&gt;
+ // &lt;href=foo&gt;
+ // &lt;form na&lt;e=...&gt;
+ // &lt;option selected&lt;
+ // Discussion:
+ // This is often due to a typo in an HTML element, but some runes
+ // are banned in tag names, attribute names, and unquoted attribute
+ // values because they can tickle parser ambiguities.
+ // Quoting all attributes is the best policy.
+ ErrBadHTML
+
+ // ErrBranchEnd: "{{if}} branches end in different contexts"
+ // Example:
+ // {{if .C}}&lt;a href="{{end}}{{.X}}
+ // Discussion:
+ // Package html/template statically examines each path through an
+ // {{if}}, {{range}}, or {{with}} to escape any following pipelines.
+ // The example is ambiguous since {{.X}} might be an HTML text node,
+ // or a URL prefix in an HTML attribute. The context of {{.X}} is
+ // used to figure out how to escape it, but that context depends on
+ // the run-time value of {{.C}} which is not statically known.
+ //
+ // The problem is usually something like missing quotes or angle
+ // brackets, or can be avoided by refactoring to put the two contexts
+ // into different branches of an if, range or with. If the problem
+ // is in a {{range}} over a collection that should never be empty,
+ // adding a dummy {{else}} can help.
+ ErrBranchEnd
+
+ // ErrEndContext: "... ends in a non-text context: ..."
+ // Examples:
+ // &lt;div
+ // &lt;div title="no close quote&gt;
+ // &lt;script&gt;f()
+ // Discussion:
+ // Executed templates should produce a DocumentFragment of HTML.
+ // Templates that end without closing tags will trigger this error.
+ // Templates that should not be used in an HTML context or that
+ // produce incomplete Fragments should not be executed directly.
+ //
+ // {{define "main"}} &lt;script&gt;{{template "helper"}}&lt;/script&gt; {{end}}
+ // {{define "helper"}} document.write(' &lt;div title=" ') {{end}}
+ //
+ // "helper" does not produce a valid document fragment, so should
+ // not be Executed directly.
+ ErrEndContext
+
+ // ErrNoSuchTemplate: "no such template ..."
+ // Examples:
+ // {{define "main"}}&lt;div {{template "attrs"}}&gt;{{end}}
+ // {{define "attrs"}}href="{{.URL}}"{{end}}
+ // Discussion:
+ // Package html/template looks through template calls to compute the
+ // context.
+ // Here the {{.URL}} in "attrs" must be treated as a URL when called
+ // from "main", but you will get this error if "attrs" is not defined
+ // when "main" is parsed.
+ ErrNoSuchTemplate
+
+ // ErrOutputContext: "cannot compute output context for template ..."
+ // Examples:
+ // {{define "t"}}{{if .T}}{{template "t" .T}}{{end}}{{.H}}",{{end}}
+ // Discussion:
+ // A recursive template does not end in the same context in which it
+ // starts, and a reliable output context cannot be computed.
+ // Look for typos in the named template.
+ // If the template should not be called in the named start context,
+ // look for calls to that template in unexpected contexts.
+ // Maybe refactor recursive templates to not be recursive.
+ ErrOutputContext
+
+ // ErrPartialCharset: "unfinished JS regexp charset in ..."
+ // Example:
+ // &lt;script&gt;var pattern = /foo[{{.Chars}}]/&lt;/script&gt;
+ // Discussion:
+ // Package html/template does not support interpolation into regular
+ // expression literal character sets.
+ ErrPartialCharset
+
+ // ErrPartialEscape: "unfinished escape sequence in ..."
+ // Example:
+ // &lt;script&gt;alert("\{{.X}}")&lt;/script&gt;
+ // Discussion:
+ // Package html/template does not support actions following a
+ // backslash.
+ // This is usually an error and there are better solutions; for
+ // example
+ // &lt;script&gt;alert("{{.X}}")&lt;/script&gt;
+ // should work, and if {{.X}} is a partial escape sequence such as
+ // "xA0", mark the whole sequence as safe content: JSStr(`\xA0`)
+ ErrPartialEscape
+
+ // ErrRangeLoopReentry: "on range loop re-entry: ..."
+ // Example:
+ // &lt;script&gt;var x = [{{range .}}'{{.}},{{end}}]&lt;/script&gt;
+ // Discussion:
+ // If an iteration through a range would cause it to end in a
+ // different context than an earlier pass, there is no single context.
+ // In the example, there is missing a quote, so it is not clear
+ // whether {{.}} is meant to be inside a JS string or in a JS value
+ // context. The second iteration would produce something like
+ //
+ // &lt;script&gt;var x = ['firstValue,'secondValue]&lt;/script&gt;
+ ErrRangeLoopReentry
+
+ // ErrSlashAmbig: '/' could start a division or regexp.
+ // Example:
+ // &lt;script&gt;
+ // {{if .C}}var x = 1{{end}}
+ // /-{{.N}}/i.test(x) ? doThis : doThat();
+ // &lt;/script&gt;
+ // Discussion:
+ // The example above could produce `var x = 1/-2/i.test(s)...`
+ // in which the first '/' is a mathematical division operator or it
+ // could produce `/-2/i.test(s)` in which the first '/' starts a
+ // regexp literal.
+ // Look for missing semicolons inside branches, and maybe add
+ // parentheses to make it clear which interpretation you intend.
+ ErrSlashAmbig
+
+ // ErrPredefinedEscaper: "predefined escaper ... disallowed in template"
+ // Example:
+ // &lt;div class={{. | html}}&gt;Hello&lt;div&gt;
+ // Discussion:
+ // Package html/template already contextually escapes all pipelines to
+ // produce HTML output safe against code injection. Manually escaping
+ // pipeline output using the predefined escapers "html" or "urlquery" is
+ // unnecessary, and may affect the correctness or safety of the escaped
+ // pipeline output in Go 1.8 and earlier.
+ //
+ // In most cases, such as the given example, this error can be resolved by
+ // simply removing the predefined escaper from the pipeline and letting the
+ // contextual autoescaper handle the escaping of the pipeline. In other
+ // instances, where the predefined escaper occurs in the middle of a
+ // pipeline where subsequent commands expect escaped input, e.g.
+ // {{.X | html | makeALink}}
+ // where makeALink does
+ // return `&lt;a href="`+input+`"&gt;link&lt;/a&gt;`
+ // consider refactoring the surrounding template to make use of the
+ // contextual autoescaper, i.e.
+ // &lt;a href="{{.X}}"&gt;link&lt;/a&gt;
+ //
+ // To ease migration to Go 1.9 and beyond, "html" and "urlquery" will
+ // continue to be allowed as the last command in a pipeline. However, if the
+ // pipeline occurs in an unquoted attribute value context, "html" is
+ // disallowed. Avoid using "html" and "urlquery" entirely in new templates.
+ ErrPredefinedEscaper
+
+ // ErrJSTemplate: "... appears in a JS template literal"
+ // Example:
+ // &lt;script&gt;var tmpl = `{{.Interp}}`&lt;/script&gt;
+ // Discussion:
+ // Package html/template does not support actions inside of JS template
+ // literals.
+ //
+ // Deprecated: ErrJSTemplate is no longer returned when an action is present
+ // in a JS template literal. Actions inside of JS template literals are now
+ // escaped as expected.
+ ErrJSTemplate
+)</pre> <h2 id="FuncMap">type <span>FuncMap</span> </h2> <pre data-language="go">type FuncMap = template.FuncMap</pre> <h2 id="HTML">type <span>HTML</span> </h2> <p>HTML encapsulates a known safe HTML document fragment. It should not be used for HTML from a third-party, or HTML with unclosed tags or comments. The outputs of a sound HTML sanitizer and a template escaped by this package are fine for use with HTML. </p>
+<p>Use of this type presents a security risk: the encapsulated content should come from a trusted source, as it will be included verbatim in the template output. </p>
+<pre data-language="go">type HTML string</pre> <h2 id="HTMLAttr">type <span>HTMLAttr</span> </h2> <p>HTMLAttr encapsulates an HTML attribute from a trusted source, for example, ` dir="ltr"`. </p>
+<p>Use of this type presents a security risk: the encapsulated content should come from a trusted source, as it will be included verbatim in the template output. </p>
+<pre data-language="go">type HTMLAttr string</pre> <h2 id="JS">type <span>JS</span> </h2> <p>JS encapsulates a known safe EcmaScript5 Expression, for example, `(x + y * z())`. Template authors are responsible for ensuring that typed expressions do not break the intended precedence and that there is no statement/expression ambiguity as when passing an expression like "{ foo: bar() }\n['foo']()", which is both a valid Expression and a valid Program with a very different meaning. </p>
+<p>Use of this type presents a security risk: the encapsulated content should come from a trusted source, as it will be included verbatim in the template output. </p>
+<p>Using JS to include valid but untrusted JSON is not safe. A safe alternative is to parse the JSON with json.Unmarshal and then pass the resultant object into the template, where it will be converted to sanitized JSON when presented in a JavaScript context. </p>
+<pre data-language="go">type JS string</pre> <h2 id="JSStr">type <span>JSStr</span> </h2> <p>JSStr encapsulates a sequence of characters meant to be embedded between quotes in a JavaScript expression. The string must match a series of StringCharacters: </p>
+<pre data-language="go">StringCharacter :: SourceCharacter but not `\` or LineTerminator
+ | EscapeSequence
+</pre> <p>Note that LineContinuations are not allowed. JSStr("foo\\nbar") is fine, but JSStr("foo\\\nbar") is not. </p>
+<p>Use of this type presents a security risk: the encapsulated content should come from a trusted source, as it will be included verbatim in the template output. </p>
+<pre data-language="go">type JSStr string</pre> <h2 id="Srcset">type <span>Srcset</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>Srcset encapsulates a known safe srcset attribute (see <a href="https://w3c.github.io/html/semantics-embedded-content.html#element-attrdef-img-srcset">https://w3c.github.io/html/semantics-embedded-content.html#element-attrdef-img-srcset</a>). </p>
+<p>Use of this type presents a security risk: the encapsulated content should come from a trusted source, as it will be included verbatim in the template output. </p>
+<pre data-language="go">type Srcset string</pre> <h2 id="Template">type <span>Template</span> </h2> <p>Template is a specialized Template from "text/template" that produces a safe HTML document fragment. </p>
+<pre data-language="go">type Template struct {
+
+ // The underlying template's parse tree, updated to be HTML-safe.
+ Tree *parse.Tree // Go 1.2
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Template_block"> <span class="text">Example (Block)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const (
+ master = `Names:{{block "list" .}}{{"\n"}}{{range .}}{{println "-" .}}{{end}}{{end}}`
+ overlay = `{{define "list"}} {{join . ", "}}{{end}} `
+)
+var (
+ funcs = template.FuncMap{"join": strings.Join}
+ guardians = []string{"Gamora", "Groot", "Nebula", "Rocket", "Star-Lord"}
+)
+masterTmpl, err := template.New("master").Funcs(funcs).Parse(master)
+if err != nil {
+ log.Fatal(err)
+}
+overlayTmpl, err := template.Must(masterTmpl.Clone()).Parse(overlay)
+if err != nil {
+ log.Fatal(err)
+}
+if err := masterTmpl.Execute(os.Stdout, guardians); err != nil {
+ log.Fatal(err)
+}
+if err := overlayTmpl.Execute(os.Stdout, guardians); err != nil {
+ log.Fatal(err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">Names:
+- Gamora
+- Groot
+- Nebula
+- Rocket
+- Star-Lord
+Names: Gamora, Groot, Nebula, Rocket, Star-Lord
+</pre> <h4 id="example_Template_glob"> <span class="text">Example (Glob)</span>
+</h4> <p>Here we demonstrate loading a set of templates from a directory. </p> <p>Code:</p> <pre class="code" data-language="go">// Here we create a temporary directory and populate it with our sample
+// template definition files; usually the template files would already
+// exist in some location known to the program.
+dir := createTestDir([]templateFile{
+ // T0.tmpl is a plain template file that just invokes T1.
+ {"T0.tmpl", `T0 invokes T1: ({{template "T1"}})`},
+ // T1.tmpl defines a template, T1 that invokes T2.
+ {"T1.tmpl", `{{define "T1"}}T1 invokes T2: ({{template "T2"}}){{end}}`},
+ // T2.tmpl defines a template T2.
+ {"T2.tmpl", `{{define "T2"}}This is T2{{end}}`},
+})
+// Clean up after the test; another quirk of running as an example.
+defer os.RemoveAll(dir)
+
+// pattern is the glob pattern used to find all the template files.
+pattern := filepath.Join(dir, "*.tmpl")
+
+// Here starts the example proper.
+// T0.tmpl is the first name matched, so it becomes the starting template,
+// the value returned by ParseGlob.
+tmpl := template.Must(template.ParseGlob(pattern))
+
+err := tmpl.Execute(os.Stdout, nil)
+if err != nil {
+ log.Fatalf("template execution: %s", err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">T0 invokes T1: (T1 invokes T2: (This is T2))
+</pre> <h4 id="example_Template_helpers"> <span class="text">Example (Helpers)</span>
+</h4> <p>This example demonstrates one way to share some templates and use them in different contexts. In this variant we add multiple driver templates by hand to an existing bundle of templates. </p> <p>Code:</p> <pre class="code" data-language="go">// Here we create a temporary directory and populate it with our sample
+// template definition files; usually the template files would already
+// exist in some location known to the program.
+dir := createTestDir([]templateFile{
+ // T1.tmpl defines a template, T1 that invokes T2.
+ {"T1.tmpl", `{{define "T1"}}T1 invokes T2: ({{template "T2"}}){{end}}`},
+ // T2.tmpl defines a template T2.
+ {"T2.tmpl", `{{define "T2"}}This is T2{{end}}`},
+})
+// Clean up after the test; another quirk of running as an example.
+defer os.RemoveAll(dir)
+
+// pattern is the glob pattern used to find all the template files.
+pattern := filepath.Join(dir, "*.tmpl")
+
+// Here starts the example proper.
+// Load the helpers.
+templates := template.Must(template.ParseGlob(pattern))
+// Add one driver template to the bunch; we do this with an explicit template definition.
+_, err := templates.Parse("{{define `driver1`}}Driver 1 calls T1: ({{template `T1`}})\n{{end}}")
+if err != nil {
+ log.Fatal("parsing driver1: ", err)
+}
+// Add another driver template.
+_, err = templates.Parse("{{define `driver2`}}Driver 2 calls T2: ({{template `T2`}})\n{{end}}")
+if err != nil {
+ log.Fatal("parsing driver2: ", err)
+}
+// We load all the templates before execution. This package does not require
+// that behavior but html/template's escaping does, so it's a good habit.
+err = templates.ExecuteTemplate(os.Stdout, "driver1", nil)
+if err != nil {
+ log.Fatalf("driver1 execution: %s", err)
+}
+err = templates.ExecuteTemplate(os.Stdout, "driver2", nil)
+if err != nil {
+ log.Fatalf("driver2 execution: %s", err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">Driver 1 calls T1: (T1 invokes T2: (This is T2))
+Driver 2 calls T2: (This is T2)
+</pre> <h4 id="example_Template_parsefiles"> <span class="text">Example (Parsefiles)</span>
+</h4> <p>Here we demonstrate loading a set of templates from files in different directories </p> <p>Code:</p> <pre class="code" data-language="go">// Here we create different temporary directories and populate them with our sample
+// template definition files; usually the template files would already
+// exist in some location known to the program.
+dir1 := createTestDir([]templateFile{
+ // T1.tmpl is a plain template file that just invokes T2.
+ {"T1.tmpl", `T1 invokes T2: ({{template "T2"}})`},
+})
+
+dir2 := createTestDir([]templateFile{
+ // T2.tmpl defines a template T2.
+ {"T2.tmpl", `{{define "T2"}}This is T2{{end}}`},
+})
+
+// Clean up after the test; another quirk of running as an example.
+defer func(dirs ...string) {
+ for _, dir := range dirs {
+ os.RemoveAll(dir)
+ }
+}(dir1, dir2)
+
+// Here starts the example proper.
+// Let's just parse only dir1/T0 and dir2/T2
+paths := []string{
+ filepath.Join(dir1, "T1.tmpl"),
+ filepath.Join(dir2, "T2.tmpl"),
+}
+tmpl := template.Must(template.ParseFiles(paths...))
+
+err := tmpl.Execute(os.Stdout, nil)
+if err != nil {
+ log.Fatalf("template execution: %s", err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">T1 invokes T2: (This is T2)
+</pre> <h4 id="example_Template_share"> <span class="text">Example (Share)</span>
+</h4> <p>This example demonstrates how to use one group of driver templates with distinct sets of helper templates. </p> <p>Code:</p> <pre class="code" data-language="go">// Here we create a temporary directory and populate it with our sample
+// template definition files; usually the template files would already
+// exist in some location known to the program.
+dir := createTestDir([]templateFile{
+ // T0.tmpl is a plain template file that just invokes T1.
+ {"T0.tmpl", "T0 ({{.}} version) invokes T1: ({{template `T1`}})\n"},
+ // T1.tmpl defines a template, T1 that invokes T2. Note T2 is not defined
+ {"T1.tmpl", `{{define "T1"}}T1 invokes T2: ({{template "T2"}}){{end}}`},
+})
+// Clean up after the test; another quirk of running as an example.
+defer os.RemoveAll(dir)
+
+// pattern is the glob pattern used to find all the template files.
+pattern := filepath.Join(dir, "*.tmpl")
+
+// Here starts the example proper.
+// Load the drivers.
+drivers := template.Must(template.ParseGlob(pattern))
+
+// We must define an implementation of the T2 template. First we clone
+// the drivers, then add a definition of T2 to the template name space.
+
+// 1. Clone the helper set to create a new name space from which to run them.
+first, err := drivers.Clone()
+if err != nil {
+ log.Fatal("cloning helpers: ", err)
+}
+// 2. Define T2, version A, and parse it.
+_, err = first.Parse("{{define `T2`}}T2, version A{{end}}")
+if err != nil {
+ log.Fatal("parsing T2: ", err)
+}
+
+// Now repeat the whole thing, using a different version of T2.
+// 1. Clone the drivers.
+second, err := drivers.Clone()
+if err != nil {
+ log.Fatal("cloning drivers: ", err)
+}
+// 2. Define T2, version B, and parse it.
+_, err = second.Parse("{{define `T2`}}T2, version B{{end}}")
+if err != nil {
+ log.Fatal("parsing T2: ", err)
+}
+
+// Execute the templates in the reverse order to verify the
+// first is unaffected by the second.
+err = second.ExecuteTemplate(os.Stdout, "T0.tmpl", "second")
+if err != nil {
+ log.Fatalf("second execution: %s", err)
+}
+err = first.ExecuteTemplate(os.Stdout, "T0.tmpl", "first")
+if err != nil {
+ log.Fatalf("first: execution: %s", err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">T0 (second version) invokes T1: (T1 invokes T2: (T2, version B))
+T0 (first version) invokes T1: (T1 invokes T2: (T2, version A))
+</pre> <h3 id="Must">func <span>Must</span> </h3> <pre data-language="go">func Must(t *Template, err error) *Template</pre> <p>Must is a helper that wraps a call to a function returning (*Template, error) and panics if the error is non-nil. It is intended for use in variable initializations such as </p>
+<pre data-language="go">var t = template.Must(template.New("name").Parse("html"))
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(name string) *Template</pre> <p>New allocates a new HTML template with the given name. </p>
+<h3 id="ParseFS">func <span>ParseFS</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func ParseFS(fs fs.FS, patterns ...string) (*Template, error)</pre> <p>ParseFS is like ParseFiles or ParseGlob but reads from the file system fs instead of the host operating system's file system. It accepts a list of glob patterns. (Note that most file names serve as glob patterns matching only themselves.) </p>
+<h3 id="ParseFiles">func <span>ParseFiles</span> </h3> <pre data-language="go">func ParseFiles(filenames ...string) (*Template, error)</pre> <p>ParseFiles creates a new Template and parses the template definitions from the named files. The returned template's name will have the (base) name and (parsed) contents of the first file. There must be at least one file. If an error occurs, parsing stops and the returned *Template is nil. </p>
+<p>When parsing multiple files with the same name in different directories, the last one mentioned will be the one that results. For instance, ParseFiles("a/foo", "b/foo") stores "b/foo" as the template named "foo", while "a/foo" is unavailable. </p>
+<h3 id="ParseGlob">func <span>ParseGlob</span> </h3> <pre data-language="go">func ParseGlob(pattern string) (*Template, error)</pre> <p>ParseGlob creates a new Template and parses the template definitions from the files identified by the pattern. The files are matched according to the semantics of filepath.Match, and the pattern must match at least one file. The returned template will have the (base) name and (parsed) contents of the first file matched by the pattern. ParseGlob is equivalent to calling ParseFiles with the list of files matched by the pattern. </p>
+<p>When parsing multiple files with the same name in different directories, the last one mentioned will be the one that results. </p>
+<h3 id="Template.AddParseTree">func (*Template) <span>AddParseTree</span> </h3> <pre data-language="go">func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error)</pre> <p>AddParseTree creates a new template with the name and parse tree and associates it with t. </p>
+<p>It returns an error if t or any associated template has already been executed. </p>
+<h3 id="Template.Clone">func (*Template) <span>Clone</span> </h3> <pre data-language="go">func (t *Template) Clone() (*Template, error)</pre> <p>Clone returns a duplicate of the template, including all associated templates. The actual representation is not copied, but the name space of associated templates is, so further calls to Parse in the copy will add templates to the copy but not to the original. Clone can be used to prepare common templates and use them with variant definitions for other templates by adding the variants after the clone is made. </p>
+<p>It returns an error if t has already been executed. </p>
+<h3 id="Template.DefinedTemplates">func (*Template) <span>DefinedTemplates</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (t *Template) DefinedTemplates() string</pre> <p>DefinedTemplates returns a string listing the defined templates, prefixed by the string "; defined templates are: ". If there are none, it returns the empty string. Used to generate an error message. </p>
+<h3 id="Template.Delims">func (*Template) <span>Delims</span> </h3> <pre data-language="go">func (t *Template) Delims(left, right string) *Template</pre> <p>Delims sets the action delimiters to the specified strings, to be used in subsequent calls to Parse, ParseFiles, or ParseGlob. Nested template definitions will inherit the settings. An empty delimiter stands for the corresponding default: {{ or }}. The return value is the template, so calls can be chained. </p> <h4 id="example_Template_Delims"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const text = "&lt;&lt;.Greeting&gt;&gt; {{.Name}}"
+
+data := struct {
+ Greeting string
+ Name string
+}{
+ Greeting: "Hello",
+ Name: "Joe",
+}
+
+t := template.Must(template.New("tpl").Delims("&lt;&lt;", "&gt;&gt;").Parse(text))
+
+err := t.Execute(os.Stdout, data)
+if err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello {{.Name}}
+</pre> <h3 id="Template.Execute">func (*Template) <span>Execute</span> </h3> <pre data-language="go">func (t *Template) Execute(wr io.Writer, data any) error</pre> <p>Execute applies a parsed template to the specified data object, writing the output to wr. If an error occurs executing the template or writing its output, execution stops, but partial results may already have been written to the output writer. A template may be executed safely in parallel, although if parallel executions share a Writer the output may be interleaved. </p>
+<h3 id="Template.ExecuteTemplate">func (*Template) <span>ExecuteTemplate</span> </h3> <pre data-language="go">func (t *Template) ExecuteTemplate(wr io.Writer, name string, data any) error</pre> <p>ExecuteTemplate applies the template associated with t that has the given name to the specified data object and writes the output to wr. If an error occurs executing the template or writing its output, execution stops, but partial results may already have been written to the output writer. A template may be executed safely in parallel, although if parallel executions share a Writer the output may be interleaved. </p>
+<h3 id="Template.Funcs">func (*Template) <span>Funcs</span> </h3> <pre data-language="go">func (t *Template) Funcs(funcMap FuncMap) *Template</pre> <p>Funcs adds the elements of the argument map to the template's function map. It must be called before the template is parsed. It panics if a value in the map is not a function with appropriate return type. However, it is legal to overwrite elements of the map. The return value is the template, so calls can be chained. </p>
+<h3 id="Template.Lookup">func (*Template) <span>Lookup</span> </h3> <pre data-language="go">func (t *Template) Lookup(name string) *Template</pre> <p>Lookup returns the template with the given name that is associated with t, or nil if there is no such template. </p>
+<h3 id="Template.Name">func (*Template) <span>Name</span> </h3> <pre data-language="go">func (t *Template) Name() string</pre> <p>Name returns the name of the template. </p>
+<h3 id="Template.New">func (*Template) <span>New</span> </h3> <pre data-language="go">func (t *Template) New(name string) *Template</pre> <p>New allocates a new HTML template associated with the given one and with the same delimiters. The association, which is transitive, allows one template to invoke another with a {{template}} action. </p>
+<p>If a template with the given name already exists, the new HTML template will replace it. The existing template will be reset and disassociated with t. </p>
+<h3 id="Template.Option">func (*Template) <span>Option</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Template) Option(opt ...string) *Template</pre> <p>Option sets options for the template. Options are described by strings, either a simple string or "key=value". There can be at most one equals sign in an option string. If the option string is unrecognized or otherwise invalid, Option panics. </p>
+<p>Known options: </p>
+<p>missingkey: Control the behavior during execution if a map is indexed with a key that is not present in the map. </p>
+<pre data-language="go">"missingkey=default" or "missingkey=invalid"
+ The default behavior: Do nothing and continue execution.
+ If printed, the result of the index operation is the string
+ "&lt;no value&gt;".
+"missingkey=zero"
+ The operation returns the zero value for the map type's element.
+"missingkey=error"
+ Execution stops immediately with an error.
+</pre> <h3 id="Template.Parse">func (*Template) <span>Parse</span> </h3> <pre data-language="go">func (t *Template) Parse(text string) (*Template, error)</pre> <p>Parse parses text as a template body for t. Named template definitions ({{define ...}} or {{block ...}} statements) in text define additional templates associated with t and are removed from the definition of t itself. </p>
+<p>Templates can be redefined in successive calls to Parse, before the first use of Execute on t or any associated template. A template definition with a body containing only white space and comments is considered empty and will not replace an existing template's body. This allows using Parse to add new named template definitions without overwriting the main template body. </p>
+<h3 id="Template.ParseFS">func (*Template) <span>ParseFS</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (t *Template) ParseFS(fs fs.FS, patterns ...string) (*Template, error)</pre> <p>ParseFS is like ParseFiles or ParseGlob but reads from the file system fs instead of the host operating system's file system. It accepts a list of glob patterns. (Note that most file names serve as glob patterns matching only themselves.) </p>
+<h3 id="Template.ParseFiles">func (*Template) <span>ParseFiles</span> </h3> <pre data-language="go">func (t *Template) ParseFiles(filenames ...string) (*Template, error)</pre> <p>ParseFiles parses the named files and associates the resulting templates with t. If an error occurs, parsing stops and the returned template is nil; otherwise it is t. There must be at least one file. </p>
+<p>When parsing multiple files with the same name in different directories, the last one mentioned will be the one that results. </p>
+<p>ParseFiles returns an error if t or any associated template has already been executed. </p>
+<h3 id="Template.ParseGlob">func (*Template) <span>ParseGlob</span> </h3> <pre data-language="go">func (t *Template) ParseGlob(pattern string) (*Template, error)</pre> <p>ParseGlob parses the template definitions in the files identified by the pattern and associates the resulting templates with t. The files are matched according to the semantics of filepath.Match, and the pattern must match at least one file. ParseGlob is equivalent to calling t.ParseFiles with the list of files matched by the pattern. </p>
+<p>When parsing multiple files with the same name in different directories, the last one mentioned will be the one that results. </p>
+<p>ParseGlob returns an error if t or any associated template has already been executed. </p>
+<h3 id="Template.Templates">func (*Template) <span>Templates</span> </h3> <pre data-language="go">func (t *Template) Templates() []*Template</pre> <p>Templates returns a slice of the templates associated with t, including t itself. </p>
+<h2 id="URL">type <span>URL</span> </h2> <p>URL encapsulates a known safe URL or URL substring (see RFC 3986). A URL like `javascript:checkThatFormNotEditedBeforeLeavingPage()` from a trusted source should go in the page, but by default dynamic `javascript:` URLs are filtered out since they are a frequently exploited injection vector. </p>
+<p>Use of this type presents a security risk: the encapsulated content should come from a trusted source, as it will be included verbatim in the template output. </p>
+<pre data-language="go">type URL string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/html/template/" class="_attribution-link">http://golang.org/pkg/html/template/</a>
+ </p>
+</div>
diff --git a/devdocs/go/image%2Fcolor%2Findex.html b/devdocs/go/image%2Fcolor%2Findex.html
new file mode 100644
index 00000000..49670864
--- /dev/null
+++ b/devdocs/go/image%2Fcolor%2Findex.html
@@ -0,0 +1,149 @@
+<h1> Package color </h1> <ul id="short-nav">
+<li><code>import "image/color"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package color implements a basic color library. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#CMYKToRGB">func CMYKToRGB(c, m, y, k uint8) (uint8, uint8, uint8)</a></li>
+<li><a href="#RGBToCMYK">func RGBToCMYK(r, g, b uint8) (uint8, uint8, uint8, uint8)</a></li>
+<li><a href="#RGBToYCbCr">func RGBToYCbCr(r, g, b uint8) (uint8, uint8, uint8)</a></li>
+<li><a href="#YCbCrToRGB">func YCbCrToRGB(y, cb, cr uint8) (uint8, uint8, uint8)</a></li>
+<li><a href="#Alpha">type Alpha</a></li>
+<li> <a href="#Alpha.RGBA">func (c Alpha) RGBA() (r, g, b, a uint32)</a>
+</li>
+<li><a href="#Alpha16">type Alpha16</a></li>
+<li> <a href="#Alpha16.RGBA">func (c Alpha16) RGBA() (r, g, b, a uint32)</a>
+</li>
+<li><a href="#CMYK">type CMYK</a></li>
+<li> <a href="#CMYK.RGBA">func (c CMYK) RGBA() (uint32, uint32, uint32, uint32)</a>
+</li>
+<li><a href="#Color">type Color</a></li>
+<li><a href="#Gray">type Gray</a></li>
+<li> <a href="#Gray.RGBA">func (c Gray) RGBA() (r, g, b, a uint32)</a>
+</li>
+<li><a href="#Gray16">type Gray16</a></li>
+<li> <a href="#Gray16.RGBA">func (c Gray16) RGBA() (r, g, b, a uint32)</a>
+</li>
+<li><a href="#Model">type Model</a></li>
+<li> <a href="#ModelFunc">func ModelFunc(f func(Color) Color) Model</a>
+</li>
+<li><a href="#NRGBA">type NRGBA</a></li>
+<li> <a href="#NRGBA.RGBA">func (c NRGBA) RGBA() (r, g, b, a uint32)</a>
+</li>
+<li><a href="#NRGBA64">type NRGBA64</a></li>
+<li> <a href="#NRGBA64.RGBA">func (c NRGBA64) RGBA() (r, g, b, a uint32)</a>
+</li>
+<li><a href="#NYCbCrA">type NYCbCrA</a></li>
+<li> <a href="#NYCbCrA.RGBA">func (c NYCbCrA) RGBA() (uint32, uint32, uint32, uint32)</a>
+</li>
+<li><a href="#Palette">type Palette</a></li>
+<li> <a href="#Palette.Convert">func (p Palette) Convert(c Color) Color</a>
+</li>
+<li> <a href="#Palette.Index">func (p Palette) Index(c Color) int</a>
+</li>
+<li><a href="#RGBA">type RGBA</a></li>
+<li> <a href="#RGBA.RGBA">func (c RGBA) RGBA() (r, g, b, a uint32)</a>
+</li>
+<li><a href="#RGBA64">type RGBA64</a></li>
+<li> <a href="#RGBA64.RGBA">func (c RGBA64) RGBA() (r, g, b, a uint32)</a>
+</li>
+<li><a href="#YCbCr">type YCbCr</a></li>
+<li> <a href="#YCbCr.RGBA">func (c YCbCr) RGBA() (uint32, uint32, uint32, uint32)</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>color.go</span> <span>ycbcr.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>Standard colors. </p>
+<pre data-language="go">var (
+ Black = Gray16{0}
+ White = Gray16{0xffff}
+ Transparent = Alpha16{0}
+ Opaque = Alpha16{0xffff}
+)</pre> <h2 id="CMYKToRGB">func <span>CMYKToRGB</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func CMYKToRGB(c, m, y, k uint8) (uint8, uint8, uint8)</pre> <p>CMYKToRGB converts a <a href="#CMYK">CMYK</a> quadruple to an RGB triple. </p>
+<h2 id="RGBToCMYK">func <span>RGBToCMYK</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func RGBToCMYK(r, g, b uint8) (uint8, uint8, uint8, uint8)</pre> <p>RGBToCMYK converts an RGB triple to a CMYK quadruple. </p>
+<h2 id="RGBToYCbCr">func <span>RGBToYCbCr</span> </h2> <pre data-language="go">func RGBToYCbCr(r, g, b uint8) (uint8, uint8, uint8)</pre> <p>RGBToYCbCr converts an RGB triple to a Y'CbCr triple. </p>
+<h2 id="YCbCrToRGB">func <span>YCbCrToRGB</span> </h2> <pre data-language="go">func YCbCrToRGB(y, cb, cr uint8) (uint8, uint8, uint8)</pre> <p>YCbCrToRGB converts a Y'CbCr triple to an RGB triple. </p>
+<h2 id="Alpha">type <span>Alpha</span> </h2> <p>Alpha represents an 8-bit alpha color. </p>
+<pre data-language="go">type Alpha struct {
+ A uint8
+}
+</pre> <h3 id="Alpha.RGBA">func (Alpha) <span>RGBA</span> </h3> <pre data-language="go">func (c Alpha) RGBA() (r, g, b, a uint32)</pre> <h2 id="Alpha16">type <span>Alpha16</span> </h2> <p>Alpha16 represents a 16-bit alpha color. </p>
+<pre data-language="go">type Alpha16 struct {
+ A uint16
+}
+</pre> <h3 id="Alpha16.RGBA">func (Alpha16) <span>RGBA</span> </h3> <pre data-language="go">func (c Alpha16) RGBA() (r, g, b, a uint32)</pre> <h2 id="CMYK">type <span>CMYK</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>CMYK represents a fully opaque CMYK color, having 8 bits for each of cyan, magenta, yellow and black. </p>
+<p>It is not associated with any particular color profile. </p>
+<pre data-language="go">type CMYK struct {
+ C, M, Y, K uint8
+}
+</pre> <h3 id="CMYK.RGBA">func (CMYK) <span>RGBA</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (c CMYK) RGBA() (uint32, uint32, uint32, uint32)</pre> <h2 id="Color">type <span>Color</span> </h2> <p>Color can convert itself to alpha-premultiplied 16-bits per channel RGBA. The conversion may be lossy. </p>
+<pre data-language="go">type Color interface {
+ // RGBA returns the alpha-premultiplied red, green, blue and alpha values
+ // for the color. Each value ranges within [0, 0xffff], but is represented
+ // by a uint32 so that multiplying by a blend factor up to 0xffff will not
+ // overflow.
+ //
+ // An alpha-premultiplied color component c has been scaled by alpha (a),
+ // so has valid values 0 &lt;= c &lt;= a.
+ RGBA() (r, g, b, a uint32)
+}</pre> <h2 id="Gray">type <span>Gray</span> </h2> <p>Gray represents an 8-bit grayscale color. </p>
+<pre data-language="go">type Gray struct {
+ Y uint8
+}
+</pre> <h3 id="Gray.RGBA">func (Gray) <span>RGBA</span> </h3> <pre data-language="go">func (c Gray) RGBA() (r, g, b, a uint32)</pre> <h2 id="Gray16">type <span>Gray16</span> </h2> <p>Gray16 represents a 16-bit grayscale color. </p>
+<pre data-language="go">type Gray16 struct {
+ Y uint16
+}
+</pre> <h3 id="Gray16.RGBA">func (Gray16) <span>RGBA</span> </h3> <pre data-language="go">func (c Gray16) RGBA() (r, g, b, a uint32)</pre> <h2 id="Model">type <span>Model</span> </h2> <p>Model can convert any <a href="#Color">Color</a> to one from its own color model. The conversion may be lossy. </p>
+<pre data-language="go">type Model interface {
+ Convert(c Color) Color
+}</pre> <p>Models for the standard color types. </p>
+<pre data-language="go">var (
+ RGBAModel Model = ModelFunc(rgbaModel)
+ RGBA64Model Model = ModelFunc(rgba64Model)
+ NRGBAModel Model = ModelFunc(nrgbaModel)
+ NRGBA64Model Model = ModelFunc(nrgba64Model)
+ AlphaModel Model = ModelFunc(alphaModel)
+ Alpha16Model Model = ModelFunc(alpha16Model)
+ GrayModel Model = ModelFunc(grayModel)
+ Gray16Model Model = ModelFunc(gray16Model)
+)</pre> <p>CMYKModel is the <a href="#Model">Model</a> for CMYK colors. </p>
+<pre data-language="go">var CMYKModel Model = ModelFunc(cmykModel)</pre> <p>NYCbCrAModel is the <a href="#Model">Model</a> for non-alpha-premultiplied Y'CbCr-with-alpha colors. </p>
+<pre data-language="go">var NYCbCrAModel Model = ModelFunc(nYCbCrAModel)</pre> <p>YCbCrModel is the <a href="#Model">Model</a> for Y'CbCr colors. </p>
+<pre data-language="go">var YCbCrModel Model = ModelFunc(yCbCrModel)</pre> <h3 id="ModelFunc">func <span>ModelFunc</span> </h3> <pre data-language="go">func ModelFunc(f func(Color) Color) Model</pre> <p>ModelFunc returns a <a href="#Model">Model</a> that invokes f to implement the conversion. </p>
+<h2 id="NRGBA">type <span>NRGBA</span> </h2> <p>NRGBA represents a non-alpha-premultiplied 32-bit color. </p>
+<pre data-language="go">type NRGBA struct {
+ R, G, B, A uint8
+}
+</pre> <h3 id="NRGBA.RGBA">func (NRGBA) <span>RGBA</span> </h3> <pre data-language="go">func (c NRGBA) RGBA() (r, g, b, a uint32)</pre> <h2 id="NRGBA64">type <span>NRGBA64</span> </h2> <p>NRGBA64 represents a non-alpha-premultiplied 64-bit color, having 16 bits for each of red, green, blue and alpha. </p>
+<pre data-language="go">type NRGBA64 struct {
+ R, G, B, A uint16
+}
+</pre> <h3 id="NRGBA64.RGBA">func (NRGBA64) <span>RGBA</span> </h3> <pre data-language="go">func (c NRGBA64) RGBA() (r, g, b, a uint32)</pre> <h2 id="NYCbCrA">type <span>NYCbCrA</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>NYCbCrA represents a non-alpha-premultiplied Y'CbCr-with-alpha color, having 8 bits each for one luma, two chroma and one alpha component. </p>
+<pre data-language="go">type NYCbCrA struct {
+ YCbCr
+ A uint8
+}
+</pre> <h3 id="NYCbCrA.RGBA">func (NYCbCrA) <span>RGBA</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (c NYCbCrA) RGBA() (uint32, uint32, uint32, uint32)</pre> <h2 id="Palette">type <span>Palette</span> </h2> <p>Palette is a palette of colors. </p>
+<pre data-language="go">type Palette []Color</pre> <h3 id="Palette.Convert">func (Palette) <span>Convert</span> </h3> <pre data-language="go">func (p Palette) Convert(c Color) Color</pre> <p>Convert returns the palette color closest to c in Euclidean R,G,B space. </p>
+<h3 id="Palette.Index">func (Palette) <span>Index</span> </h3> <pre data-language="go">func (p Palette) Index(c Color) int</pre> <p>Index returns the index of the palette color closest to c in Euclidean R,G,B,A space. </p>
+<h2 id="RGBA">type <span>RGBA</span> </h2> <p>RGBA represents a traditional 32-bit alpha-premultiplied color, having 8 bits for each of red, green, blue and alpha. </p>
+<p>An alpha-premultiplied color component C has been scaled by alpha (A), so has valid values 0 &lt;= C &lt;= A. </p>
+<pre data-language="go">type RGBA struct {
+ R, G, B, A uint8
+}
+</pre> <h3 id="RGBA.RGBA">func (RGBA) <span>RGBA</span> </h3> <pre data-language="go">func (c RGBA) RGBA() (r, g, b, a uint32)</pre> <h2 id="RGBA64">type <span>RGBA64</span> </h2> <p>RGBA64 represents a 64-bit alpha-premultiplied color, having 16 bits for each of red, green, blue and alpha. </p>
+<p>An alpha-premultiplied color component C has been scaled by alpha (A), so has valid values 0 &lt;= C &lt;= A. </p>
+<pre data-language="go">type RGBA64 struct {
+ R, G, B, A uint16
+}
+</pre> <h3 id="RGBA64.RGBA">func (RGBA64) <span>RGBA</span> </h3> <pre data-language="go">func (c RGBA64) RGBA() (r, g, b, a uint32)</pre> <h2 id="YCbCr">type <span>YCbCr</span> </h2> <p>YCbCr represents a fully opaque 24-bit Y'CbCr color, having 8 bits each for one luma and two chroma components. </p>
+<p>JPEG, VP8, the MPEG family and other codecs use this color model. Such codecs often use the terms YUV and Y'CbCr interchangeably, but strictly speaking, the term YUV applies only to analog video signals, and Y' (luma) is Y (luminance) after applying gamma correction. </p>
+<p>Conversion between RGB and Y'CbCr is lossy and there are multiple, slightly different formulae for converting between the two. This package follows the JFIF specification at <a href="https://www.w3.org/Graphics/JPEG/jfif3.pdf">https://www.w3.org/Graphics/JPEG/jfif3.pdf</a>. </p>
+<pre data-language="go">type YCbCr struct {
+ Y, Cb, Cr uint8
+}
+</pre> <h3 id="YCbCr.RGBA">func (YCbCr) <span>RGBA</span> </h3> <pre data-language="go">func (c YCbCr) RGBA() (uint32, uint32, uint32, uint32)</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="palette/index">palette</a> </td> <td class="pkg-synopsis"> Package palette provides standard color palettes. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/image/color/" class="_attribution-link">http://golang.org/pkg/image/color/</a>
+ </p>
+</div>
diff --git a/devdocs/go/image%2Fcolor%2Fpalette%2Findex.html b/devdocs/go/image%2Fcolor%2Fpalette%2Findex.html
new file mode 100644
index 00000000..8f6e60cf
--- /dev/null
+++ b/devdocs/go/image%2Fcolor%2Fpalette%2Findex.html
@@ -0,0 +1,488 @@
+<h1> Package palette </h1> <ul id="short-nav">
+<li><code>import "image/color/palette"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package palette provides standard color palettes. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav"><li><a href="#pkg-variables">Variables</a></li></ul> <h3>Package files</h3> <p> <span>generate.go</span> <span>palette.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>Plan9 is a 256-color palette that partitions the 24-bit RGB space into 4×4×4 subdivision, with 4 shades in each subcube. Compared to the <a href="#WebSafe">WebSafe</a>, the idea is to reduce the color resolution by dicing the color cube into fewer cells, and to use the extra space to increase the intensity resolution. This results in 16 gray shades (4 gray subcubes with 4 samples in each), 13 shades of each primary and secondary color (3 subcubes with 4 samples plus black) and a reasonable selection of colors covering the rest of the color cube. The advantage is better representation of continuous tones. </p>
+<p>This palette was used in the Plan 9 Operating System, described at <a href="https://9p.io/magic/man2html/6/color">https://9p.io/magic/man2html/6/color</a> </p>
+<pre data-language="go">var Plan9 = []color.Color{
+ color.RGBA{0x00, 0x00, 0x00, 0xff},
+ color.RGBA{0x00, 0x00, 0x44, 0xff},
+ color.RGBA{0x00, 0x00, 0x88, 0xff},
+ color.RGBA{0x00, 0x00, 0xcc, 0xff},
+ color.RGBA{0x00, 0x44, 0x00, 0xff},
+ color.RGBA{0x00, 0x44, 0x44, 0xff},
+ color.RGBA{0x00, 0x44, 0x88, 0xff},
+ color.RGBA{0x00, 0x44, 0xcc, 0xff},
+ color.RGBA{0x00, 0x88, 0x00, 0xff},
+ color.RGBA{0x00, 0x88, 0x44, 0xff},
+ color.RGBA{0x00, 0x88, 0x88, 0xff},
+ color.RGBA{0x00, 0x88, 0xcc, 0xff},
+ color.RGBA{0x00, 0xcc, 0x00, 0xff},
+ color.RGBA{0x00, 0xcc, 0x44, 0xff},
+ color.RGBA{0x00, 0xcc, 0x88, 0xff},
+ color.RGBA{0x00, 0xcc, 0xcc, 0xff},
+ color.RGBA{0x00, 0xdd, 0xdd, 0xff},
+ color.RGBA{0x11, 0x11, 0x11, 0xff},
+ color.RGBA{0x00, 0x00, 0x55, 0xff},
+ color.RGBA{0x00, 0x00, 0x99, 0xff},
+ color.RGBA{0x00, 0x00, 0xdd, 0xff},
+ color.RGBA{0x00, 0x55, 0x00, 0xff},
+ color.RGBA{0x00, 0x55, 0x55, 0xff},
+ color.RGBA{0x00, 0x4c, 0x99, 0xff},
+ color.RGBA{0x00, 0x49, 0xdd, 0xff},
+ color.RGBA{0x00, 0x99, 0x00, 0xff},
+ color.RGBA{0x00, 0x99, 0x4c, 0xff},
+ color.RGBA{0x00, 0x99, 0x99, 0xff},
+ color.RGBA{0x00, 0x93, 0xdd, 0xff},
+ color.RGBA{0x00, 0xdd, 0x00, 0xff},
+ color.RGBA{0x00, 0xdd, 0x49, 0xff},
+ color.RGBA{0x00, 0xdd, 0x93, 0xff},
+ color.RGBA{0x00, 0xee, 0x9e, 0xff},
+ color.RGBA{0x00, 0xee, 0xee, 0xff},
+ color.RGBA{0x22, 0x22, 0x22, 0xff},
+ color.RGBA{0x00, 0x00, 0x66, 0xff},
+ color.RGBA{0x00, 0x00, 0xaa, 0xff},
+ color.RGBA{0x00, 0x00, 0xee, 0xff},
+ color.RGBA{0x00, 0x66, 0x00, 0xff},
+ color.RGBA{0x00, 0x66, 0x66, 0xff},
+ color.RGBA{0x00, 0x55, 0xaa, 0xff},
+ color.RGBA{0x00, 0x4f, 0xee, 0xff},
+ color.RGBA{0x00, 0xaa, 0x00, 0xff},
+ color.RGBA{0x00, 0xaa, 0x55, 0xff},
+ color.RGBA{0x00, 0xaa, 0xaa, 0xff},
+ color.RGBA{0x00, 0x9e, 0xee, 0xff},
+ color.RGBA{0x00, 0xee, 0x00, 0xff},
+ color.RGBA{0x00, 0xee, 0x4f, 0xff},
+ color.RGBA{0x00, 0xff, 0x55, 0xff},
+ color.RGBA{0x00, 0xff, 0xaa, 0xff},
+ color.RGBA{0x00, 0xff, 0xff, 0xff},
+ color.RGBA{0x33, 0x33, 0x33, 0xff},
+ color.RGBA{0x00, 0x00, 0x77, 0xff},
+ color.RGBA{0x00, 0x00, 0xbb, 0xff},
+ color.RGBA{0x00, 0x00, 0xff, 0xff},
+ color.RGBA{0x00, 0x77, 0x00, 0xff},
+ color.RGBA{0x00, 0x77, 0x77, 0xff},
+ color.RGBA{0x00, 0x5d, 0xbb, 0xff},
+ color.RGBA{0x00, 0x55, 0xff, 0xff},
+ color.RGBA{0x00, 0xbb, 0x00, 0xff},
+ color.RGBA{0x00, 0xbb, 0x5d, 0xff},
+ color.RGBA{0x00, 0xbb, 0xbb, 0xff},
+ color.RGBA{0x00, 0xaa, 0xff, 0xff},
+ color.RGBA{0x00, 0xff, 0x00, 0xff},
+ color.RGBA{0x44, 0x00, 0x44, 0xff},
+ color.RGBA{0x44, 0x00, 0x88, 0xff},
+ color.RGBA{0x44, 0x00, 0xcc, 0xff},
+ color.RGBA{0x44, 0x44, 0x00, 0xff},
+ color.RGBA{0x44, 0x44, 0x44, 0xff},
+ color.RGBA{0x44, 0x44, 0x88, 0xff},
+ color.RGBA{0x44, 0x44, 0xcc, 0xff},
+ color.RGBA{0x44, 0x88, 0x00, 0xff},
+ color.RGBA{0x44, 0x88, 0x44, 0xff},
+ color.RGBA{0x44, 0x88, 0x88, 0xff},
+ color.RGBA{0x44, 0x88, 0xcc, 0xff},
+ color.RGBA{0x44, 0xcc, 0x00, 0xff},
+ color.RGBA{0x44, 0xcc, 0x44, 0xff},
+ color.RGBA{0x44, 0xcc, 0x88, 0xff},
+ color.RGBA{0x44, 0xcc, 0xcc, 0xff},
+ color.RGBA{0x44, 0x00, 0x00, 0xff},
+ color.RGBA{0x55, 0x00, 0x00, 0xff},
+ color.RGBA{0x55, 0x00, 0x55, 0xff},
+ color.RGBA{0x4c, 0x00, 0x99, 0xff},
+ color.RGBA{0x49, 0x00, 0xdd, 0xff},
+ color.RGBA{0x55, 0x55, 0x00, 0xff},
+ color.RGBA{0x55, 0x55, 0x55, 0xff},
+ color.RGBA{0x4c, 0x4c, 0x99, 0xff},
+ color.RGBA{0x49, 0x49, 0xdd, 0xff},
+ color.RGBA{0x4c, 0x99, 0x00, 0xff},
+ color.RGBA{0x4c, 0x99, 0x4c, 0xff},
+ color.RGBA{0x4c, 0x99, 0x99, 0xff},
+ color.RGBA{0x49, 0x93, 0xdd, 0xff},
+ color.RGBA{0x49, 0xdd, 0x00, 0xff},
+ color.RGBA{0x49, 0xdd, 0x49, 0xff},
+ color.RGBA{0x49, 0xdd, 0x93, 0xff},
+ color.RGBA{0x49, 0xdd, 0xdd, 0xff},
+ color.RGBA{0x4f, 0xee, 0xee, 0xff},
+ color.RGBA{0x66, 0x00, 0x00, 0xff},
+ color.RGBA{0x66, 0x00, 0x66, 0xff},
+ color.RGBA{0x55, 0x00, 0xaa, 0xff},
+ color.RGBA{0x4f, 0x00, 0xee, 0xff},
+ color.RGBA{0x66, 0x66, 0x00, 0xff},
+ color.RGBA{0x66, 0x66, 0x66, 0xff},
+ color.RGBA{0x55, 0x55, 0xaa, 0xff},
+ color.RGBA{0x4f, 0x4f, 0xee, 0xff},
+ color.RGBA{0x55, 0xaa, 0x00, 0xff},
+ color.RGBA{0x55, 0xaa, 0x55, 0xff},
+ color.RGBA{0x55, 0xaa, 0xaa, 0xff},
+ color.RGBA{0x4f, 0x9e, 0xee, 0xff},
+ color.RGBA{0x4f, 0xee, 0x00, 0xff},
+ color.RGBA{0x4f, 0xee, 0x4f, 0xff},
+ color.RGBA{0x4f, 0xee, 0x9e, 0xff},
+ color.RGBA{0x55, 0xff, 0xaa, 0xff},
+ color.RGBA{0x55, 0xff, 0xff, 0xff},
+ color.RGBA{0x77, 0x00, 0x00, 0xff},
+ color.RGBA{0x77, 0x00, 0x77, 0xff},
+ color.RGBA{0x5d, 0x00, 0xbb, 0xff},
+ color.RGBA{0x55, 0x00, 0xff, 0xff},
+ color.RGBA{0x77, 0x77, 0x00, 0xff},
+ color.RGBA{0x77, 0x77, 0x77, 0xff},
+ color.RGBA{0x5d, 0x5d, 0xbb, 0xff},
+ color.RGBA{0x55, 0x55, 0xff, 0xff},
+ color.RGBA{0x5d, 0xbb, 0x00, 0xff},
+ color.RGBA{0x5d, 0xbb, 0x5d, 0xff},
+ color.RGBA{0x5d, 0xbb, 0xbb, 0xff},
+ color.RGBA{0x55, 0xaa, 0xff, 0xff},
+ color.RGBA{0x55, 0xff, 0x00, 0xff},
+ color.RGBA{0x55, 0xff, 0x55, 0xff},
+ color.RGBA{0x88, 0x00, 0x88, 0xff},
+ color.RGBA{0x88, 0x00, 0xcc, 0xff},
+ color.RGBA{0x88, 0x44, 0x00, 0xff},
+ color.RGBA{0x88, 0x44, 0x44, 0xff},
+ color.RGBA{0x88, 0x44, 0x88, 0xff},
+ color.RGBA{0x88, 0x44, 0xcc, 0xff},
+ color.RGBA{0x88, 0x88, 0x00, 0xff},
+ color.RGBA{0x88, 0x88, 0x44, 0xff},
+ color.RGBA{0x88, 0x88, 0x88, 0xff},
+ color.RGBA{0x88, 0x88, 0xcc, 0xff},
+ color.RGBA{0x88, 0xcc, 0x00, 0xff},
+ color.RGBA{0x88, 0xcc, 0x44, 0xff},
+ color.RGBA{0x88, 0xcc, 0x88, 0xff},
+ color.RGBA{0x88, 0xcc, 0xcc, 0xff},
+ color.RGBA{0x88, 0x00, 0x00, 0xff},
+ color.RGBA{0x88, 0x00, 0x44, 0xff},
+ color.RGBA{0x99, 0x00, 0x4c, 0xff},
+ color.RGBA{0x99, 0x00, 0x99, 0xff},
+ color.RGBA{0x93, 0x00, 0xdd, 0xff},
+ color.RGBA{0x99, 0x4c, 0x00, 0xff},
+ color.RGBA{0x99, 0x4c, 0x4c, 0xff},
+ color.RGBA{0x99, 0x4c, 0x99, 0xff},
+ color.RGBA{0x93, 0x49, 0xdd, 0xff},
+ color.RGBA{0x99, 0x99, 0x00, 0xff},
+ color.RGBA{0x99, 0x99, 0x4c, 0xff},
+ color.RGBA{0x99, 0x99, 0x99, 0xff},
+ color.RGBA{0x93, 0x93, 0xdd, 0xff},
+ color.RGBA{0x93, 0xdd, 0x00, 0xff},
+ color.RGBA{0x93, 0xdd, 0x49, 0xff},
+ color.RGBA{0x93, 0xdd, 0x93, 0xff},
+ color.RGBA{0x93, 0xdd, 0xdd, 0xff},
+ color.RGBA{0x99, 0x00, 0x00, 0xff},
+ color.RGBA{0xaa, 0x00, 0x00, 0xff},
+ color.RGBA{0xaa, 0x00, 0x55, 0xff},
+ color.RGBA{0xaa, 0x00, 0xaa, 0xff},
+ color.RGBA{0x9e, 0x00, 0xee, 0xff},
+ color.RGBA{0xaa, 0x55, 0x00, 0xff},
+ color.RGBA{0xaa, 0x55, 0x55, 0xff},
+ color.RGBA{0xaa, 0x55, 0xaa, 0xff},
+ color.RGBA{0x9e, 0x4f, 0xee, 0xff},
+ color.RGBA{0xaa, 0xaa, 0x00, 0xff},
+ color.RGBA{0xaa, 0xaa, 0x55, 0xff},
+ color.RGBA{0xaa, 0xaa, 0xaa, 0xff},
+ color.RGBA{0x9e, 0x9e, 0xee, 0xff},
+ color.RGBA{0x9e, 0xee, 0x00, 0xff},
+ color.RGBA{0x9e, 0xee, 0x4f, 0xff},
+ color.RGBA{0x9e, 0xee, 0x9e, 0xff},
+ color.RGBA{0x9e, 0xee, 0xee, 0xff},
+ color.RGBA{0xaa, 0xff, 0xff, 0xff},
+ color.RGBA{0xbb, 0x00, 0x00, 0xff},
+ color.RGBA{0xbb, 0x00, 0x5d, 0xff},
+ color.RGBA{0xbb, 0x00, 0xbb, 0xff},
+ color.RGBA{0xaa, 0x00, 0xff, 0xff},
+ color.RGBA{0xbb, 0x5d, 0x00, 0xff},
+ color.RGBA{0xbb, 0x5d, 0x5d, 0xff},
+ color.RGBA{0xbb, 0x5d, 0xbb, 0xff},
+ color.RGBA{0xaa, 0x55, 0xff, 0xff},
+ color.RGBA{0xbb, 0xbb, 0x00, 0xff},
+ color.RGBA{0xbb, 0xbb, 0x5d, 0xff},
+ color.RGBA{0xbb, 0xbb, 0xbb, 0xff},
+ color.RGBA{0xaa, 0xaa, 0xff, 0xff},
+ color.RGBA{0xaa, 0xff, 0x00, 0xff},
+ color.RGBA{0xaa, 0xff, 0x55, 0xff},
+ color.RGBA{0xaa, 0xff, 0xaa, 0xff},
+ color.RGBA{0xcc, 0x00, 0xcc, 0xff},
+ color.RGBA{0xcc, 0x44, 0x00, 0xff},
+ color.RGBA{0xcc, 0x44, 0x44, 0xff},
+ color.RGBA{0xcc, 0x44, 0x88, 0xff},
+ color.RGBA{0xcc, 0x44, 0xcc, 0xff},
+ color.RGBA{0xcc, 0x88, 0x00, 0xff},
+ color.RGBA{0xcc, 0x88, 0x44, 0xff},
+ color.RGBA{0xcc, 0x88, 0x88, 0xff},
+ color.RGBA{0xcc, 0x88, 0xcc, 0xff},
+ color.RGBA{0xcc, 0xcc, 0x00, 0xff},
+ color.RGBA{0xcc, 0xcc, 0x44, 0xff},
+ color.RGBA{0xcc, 0xcc, 0x88, 0xff},
+ color.RGBA{0xcc, 0xcc, 0xcc, 0xff},
+ color.RGBA{0xcc, 0x00, 0x00, 0xff},
+ color.RGBA{0xcc, 0x00, 0x44, 0xff},
+ color.RGBA{0xcc, 0x00, 0x88, 0xff},
+ color.RGBA{0xdd, 0x00, 0x93, 0xff},
+ color.RGBA{0xdd, 0x00, 0xdd, 0xff},
+ color.RGBA{0xdd, 0x49, 0x00, 0xff},
+ color.RGBA{0xdd, 0x49, 0x49, 0xff},
+ color.RGBA{0xdd, 0x49, 0x93, 0xff},
+ color.RGBA{0xdd, 0x49, 0xdd, 0xff},
+ color.RGBA{0xdd, 0x93, 0x00, 0xff},
+ color.RGBA{0xdd, 0x93, 0x49, 0xff},
+ color.RGBA{0xdd, 0x93, 0x93, 0xff},
+ color.RGBA{0xdd, 0x93, 0xdd, 0xff},
+ color.RGBA{0xdd, 0xdd, 0x00, 0xff},
+ color.RGBA{0xdd, 0xdd, 0x49, 0xff},
+ color.RGBA{0xdd, 0xdd, 0x93, 0xff},
+ color.RGBA{0xdd, 0xdd, 0xdd, 0xff},
+ color.RGBA{0xdd, 0x00, 0x00, 0xff},
+ color.RGBA{0xdd, 0x00, 0x49, 0xff},
+ color.RGBA{0xee, 0x00, 0x4f, 0xff},
+ color.RGBA{0xee, 0x00, 0x9e, 0xff},
+ color.RGBA{0xee, 0x00, 0xee, 0xff},
+ color.RGBA{0xee, 0x4f, 0x00, 0xff},
+ color.RGBA{0xee, 0x4f, 0x4f, 0xff},
+ color.RGBA{0xee, 0x4f, 0x9e, 0xff},
+ color.RGBA{0xee, 0x4f, 0xee, 0xff},
+ color.RGBA{0xee, 0x9e, 0x00, 0xff},
+ color.RGBA{0xee, 0x9e, 0x4f, 0xff},
+ color.RGBA{0xee, 0x9e, 0x9e, 0xff},
+ color.RGBA{0xee, 0x9e, 0xee, 0xff},
+ color.RGBA{0xee, 0xee, 0x00, 0xff},
+ color.RGBA{0xee, 0xee, 0x4f, 0xff},
+ color.RGBA{0xee, 0xee, 0x9e, 0xff},
+ color.RGBA{0xee, 0xee, 0xee, 0xff},
+ color.RGBA{0xee, 0x00, 0x00, 0xff},
+ color.RGBA{0xff, 0x00, 0x00, 0xff},
+ color.RGBA{0xff, 0x00, 0x55, 0xff},
+ color.RGBA{0xff, 0x00, 0xaa, 0xff},
+ color.RGBA{0xff, 0x00, 0xff, 0xff},
+ color.RGBA{0xff, 0x55, 0x00, 0xff},
+ color.RGBA{0xff, 0x55, 0x55, 0xff},
+ color.RGBA{0xff, 0x55, 0xaa, 0xff},
+ color.RGBA{0xff, 0x55, 0xff, 0xff},
+ color.RGBA{0xff, 0xaa, 0x00, 0xff},
+ color.RGBA{0xff, 0xaa, 0x55, 0xff},
+ color.RGBA{0xff, 0xaa, 0xaa, 0xff},
+ color.RGBA{0xff, 0xaa, 0xff, 0xff},
+ color.RGBA{0xff, 0xff, 0x00, 0xff},
+ color.RGBA{0xff, 0xff, 0x55, 0xff},
+ color.RGBA{0xff, 0xff, 0xaa, 0xff},
+ color.RGBA{0xff, 0xff, 0xff, 0xff},
+}</pre> <p>WebSafe is a 216-color palette that was popularized by early versions of Netscape Navigator. It is also known as the Netscape Color Cube. </p>
+<p>See <a href="https://en.wikipedia.org/wiki/Web_colors#Web-safe_colors">https://en.wikipedia.org/wiki/Web_colors#Web-safe_colors</a> for details. </p>
+<pre data-language="go">var WebSafe = []color.Color{
+ color.RGBA{0x00, 0x00, 0x00, 0xff},
+ color.RGBA{0x00, 0x00, 0x33, 0xff},
+ color.RGBA{0x00, 0x00, 0x66, 0xff},
+ color.RGBA{0x00, 0x00, 0x99, 0xff},
+ color.RGBA{0x00, 0x00, 0xcc, 0xff},
+ color.RGBA{0x00, 0x00, 0xff, 0xff},
+ color.RGBA{0x00, 0x33, 0x00, 0xff},
+ color.RGBA{0x00, 0x33, 0x33, 0xff},
+ color.RGBA{0x00, 0x33, 0x66, 0xff},
+ color.RGBA{0x00, 0x33, 0x99, 0xff},
+ color.RGBA{0x00, 0x33, 0xcc, 0xff},
+ color.RGBA{0x00, 0x33, 0xff, 0xff},
+ color.RGBA{0x00, 0x66, 0x00, 0xff},
+ color.RGBA{0x00, 0x66, 0x33, 0xff},
+ color.RGBA{0x00, 0x66, 0x66, 0xff},
+ color.RGBA{0x00, 0x66, 0x99, 0xff},
+ color.RGBA{0x00, 0x66, 0xcc, 0xff},
+ color.RGBA{0x00, 0x66, 0xff, 0xff},
+ color.RGBA{0x00, 0x99, 0x00, 0xff},
+ color.RGBA{0x00, 0x99, 0x33, 0xff},
+ color.RGBA{0x00, 0x99, 0x66, 0xff},
+ color.RGBA{0x00, 0x99, 0x99, 0xff},
+ color.RGBA{0x00, 0x99, 0xcc, 0xff},
+ color.RGBA{0x00, 0x99, 0xff, 0xff},
+ color.RGBA{0x00, 0xcc, 0x00, 0xff},
+ color.RGBA{0x00, 0xcc, 0x33, 0xff},
+ color.RGBA{0x00, 0xcc, 0x66, 0xff},
+ color.RGBA{0x00, 0xcc, 0x99, 0xff},
+ color.RGBA{0x00, 0xcc, 0xcc, 0xff},
+ color.RGBA{0x00, 0xcc, 0xff, 0xff},
+ color.RGBA{0x00, 0xff, 0x00, 0xff},
+ color.RGBA{0x00, 0xff, 0x33, 0xff},
+ color.RGBA{0x00, 0xff, 0x66, 0xff},
+ color.RGBA{0x00, 0xff, 0x99, 0xff},
+ color.RGBA{0x00, 0xff, 0xcc, 0xff},
+ color.RGBA{0x00, 0xff, 0xff, 0xff},
+ color.RGBA{0x33, 0x00, 0x00, 0xff},
+ color.RGBA{0x33, 0x00, 0x33, 0xff},
+ color.RGBA{0x33, 0x00, 0x66, 0xff},
+ color.RGBA{0x33, 0x00, 0x99, 0xff},
+ color.RGBA{0x33, 0x00, 0xcc, 0xff},
+ color.RGBA{0x33, 0x00, 0xff, 0xff},
+ color.RGBA{0x33, 0x33, 0x00, 0xff},
+ color.RGBA{0x33, 0x33, 0x33, 0xff},
+ color.RGBA{0x33, 0x33, 0x66, 0xff},
+ color.RGBA{0x33, 0x33, 0x99, 0xff},
+ color.RGBA{0x33, 0x33, 0xcc, 0xff},
+ color.RGBA{0x33, 0x33, 0xff, 0xff},
+ color.RGBA{0x33, 0x66, 0x00, 0xff},
+ color.RGBA{0x33, 0x66, 0x33, 0xff},
+ color.RGBA{0x33, 0x66, 0x66, 0xff},
+ color.RGBA{0x33, 0x66, 0x99, 0xff},
+ color.RGBA{0x33, 0x66, 0xcc, 0xff},
+ color.RGBA{0x33, 0x66, 0xff, 0xff},
+ color.RGBA{0x33, 0x99, 0x00, 0xff},
+ color.RGBA{0x33, 0x99, 0x33, 0xff},
+ color.RGBA{0x33, 0x99, 0x66, 0xff},
+ color.RGBA{0x33, 0x99, 0x99, 0xff},
+ color.RGBA{0x33, 0x99, 0xcc, 0xff},
+ color.RGBA{0x33, 0x99, 0xff, 0xff},
+ color.RGBA{0x33, 0xcc, 0x00, 0xff},
+ color.RGBA{0x33, 0xcc, 0x33, 0xff},
+ color.RGBA{0x33, 0xcc, 0x66, 0xff},
+ color.RGBA{0x33, 0xcc, 0x99, 0xff},
+ color.RGBA{0x33, 0xcc, 0xcc, 0xff},
+ color.RGBA{0x33, 0xcc, 0xff, 0xff},
+ color.RGBA{0x33, 0xff, 0x00, 0xff},
+ color.RGBA{0x33, 0xff, 0x33, 0xff},
+ color.RGBA{0x33, 0xff, 0x66, 0xff},
+ color.RGBA{0x33, 0xff, 0x99, 0xff},
+ color.RGBA{0x33, 0xff, 0xcc, 0xff},
+ color.RGBA{0x33, 0xff, 0xff, 0xff},
+ color.RGBA{0x66, 0x00, 0x00, 0xff},
+ color.RGBA{0x66, 0x00, 0x33, 0xff},
+ color.RGBA{0x66, 0x00, 0x66, 0xff},
+ color.RGBA{0x66, 0x00, 0x99, 0xff},
+ color.RGBA{0x66, 0x00, 0xcc, 0xff},
+ color.RGBA{0x66, 0x00, 0xff, 0xff},
+ color.RGBA{0x66, 0x33, 0x00, 0xff},
+ color.RGBA{0x66, 0x33, 0x33, 0xff},
+ color.RGBA{0x66, 0x33, 0x66, 0xff},
+ color.RGBA{0x66, 0x33, 0x99, 0xff},
+ color.RGBA{0x66, 0x33, 0xcc, 0xff},
+ color.RGBA{0x66, 0x33, 0xff, 0xff},
+ color.RGBA{0x66, 0x66, 0x00, 0xff},
+ color.RGBA{0x66, 0x66, 0x33, 0xff},
+ color.RGBA{0x66, 0x66, 0x66, 0xff},
+ color.RGBA{0x66, 0x66, 0x99, 0xff},
+ color.RGBA{0x66, 0x66, 0xcc, 0xff},
+ color.RGBA{0x66, 0x66, 0xff, 0xff},
+ color.RGBA{0x66, 0x99, 0x00, 0xff},
+ color.RGBA{0x66, 0x99, 0x33, 0xff},
+ color.RGBA{0x66, 0x99, 0x66, 0xff},
+ color.RGBA{0x66, 0x99, 0x99, 0xff},
+ color.RGBA{0x66, 0x99, 0xcc, 0xff},
+ color.RGBA{0x66, 0x99, 0xff, 0xff},
+ color.RGBA{0x66, 0xcc, 0x00, 0xff},
+ color.RGBA{0x66, 0xcc, 0x33, 0xff},
+ color.RGBA{0x66, 0xcc, 0x66, 0xff},
+ color.RGBA{0x66, 0xcc, 0x99, 0xff},
+ color.RGBA{0x66, 0xcc, 0xcc, 0xff},
+ color.RGBA{0x66, 0xcc, 0xff, 0xff},
+ color.RGBA{0x66, 0xff, 0x00, 0xff},
+ color.RGBA{0x66, 0xff, 0x33, 0xff},
+ color.RGBA{0x66, 0xff, 0x66, 0xff},
+ color.RGBA{0x66, 0xff, 0x99, 0xff},
+ color.RGBA{0x66, 0xff, 0xcc, 0xff},
+ color.RGBA{0x66, 0xff, 0xff, 0xff},
+ color.RGBA{0x99, 0x00, 0x00, 0xff},
+ color.RGBA{0x99, 0x00, 0x33, 0xff},
+ color.RGBA{0x99, 0x00, 0x66, 0xff},
+ color.RGBA{0x99, 0x00, 0x99, 0xff},
+ color.RGBA{0x99, 0x00, 0xcc, 0xff},
+ color.RGBA{0x99, 0x00, 0xff, 0xff},
+ color.RGBA{0x99, 0x33, 0x00, 0xff},
+ color.RGBA{0x99, 0x33, 0x33, 0xff},
+ color.RGBA{0x99, 0x33, 0x66, 0xff},
+ color.RGBA{0x99, 0x33, 0x99, 0xff},
+ color.RGBA{0x99, 0x33, 0xcc, 0xff},
+ color.RGBA{0x99, 0x33, 0xff, 0xff},
+ color.RGBA{0x99, 0x66, 0x00, 0xff},
+ color.RGBA{0x99, 0x66, 0x33, 0xff},
+ color.RGBA{0x99, 0x66, 0x66, 0xff},
+ color.RGBA{0x99, 0x66, 0x99, 0xff},
+ color.RGBA{0x99, 0x66, 0xcc, 0xff},
+ color.RGBA{0x99, 0x66, 0xff, 0xff},
+ color.RGBA{0x99, 0x99, 0x00, 0xff},
+ color.RGBA{0x99, 0x99, 0x33, 0xff},
+ color.RGBA{0x99, 0x99, 0x66, 0xff},
+ color.RGBA{0x99, 0x99, 0x99, 0xff},
+ color.RGBA{0x99, 0x99, 0xcc, 0xff},
+ color.RGBA{0x99, 0x99, 0xff, 0xff},
+ color.RGBA{0x99, 0xcc, 0x00, 0xff},
+ color.RGBA{0x99, 0xcc, 0x33, 0xff},
+ color.RGBA{0x99, 0xcc, 0x66, 0xff},
+ color.RGBA{0x99, 0xcc, 0x99, 0xff},
+ color.RGBA{0x99, 0xcc, 0xcc, 0xff},
+ color.RGBA{0x99, 0xcc, 0xff, 0xff},
+ color.RGBA{0x99, 0xff, 0x00, 0xff},
+ color.RGBA{0x99, 0xff, 0x33, 0xff},
+ color.RGBA{0x99, 0xff, 0x66, 0xff},
+ color.RGBA{0x99, 0xff, 0x99, 0xff},
+ color.RGBA{0x99, 0xff, 0xcc, 0xff},
+ color.RGBA{0x99, 0xff, 0xff, 0xff},
+ color.RGBA{0xcc, 0x00, 0x00, 0xff},
+ color.RGBA{0xcc, 0x00, 0x33, 0xff},
+ color.RGBA{0xcc, 0x00, 0x66, 0xff},
+ color.RGBA{0xcc, 0x00, 0x99, 0xff},
+ color.RGBA{0xcc, 0x00, 0xcc, 0xff},
+ color.RGBA{0xcc, 0x00, 0xff, 0xff},
+ color.RGBA{0xcc, 0x33, 0x00, 0xff},
+ color.RGBA{0xcc, 0x33, 0x33, 0xff},
+ color.RGBA{0xcc, 0x33, 0x66, 0xff},
+ color.RGBA{0xcc, 0x33, 0x99, 0xff},
+ color.RGBA{0xcc, 0x33, 0xcc, 0xff},
+ color.RGBA{0xcc, 0x33, 0xff, 0xff},
+ color.RGBA{0xcc, 0x66, 0x00, 0xff},
+ color.RGBA{0xcc, 0x66, 0x33, 0xff},
+ color.RGBA{0xcc, 0x66, 0x66, 0xff},
+ color.RGBA{0xcc, 0x66, 0x99, 0xff},
+ color.RGBA{0xcc, 0x66, 0xcc, 0xff},
+ color.RGBA{0xcc, 0x66, 0xff, 0xff},
+ color.RGBA{0xcc, 0x99, 0x00, 0xff},
+ color.RGBA{0xcc, 0x99, 0x33, 0xff},
+ color.RGBA{0xcc, 0x99, 0x66, 0xff},
+ color.RGBA{0xcc, 0x99, 0x99, 0xff},
+ color.RGBA{0xcc, 0x99, 0xcc, 0xff},
+ color.RGBA{0xcc, 0x99, 0xff, 0xff},
+ color.RGBA{0xcc, 0xcc, 0x00, 0xff},
+ color.RGBA{0xcc, 0xcc, 0x33, 0xff},
+ color.RGBA{0xcc, 0xcc, 0x66, 0xff},
+ color.RGBA{0xcc, 0xcc, 0x99, 0xff},
+ color.RGBA{0xcc, 0xcc, 0xcc, 0xff},
+ color.RGBA{0xcc, 0xcc, 0xff, 0xff},
+ color.RGBA{0xcc, 0xff, 0x00, 0xff},
+ color.RGBA{0xcc, 0xff, 0x33, 0xff},
+ color.RGBA{0xcc, 0xff, 0x66, 0xff},
+ color.RGBA{0xcc, 0xff, 0x99, 0xff},
+ color.RGBA{0xcc, 0xff, 0xcc, 0xff},
+ color.RGBA{0xcc, 0xff, 0xff, 0xff},
+ color.RGBA{0xff, 0x00, 0x00, 0xff},
+ color.RGBA{0xff, 0x00, 0x33, 0xff},
+ color.RGBA{0xff, 0x00, 0x66, 0xff},
+ color.RGBA{0xff, 0x00, 0x99, 0xff},
+ color.RGBA{0xff, 0x00, 0xcc, 0xff},
+ color.RGBA{0xff, 0x00, 0xff, 0xff},
+ color.RGBA{0xff, 0x33, 0x00, 0xff},
+ color.RGBA{0xff, 0x33, 0x33, 0xff},
+ color.RGBA{0xff, 0x33, 0x66, 0xff},
+ color.RGBA{0xff, 0x33, 0x99, 0xff},
+ color.RGBA{0xff, 0x33, 0xcc, 0xff},
+ color.RGBA{0xff, 0x33, 0xff, 0xff},
+ color.RGBA{0xff, 0x66, 0x00, 0xff},
+ color.RGBA{0xff, 0x66, 0x33, 0xff},
+ color.RGBA{0xff, 0x66, 0x66, 0xff},
+ color.RGBA{0xff, 0x66, 0x99, 0xff},
+ color.RGBA{0xff, 0x66, 0xcc, 0xff},
+ color.RGBA{0xff, 0x66, 0xff, 0xff},
+ color.RGBA{0xff, 0x99, 0x00, 0xff},
+ color.RGBA{0xff, 0x99, 0x33, 0xff},
+ color.RGBA{0xff, 0x99, 0x66, 0xff},
+ color.RGBA{0xff, 0x99, 0x99, 0xff},
+ color.RGBA{0xff, 0x99, 0xcc, 0xff},
+ color.RGBA{0xff, 0x99, 0xff, 0xff},
+ color.RGBA{0xff, 0xcc, 0x00, 0xff},
+ color.RGBA{0xff, 0xcc, 0x33, 0xff},
+ color.RGBA{0xff, 0xcc, 0x66, 0xff},
+ color.RGBA{0xff, 0xcc, 0x99, 0xff},
+ color.RGBA{0xff, 0xcc, 0xcc, 0xff},
+ color.RGBA{0xff, 0xcc, 0xff, 0xff},
+ color.RGBA{0xff, 0xff, 0x00, 0xff},
+ color.RGBA{0xff, 0xff, 0x33, 0xff},
+ color.RGBA{0xff, 0xff, 0x66, 0xff},
+ color.RGBA{0xff, 0xff, 0x99, 0xff},
+ color.RGBA{0xff, 0xff, 0xcc, 0xff},
+ color.RGBA{0xff, 0xff, 0xff, 0xff},
+}</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/image/color/palette/" class="_attribution-link">http://golang.org/pkg/image/color/palette/</a>
+ </p>
+</div>
diff --git a/devdocs/go/image%2Fdraw%2Findex.html b/devdocs/go/image%2Fdraw%2Findex.html
new file mode 100644
index 00000000..b44b2f3c
--- /dev/null
+++ b/devdocs/go/image%2Fdraw%2Findex.html
@@ -0,0 +1,85 @@
+<h1> Package draw </h1> <ul id="short-nav">
+<li><code>import "image/draw"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package draw provides image composition functions. </p>
+<p>See "The Go image/draw package" for an introduction to this package: <a href="https://golang.org/doc/articles/image_draw.html">https://golang.org/doc/articles/image_draw.html</a> </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Draw">func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)</a></li>
+<li><a href="#DrawMask">func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op)</a></li>
+<li><a href="#Drawer">type Drawer</a></li>
+<li><a href="#Image">type Image</a></li>
+<li><a href="#Op">type Op</a></li>
+<li> <a href="#Op.Draw">func (op Op) Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point)</a>
+</li>
+<li><a href="#Quantizer">type Quantizer</a></li>
+<li><a href="#RGBA64Image">type RGBA64Image</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Drawer_floydSteinberg">Drawer (FloydSteinberg)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>draw.go</span> </p> <h2 id="Draw">func <span>Draw</span> </h2> <pre data-language="go">func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)</pre> <p>Draw calls <a href="#DrawMask">DrawMask</a> with a nil mask. </p>
+<h2 id="DrawMask">func <span>DrawMask</span> </h2> <pre data-language="go">func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op)</pre> <p>DrawMask aligns r.Min in dst with sp in src and mp in mask and then replaces the rectangle r in dst with the result of a Porter-Duff composition. A nil mask is treated as opaque. </p>
+<h2 id="Drawer">type <span>Drawer</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>Drawer contains the <a href="#Draw">Draw</a> method. </p>
+<pre data-language="go">type Drawer interface {
+ // Draw aligns r.Min in dst with sp in src and then replaces the
+ // rectangle r in dst with the result of drawing src on dst.
+ Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point)
+}</pre> <p>FloydSteinberg is a <a href="#Drawer">Drawer</a> that is the <a href="#Src">Src</a> <a href="#Op">Op</a> with Floyd-Steinberg error diffusion. </p>
+<pre data-language="go">var FloydSteinberg Drawer = floydSteinberg{}</pre> <h4 id="example_Drawer_floydSteinberg"> <span class="text">Example (FloydSteinberg)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+const width = 130
+const height = 50
+
+im := image.NewGray(image.Rectangle{Max: image.Point{X: width, Y: height}})
+for x := 0; x &lt; width; x++ {
+ for y := 0; y &lt; height; y++ {
+ dist := math.Sqrt(math.Pow(float64(x-width/2), 2)/3+math.Pow(float64(y-height/2), 2)) / (height / 1.5) * 255
+ var gray uint8
+ if dist &gt; 255 {
+ gray = 255
+ } else {
+ gray = uint8(dist)
+ }
+ im.SetGray(x, y, color.Gray{Y: 255 - gray})
+ }
+}
+pi := image.NewPaletted(im.Bounds(), []color.Color{
+ color.Gray{Y: 255},
+ color.Gray{Y: 160},
+ color.Gray{Y: 70},
+ color.Gray{Y: 35},
+ color.Gray{Y: 0},
+})
+
+draw.FloydSteinberg.Draw(pi, im.Bounds(), im, image.Point{})
+shade := []string{" ", "░", "▒", "▓", "█"}
+for i, p := range pi.Pix {
+ fmt.Print(shade[p])
+ if (i+1)%width == 0 {
+ fmt.Print("\n")
+ }
+}
+</pre> <h2 id="Image">type <span>Image</span> </h2> <p>Image is an image.Image with a Set method to change a single pixel. </p>
+<pre data-language="go">type Image interface {
+ image.Image
+ Set(x, y int, c color.Color)
+}</pre> <h2 id="Op">type <span>Op</span> </h2> <p>Op is a Porter-Duff compositing operator. </p>
+<pre data-language="go">type Op int</pre> <pre data-language="go">const (
+ // Over specifies ``(src in mask) over dst''.
+ Over Op = iota
+ // Src specifies ``src in mask''.
+ Src
+)</pre> <h3 id="Op.Draw">func (Op) <span>Draw</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (op Op) Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point)</pre> <p>Draw implements the <a href="#Drawer">Drawer</a> interface by calling the Draw function with this <a href="#Op">Op</a>. </p>
+<h2 id="Quantizer">type <span>Quantizer</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>Quantizer produces a palette for an image. </p>
+<pre data-language="go">type Quantizer interface {
+ // Quantize appends up to cap(p) - len(p) colors to p and returns the
+ // updated palette suitable for converting m to a paletted image.
+ Quantize(p color.Palette, m image.Image) color.Palette
+}</pre> <h2 id="RGBA64Image">type <span>RGBA64Image</span> <span title="Added in Go 1.17">1.17</span> </h2> <p>RGBA64Image extends both the <a href="#Image">Image</a> and <span>image.RGBA64Image</span> interfaces with a SetRGBA64 method to change a single pixel. SetRGBA64 is equivalent to calling Set, but it can avoid allocations from converting concrete color types to the <span>color.Color</span> interface type. </p>
+<pre data-language="go">type RGBA64Image interface {
+ image.RGBA64Image
+ Set(x, y int, c color.Color)
+ SetRGBA64(x, y int, c color.RGBA64)
+}</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/image/draw/" class="_attribution-link">http://golang.org/pkg/image/draw/</a>
+ </p>
+</div>
diff --git a/devdocs/go/image%2Fgif%2Findex.html b/devdocs/go/image%2Fgif%2Findex.html
new file mode 100644
index 00000000..e695fb18
--- /dev/null
+++ b/devdocs/go/image%2Fgif%2Findex.html
@@ -0,0 +1,74 @@
+<h1> Package gif </h1> <ul id="short-nav">
+<li><code>import "image/gif"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package gif implements a GIF image decoder and encoder. </p>
+<p>The GIF specification is at <a href="https://www.w3.org/Graphics/GIF/spec-gif89a.txt">https://www.w3.org/Graphics/GIF/spec-gif89a.txt</a>. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Decode">func Decode(r io.Reader) (image.Image, error)</a></li>
+<li><a href="#DecodeConfig">func DecodeConfig(r io.Reader) (image.Config, error)</a></li>
+<li><a href="#Encode">func Encode(w io.Writer, m image.Image, o *Options) error</a></li>
+<li><a href="#EncodeAll">func EncodeAll(w io.Writer, g *GIF) error</a></li>
+<li><a href="#GIF">type GIF</a></li>
+<li> <a href="#DecodeAll">func DecodeAll(r io.Reader) (*GIF, error)</a>
+</li>
+<li><a href="#Options">type Options</a></li>
+</ul> <h3>Package files</h3> <p> <span>reader.go</span> <span>writer.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Disposal Methods. </p>
+<pre data-language="go">const (
+ DisposalNone = 0x01
+ DisposalBackground = 0x02
+ DisposalPrevious = 0x03
+)</pre> <h2 id="Decode">func <span>Decode</span> </h2> <pre data-language="go">func Decode(r io.Reader) (image.Image, error)</pre> <p>Decode reads a GIF image from r and returns the first embedded image as an <span>image.Image</span>. </p>
+<h2 id="DecodeConfig">func <span>DecodeConfig</span> </h2> <pre data-language="go">func DecodeConfig(r io.Reader) (image.Config, error)</pre> <p>DecodeConfig returns the global color model and dimensions of a GIF image without decoding the entire image. </p>
+<h2 id="Encode">func <span>Encode</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Encode(w io.Writer, m image.Image, o *Options) error</pre> <p>Encode writes the Image m to w in GIF format. </p>
+<h2 id="EncodeAll">func <span>EncodeAll</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func EncodeAll(w io.Writer, g *GIF) error</pre> <p>EncodeAll writes the images in g to w in GIF format with the given loop count and delay between frames. </p>
+<h2 id="GIF">type <span>GIF</span> </h2> <p>GIF represents the possibly multiple images stored in a GIF file. </p>
+<pre data-language="go">type GIF struct {
+ Image []*image.Paletted // The successive images.
+ Delay []int // The successive delay times, one per frame, in 100ths of a second.
+ // LoopCount controls the number of times an animation will be
+ // restarted during display.
+ // A LoopCount of 0 means to loop forever.
+ // A LoopCount of -1 means to show each frame only once.
+ // Otherwise, the animation is looped LoopCount+1 times.
+ LoopCount int
+ // Disposal is the successive disposal methods, one per frame. For
+ // backwards compatibility, a nil Disposal is valid to pass to EncodeAll,
+ // and implies that each frame's disposal method is 0 (no disposal
+ // specified).
+ Disposal []byte // Go 1.5
+ // Config is the global color table (palette), width and height. A nil or
+ // empty-color.Palette Config.ColorModel means that each frame has its own
+ // color table and there is no global color table. Each frame's bounds must
+ // be within the rectangle defined by the two points (0, 0) and
+ // (Config.Width, Config.Height).
+ //
+ // For backwards compatibility, a zero-valued Config is valid to pass to
+ // EncodeAll, and implies that the overall GIF's width and height equals
+ // the first frame's bounds' Rectangle.Max point.
+ Config image.Config // Go 1.5
+ // BackgroundIndex is the background index in the global color table, for
+ // use with the DisposalBackground disposal method.
+ BackgroundIndex byte // Go 1.5
+}
+</pre> <h3 id="DecodeAll">func <span>DecodeAll</span> </h3> <pre data-language="go">func DecodeAll(r io.Reader) (*GIF, error)</pre> <p>DecodeAll reads a GIF image from r and returns the sequential frames and timing information. </p>
+<h2 id="Options">type <span>Options</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>Options are the encoding parameters. </p>
+<pre data-language="go">type Options struct {
+ // NumColors is the maximum number of colors used in the image.
+ // It ranges from 1 to 256.
+ NumColors int
+
+ // Quantizer is used to produce a palette with size NumColors.
+ // palette.Plan9 is used in place of a nil Quantizer.
+ Quantizer draw.Quantizer
+
+ // Drawer is used to convert the source image to the desired palette.
+ // draw.FloydSteinberg is used in place of a nil Drawer.
+ Drawer draw.Drawer
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/image/gif/" class="_attribution-link">http://golang.org/pkg/image/gif/</a>
+ </p>
+</div>
diff --git a/devdocs/go/image%2Findex.html b/devdocs/go/image%2Findex.html
new file mode 100644
index 00000000..d3c4b716
--- /dev/null
+++ b/devdocs/go/image%2Findex.html
@@ -0,0 +1,721 @@
+<h1> Package image </h1> <ul id="short-nav">
+<li><code>import "image"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package image implements a basic 2-D image library. </p>
+<p>The fundamental interface is called <a href="#Image">Image</a>. An <a href="#Image">Image</a> contains colors, which are described in the image/color package. </p>
+<p>Values of the <a href="#Image">Image</a> interface are created either by calling functions such as <a href="#NewRGBA">NewRGBA</a> and <a href="#NewPaletted">NewPaletted</a>, or by calling <a href="#Decode">Decode</a> on an <span>io.Reader</span> containing image data in a format such as GIF, JPEG or PNG. Decoding any particular image format requires the prior registration of a decoder function. Registration is typically automatic as a side effect of initializing that format's package so that, to decode a PNG image, it suffices to have </p>
+<pre data-language="go">import _ "image/png"
+</pre> <p>in a program's main package. The _ means to import a package purely for its initialization side effects. </p>
+<p>See "The Go image package" for more details: <a href="https://golang.org/doc/articles/image_package.html">https://golang.org/doc/articles/image_package.html</a> </p>
+<h3 id="hdr-Security_Considerations">Security Considerations</h3> <p>The image package can be used to parse arbitrarily large images, which can cause resource exhaustion on machines which do not have enough memory to store them. When operating on arbitrary images, <a href="#DecodeConfig">DecodeConfig</a> should be called before <a href="#Decode">Decode</a>, so that the program can decide whether the image, as defined in the returned header, can be safely decoded with the available resources. A call to <a href="#Decode">Decode</a> which produces an extremely large image, as defined in the header returned by <a href="#DecodeConfig">DecodeConfig</a>, is not considered a security issue, regardless of whether the image is itself malformed or not. A call to <a href="#DecodeConfig">DecodeConfig</a> which returns a header which does not match the image returned by <a href="#Decode">Decode</a> may be considered a security issue, and should be reported per the [Go Security Policy](<a href="https://go.dev/security/policy">https://go.dev/security/policy</a>). </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Decode the JPEG data. If reading from file, create a reader with
+//
+// reader, err := os.Open("testdata/video-001.q50.420.jpeg")
+// if err != nil {
+// log.Fatal(err)
+// }
+// defer reader.Close()
+reader := base64.NewDecoder(base64.StdEncoding, strings.NewReader(data))
+m, _, err := image.Decode(reader)
+if err != nil {
+ log.Fatal(err)
+}
+bounds := m.Bounds()
+
+// Calculate a 16-bin histogram for m's red, green, blue and alpha components.
+//
+// An image's bounds do not necessarily start at (0, 0), so the two loops start
+// at bounds.Min.Y and bounds.Min.X. Looping over Y first and X second is more
+// likely to result in better memory access patterns than X first and Y second.
+var histogram [16][4]int
+for y := bounds.Min.Y; y &lt; bounds.Max.Y; y++ {
+ for x := bounds.Min.X; x &lt; bounds.Max.X; x++ {
+ r, g, b, a := m.At(x, y).RGBA()
+ // A color's RGBA method returns values in the range [0, 65535].
+ // Shifting by 12 reduces this to the range [0, 15].
+ histogram[r&gt;&gt;12][0]++
+ histogram[g&gt;&gt;12][1]++
+ histogram[b&gt;&gt;12][2]++
+ histogram[a&gt;&gt;12][3]++
+ }
+}
+
+// Print the results.
+fmt.Printf("%-14s %6s %6s %6s %6s\n", "bin", "red", "green", "blue", "alpha")
+for i, x := range histogram {
+ fmt.Printf("0x%04x-0x%04x: %6d %6d %6d %6d\n", i&lt;&lt;12, (i+1)&lt;&lt;12-1, x[0], x[1], x[2], x[3])
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">bin red green blue alpha
+0x0000-0x0fff: 364 790 7242 0
+0x1000-0x1fff: 645 2967 1039 0
+0x2000-0x2fff: 1072 2299 979 0
+0x3000-0x3fff: 820 2266 980 0
+0x4000-0x4fff: 537 1305 541 0
+0x5000-0x5fff: 319 962 261 0
+0x6000-0x6fff: 322 375 177 0
+0x7000-0x7fff: 601 279 214 0
+0x8000-0x8fff: 3478 227 273 0
+0x9000-0x9fff: 2260 234 329 0
+0xa000-0xafff: 921 282 373 0
+0xb000-0xbfff: 321 335 397 0
+0xc000-0xcfff: 229 388 298 0
+0xd000-0xdfff: 260 414 277 0
+0xe000-0xefff: 516 428 298 0
+0xf000-0xffff: 2785 1899 1772 15450
+</pre> <h4 id="example__decodeConfig"> <span class="text">Example (DecodeConfig)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+reader := base64.NewDecoder(base64.StdEncoding, strings.NewReader(data))
+config, format, err := image.DecodeConfig(reader)
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println("Width:", config.Width, "Height:", config.Height, "Format:", format)
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#RegisterFormat">func RegisterFormat(name, magic string, decode func(io.Reader) (Image, error), decodeConfig func(io.Reader) (Config, error))</a></li>
+<li><a href="#Alpha">type Alpha</a></li>
+<li> <a href="#NewAlpha">func NewAlpha(r Rectangle) *Alpha</a>
+</li>
+<li> <a href="#Alpha.AlphaAt">func (p *Alpha) AlphaAt(x, y int) color.Alpha</a>
+</li>
+<li> <a href="#Alpha.At">func (p *Alpha) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#Alpha.Bounds">func (p *Alpha) Bounds() Rectangle</a>
+</li>
+<li> <a href="#Alpha.ColorModel">func (p *Alpha) ColorModel() color.Model</a>
+</li>
+<li> <a href="#Alpha.Opaque">func (p *Alpha) Opaque() bool</a>
+</li>
+<li> <a href="#Alpha.PixOffset">func (p *Alpha) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#Alpha.RGBA64At">func (p *Alpha) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#Alpha.Set">func (p *Alpha) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#Alpha.SetAlpha">func (p *Alpha) SetAlpha(x, y int, c color.Alpha)</a>
+</li>
+<li> <a href="#Alpha.SetRGBA64">func (p *Alpha) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#Alpha.SubImage">func (p *Alpha) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#Alpha16">type Alpha16</a></li>
+<li> <a href="#NewAlpha16">func NewAlpha16(r Rectangle) *Alpha16</a>
+</li>
+<li> <a href="#Alpha16.Alpha16At">func (p *Alpha16) Alpha16At(x, y int) color.Alpha16</a>
+</li>
+<li> <a href="#Alpha16.At">func (p *Alpha16) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#Alpha16.Bounds">func (p *Alpha16) Bounds() Rectangle</a>
+</li>
+<li> <a href="#Alpha16.ColorModel">func (p *Alpha16) ColorModel() color.Model</a>
+</li>
+<li> <a href="#Alpha16.Opaque">func (p *Alpha16) Opaque() bool</a>
+</li>
+<li> <a href="#Alpha16.PixOffset">func (p *Alpha16) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#Alpha16.RGBA64At">func (p *Alpha16) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#Alpha16.Set">func (p *Alpha16) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#Alpha16.SetAlpha16">func (p *Alpha16) SetAlpha16(x, y int, c color.Alpha16)</a>
+</li>
+<li> <a href="#Alpha16.SetRGBA64">func (p *Alpha16) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#Alpha16.SubImage">func (p *Alpha16) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#CMYK">type CMYK</a></li>
+<li> <a href="#NewCMYK">func NewCMYK(r Rectangle) *CMYK</a>
+</li>
+<li> <a href="#CMYK.At">func (p *CMYK) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#CMYK.Bounds">func (p *CMYK) Bounds() Rectangle</a>
+</li>
+<li> <a href="#CMYK.CMYKAt">func (p *CMYK) CMYKAt(x, y int) color.CMYK</a>
+</li>
+<li> <a href="#CMYK.ColorModel">func (p *CMYK) ColorModel() color.Model</a>
+</li>
+<li> <a href="#CMYK.Opaque">func (p *CMYK) Opaque() bool</a>
+</li>
+<li> <a href="#CMYK.PixOffset">func (p *CMYK) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#CMYK.RGBA64At">func (p *CMYK) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#CMYK.Set">func (p *CMYK) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#CMYK.SetCMYK">func (p *CMYK) SetCMYK(x, y int, c color.CMYK)</a>
+</li>
+<li> <a href="#CMYK.SetRGBA64">func (p *CMYK) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#CMYK.SubImage">func (p *CMYK) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#Config">type Config</a></li>
+<li> <a href="#DecodeConfig">func DecodeConfig(r io.Reader) (Config, string, error)</a>
+</li>
+<li><a href="#Gray">type Gray</a></li>
+<li> <a href="#NewGray">func NewGray(r Rectangle) *Gray</a>
+</li>
+<li> <a href="#Gray.At">func (p *Gray) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#Gray.Bounds">func (p *Gray) Bounds() Rectangle</a>
+</li>
+<li> <a href="#Gray.ColorModel">func (p *Gray) ColorModel() color.Model</a>
+</li>
+<li> <a href="#Gray.GrayAt">func (p *Gray) GrayAt(x, y int) color.Gray</a>
+</li>
+<li> <a href="#Gray.Opaque">func (p *Gray) Opaque() bool</a>
+</li>
+<li> <a href="#Gray.PixOffset">func (p *Gray) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#Gray.RGBA64At">func (p *Gray) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#Gray.Set">func (p *Gray) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#Gray.SetGray">func (p *Gray) SetGray(x, y int, c color.Gray)</a>
+</li>
+<li> <a href="#Gray.SetRGBA64">func (p *Gray) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#Gray.SubImage">func (p *Gray) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#Gray16">type Gray16</a></li>
+<li> <a href="#NewGray16">func NewGray16(r Rectangle) *Gray16</a>
+</li>
+<li> <a href="#Gray16.At">func (p *Gray16) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#Gray16.Bounds">func (p *Gray16) Bounds() Rectangle</a>
+</li>
+<li> <a href="#Gray16.ColorModel">func (p *Gray16) ColorModel() color.Model</a>
+</li>
+<li> <a href="#Gray16.Gray16At">func (p *Gray16) Gray16At(x, y int) color.Gray16</a>
+</li>
+<li> <a href="#Gray16.Opaque">func (p *Gray16) Opaque() bool</a>
+</li>
+<li> <a href="#Gray16.PixOffset">func (p *Gray16) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#Gray16.RGBA64At">func (p *Gray16) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#Gray16.Set">func (p *Gray16) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#Gray16.SetGray16">func (p *Gray16) SetGray16(x, y int, c color.Gray16)</a>
+</li>
+<li> <a href="#Gray16.SetRGBA64">func (p *Gray16) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#Gray16.SubImage">func (p *Gray16) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#Image">type Image</a></li>
+<li> <a href="#Decode">func Decode(r io.Reader) (Image, string, error)</a>
+</li>
+<li><a href="#NRGBA">type NRGBA</a></li>
+<li> <a href="#NewNRGBA">func NewNRGBA(r Rectangle) *NRGBA</a>
+</li>
+<li> <a href="#NRGBA.At">func (p *NRGBA) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#NRGBA.Bounds">func (p *NRGBA) Bounds() Rectangle</a>
+</li>
+<li> <a href="#NRGBA.ColorModel">func (p *NRGBA) ColorModel() color.Model</a>
+</li>
+<li> <a href="#NRGBA.NRGBAAt">func (p *NRGBA) NRGBAAt(x, y int) color.NRGBA</a>
+</li>
+<li> <a href="#NRGBA.Opaque">func (p *NRGBA) Opaque() bool</a>
+</li>
+<li> <a href="#NRGBA.PixOffset">func (p *NRGBA) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#NRGBA.RGBA64At">func (p *NRGBA) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#NRGBA.Set">func (p *NRGBA) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#NRGBA.SetNRGBA">func (p *NRGBA) SetNRGBA(x, y int, c color.NRGBA)</a>
+</li>
+<li> <a href="#NRGBA.SetRGBA64">func (p *NRGBA) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#NRGBA.SubImage">func (p *NRGBA) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#NRGBA64">type NRGBA64</a></li>
+<li> <a href="#NewNRGBA64">func NewNRGBA64(r Rectangle) *NRGBA64</a>
+</li>
+<li> <a href="#NRGBA64.At">func (p *NRGBA64) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#NRGBA64.Bounds">func (p *NRGBA64) Bounds() Rectangle</a>
+</li>
+<li> <a href="#NRGBA64.ColorModel">func (p *NRGBA64) ColorModel() color.Model</a>
+</li>
+<li> <a href="#NRGBA64.NRGBA64At">func (p *NRGBA64) NRGBA64At(x, y int) color.NRGBA64</a>
+</li>
+<li> <a href="#NRGBA64.Opaque">func (p *NRGBA64) Opaque() bool</a>
+</li>
+<li> <a href="#NRGBA64.PixOffset">func (p *NRGBA64) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#NRGBA64.RGBA64At">func (p *NRGBA64) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#NRGBA64.Set">func (p *NRGBA64) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#NRGBA64.SetNRGBA64">func (p *NRGBA64) SetNRGBA64(x, y int, c color.NRGBA64)</a>
+</li>
+<li> <a href="#NRGBA64.SetRGBA64">func (p *NRGBA64) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#NRGBA64.SubImage">func (p *NRGBA64) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#NYCbCrA">type NYCbCrA</a></li>
+<li> <a href="#NewNYCbCrA">func NewNYCbCrA(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA</a>
+</li>
+<li> <a href="#NYCbCrA.AOffset">func (p *NYCbCrA) AOffset(x, y int) int</a>
+</li>
+<li> <a href="#NYCbCrA.At">func (p *NYCbCrA) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#NYCbCrA.ColorModel">func (p *NYCbCrA) ColorModel() color.Model</a>
+</li>
+<li> <a href="#NYCbCrA.NYCbCrAAt">func (p *NYCbCrA) NYCbCrAAt(x, y int) color.NYCbCrA</a>
+</li>
+<li> <a href="#NYCbCrA.Opaque">func (p *NYCbCrA) Opaque() bool</a>
+</li>
+<li> <a href="#NYCbCrA.RGBA64At">func (p *NYCbCrA) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#NYCbCrA.SubImage">func (p *NYCbCrA) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#Paletted">type Paletted</a></li>
+<li> <a href="#NewPaletted">func NewPaletted(r Rectangle, p color.Palette) *Paletted</a>
+</li>
+<li> <a href="#Paletted.At">func (p *Paletted) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#Paletted.Bounds">func (p *Paletted) Bounds() Rectangle</a>
+</li>
+<li> <a href="#Paletted.ColorIndexAt">func (p *Paletted) ColorIndexAt(x, y int) uint8</a>
+</li>
+<li> <a href="#Paletted.ColorModel">func (p *Paletted) ColorModel() color.Model</a>
+</li>
+<li> <a href="#Paletted.Opaque">func (p *Paletted) Opaque() bool</a>
+</li>
+<li> <a href="#Paletted.PixOffset">func (p *Paletted) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#Paletted.RGBA64At">func (p *Paletted) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#Paletted.Set">func (p *Paletted) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#Paletted.SetColorIndex">func (p *Paletted) SetColorIndex(x, y int, index uint8)</a>
+</li>
+<li> <a href="#Paletted.SetRGBA64">func (p *Paletted) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#Paletted.SubImage">func (p *Paletted) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#PalettedImage">type PalettedImage</a></li>
+<li><a href="#Point">type Point</a></li>
+<li> <a href="#Pt">func Pt(X, Y int) Point</a>
+</li>
+<li> <a href="#Point.Add">func (p Point) Add(q Point) Point</a>
+</li>
+<li> <a href="#Point.Div">func (p Point) Div(k int) Point</a>
+</li>
+<li> <a href="#Point.Eq">func (p Point) Eq(q Point) bool</a>
+</li>
+<li> <a href="#Point.In">func (p Point) In(r Rectangle) bool</a>
+</li>
+<li> <a href="#Point.Mod">func (p Point) Mod(r Rectangle) Point</a>
+</li>
+<li> <a href="#Point.Mul">func (p Point) Mul(k int) Point</a>
+</li>
+<li> <a href="#Point.String">func (p Point) String() string</a>
+</li>
+<li> <a href="#Point.Sub">func (p Point) Sub(q Point) Point</a>
+</li>
+<li><a href="#RGBA">type RGBA</a></li>
+<li> <a href="#NewRGBA">func NewRGBA(r Rectangle) *RGBA</a>
+</li>
+<li> <a href="#RGBA.At">func (p *RGBA) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#RGBA.Bounds">func (p *RGBA) Bounds() Rectangle</a>
+</li>
+<li> <a href="#RGBA.ColorModel">func (p *RGBA) ColorModel() color.Model</a>
+</li>
+<li> <a href="#RGBA.Opaque">func (p *RGBA) Opaque() bool</a>
+</li>
+<li> <a href="#RGBA.PixOffset">func (p *RGBA) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#RGBA.RGBA64At">func (p *RGBA) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#RGBA.RGBAAt">func (p *RGBA) RGBAAt(x, y int) color.RGBA</a>
+</li>
+<li> <a href="#RGBA.Set">func (p *RGBA) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#RGBA.SetRGBA">func (p *RGBA) SetRGBA(x, y int, c color.RGBA)</a>
+</li>
+<li> <a href="#RGBA.SetRGBA64">func (p *RGBA) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#RGBA.SubImage">func (p *RGBA) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#RGBA64">type RGBA64</a></li>
+<li> <a href="#NewRGBA64">func NewRGBA64(r Rectangle) *RGBA64</a>
+</li>
+<li> <a href="#RGBA64.At">func (p *RGBA64) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#RGBA64.Bounds">func (p *RGBA64) Bounds() Rectangle</a>
+</li>
+<li> <a href="#RGBA64.ColorModel">func (p *RGBA64) ColorModel() color.Model</a>
+</li>
+<li> <a href="#RGBA64.Opaque">func (p *RGBA64) Opaque() bool</a>
+</li>
+<li> <a href="#RGBA64.PixOffset">func (p *RGBA64) PixOffset(x, y int) int</a>
+</li>
+<li> <a href="#RGBA64.RGBA64At">func (p *RGBA64) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#RGBA64.Set">func (p *RGBA64) Set(x, y int, c color.Color)</a>
+</li>
+<li> <a href="#RGBA64.SetRGBA64">func (p *RGBA64) SetRGBA64(x, y int, c color.RGBA64)</a>
+</li>
+<li> <a href="#RGBA64.SubImage">func (p *RGBA64) SubImage(r Rectangle) Image</a>
+</li>
+<li><a href="#RGBA64Image">type RGBA64Image</a></li>
+<li><a href="#Rectangle">type Rectangle</a></li>
+<li> <a href="#Rect">func Rect(x0, y0, x1, y1 int) Rectangle</a>
+</li>
+<li> <a href="#Rectangle.Add">func (r Rectangle) Add(p Point) Rectangle</a>
+</li>
+<li> <a href="#Rectangle.At">func (r Rectangle) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#Rectangle.Bounds">func (r Rectangle) Bounds() Rectangle</a>
+</li>
+<li> <a href="#Rectangle.Canon">func (r Rectangle) Canon() Rectangle</a>
+</li>
+<li> <a href="#Rectangle.ColorModel">func (r Rectangle) ColorModel() color.Model</a>
+</li>
+<li> <a href="#Rectangle.Dx">func (r Rectangle) Dx() int</a>
+</li>
+<li> <a href="#Rectangle.Dy">func (r Rectangle) Dy() int</a>
+</li>
+<li> <a href="#Rectangle.Empty">func (r Rectangle) Empty() bool</a>
+</li>
+<li> <a href="#Rectangle.Eq">func (r Rectangle) Eq(s Rectangle) bool</a>
+</li>
+<li> <a href="#Rectangle.In">func (r Rectangle) In(s Rectangle) bool</a>
+</li>
+<li> <a href="#Rectangle.Inset">func (r Rectangle) Inset(n int) Rectangle</a>
+</li>
+<li> <a href="#Rectangle.Intersect">func (r Rectangle) Intersect(s Rectangle) Rectangle</a>
+</li>
+<li> <a href="#Rectangle.Overlaps">func (r Rectangle) Overlaps(s Rectangle) bool</a>
+</li>
+<li> <a href="#Rectangle.RGBA64At">func (r Rectangle) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#Rectangle.Size">func (r Rectangle) Size() Point</a>
+</li>
+<li> <a href="#Rectangle.String">func (r Rectangle) String() string</a>
+</li>
+<li> <a href="#Rectangle.Sub">func (r Rectangle) Sub(p Point) Rectangle</a>
+</li>
+<li> <a href="#Rectangle.Union">func (r Rectangle) Union(s Rectangle) Rectangle</a>
+</li>
+<li><a href="#Uniform">type Uniform</a></li>
+<li> <a href="#NewUniform">func NewUniform(c color.Color) *Uniform</a>
+</li>
+<li> <a href="#Uniform.At">func (c *Uniform) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#Uniform.Bounds">func (c *Uniform) Bounds() Rectangle</a>
+</li>
+<li> <a href="#Uniform.ColorModel">func (c *Uniform) ColorModel() color.Model</a>
+</li>
+<li> <a href="#Uniform.Convert">func (c *Uniform) Convert(color.Color) color.Color</a>
+</li>
+<li> <a href="#Uniform.Opaque">func (c *Uniform) Opaque() bool</a>
+</li>
+<li> <a href="#Uniform.RGBA">func (c *Uniform) RGBA() (r, g, b, a uint32)</a>
+</li>
+<li> <a href="#Uniform.RGBA64At">func (c *Uniform) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li><a href="#YCbCr">type YCbCr</a></li>
+<li> <a href="#NewYCbCr">func NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr</a>
+</li>
+<li> <a href="#YCbCr.At">func (p *YCbCr) At(x, y int) color.Color</a>
+</li>
+<li> <a href="#YCbCr.Bounds">func (p *YCbCr) Bounds() Rectangle</a>
+</li>
+<li> <a href="#YCbCr.COffset">func (p *YCbCr) COffset(x, y int) int</a>
+</li>
+<li> <a href="#YCbCr.ColorModel">func (p *YCbCr) ColorModel() color.Model</a>
+</li>
+<li> <a href="#YCbCr.Opaque">func (p *YCbCr) Opaque() bool</a>
+</li>
+<li> <a href="#YCbCr.RGBA64At">func (p *YCbCr) RGBA64At(x, y int) color.RGBA64</a>
+</li>
+<li> <a href="#YCbCr.SubImage">func (p *YCbCr) SubImage(r Rectangle) Image</a>
+</li>
+<li> <a href="#YCbCr.YCbCrAt">func (p *YCbCr) YCbCrAt(x, y int) color.YCbCr</a>
+</li>
+<li> <a href="#YCbCr.YOffset">func (p *YCbCr) YOffset(x, y int) int</a>
+</li>
+<li><a href="#YCbCrSubsampleRatio">type YCbCrSubsampleRatio</a></li>
+<li> <a href="#YCbCrSubsampleRatio.String">func (s YCbCrSubsampleRatio) String() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example__decodeConfig">Package (DecodeConfig)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>format.go</span> <span>geom.go</span> <span>image.go</span> <span>names.go</span> <span>ycbcr.go</span> </p> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var (
+ // Black is an opaque black uniform image.
+ Black = NewUniform(color.Black)
+ // White is an opaque white uniform image.
+ White = NewUniform(color.White)
+ // Transparent is a fully transparent uniform image.
+ Transparent = NewUniform(color.Transparent)
+ // Opaque is a fully opaque uniform image.
+ Opaque = NewUniform(color.Opaque)
+)</pre> <p>ErrFormat indicates that decoding encountered an unknown format. </p>
+<pre data-language="go">var ErrFormat = errors.New("image: unknown format")</pre> <h2 id="RegisterFormat">func <span>RegisterFormat</span> </h2> <pre data-language="go">func RegisterFormat(name, magic string, decode func(io.Reader) (Image, error), decodeConfig func(io.Reader) (Config, error))</pre> <p>RegisterFormat registers an image format for use by <a href="#Decode">Decode</a>. Name is the name of the format, like "jpeg" or "png". Magic is the magic prefix that identifies the format's encoding. The magic string can contain "?" wildcards that each match any one byte. <a href="#Decode">Decode</a> is the function that decodes the encoded image. <a href="#DecodeConfig">DecodeConfig</a> is the function that decodes just its configuration. </p>
+<h2 id="Alpha">type <span>Alpha</span> </h2> <p>Alpha is an in-memory image whose At method returns <span>color.Alpha</span> values. </p>
+<pre data-language="go">type Alpha struct {
+ // Pix holds the image's pixels, as alpha values. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+}
+</pre> <h3 id="NewAlpha">func <span>NewAlpha</span> </h3> <pre data-language="go">func NewAlpha(r Rectangle) *Alpha</pre> <p>NewAlpha returns a new <a href="#Alpha">Alpha</a> image with the given bounds. </p>
+<h3 id="Alpha.AlphaAt">func (*Alpha) <span>AlphaAt</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (p *Alpha) AlphaAt(x, y int) color.Alpha</pre> <h3 id="Alpha.At">func (*Alpha) <span>At</span> </h3> <pre data-language="go">func (p *Alpha) At(x, y int) color.Color</pre> <h3 id="Alpha.Bounds">func (*Alpha) <span>Bounds</span> </h3> <pre data-language="go">func (p *Alpha) Bounds() Rectangle</pre> <h3 id="Alpha.ColorModel">func (*Alpha) <span>ColorModel</span> </h3> <pre data-language="go">func (p *Alpha) ColorModel() color.Model</pre> <h3 id="Alpha.Opaque">func (*Alpha) <span>Opaque</span> </h3> <pre data-language="go">func (p *Alpha) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="Alpha.PixOffset">func (*Alpha) <span>PixOffset</span> </h3> <pre data-language="go">func (p *Alpha) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="Alpha.RGBA64At">func (*Alpha) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Alpha) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="Alpha.Set">func (*Alpha) <span>Set</span> </h3> <pre data-language="go">func (p *Alpha) Set(x, y int, c color.Color)</pre> <h3 id="Alpha.SetAlpha">func (*Alpha) <span>SetAlpha</span> </h3> <pre data-language="go">func (p *Alpha) SetAlpha(x, y int, c color.Alpha)</pre> <h3 id="Alpha.SetRGBA64">func (*Alpha) <span>SetRGBA64</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Alpha) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="Alpha.SubImage">func (*Alpha) <span>SubImage</span> </h3> <pre data-language="go">func (p *Alpha) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="Alpha16">type <span>Alpha16</span> </h2> <p>Alpha16 is an in-memory image whose At method returns <span>color.Alpha16</span> values. </p>
+<pre data-language="go">type Alpha16 struct {
+ // Pix holds the image's pixels, as alpha values in big-endian format. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+}
+</pre> <h3 id="NewAlpha16">func <span>NewAlpha16</span> </h3> <pre data-language="go">func NewAlpha16(r Rectangle) *Alpha16</pre> <p>NewAlpha16 returns a new <a href="#Alpha16">Alpha16</a> image with the given bounds. </p>
+<h3 id="Alpha16.Alpha16At">func (*Alpha16) <span>Alpha16At</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (p *Alpha16) Alpha16At(x, y int) color.Alpha16</pre> <h3 id="Alpha16.At">func (*Alpha16) <span>At</span> </h3> <pre data-language="go">func (p *Alpha16) At(x, y int) color.Color</pre> <h3 id="Alpha16.Bounds">func (*Alpha16) <span>Bounds</span> </h3> <pre data-language="go">func (p *Alpha16) Bounds() Rectangle</pre> <h3 id="Alpha16.ColorModel">func (*Alpha16) <span>ColorModel</span> </h3> <pre data-language="go">func (p *Alpha16) ColorModel() color.Model</pre> <h3 id="Alpha16.Opaque">func (*Alpha16) <span>Opaque</span> </h3> <pre data-language="go">func (p *Alpha16) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="Alpha16.PixOffset">func (*Alpha16) <span>PixOffset</span> </h3> <pre data-language="go">func (p *Alpha16) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="Alpha16.RGBA64At">func (*Alpha16) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Alpha16) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="Alpha16.Set">func (*Alpha16) <span>Set</span> </h3> <pre data-language="go">func (p *Alpha16) Set(x, y int, c color.Color)</pre> <h3 id="Alpha16.SetAlpha16">func (*Alpha16) <span>SetAlpha16</span> </h3> <pre data-language="go">func (p *Alpha16) SetAlpha16(x, y int, c color.Alpha16)</pre> <h3 id="Alpha16.SetRGBA64">func (*Alpha16) <span>SetRGBA64</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Alpha16) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="Alpha16.SubImage">func (*Alpha16) <span>SubImage</span> </h3> <pre data-language="go">func (p *Alpha16) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="CMYK">type <span>CMYK</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>CMYK is an in-memory image whose At method returns <span>color.CMYK</span> values. </p>
+<pre data-language="go">type CMYK struct {
+ // Pix holds the image's pixels, in C, M, Y, K order. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+}
+</pre> <h3 id="NewCMYK">func <span>NewCMYK</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewCMYK(r Rectangle) *CMYK</pre> <p>NewCMYK returns a new CMYK image with the given bounds. </p>
+<h3 id="CMYK.At">func (*CMYK) <span>At</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *CMYK) At(x, y int) color.Color</pre> <h3 id="CMYK.Bounds">func (*CMYK) <span>Bounds</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *CMYK) Bounds() Rectangle</pre> <h3 id="CMYK.CMYKAt">func (*CMYK) <span>CMYKAt</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *CMYK) CMYKAt(x, y int) color.CMYK</pre> <h3 id="CMYK.ColorModel">func (*CMYK) <span>ColorModel</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *CMYK) ColorModel() color.Model</pre> <h3 id="CMYK.Opaque">func (*CMYK) <span>Opaque</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *CMYK) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="CMYK.PixOffset">func (*CMYK) <span>PixOffset</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *CMYK) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="CMYK.RGBA64At">func (*CMYK) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *CMYK) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="CMYK.Set">func (*CMYK) <span>Set</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *CMYK) Set(x, y int, c color.Color)</pre> <h3 id="CMYK.SetCMYK">func (*CMYK) <span>SetCMYK</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *CMYK) SetCMYK(x, y int, c color.CMYK)</pre> <h3 id="CMYK.SetRGBA64">func (*CMYK) <span>SetRGBA64</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *CMYK) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="CMYK.SubImage">func (*CMYK) <span>SubImage</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *CMYK) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="Config">type <span>Config</span> </h2> <p>Config holds an image's color model and dimensions. </p>
+<pre data-language="go">type Config struct {
+ ColorModel color.Model
+ Width, Height int
+}
+</pre> <h3 id="DecodeConfig">func <span>DecodeConfig</span> </h3> <pre data-language="go">func DecodeConfig(r io.Reader) (Config, string, error)</pre> <p>DecodeConfig decodes the color model and dimensions of an image that has been encoded in a registered format. The string returned is the format name used during format registration. Format registration is typically done by an init function in the codec-specific package. </p>
+<h2 id="Gray">type <span>Gray</span> </h2> <p>Gray is an in-memory image whose At method returns <span>color.Gray</span> values. </p>
+<pre data-language="go">type Gray struct {
+ // Pix holds the image's pixels, as gray values. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+}
+</pre> <h3 id="NewGray">func <span>NewGray</span> </h3> <pre data-language="go">func NewGray(r Rectangle) *Gray</pre> <p>NewGray returns a new <a href="#Gray">Gray</a> image with the given bounds. </p>
+<h3 id="Gray.At">func (*Gray) <span>At</span> </h3> <pre data-language="go">func (p *Gray) At(x, y int) color.Color</pre> <h3 id="Gray.Bounds">func (*Gray) <span>Bounds</span> </h3> <pre data-language="go">func (p *Gray) Bounds() Rectangle</pre> <h3 id="Gray.ColorModel">func (*Gray) <span>ColorModel</span> </h3> <pre data-language="go">func (p *Gray) ColorModel() color.Model</pre> <h3 id="Gray.GrayAt">func (*Gray) <span>GrayAt</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (p *Gray) GrayAt(x, y int) color.Gray</pre> <h3 id="Gray.Opaque">func (*Gray) <span>Opaque</span> </h3> <pre data-language="go">func (p *Gray) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="Gray.PixOffset">func (*Gray) <span>PixOffset</span> </h3> <pre data-language="go">func (p *Gray) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="Gray.RGBA64At">func (*Gray) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Gray) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="Gray.Set">func (*Gray) <span>Set</span> </h3> <pre data-language="go">func (p *Gray) Set(x, y int, c color.Color)</pre> <h3 id="Gray.SetGray">func (*Gray) <span>SetGray</span> </h3> <pre data-language="go">func (p *Gray) SetGray(x, y int, c color.Gray)</pre> <h3 id="Gray.SetRGBA64">func (*Gray) <span>SetRGBA64</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Gray) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="Gray.SubImage">func (*Gray) <span>SubImage</span> </h3> <pre data-language="go">func (p *Gray) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="Gray16">type <span>Gray16</span> </h2> <p>Gray16 is an in-memory image whose At method returns <span>color.Gray16</span> values. </p>
+<pre data-language="go">type Gray16 struct {
+ // Pix holds the image's pixels, as gray values in big-endian format. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+}
+</pre> <h3 id="NewGray16">func <span>NewGray16</span> </h3> <pre data-language="go">func NewGray16(r Rectangle) *Gray16</pre> <p>NewGray16 returns a new <a href="#Gray16">Gray16</a> image with the given bounds. </p>
+<h3 id="Gray16.At">func (*Gray16) <span>At</span> </h3> <pre data-language="go">func (p *Gray16) At(x, y int) color.Color</pre> <h3 id="Gray16.Bounds">func (*Gray16) <span>Bounds</span> </h3> <pre data-language="go">func (p *Gray16) Bounds() Rectangle</pre> <h3 id="Gray16.ColorModel">func (*Gray16) <span>ColorModel</span> </h3> <pre data-language="go">func (p *Gray16) ColorModel() color.Model</pre> <h3 id="Gray16.Gray16At">func (*Gray16) <span>Gray16At</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (p *Gray16) Gray16At(x, y int) color.Gray16</pre> <h3 id="Gray16.Opaque">func (*Gray16) <span>Opaque</span> </h3> <pre data-language="go">func (p *Gray16) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="Gray16.PixOffset">func (*Gray16) <span>PixOffset</span> </h3> <pre data-language="go">func (p *Gray16) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="Gray16.RGBA64At">func (*Gray16) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Gray16) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="Gray16.Set">func (*Gray16) <span>Set</span> </h3> <pre data-language="go">func (p *Gray16) Set(x, y int, c color.Color)</pre> <h3 id="Gray16.SetGray16">func (*Gray16) <span>SetGray16</span> </h3> <pre data-language="go">func (p *Gray16) SetGray16(x, y int, c color.Gray16)</pre> <h3 id="Gray16.SetRGBA64">func (*Gray16) <span>SetRGBA64</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Gray16) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="Gray16.SubImage">func (*Gray16) <span>SubImage</span> </h3> <pre data-language="go">func (p *Gray16) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="Image">type <span>Image</span> </h2> <p>Image is a finite rectangular grid of <span>color.Color</span> values taken from a color model. </p>
+<pre data-language="go">type Image interface {
+ // ColorModel returns the Image's color model.
+ ColorModel() color.Model
+ // Bounds returns the domain for which At can return non-zero color.
+ // The bounds do not necessarily contain the point (0, 0).
+ Bounds() Rectangle
+ // At returns the color of the pixel at (x, y).
+ // At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid.
+ // At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.
+ At(x, y int) color.Color
+}</pre> <h3 id="Decode">func <span>Decode</span> </h3> <pre data-language="go">func Decode(r io.Reader) (Image, string, error)</pre> <p>Decode decodes an image that has been encoded in a registered format. The string returned is the format name used during format registration. Format registration is typically done by an init function in the codec- specific package. </p>
+<h2 id="NRGBA">type <span>NRGBA</span> </h2> <p>NRGBA is an in-memory image whose At method returns <span>color.NRGBA</span> values. </p>
+<pre data-language="go">type NRGBA struct {
+ // Pix holds the image's pixels, in R, G, B, A order. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+}
+</pre> <h3 id="NewNRGBA">func <span>NewNRGBA</span> </h3> <pre data-language="go">func NewNRGBA(r Rectangle) *NRGBA</pre> <p>NewNRGBA returns a new <a href="#NRGBA">NRGBA</a> image with the given bounds. </p>
+<h3 id="NRGBA.At">func (*NRGBA) <span>At</span> </h3> <pre data-language="go">func (p *NRGBA) At(x, y int) color.Color</pre> <h3 id="NRGBA.Bounds">func (*NRGBA) <span>Bounds</span> </h3> <pre data-language="go">func (p *NRGBA) Bounds() Rectangle</pre> <h3 id="NRGBA.ColorModel">func (*NRGBA) <span>ColorModel</span> </h3> <pre data-language="go">func (p *NRGBA) ColorModel() color.Model</pre> <h3 id="NRGBA.NRGBAAt">func (*NRGBA) <span>NRGBAAt</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (p *NRGBA) NRGBAAt(x, y int) color.NRGBA</pre> <h3 id="NRGBA.Opaque">func (*NRGBA) <span>Opaque</span> </h3> <pre data-language="go">func (p *NRGBA) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="NRGBA.PixOffset">func (*NRGBA) <span>PixOffset</span> </h3> <pre data-language="go">func (p *NRGBA) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="NRGBA.RGBA64At">func (*NRGBA) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *NRGBA) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="NRGBA.Set">func (*NRGBA) <span>Set</span> </h3> <pre data-language="go">func (p *NRGBA) Set(x, y int, c color.Color)</pre> <h3 id="NRGBA.SetNRGBA">func (*NRGBA) <span>SetNRGBA</span> </h3> <pre data-language="go">func (p *NRGBA) SetNRGBA(x, y int, c color.NRGBA)</pre> <h3 id="NRGBA.SetRGBA64">func (*NRGBA) <span>SetRGBA64</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *NRGBA) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="NRGBA.SubImage">func (*NRGBA) <span>SubImage</span> </h3> <pre data-language="go">func (p *NRGBA) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="NRGBA64">type <span>NRGBA64</span> </h2> <p>NRGBA64 is an in-memory image whose At method returns <span>color.NRGBA64</span> values. </p>
+<pre data-language="go">type NRGBA64 struct {
+ // Pix holds the image's pixels, in R, G, B, A order and big-endian format. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*8].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+}
+</pre> <h3 id="NewNRGBA64">func <span>NewNRGBA64</span> </h3> <pre data-language="go">func NewNRGBA64(r Rectangle) *NRGBA64</pre> <p>NewNRGBA64 returns a new <a href="#NRGBA64">NRGBA64</a> image with the given bounds. </p>
+<h3 id="NRGBA64.At">func (*NRGBA64) <span>At</span> </h3> <pre data-language="go">func (p *NRGBA64) At(x, y int) color.Color</pre> <h3 id="NRGBA64.Bounds">func (*NRGBA64) <span>Bounds</span> </h3> <pre data-language="go">func (p *NRGBA64) Bounds() Rectangle</pre> <h3 id="NRGBA64.ColorModel">func (*NRGBA64) <span>ColorModel</span> </h3> <pre data-language="go">func (p *NRGBA64) ColorModel() color.Model</pre> <h3 id="NRGBA64.NRGBA64At">func (*NRGBA64) <span>NRGBA64At</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (p *NRGBA64) NRGBA64At(x, y int) color.NRGBA64</pre> <h3 id="NRGBA64.Opaque">func (*NRGBA64) <span>Opaque</span> </h3> <pre data-language="go">func (p *NRGBA64) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="NRGBA64.PixOffset">func (*NRGBA64) <span>PixOffset</span> </h3> <pre data-language="go">func (p *NRGBA64) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="NRGBA64.RGBA64At">func (*NRGBA64) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *NRGBA64) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="NRGBA64.Set">func (*NRGBA64) <span>Set</span> </h3> <pre data-language="go">func (p *NRGBA64) Set(x, y int, c color.Color)</pre> <h3 id="NRGBA64.SetNRGBA64">func (*NRGBA64) <span>SetNRGBA64</span> </h3> <pre data-language="go">func (p *NRGBA64) SetNRGBA64(x, y int, c color.NRGBA64)</pre> <h3 id="NRGBA64.SetRGBA64">func (*NRGBA64) <span>SetRGBA64</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *NRGBA64) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="NRGBA64.SubImage">func (*NRGBA64) <span>SubImage</span> </h3> <pre data-language="go">func (p *NRGBA64) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="NYCbCrA">type <span>NYCbCrA</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>NYCbCrA is an in-memory image of non-alpha-premultiplied Y'CbCr-with-alpha colors. A and AStride are analogous to the Y and YStride fields of the embedded YCbCr. </p>
+<pre data-language="go">type NYCbCrA struct {
+ YCbCr
+ A []uint8
+ AStride int
+}
+</pre> <h3 id="NewNYCbCrA">func <span>NewNYCbCrA</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func NewNYCbCrA(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA</pre> <p>NewNYCbCrA returns a new <a href="#NYCbCrA">NYCbCrA</a> image with the given bounds and subsample ratio. </p>
+<h3 id="NYCbCrA.AOffset">func (*NYCbCrA) <span>AOffset</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (p *NYCbCrA) AOffset(x, y int) int</pre> <p>AOffset returns the index of the first element of A that corresponds to the pixel at (x, y). </p>
+<h3 id="NYCbCrA.At">func (*NYCbCrA) <span>At</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (p *NYCbCrA) At(x, y int) color.Color</pre> <h3 id="NYCbCrA.ColorModel">func (*NYCbCrA) <span>ColorModel</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (p *NYCbCrA) ColorModel() color.Model</pre> <h3 id="NYCbCrA.NYCbCrAAt">func (*NYCbCrA) <span>NYCbCrAAt</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (p *NYCbCrA) NYCbCrAAt(x, y int) color.NYCbCrA</pre> <h3 id="NYCbCrA.Opaque">func (*NYCbCrA) <span>Opaque</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (p *NYCbCrA) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="NYCbCrA.RGBA64At">func (*NYCbCrA) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *NYCbCrA) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="NYCbCrA.SubImage">func (*NYCbCrA) <span>SubImage</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (p *NYCbCrA) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="Paletted">type <span>Paletted</span> </h2> <p>Paletted is an in-memory image of uint8 indices into a given palette. </p>
+<pre data-language="go">type Paletted struct {
+ // Pix holds the image's pixels, as palette indices. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+ // Palette is the image's palette.
+ Palette color.Palette
+}
+</pre> <h3 id="NewPaletted">func <span>NewPaletted</span> </h3> <pre data-language="go">func NewPaletted(r Rectangle, p color.Palette) *Paletted</pre> <p>NewPaletted returns a new <a href="#Paletted">Paletted</a> image with the given width, height and palette. </p>
+<h3 id="Paletted.At">func (*Paletted) <span>At</span> </h3> <pre data-language="go">func (p *Paletted) At(x, y int) color.Color</pre> <h3 id="Paletted.Bounds">func (*Paletted) <span>Bounds</span> </h3> <pre data-language="go">func (p *Paletted) Bounds() Rectangle</pre> <h3 id="Paletted.ColorIndexAt">func (*Paletted) <span>ColorIndexAt</span> </h3> <pre data-language="go">func (p *Paletted) ColorIndexAt(x, y int) uint8</pre> <h3 id="Paletted.ColorModel">func (*Paletted) <span>ColorModel</span> </h3> <pre data-language="go">func (p *Paletted) ColorModel() color.Model</pre> <h3 id="Paletted.Opaque">func (*Paletted) <span>Opaque</span> </h3> <pre data-language="go">func (p *Paletted) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="Paletted.PixOffset">func (*Paletted) <span>PixOffset</span> </h3> <pre data-language="go">func (p *Paletted) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="Paletted.RGBA64At">func (*Paletted) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Paletted) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="Paletted.Set">func (*Paletted) <span>Set</span> </h3> <pre data-language="go">func (p *Paletted) Set(x, y int, c color.Color)</pre> <h3 id="Paletted.SetColorIndex">func (*Paletted) <span>SetColorIndex</span> </h3> <pre data-language="go">func (p *Paletted) SetColorIndex(x, y int, index uint8)</pre> <h3 id="Paletted.SetRGBA64">func (*Paletted) <span>SetRGBA64</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *Paletted) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="Paletted.SubImage">func (*Paletted) <span>SubImage</span> </h3> <pre data-language="go">func (p *Paletted) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="PalettedImage">type <span>PalettedImage</span> </h2> <p>PalettedImage is an image whose colors may come from a limited palette. If m is a PalettedImage and m.ColorModel() returns a <span>color.Palette</span> p, then m.At(x, y) should be equivalent to p[m.ColorIndexAt(x, y)]. If m's color model is not a color.Palette, then ColorIndexAt's behavior is undefined. </p>
+<pre data-language="go">type PalettedImage interface {
+ // ColorIndexAt returns the palette index of the pixel at (x, y).
+ ColorIndexAt(x, y int) uint8
+ Image
+}</pre> <h2 id="Point">type <span>Point</span> </h2> <p>A Point is an X, Y coordinate pair. The axes increase right and down. </p>
+<pre data-language="go">type Point struct {
+ X, Y int
+}
+</pre> <p>ZP is the zero <a href="#Point">Point</a>. </p>
+<p>Deprecated: Use a literal <a href="#Point">image.Point</a> instead. </p>
+<pre data-language="go">var ZP Point</pre> <h3 id="Pt">func <span>Pt</span> </h3> <pre data-language="go">func Pt(X, Y int) Point</pre> <p>Pt is shorthand for <a href="#Point">Point</a>{X, Y}. </p>
+<h3 id="Point.Add">func (Point) <span>Add</span> </h3> <pre data-language="go">func (p Point) Add(q Point) Point</pre> <p>Add returns the vector p+q. </p>
+<h3 id="Point.Div">func (Point) <span>Div</span> </h3> <pre data-language="go">func (p Point) Div(k int) Point</pre> <p>Div returns the vector p/k. </p>
+<h3 id="Point.Eq">func (Point) <span>Eq</span> </h3> <pre data-language="go">func (p Point) Eq(q Point) bool</pre> <p>Eq reports whether p and q are equal. </p>
+<h3 id="Point.In">func (Point) <span>In</span> </h3> <pre data-language="go">func (p Point) In(r Rectangle) bool</pre> <p>In reports whether p is in r. </p>
+<h3 id="Point.Mod">func (Point) <span>Mod</span> </h3> <pre data-language="go">func (p Point) Mod(r Rectangle) Point</pre> <p>Mod returns the point q in r such that p.X-q.X is a multiple of r's width and p.Y-q.Y is a multiple of r's height. </p>
+<h3 id="Point.Mul">func (Point) <span>Mul</span> </h3> <pre data-language="go">func (p Point) Mul(k int) Point</pre> <p>Mul returns the vector p*k. </p>
+<h3 id="Point.String">func (Point) <span>String</span> </h3> <pre data-language="go">func (p Point) String() string</pre> <p>String returns a string representation of p like "(3,4)". </p>
+<h3 id="Point.Sub">func (Point) <span>Sub</span> </h3> <pre data-language="go">func (p Point) Sub(q Point) Point</pre> <p>Sub returns the vector p-q. </p>
+<h2 id="RGBA">type <span>RGBA</span> </h2> <p>RGBA is an in-memory image whose At method returns <span>color.RGBA</span> values. </p>
+<pre data-language="go">type RGBA struct {
+ // Pix holds the image's pixels, in R, G, B, A order. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+}
+</pre> <h3 id="NewRGBA">func <span>NewRGBA</span> </h3> <pre data-language="go">func NewRGBA(r Rectangle) *RGBA</pre> <p>NewRGBA returns a new <a href="#RGBA">RGBA</a> image with the given bounds. </p>
+<h3 id="RGBA.At">func (*RGBA) <span>At</span> </h3> <pre data-language="go">func (p *RGBA) At(x, y int) color.Color</pre> <h3 id="RGBA.Bounds">func (*RGBA) <span>Bounds</span> </h3> <pre data-language="go">func (p *RGBA) Bounds() Rectangle</pre> <h3 id="RGBA.ColorModel">func (*RGBA) <span>ColorModel</span> </h3> <pre data-language="go">func (p *RGBA) ColorModel() color.Model</pre> <h3 id="RGBA.Opaque">func (*RGBA) <span>Opaque</span> </h3> <pre data-language="go">func (p *RGBA) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="RGBA.PixOffset">func (*RGBA) <span>PixOffset</span> </h3> <pre data-language="go">func (p *RGBA) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="RGBA.RGBA64At">func (*RGBA) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *RGBA) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="RGBA.RGBAAt">func (*RGBA) <span>RGBAAt</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (p *RGBA) RGBAAt(x, y int) color.RGBA</pre> <h3 id="RGBA.Set">func (*RGBA) <span>Set</span> </h3> <pre data-language="go">func (p *RGBA) Set(x, y int, c color.Color)</pre> <h3 id="RGBA.SetRGBA">func (*RGBA) <span>SetRGBA</span> </h3> <pre data-language="go">func (p *RGBA) SetRGBA(x, y int, c color.RGBA)</pre> <h3 id="RGBA.SetRGBA64">func (*RGBA) <span>SetRGBA64</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *RGBA) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="RGBA.SubImage">func (*RGBA) <span>SubImage</span> </h3> <pre data-language="go">func (p *RGBA) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="RGBA64">type <span>RGBA64</span> </h2> <p>RGBA64 is an in-memory image whose At method returns <span>color.RGBA64</span> values. </p>
+<pre data-language="go">type RGBA64 struct {
+ // Pix holds the image's pixels, in R, G, B, A order and big-endian format. The pixel at
+ // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*8].
+ Pix []uint8
+ // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
+ Stride int
+ // Rect is the image's bounds.
+ Rect Rectangle
+}
+</pre> <h3 id="NewRGBA64">func <span>NewRGBA64</span> </h3> <pre data-language="go">func NewRGBA64(r Rectangle) *RGBA64</pre> <p>NewRGBA64 returns a new <a href="#RGBA64">RGBA64</a> image with the given bounds. </p>
+<h3 id="RGBA64.At">func (*RGBA64) <span>At</span> </h3> <pre data-language="go">func (p *RGBA64) At(x, y int) color.Color</pre> <h3 id="RGBA64.Bounds">func (*RGBA64) <span>Bounds</span> </h3> <pre data-language="go">func (p *RGBA64) Bounds() Rectangle</pre> <h3 id="RGBA64.ColorModel">func (*RGBA64) <span>ColorModel</span> </h3> <pre data-language="go">func (p *RGBA64) ColorModel() color.Model</pre> <h3 id="RGBA64.Opaque">func (*RGBA64) <span>Opaque</span> </h3> <pre data-language="go">func (p *RGBA64) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="RGBA64.PixOffset">func (*RGBA64) <span>PixOffset</span> </h3> <pre data-language="go">func (p *RGBA64) PixOffset(x, y int) int</pre> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p>
+<h3 id="RGBA64.RGBA64At">func (*RGBA64) <span>RGBA64At</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (p *RGBA64) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="RGBA64.Set">func (*RGBA64) <span>Set</span> </h3> <pre data-language="go">func (p *RGBA64) Set(x, y int, c color.Color)</pre> <h3 id="RGBA64.SetRGBA64">func (*RGBA64) <span>SetRGBA64</span> </h3> <pre data-language="go">func (p *RGBA64) SetRGBA64(x, y int, c color.RGBA64)</pre> <h3 id="RGBA64.SubImage">func (*RGBA64) <span>SubImage</span> </h3> <pre data-language="go">func (p *RGBA64) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h2 id="RGBA64Image">type <span>RGBA64Image</span> <span title="Added in Go 1.17">1.17</span> </h2> <p>RGBA64Image is an <a href="#Image">Image</a> whose pixels can be converted directly to a color.RGBA64. </p>
+<pre data-language="go">type RGBA64Image interface {
+ // RGBA64At returns the RGBA64 color of the pixel at (x, y). It is
+ // equivalent to calling At(x, y).RGBA() and converting the resulting
+ // 32-bit return values to a color.RGBA64, but it can avoid allocations
+ // from converting concrete color types to the color.Color interface type.
+ RGBA64At(x, y int) color.RGBA64
+ Image
+}</pre> <h2 id="Rectangle">type <span>Rectangle</span> </h2> <p>A Rectangle contains the points with Min.X &lt;= X &lt; Max.X, Min.Y &lt;= Y &lt; Max.Y. It is well-formed if Min.X &lt;= Max.X and likewise for Y. Points are always well-formed. A rectangle's methods always return well-formed outputs for well-formed inputs. </p>
+<p>A Rectangle is also an <a href="#Image">Image</a> whose bounds are the rectangle itself. At returns color.Opaque for points in the rectangle and color.Transparent otherwise. </p>
+<pre data-language="go">type Rectangle struct {
+ Min, Max Point
+}
+</pre> <p>ZR is the zero <a href="#Rectangle">Rectangle</a>. </p>
+<p>Deprecated: Use a literal <a href="#Rectangle">image.Rectangle</a> instead. </p>
+<pre data-language="go">var ZR Rectangle</pre> <h3 id="Rect">func <span>Rect</span> </h3> <pre data-language="go">func Rect(x0, y0, x1, y1 int) Rectangle</pre> <p>Rect is shorthand for <a href="#Rectangle">Rectangle</a>{Pt(x0, y0), <a href="#Pt">Pt</a>(x1, y1)}. The returned rectangle has minimum and maximum coordinates swapped if necessary so that it is well-formed. </p>
+<h3 id="Rectangle.Add">func (Rectangle) <span>Add</span> </h3> <pre data-language="go">func (r Rectangle) Add(p Point) Rectangle</pre> <p>Add returns the rectangle r translated by p. </p>
+<h3 id="Rectangle.At">func (Rectangle) <span>At</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r Rectangle) At(x, y int) color.Color</pre> <p>At implements the <a href="#Image">Image</a> interface. </p>
+<h3 id="Rectangle.Bounds">func (Rectangle) <span>Bounds</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r Rectangle) Bounds() Rectangle</pre> <p>Bounds implements the <a href="#Image">Image</a> interface. </p>
+<h3 id="Rectangle.Canon">func (Rectangle) <span>Canon</span> </h3> <pre data-language="go">func (r Rectangle) Canon() Rectangle</pre> <p>Canon returns the canonical version of r. The returned rectangle has minimum and maximum coordinates swapped if necessary so that it is well-formed. </p>
+<h3 id="Rectangle.ColorModel">func (Rectangle) <span>ColorModel</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r Rectangle) ColorModel() color.Model</pre> <p>ColorModel implements the <a href="#Image">Image</a> interface. </p>
+<h3 id="Rectangle.Dx">func (Rectangle) <span>Dx</span> </h3> <pre data-language="go">func (r Rectangle) Dx() int</pre> <p>Dx returns r's width. </p>
+<h3 id="Rectangle.Dy">func (Rectangle) <span>Dy</span> </h3> <pre data-language="go">func (r Rectangle) Dy() int</pre> <p>Dy returns r's height. </p>
+<h3 id="Rectangle.Empty">func (Rectangle) <span>Empty</span> </h3> <pre data-language="go">func (r Rectangle) Empty() bool</pre> <p>Empty reports whether the rectangle contains no points. </p>
+<h3 id="Rectangle.Eq">func (Rectangle) <span>Eq</span> </h3> <pre data-language="go">func (r Rectangle) Eq(s Rectangle) bool</pre> <p>Eq reports whether r and s contain the same set of points. All empty rectangles are considered equal. </p>
+<h3 id="Rectangle.In">func (Rectangle) <span>In</span> </h3> <pre data-language="go">func (r Rectangle) In(s Rectangle) bool</pre> <p>In reports whether every point in r is in s. </p>
+<h3 id="Rectangle.Inset">func (Rectangle) <span>Inset</span> </h3> <pre data-language="go">func (r Rectangle) Inset(n int) Rectangle</pre> <p>Inset returns the rectangle r inset by n, which may be negative. If either of r's dimensions is less than 2*n then an empty rectangle near the center of r will be returned. </p>
+<h3 id="Rectangle.Intersect">func (Rectangle) <span>Intersect</span> </h3> <pre data-language="go">func (r Rectangle) Intersect(s Rectangle) Rectangle</pre> <p>Intersect returns the largest rectangle contained by both r and s. If the two rectangles do not overlap then the zero rectangle will be returned. </p>
+<h3 id="Rectangle.Overlaps">func (Rectangle) <span>Overlaps</span> </h3> <pre data-language="go">func (r Rectangle) Overlaps(s Rectangle) bool</pre> <p>Overlaps reports whether r and s have a non-empty intersection. </p>
+<h3 id="Rectangle.RGBA64At">func (Rectangle) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (r Rectangle) RGBA64At(x, y int) color.RGBA64</pre> <p>RGBA64At implements the <a href="#RGBA64Image">RGBA64Image</a> interface. </p>
+<h3 id="Rectangle.Size">func (Rectangle) <span>Size</span> </h3> <pre data-language="go">func (r Rectangle) Size() Point</pre> <p>Size returns r's width and height. </p>
+<h3 id="Rectangle.String">func (Rectangle) <span>String</span> </h3> <pre data-language="go">func (r Rectangle) String() string</pre> <p>String returns a string representation of r like "(3,4)-(6,5)". </p>
+<h3 id="Rectangle.Sub">func (Rectangle) <span>Sub</span> </h3> <pre data-language="go">func (r Rectangle) Sub(p Point) Rectangle</pre> <p>Sub returns the rectangle r translated by -p. </p>
+<h3 id="Rectangle.Union">func (Rectangle) <span>Union</span> </h3> <pre data-language="go">func (r Rectangle) Union(s Rectangle) Rectangle</pre> <p>Union returns the smallest rectangle that contains both r and s. </p>
+<h2 id="Uniform">type <span>Uniform</span> </h2> <p>Uniform is an infinite-sized <a href="#Image">Image</a> of uniform color. It implements the <span>color.Color</span>, <span>color.Model</span>, and <a href="#Image">Image</a> interfaces. </p>
+<pre data-language="go">type Uniform struct {
+ C color.Color
+}
+</pre> <h3 id="NewUniform">func <span>NewUniform</span> </h3> <pre data-language="go">func NewUniform(c color.Color) *Uniform</pre> <p>NewUniform returns a new <a href="#Uniform">Uniform</a> image of the given color. </p>
+<h3 id="Uniform.At">func (*Uniform) <span>At</span> </h3> <pre data-language="go">func (c *Uniform) At(x, y int) color.Color</pre> <h3 id="Uniform.Bounds">func (*Uniform) <span>Bounds</span> </h3> <pre data-language="go">func (c *Uniform) Bounds() Rectangle</pre> <h3 id="Uniform.ColorModel">func (*Uniform) <span>ColorModel</span> </h3> <pre data-language="go">func (c *Uniform) ColorModel() color.Model</pre> <h3 id="Uniform.Convert">func (*Uniform) <span>Convert</span> </h3> <pre data-language="go">func (c *Uniform) Convert(color.Color) color.Color</pre> <h3 id="Uniform.Opaque">func (*Uniform) <span>Opaque</span> </h3> <pre data-language="go">func (c *Uniform) Opaque() bool</pre> <p>Opaque scans the entire image and reports whether it is fully opaque. </p>
+<h3 id="Uniform.RGBA">func (*Uniform) <span>RGBA</span> </h3> <pre data-language="go">func (c *Uniform) RGBA() (r, g, b, a uint32)</pre> <h3 id="Uniform.RGBA64At">func (*Uniform) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (c *Uniform) RGBA64At(x, y int) color.RGBA64</pre> <h2 id="YCbCr">type <span>YCbCr</span> </h2> <p>YCbCr is an in-memory image of Y'CbCr colors. There is one Y sample per pixel, but each Cb and Cr sample can span one or more pixels. YStride is the Y slice index delta between vertically adjacent pixels. CStride is the Cb and Cr slice index delta between vertically adjacent pixels that map to separate chroma samples. It is not an absolute requirement, but YStride and len(Y) are typically multiples of 8, and: </p>
+<pre data-language="go">For 4:4:4, CStride == YStride/1 &amp;&amp; len(Cb) == len(Cr) == len(Y)/1.
+For 4:2:2, CStride == YStride/2 &amp;&amp; len(Cb) == len(Cr) == len(Y)/2.
+For 4:2:0, CStride == YStride/2 &amp;&amp; len(Cb) == len(Cr) == len(Y)/4.
+For 4:4:0, CStride == YStride/1 &amp;&amp; len(Cb) == len(Cr) == len(Y)/2.
+For 4:1:1, CStride == YStride/4 &amp;&amp; len(Cb) == len(Cr) == len(Y)/4.
+For 4:1:0, CStride == YStride/4 &amp;&amp; len(Cb) == len(Cr) == len(Y)/8.
+</pre> <pre data-language="go">type YCbCr struct {
+ Y, Cb, Cr []uint8
+ YStride int
+ CStride int
+ SubsampleRatio YCbCrSubsampleRatio
+ Rect Rectangle
+}
+</pre> <h3 id="NewYCbCr">func <span>NewYCbCr</span> </h3> <pre data-language="go">func NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr</pre> <p>NewYCbCr returns a new YCbCr image with the given bounds and subsample ratio. </p>
+<h3 id="YCbCr.At">func (*YCbCr) <span>At</span> </h3> <pre data-language="go">func (p *YCbCr) At(x, y int) color.Color</pre> <h3 id="YCbCr.Bounds">func (*YCbCr) <span>Bounds</span> </h3> <pre data-language="go">func (p *YCbCr) Bounds() Rectangle</pre> <h3 id="YCbCr.COffset">func (*YCbCr) <span>COffset</span> </h3> <pre data-language="go">func (p *YCbCr) COffset(x, y int) int</pre> <p>COffset returns the index of the first element of Cb or Cr that corresponds to the pixel at (x, y). </p>
+<h3 id="YCbCr.ColorModel">func (*YCbCr) <span>ColorModel</span> </h3> <pre data-language="go">func (p *YCbCr) ColorModel() color.Model</pre> <h3 id="YCbCr.Opaque">func (*YCbCr) <span>Opaque</span> </h3> <pre data-language="go">func (p *YCbCr) Opaque() bool</pre> <h3 id="YCbCr.RGBA64At">func (*YCbCr) <span>RGBA64At</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (p *YCbCr) RGBA64At(x, y int) color.RGBA64</pre> <h3 id="YCbCr.SubImage">func (*YCbCr) <span>SubImage</span> </h3> <pre data-language="go">func (p *YCbCr) SubImage(r Rectangle) Image</pre> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p>
+<h3 id="YCbCr.YCbCrAt">func (*YCbCr) <span>YCbCrAt</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (p *YCbCr) YCbCrAt(x, y int) color.YCbCr</pre> <h3 id="YCbCr.YOffset">func (*YCbCr) <span>YOffset</span> </h3> <pre data-language="go">func (p *YCbCr) YOffset(x, y int) int</pre> <p>YOffset returns the index of the first element of Y that corresponds to the pixel at (x, y). </p>
+<h2 id="YCbCrSubsampleRatio">type <span>YCbCrSubsampleRatio</span> </h2> <p>YCbCrSubsampleRatio is the chroma subsample ratio used in a YCbCr image. </p>
+<pre data-language="go">type YCbCrSubsampleRatio int</pre> <pre data-language="go">const (
+ YCbCrSubsampleRatio444 YCbCrSubsampleRatio = iota
+ YCbCrSubsampleRatio422
+ YCbCrSubsampleRatio420
+ YCbCrSubsampleRatio440
+ YCbCrSubsampleRatio411
+ YCbCrSubsampleRatio410
+)</pre> <h3 id="YCbCrSubsampleRatio.String">func (YCbCrSubsampleRatio) <span>String</span> </h3> <pre data-language="go">func (s YCbCrSubsampleRatio) String() string</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="color/index">color</a> </td> <td class="pkg-synopsis"> Package color implements a basic color library. </td> </tr> <tr> <td class="pkg-name"> <a href="color/palette/index">palette</a> </td> <td class="pkg-synopsis"> Package palette provides standard color palettes. </td> </tr> <tr> <td class="pkg-name"> <a href="draw/index">draw</a> </td> <td class="pkg-synopsis"> Package draw provides image composition functions. </td> </tr> <tr> <td class="pkg-name"> <a href="gif/index">gif</a> </td> <td class="pkg-synopsis"> Package gif implements a GIF image decoder and encoder. </td> </tr> <tr> <td class="pkg-name"> <a href="jpeg/index">jpeg</a> </td> <td class="pkg-synopsis"> Package jpeg implements a JPEG image decoder and encoder. </td> </tr> <tr> <td class="pkg-name"> <a href="png/index">png</a> </td> <td class="pkg-synopsis"> Package png implements a PNG image decoder and encoder. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/image/" class="_attribution-link">http://golang.org/pkg/image/</a>
+ </p>
+</div>
diff --git a/devdocs/go/image%2Fjpeg%2Findex.html b/devdocs/go/image%2Fjpeg%2Findex.html
new file mode 100644
index 00000000..7b4c616f
--- /dev/null
+++ b/devdocs/go/image%2Fjpeg%2Findex.html
@@ -0,0 +1,38 @@
+<h1> Package jpeg </h1> <ul id="short-nav">
+<li><code>import "image/jpeg"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package jpeg implements a JPEG image decoder and encoder. </p>
+<p>JPEG is defined in ITU-T T.81: <a href="https://www.w3.org/Graphics/JPEG/itu-t81.pdf">https://www.w3.org/Graphics/JPEG/itu-t81.pdf</a>. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Decode">func Decode(r io.Reader) (image.Image, error)</a></li>
+<li><a href="#DecodeConfig">func DecodeConfig(r io.Reader) (image.Config, error)</a></li>
+<li><a href="#Encode">func Encode(w io.Writer, m image.Image, o *Options) error</a></li>
+<li><a href="#FormatError">type FormatError</a></li>
+<li> <a href="#FormatError.Error">func (e FormatError) Error() string</a>
+</li>
+<li><a href="#Options">type Options</a></li>
+<li><a href="#Reader">type Reader</a></li>
+<li><a href="#UnsupportedError">type UnsupportedError</a></li>
+<li> <a href="#UnsupportedError.Error">func (e UnsupportedError) Error() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>fdct.go</span> <span>huffman.go</span> <span>idct.go</span> <span>reader.go</span> <span>scan.go</span> <span>writer.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>DefaultQuality is the default quality encoding parameter. </p>
+<pre data-language="go">const DefaultQuality = 75</pre> <h2 id="Decode">func <span>Decode</span> </h2> <pre data-language="go">func Decode(r io.Reader) (image.Image, error)</pre> <p>Decode reads a JPEG image from r and returns it as an <span>image.Image</span>. </p>
+<h2 id="DecodeConfig">func <span>DecodeConfig</span> </h2> <pre data-language="go">func DecodeConfig(r io.Reader) (image.Config, error)</pre> <p>DecodeConfig returns the color model and dimensions of a JPEG image without decoding the entire image. </p>
+<h2 id="Encode">func <span>Encode</span> </h2> <pre data-language="go">func Encode(w io.Writer, m image.Image, o *Options) error</pre> <p>Encode writes the Image m to w in JPEG 4:2:0 baseline format with the given options. Default parameters are used if a nil *<a href="#Options">Options</a> is passed. </p>
+<h2 id="FormatError">type <span>FormatError</span> </h2> <p>A FormatError reports that the input is not a valid JPEG. </p>
+<pre data-language="go">type FormatError string</pre> <h3 id="FormatError.Error">func (FormatError) <span>Error</span> </h3> <pre data-language="go">func (e FormatError) Error() string</pre> <h2 id="Options">type <span>Options</span> </h2> <p>Options are the encoding parameters. Quality ranges from 1 to 100 inclusive, higher is better. </p>
+<pre data-language="go">type Options struct {
+ Quality int
+}
+</pre> <h2 id="Reader">type <span>Reader</span> </h2> <p>Deprecated: Reader is not used by the <span>image/jpeg</span> package and should not be used by others. It is kept for compatibility. </p>
+<pre data-language="go">type Reader interface {
+ io.ByteReader
+ io.Reader
+}</pre> <h2 id="UnsupportedError">type <span>UnsupportedError</span> </h2> <p>An UnsupportedError reports that the input uses a valid but unimplemented JPEG feature. </p>
+<pre data-language="go">type UnsupportedError string</pre> <h3 id="UnsupportedError.Error">func (UnsupportedError) <span>Error</span> </h3> <pre data-language="go">func (e UnsupportedError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/image/jpeg/" class="_attribution-link">http://golang.org/pkg/image/jpeg/</a>
+ </p>
+</div>
diff --git a/devdocs/go/image%2Fpng%2Findex.html b/devdocs/go/image%2Fpng%2Findex.html
new file mode 100644
index 00000000..81d127b6
--- /dev/null
+++ b/devdocs/go/image%2Fpng%2Findex.html
@@ -0,0 +1,104 @@
+<h1> Package png </h1> <ul id="short-nav">
+<li><code>import "image/png"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package png implements a PNG image decoder and encoder. </p>
+<p>The PNG specification is at <a href="https://www.w3.org/TR/PNG/">https://www.w3.org/TR/PNG/</a>. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Decode">func Decode(r io.Reader) (image.Image, error)</a></li>
+<li><a href="#DecodeConfig">func DecodeConfig(r io.Reader) (image.Config, error)</a></li>
+<li><a href="#Encode">func Encode(w io.Writer, m image.Image) error</a></li>
+<li><a href="#CompressionLevel">type CompressionLevel</a></li>
+<li><a href="#Encoder">type Encoder</a></li>
+<li> <a href="#Encoder.Encode">func (enc *Encoder) Encode(w io.Writer, m image.Image) error</a>
+</li>
+<li><a href="#EncoderBuffer">type EncoderBuffer</a></li>
+<li><a href="#EncoderBufferPool">type EncoderBufferPool</a></li>
+<li><a href="#FormatError">type FormatError</a></li>
+<li> <a href="#FormatError.Error">func (e FormatError) Error() string</a>
+</li>
+<li><a href="#UnsupportedError">type UnsupportedError</a></li>
+<li> <a href="#UnsupportedError.Error">func (e UnsupportedError) Error() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Decode">Decode</a></dd> <dd><a class="exampleLink" href="#example_Encode">Encode</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>paeth.go</span> <span>reader.go</span> <span>writer.go</span> </p> <h2 id="Decode">func <span>Decode</span> </h2> <pre data-language="go">func Decode(r io.Reader) (image.Image, error)</pre> <p>Decode reads a PNG image from r and returns it as an <span>image.Image</span>. The type of Image returned depends on the PNG contents. </p> <h4 id="example_Decode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// This example uses png.Decode which can only decode PNG images.
+// Consider using the general image.Decode as it can sniff and decode any registered image format.
+img, err := png.Decode(gopherPNG())
+if err != nil {
+ log.Fatal(err)
+}
+
+levels := []string{" ", "░", "▒", "▓", "█"}
+
+for y := img.Bounds().Min.Y; y &lt; img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x &lt; img.Bounds().Max.X; x++ {
+ c := color.GrayModel.Convert(img.At(x, y)).(color.Gray)
+ level := c.Y / 51 // 51 * 5 = 255
+ if level == 5 {
+ level--
+ }
+ fmt.Print(levels[level])
+ }
+ fmt.Print("\n")
+}
+</pre> <h2 id="DecodeConfig">func <span>DecodeConfig</span> </h2> <pre data-language="go">func DecodeConfig(r io.Reader) (image.Config, error)</pre> <p>DecodeConfig returns the color model and dimensions of a PNG image without decoding the entire image. </p>
+<h2 id="Encode">func <span>Encode</span> </h2> <pre data-language="go">func Encode(w io.Writer, m image.Image) error</pre> <p>Encode writes the Image m to w in PNG format. Any Image may be encoded, but images that are not <span>image.NRGBA</span> might be encoded lossily. </p> <h4 id="example_Encode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+const width, height = 256, 256
+
+// Create a colored image of the given width and height.
+img := image.NewNRGBA(image.Rect(0, 0, width, height))
+
+for y := 0; y &lt; height; y++ {
+ for x := 0; x &lt; width; x++ {
+ img.Set(x, y, color.NRGBA{
+ R: uint8((x + y) &amp; 255),
+ G: uint8((x + y) &lt;&lt; 1 &amp; 255),
+ B: uint8((x + y) &lt;&lt; 2 &amp; 255),
+ A: 255,
+ })
+ }
+}
+
+f, err := os.Create("image.png")
+if err != nil {
+ log.Fatal(err)
+}
+
+if err := png.Encode(f, img); err != nil {
+ f.Close()
+ log.Fatal(err)
+}
+
+if err := f.Close(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="CompressionLevel">type <span>CompressionLevel</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>CompressionLevel indicates the compression level. </p>
+<pre data-language="go">type CompressionLevel int</pre> <pre data-language="go">const (
+ DefaultCompression CompressionLevel = 0
+ NoCompression CompressionLevel = -1
+ BestSpeed CompressionLevel = -2
+ BestCompression CompressionLevel = -3
+)</pre> <h2 id="Encoder">type <span>Encoder</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>Encoder configures encoding PNG images. </p>
+<pre data-language="go">type Encoder struct {
+ CompressionLevel CompressionLevel
+
+ // BufferPool optionally specifies a buffer pool to get temporary
+ // EncoderBuffers when encoding an image.
+ BufferPool EncoderBufferPool // Go 1.9
+}
+</pre> <h3 id="Encoder.Encode">func (*Encoder) <span>Encode</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (enc *Encoder) Encode(w io.Writer, m image.Image) error</pre> <p>Encode writes the Image m to w in PNG format. </p>
+<h2 id="EncoderBuffer">type <span>EncoderBuffer</span> <span title="Added in Go 1.9">1.9</span> </h2> <p>EncoderBuffer holds the buffers used for encoding PNG images. </p>
+<pre data-language="go">type EncoderBuffer encoder</pre> <h2 id="EncoderBufferPool">type <span>EncoderBufferPool</span> <span title="Added in Go 1.9">1.9</span> </h2> <p>EncoderBufferPool is an interface for getting and returning temporary instances of the <a href="#EncoderBuffer">EncoderBuffer</a> struct. This can be used to reuse buffers when encoding multiple images. </p>
+<pre data-language="go">type EncoderBufferPool interface {
+ Get() *EncoderBuffer
+ Put(*EncoderBuffer)
+}</pre> <h2 id="FormatError">type <span>FormatError</span> </h2> <p>A FormatError reports that the input is not a valid PNG. </p>
+<pre data-language="go">type FormatError string</pre> <h3 id="FormatError.Error">func (FormatError) <span>Error</span> </h3> <pre data-language="go">func (e FormatError) Error() string</pre> <h2 id="UnsupportedError">type <span>UnsupportedError</span> </h2> <p>An UnsupportedError reports that the input uses a valid but unimplemented PNG feature. </p>
+<pre data-language="go">type UnsupportedError string</pre> <h3 id="UnsupportedError.Error">func (UnsupportedError) <span>Error</span> </h3> <pre data-language="go">func (e UnsupportedError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/image/png/" class="_attribution-link">http://golang.org/pkg/image/png/</a>
+ </p>
+</div>
diff --git a/devdocs/go/index b/devdocs/go/index
new file mode 100644
index 00000000..5166adbf
--- /dev/null
+++ b/devdocs/go/index
@@ -0,0 +1 @@
+((pages . ["index" "arena/index" "builtin/index" "archive/tar/index" "archive/zip/index" "bufio/index" "cmp/index" "compress/bzip2/index" "compress/flate/index" "compress/gzip/index" "compress/lzw/index" "compress/zlib/index" "container/heap/index" "container/list/index" "container/ring/index" "context/index" "crypto/index" "crypto/aes/index" "crypto/boring/index" "crypto/cipher/index" "crypto/des/index" "bytes/index" "crypto/dsa/index" "crypto/ecdh/index" "crypto/ecdsa/index" "crypto/ed25519/index" "crypto/elliptic/index" "crypto/hmac/index" "crypto/md5/index" "crypto/rand/index" "crypto/rc4/index" "crypto/rsa/index" "crypto/sha1/index" "crypto/sha256/index" "crypto/sha512/index" "crypto/subtle/index" "crypto/tls/index" "crypto/tls/fipsonly/index" "crypto/x509/index" "crypto/x509/pkix/index" "database/sql/index" "database/sql/driver/index" "debug/buildinfo/index" "debug/dwarf/index" "debug/elf/index" "debug/gosym/index" "debug/macho/index" "debug/pe/index" "debug/plan9obj/index" "embed/index" "encoding/index" "encoding/ascii85/index" "encoding/asn1/index" "encoding/base32/index" "encoding/base64/index" "encoding/binary/index" "encoding/csv/index" "encoding/gob/index" "encoding/hex/index" "encoding/json/index" "encoding/pem/index" "errors/index" "expvar/index" "flag/index" "fmt/index" "go/build/index" "go/build/constraint/index" "go/constant/index" "go/doc/index" "go/doc/comment/index" "go/format/index" "go/importer/index" "go/parser/index" "go/printer/index" "go/scanner/index" "go/token/index" "encoding/xml/index" "go/ast/index" "go/types/index" "go/version/index" "hash/index" "hash/adler32/index" "hash/crc32/index" "hash/crc64/index" "hash/fnv/index" "hash/maphash/index" "html/index" "html/template/index" "image/index" "image/color/index" "image/color/palette/index" "image/draw/index" "image/gif/index" "image/jpeg/index" "image/png/index" "index/suffixarray/index" "io/index" "io/fs/index" "io/ioutil/index" "iter/index" "log/index" "log/slog/index" "log/syslog/index" "maps/index" "math/index" "math/big/index" "math/bits/index" "math/cmplx/index" "math/rand/index" "math/rand/v2/index" "mime/index" "mime/multipart/index" "mime/quotedprintable/index" "net/index" "net/http/index" "net/http/cgi/index" "net/http/cookiejar/index" "net/http/fcgi/index" "net/http/httptest/index" "net/http/httptrace/index" "net/http/httputil/index" "net/http/pprof/index" "net/mail/index" "net/netip/index" "net/rpc/index" "net/rpc/jsonrpc/index" "net/smtp/index" "net/textproto/index" "net/url/index" "os/index" "os/exec/index" "os/signal/index" "os/user/index" "path/index" "path/filepath/index" "plugin/index" "reflect/index" "regexp/index" "regexp/syntax/index" "runtime/asan/index" "runtime/cgo/index" "runtime/coverage/index" "runtime/debug/index" "runtime/metrics/index" "runtime/pprof/index" "runtime/race/index" "runtime/trace/index" "slices/index" "sort/index" "strconv/index" "strings/index" "sync/index" "sync/atomic/index" "runtime/index" "syscall/index" "syscall/js/index" "testing/index" "testing/fstest/index" "testing/iotest/index" "testing/quick/index" "testing/slogtest/index" "text/scanner/index" "text/tabwriter/index" "text/template/index" "text/template/parse/index" "time/index" "time/tzdata/index" "unicode/index" "unicode/utf16/index" "unicode/utf8/index" "unsafe/index" "net/http/internal/index" "internal/goarch/index" "internal/goos/index"]) (entries . [((name . "adler32.Checksum()") (path . "hash/adler32/index#Checksum") (type . "hash")) ((name . "adler32.New()") (path . "hash/adler32/index#New") (type . "hash")) ((name . "aes.KeySizeError") (path . "crypto/aes/index#KeySizeError") (type . "crypto")) ((name . "aes.KeySizeError.Error()") (path . "crypto/aes/index#KeySizeError.Error") (type . "crypto")) ((name . "aes.NewCipher()") (path . "crypto/aes/index#NewCipher") (type . "crypto")) ((name . "archive/tar") (path . "archive/tar/index") (type . "archive")) ((name . "archive/tar constants") (path . "archive/tar/index#pkg-constants") (type . "archive")) ((name . "archive/tar variables") (path . "archive/tar/index#pkg-variables") (type . "archive")) ((name . "archive/zip") (path . "archive/zip/index") (type . "archive")) ((name . "archive/zip constants") (path . "archive/zip/index#pkg-constants") (type . "archive")) ((name . "archive/zip variables") (path . "archive/zip/index#pkg-variables") (type . "archive")) ((name . "ascii85.CorruptInputError") (path . "encoding/ascii85/index#CorruptInputError") (type . "encoding")) ((name . "ascii85.CorruptInputError.Error()") (path . "encoding/ascii85/index#CorruptInputError.Error") (type . "encoding")) ((name . "ascii85.Decode()") (path . "encoding/ascii85/index#Decode") (type . "encoding")) ((name . "ascii85.Encode()") (path . "encoding/ascii85/index#Encode") (type . "encoding")) ((name . "ascii85.MaxEncodedLen()") (path . "encoding/ascii85/index#MaxEncodedLen") (type . "encoding")) ((name . "ascii85.NewDecoder()") (path . "encoding/ascii85/index#NewDecoder") (type . "encoding")) ((name . "ascii85.NewEncoder()") (path . "encoding/ascii85/index#NewEncoder") (type . "encoding")) ((name . "asn1.BitString") (path . "encoding/asn1/index#BitString") (type . "encoding")) ((name . "asn1.BitString.At()") (path . "encoding/asn1/index#BitString.At") (type . "encoding")) ((name . "asn1.BitString.RightAlign()") (path . "encoding/asn1/index#BitString.RightAlign") (type . "encoding")) ((name . "asn1.Enumerated") (path . "encoding/asn1/index#Enumerated") (type . "encoding")) ((name . "asn1.Flag") (path . "encoding/asn1/index#Flag") (type . "encoding")) ((name . "asn1.Marshal()") (path . "encoding/asn1/index#Marshal") (type . "encoding")) ((name . "asn1.MarshalWithParams()") (path . "encoding/asn1/index#MarshalWithParams") (type . "encoding")) ((name . "asn1.ObjectIdentifier") (path . "encoding/asn1/index#ObjectIdentifier") (type . "encoding")) ((name . "asn1.ObjectIdentifier.Equal()") (path . "encoding/asn1/index#ObjectIdentifier.Equal") (type . "encoding")) ((name . "asn1.ObjectIdentifier.String()") (path . "encoding/asn1/index#ObjectIdentifier.String") (type . "encoding")) ((name . "asn1.RawContent") (path . "encoding/asn1/index#RawContent") (type . "encoding")) ((name . "asn1.RawValue") (path . "encoding/asn1/index#RawValue") (type . "encoding")) ((name . "asn1.StructuralError") (path . "encoding/asn1/index#StructuralError") (type . "encoding")) ((name . "asn1.StructuralError.Error()") (path . "encoding/asn1/index#StructuralError.Error") (type . "encoding")) ((name . "asn1.SyntaxError") (path . "encoding/asn1/index#SyntaxError") (type . "encoding")) ((name . "asn1.SyntaxError.Error()") (path . "encoding/asn1/index#SyntaxError.Error") (type . "encoding")) ((name . "asn1.Unmarshal()") (path . "encoding/asn1/index#Unmarshal") (type . "encoding")) ((name . "asn1.UnmarshalWithParams()") (path . "encoding/asn1/index#UnmarshalWithParams") (type . "encoding")) ((name . "ast.ArrayType") (path . "go/ast/index#ArrayType") (type . "go")) ((name . "ast.ArrayType.End()") (path . "go/ast/index#ArrayType.End") (type . "go")) ((name . "ast.ArrayType.Pos()") (path . "go/ast/index#ArrayType.Pos") (type . "go")) ((name . "ast.AssignStmt") (path . "go/ast/index#AssignStmt") (type . "go")) ((name . "ast.AssignStmt.End()") (path . "go/ast/index#AssignStmt.End") (type . "go")) ((name . "ast.AssignStmt.Pos()") (path . "go/ast/index#AssignStmt.Pos") (type . "go")) ((name . "ast.BadDecl") (path . "go/ast/index#BadDecl") (type . "go")) ((name . "ast.BadDecl.End()") (path . "go/ast/index#BadDecl.End") (type . "go")) ((name . "ast.BadDecl.Pos()") (path . "go/ast/index#BadDecl.Pos") (type . "go")) ((name . "ast.BadExpr") (path . "go/ast/index#BadExpr") (type . "go")) ((name . "ast.BadExpr.End()") (path . "go/ast/index#BadExpr.End") (type . "go")) ((name . "ast.BadExpr.Pos()") (path . "go/ast/index#BadExpr.Pos") (type . "go")) ((name . "ast.BadStmt") (path . "go/ast/index#BadStmt") (type . "go")) ((name . "ast.BadStmt.End()") (path . "go/ast/index#BadStmt.End") (type . "go")) ((name . "ast.BadStmt.Pos()") (path . "go/ast/index#BadStmt.Pos") (type . "go")) ((name . "ast.BasicLit") (path . "go/ast/index#BasicLit") (type . "go")) ((name . "ast.BasicLit.End()") (path . "go/ast/index#BasicLit.End") (type . "go")) ((name . "ast.BasicLit.Pos()") (path . "go/ast/index#BasicLit.Pos") (type . "go")) ((name . "ast.BinaryExpr") (path . "go/ast/index#BinaryExpr") (type . "go")) ((name . "ast.BinaryExpr.End()") (path . "go/ast/index#BinaryExpr.End") (type . "go")) ((name . "ast.BinaryExpr.Pos()") (path . "go/ast/index#BinaryExpr.Pos") (type . "go")) ((name . "ast.BlockStmt") (path . "go/ast/index#BlockStmt") (type . "go")) ((name . "ast.BlockStmt.End()") (path . "go/ast/index#BlockStmt.End") (type . "go")) ((name . "ast.BlockStmt.Pos()") (path . "go/ast/index#BlockStmt.Pos") (type . "go")) ((name . "ast.BranchStmt") (path . "go/ast/index#BranchStmt") (type . "go")) ((name . "ast.BranchStmt.End()") (path . "go/ast/index#BranchStmt.End") (type . "go")) ((name . "ast.BranchStmt.Pos()") (path . "go/ast/index#BranchStmt.Pos") (type . "go")) ((name . "ast.CallExpr") (path . "go/ast/index#CallExpr") (type . "go")) ((name . "ast.CallExpr.End()") (path . "go/ast/index#CallExpr.End") (type . "go")) ((name . "ast.CallExpr.Pos()") (path . "go/ast/index#CallExpr.Pos") (type . "go")) ((name . "ast.CaseClause") (path . "go/ast/index#CaseClause") (type . "go")) ((name . "ast.CaseClause.End()") (path . "go/ast/index#CaseClause.End") (type . "go")) ((name . "ast.CaseClause.Pos()") (path . "go/ast/index#CaseClause.Pos") (type . "go")) ((name . "ast.ChanDir") (path . "go/ast/index#ChanDir") (type . "go")) ((name . "ast.ChanType") (path . "go/ast/index#ChanType") (type . "go")) ((name . "ast.ChanType.End()") (path . "go/ast/index#ChanType.End") (type . "go")) ((name . "ast.ChanType.Pos()") (path . "go/ast/index#ChanType.Pos") (type . "go")) ((name . "ast.CommClause") (path . "go/ast/index#CommClause") (type . "go")) ((name . "ast.CommClause.End()") (path . "go/ast/index#CommClause.End") (type . "go")) ((name . "ast.CommClause.Pos()") (path . "go/ast/index#CommClause.Pos") (type . "go")) ((name . "ast.Comment") (path . "go/ast/index#Comment") (type . "go")) ((name . "ast.Comment.End()") (path . "go/ast/index#Comment.End") (type . "go")) ((name . "ast.Comment.Pos()") (path . "go/ast/index#Comment.Pos") (type . "go")) ((name . "ast.CommentGroup") (path . "go/ast/index#CommentGroup") (type . "go")) ((name . "ast.CommentGroup.End()") (path . "go/ast/index#CommentGroup.End") (type . "go")) ((name . "ast.CommentGroup.Pos()") (path . "go/ast/index#CommentGroup.Pos") (type . "go")) ((name . "ast.CommentGroup.Text()") (path . "go/ast/index#CommentGroup.Text") (type . "go")) ((name . "ast.CommentMap") (path . "go/ast/index#CommentMap") (type . "go")) ((name . "ast.CommentMap.Comments()") (path . "go/ast/index#CommentMap.Comments") (type . "go")) ((name . "ast.CommentMap.Filter()") (path . "go/ast/index#CommentMap.Filter") (type . "go")) ((name . "ast.CommentMap.String()") (path . "go/ast/index#CommentMap.String") (type . "go")) ((name . "ast.CommentMap.Update()") (path . "go/ast/index#CommentMap.Update") (type . "go")) ((name . "ast.CompositeLit") (path . "go/ast/index#CompositeLit") (type . "go")) ((name . "ast.CompositeLit.End()") (path . "go/ast/index#CompositeLit.End") (type . "go")) ((name . "ast.CompositeLit.Pos()") (path . "go/ast/index#CompositeLit.Pos") (type . "go")) ((name . "ast.Decl") (path . "go/ast/index#Decl") (type . "go")) ((name . "ast.DeclStmt") (path . "go/ast/index#DeclStmt") (type . "go")) ((name . "ast.DeclStmt.End()") (path . "go/ast/index#DeclStmt.End") (type . "go")) ((name . "ast.DeclStmt.Pos()") (path . "go/ast/index#DeclStmt.Pos") (type . "go")) ((name . "ast.DeferStmt") (path . "go/ast/index#DeferStmt") (type . "go")) ((name . "ast.DeferStmt.End()") (path . "go/ast/index#DeferStmt.End") (type . "go")) ((name . "ast.DeferStmt.Pos()") (path . "go/ast/index#DeferStmt.Pos") (type . "go")) ((name . "ast.Ellipsis") (path . "go/ast/index#Ellipsis") (type . "go")) ((name . "ast.Ellipsis.End()") (path . "go/ast/index#Ellipsis.End") (type . "go")) ((name . "ast.Ellipsis.Pos()") (path . "go/ast/index#Ellipsis.Pos") (type . "go")) ((name . "ast.EmptyStmt") (path . "go/ast/index#EmptyStmt") (type . "go")) ((name . "ast.EmptyStmt.End()") (path . "go/ast/index#EmptyStmt.End") (type . "go")) ((name . "ast.EmptyStmt.Pos()") (path . "go/ast/index#EmptyStmt.Pos") (type . "go")) ((name . "ast.Expr") (path . "go/ast/index#Expr") (type . "go")) ((name . "ast.ExprStmt") (path . "go/ast/index#ExprStmt") (type . "go")) ((name . "ast.ExprStmt.End()") (path . "go/ast/index#ExprStmt.End") (type . "go")) ((name . "ast.ExprStmt.Pos()") (path . "go/ast/index#ExprStmt.Pos") (type . "go")) ((name . "ast.Field") (path . "go/ast/index#Field") (type . "go")) ((name . "ast.Field.End()") (path . "go/ast/index#Field.End") (type . "go")) ((name . "ast.Field.Pos()") (path . "go/ast/index#Field.Pos") (type . "go")) ((name . "ast.FieldFilter") (path . "go/ast/index#FieldFilter") (type . "go")) ((name . "ast.FieldList") (path . "go/ast/index#FieldList") (type . "go")) ((name . "ast.FieldList.End()") (path . "go/ast/index#FieldList.End") (type . "go")) ((name . "ast.FieldList.NumFields()") (path . "go/ast/index#FieldList.NumFields") (type . "go")) ((name . "ast.FieldList.Pos()") (path . "go/ast/index#FieldList.Pos") (type . "go")) ((name . "ast.File") (path . "go/ast/index#File") (type . "go")) ((name . "ast.File.End()") (path . "go/ast/index#File.End") (type . "go")) ((name . "ast.File.Pos()") (path . "go/ast/index#File.Pos") (type . "go")) ((name . "ast.FileExports()") (path . "go/ast/index#FileExports") (type . "go")) ((name . "ast.Filter") (path . "go/ast/index#Filter") (type . "go")) ((name . "ast.FilterDecl()") (path . "go/ast/index#FilterDecl") (type . "go")) ((name . "ast.FilterFile()") (path . "go/ast/index#FilterFile") (type . "go")) ((name . "ast.FilterPackage()") (path . "go/ast/index#FilterPackage") (type . "go")) ((name . "ast.ForStmt") (path . "go/ast/index#ForStmt") (type . "go")) ((name . "ast.ForStmt.End()") (path . "go/ast/index#ForStmt.End") (type . "go")) ((name . "ast.ForStmt.Pos()") (path . "go/ast/index#ForStmt.Pos") (type . "go")) ((name . "ast.Fprint()") (path . "go/ast/index#Fprint") (type . "go")) ((name . "ast.FuncDecl") (path . "go/ast/index#FuncDecl") (type . "go")) ((name . "ast.FuncDecl.End()") (path . "go/ast/index#FuncDecl.End") (type . "go")) ((name . "ast.FuncDecl.Pos()") (path . "go/ast/index#FuncDecl.Pos") (type . "go")) ((name . "ast.FuncLit") (path . "go/ast/index#FuncLit") (type . "go")) ((name . "ast.FuncLit.End()") (path . "go/ast/index#FuncLit.End") (type . "go")) ((name . "ast.FuncLit.Pos()") (path . "go/ast/index#FuncLit.Pos") (type . "go")) ((name . "ast.FuncType") (path . "go/ast/index#FuncType") (type . "go")) ((name . "ast.FuncType.End()") (path . "go/ast/index#FuncType.End") (type . "go")) ((name . "ast.FuncType.Pos()") (path . "go/ast/index#FuncType.Pos") (type . "go")) ((name . "ast.GenDecl") (path . "go/ast/index#GenDecl") (type . "go")) ((name . "ast.GenDecl.End()") (path . "go/ast/index#GenDecl.End") (type . "go")) ((name . "ast.GenDecl.Pos()") (path . "go/ast/index#GenDecl.Pos") (type . "go")) ((name . "ast.GoStmt") (path . "go/ast/index#GoStmt") (type . "go")) ((name . "ast.GoStmt.End()") (path . "go/ast/index#GoStmt.End") (type . "go")) ((name . "ast.GoStmt.Pos()") (path . "go/ast/index#GoStmt.Pos") (type . "go")) ((name . "ast.Ident") (path . "go/ast/index#Ident") (type . "go")) ((name . "ast.Ident.End()") (path . "go/ast/index#Ident.End") (type . "go")) ((name . "ast.Ident.IsExported()") (path . "go/ast/index#Ident.IsExported") (type . "go")) ((name . "ast.Ident.Pos()") (path . "go/ast/index#Ident.Pos") (type . "go")) ((name . "ast.Ident.String()") (path . "go/ast/index#Ident.String") (type . "go")) ((name . "ast.IfStmt") (path . "go/ast/index#IfStmt") (type . "go")) ((name . "ast.IfStmt.End()") (path . "go/ast/index#IfStmt.End") (type . "go")) ((name . "ast.IfStmt.Pos()") (path . "go/ast/index#IfStmt.Pos") (type . "go")) ((name . "ast.Importer") (path . "go/ast/index#Importer") (type . "go")) ((name . "ast.ImportSpec") (path . "go/ast/index#ImportSpec") (type . "go")) ((name . "ast.ImportSpec.End()") (path . "go/ast/index#ImportSpec.End") (type . "go")) ((name . "ast.ImportSpec.Pos()") (path . "go/ast/index#ImportSpec.Pos") (type . "go")) ((name . "ast.IncDecStmt") (path . "go/ast/index#IncDecStmt") (type . "go")) ((name . "ast.IncDecStmt.End()") (path . "go/ast/index#IncDecStmt.End") (type . "go")) ((name . "ast.IncDecStmt.Pos()") (path . "go/ast/index#IncDecStmt.Pos") (type . "go")) ((name . "ast.IndexExpr") (path . "go/ast/index#IndexExpr") (type . "go")) ((name . "ast.IndexExpr.End()") (path . "go/ast/index#IndexExpr.End") (type . "go")) ((name . "ast.IndexExpr.Pos()") (path . "go/ast/index#IndexExpr.Pos") (type . "go")) ((name . "ast.IndexListExpr") (path . "go/ast/index#IndexListExpr") (type . "go")) ((name . "ast.IndexListExpr.End()") (path . "go/ast/index#IndexListExpr.End") (type . "go")) ((name . "ast.IndexListExpr.Pos()") (path . "go/ast/index#IndexListExpr.Pos") (type . "go")) ((name . "ast.Inspect()") (path . "go/ast/index#Inspect") (type . "go")) ((name . "ast.InterfaceType") (path . "go/ast/index#InterfaceType") (type . "go")) ((name . "ast.InterfaceType.End()") (path . "go/ast/index#InterfaceType.End") (type . "go")) ((name . "ast.InterfaceType.Pos()") (path . "go/ast/index#InterfaceType.Pos") (type . "go")) ((name . "ast.IsExported()") (path . "go/ast/index#IsExported") (type . "go")) ((name . "ast.IsGenerated()") (path . "go/ast/index#IsGenerated") (type . "go")) ((name . "ast.KeyValueExpr") (path . "go/ast/index#KeyValueExpr") (type . "go")) ((name . "ast.KeyValueExpr.End()") (path . "go/ast/index#KeyValueExpr.End") (type . "go")) ((name . "ast.KeyValueExpr.Pos()") (path . "go/ast/index#KeyValueExpr.Pos") (type . "go")) ((name . "ast.LabeledStmt") (path . "go/ast/index#LabeledStmt") (type . "go")) ((name . "ast.LabeledStmt.End()") (path . "go/ast/index#LabeledStmt.End") (type . "go")) ((name . "ast.LabeledStmt.Pos()") (path . "go/ast/index#LabeledStmt.Pos") (type . "go")) ((name . "ast.MapType") (path . "go/ast/index#MapType") (type . "go")) ((name . "ast.MapType.End()") (path . "go/ast/index#MapType.End") (type . "go")) ((name . "ast.MapType.Pos()") (path . "go/ast/index#MapType.Pos") (type . "go")) ((name . "ast.MergeMode") (path . "go/ast/index#MergeMode") (type . "go")) ((name . "ast.MergePackageFiles()") (path . "go/ast/index#MergePackageFiles") (type . "go")) ((name . "ast.NewCommentMap()") (path . "go/ast/index#NewCommentMap") (type . "go")) ((name . "ast.NewIdent()") (path . "go/ast/index#NewIdent") (type . "go")) ((name . "ast.NewObj()") (path . "go/ast/index#NewObj") (type . "go")) ((name . "ast.NewPackage()") (path . "go/ast/index#NewPackage") (type . "go")) ((name . "ast.NewScope()") (path . "go/ast/index#NewScope") (type . "go")) ((name . "ast.Node") (path . "go/ast/index#Node") (type . "go")) ((name . "ast.NotNilFilter()") (path . "go/ast/index#NotNilFilter") (type . "go")) ((name . "ast.Object") (path . "go/ast/index#Object") (type . "go")) ((name . "ast.Object.Pos()") (path . "go/ast/index#Object.Pos") (type . "go")) ((name . "ast.ObjKind") (path . "go/ast/index#ObjKind") (type . "go")) ((name . "ast.ObjKind.String()") (path . "go/ast/index#ObjKind.String") (type . "go")) ((name . "ast.Package") (path . "go/ast/index#Package") (type . "go")) ((name . "ast.Package.End()") (path . "go/ast/index#Package.End") (type . "go")) ((name . "ast.Package.Pos()") (path . "go/ast/index#Package.Pos") (type . "go")) ((name . "ast.PackageExports()") (path . "go/ast/index#PackageExports") (type . "go")) ((name . "ast.ParenExpr") (path . "go/ast/index#ParenExpr") (type . "go")) ((name . "ast.ParenExpr.End()") (path . "go/ast/index#ParenExpr.End") (type . "go")) ((name . "ast.ParenExpr.Pos()") (path . "go/ast/index#ParenExpr.Pos") (type . "go")) ((name . "ast.Print()") (path . "go/ast/index#Print") (type . "go")) ((name . "ast.RangeStmt") (path . "go/ast/index#RangeStmt") (type . "go")) ((name . "ast.RangeStmt.End()") (path . "go/ast/index#RangeStmt.End") (type . "go")) ((name . "ast.RangeStmt.Pos()") (path . "go/ast/index#RangeStmt.Pos") (type . "go")) ((name . "ast.ReturnStmt") (path . "go/ast/index#ReturnStmt") (type . "go")) ((name . "ast.ReturnStmt.End()") (path . "go/ast/index#ReturnStmt.End") (type . "go")) ((name . "ast.ReturnStmt.Pos()") (path . "go/ast/index#ReturnStmt.Pos") (type . "go")) ((name . "ast.Scope") (path . "go/ast/index#Scope") (type . "go")) ((name . "ast.Scope.Insert()") (path . "go/ast/index#Scope.Insert") (type . "go")) ((name . "ast.Scope.Lookup()") (path . "go/ast/index#Scope.Lookup") (type . "go")) ((name . "ast.Scope.String()") (path . "go/ast/index#Scope.String") (type . "go")) ((name . "ast.SelectorExpr") (path . "go/ast/index#SelectorExpr") (type . "go")) ((name . "ast.SelectorExpr.End()") (path . "go/ast/index#SelectorExpr.End") (type . "go")) ((name . "ast.SelectorExpr.Pos()") (path . "go/ast/index#SelectorExpr.Pos") (type . "go")) ((name . "ast.SelectStmt") (path . "go/ast/index#SelectStmt") (type . "go")) ((name . "ast.SelectStmt.End()") (path . "go/ast/index#SelectStmt.End") (type . "go")) ((name . "ast.SelectStmt.Pos()") (path . "go/ast/index#SelectStmt.Pos") (type . "go")) ((name . "ast.SendStmt") (path . "go/ast/index#SendStmt") (type . "go")) ((name . "ast.SendStmt.End()") (path . "go/ast/index#SendStmt.End") (type . "go")) ((name . "ast.SendStmt.Pos()") (path . "go/ast/index#SendStmt.Pos") (type . "go")) ((name . "ast.SliceExpr") (path . "go/ast/index#SliceExpr") (type . "go")) ((name . "ast.SliceExpr.End()") (path . "go/ast/index#SliceExpr.End") (type . "go")) ((name . "ast.SliceExpr.Pos()") (path . "go/ast/index#SliceExpr.Pos") (type . "go")) ((name . "ast.SortImports()") (path . "go/ast/index#SortImports") (type . "go")) ((name . "ast.Spec") (path . "go/ast/index#Spec") (type . "go")) ((name . "ast.StarExpr") (path . "go/ast/index#StarExpr") (type . "go")) ((name . "ast.StarExpr.End()") (path . "go/ast/index#StarExpr.End") (type . "go")) ((name . "ast.StarExpr.Pos()") (path . "go/ast/index#StarExpr.Pos") (type . "go")) ((name . "ast.Stmt") (path . "go/ast/index#Stmt") (type . "go")) ((name . "ast.StructType") (path . "go/ast/index#StructType") (type . "go")) ((name . "ast.StructType.End()") (path . "go/ast/index#StructType.End") (type . "go")) ((name . "ast.StructType.Pos()") (path . "go/ast/index#StructType.Pos") (type . "go")) ((name . "ast.SwitchStmt") (path . "go/ast/index#SwitchStmt") (type . "go")) ((name . "ast.SwitchStmt.End()") (path . "go/ast/index#SwitchStmt.End") (type . "go")) ((name . "ast.SwitchStmt.Pos()") (path . "go/ast/index#SwitchStmt.Pos") (type . "go")) ((name . "ast.TypeAssertExpr") (path . "go/ast/index#TypeAssertExpr") (type . "go")) ((name . "ast.TypeAssertExpr.End()") (path . "go/ast/index#TypeAssertExpr.End") (type . "go")) ((name . "ast.TypeAssertExpr.Pos()") (path . "go/ast/index#TypeAssertExpr.Pos") (type . "go")) ((name . "ast.TypeSpec") (path . "go/ast/index#TypeSpec") (type . "go")) ((name . "ast.TypeSpec.End()") (path . "go/ast/index#TypeSpec.End") (type . "go")) ((name . "ast.TypeSpec.Pos()") (path . "go/ast/index#TypeSpec.Pos") (type . "go")) ((name . "ast.TypeSwitchStmt") (path . "go/ast/index#TypeSwitchStmt") (type . "go")) ((name . "ast.TypeSwitchStmt.End()") (path . "go/ast/index#TypeSwitchStmt.End") (type . "go")) ((name . "ast.TypeSwitchStmt.Pos()") (path . "go/ast/index#TypeSwitchStmt.Pos") (type . "go")) ((name . "ast.UnaryExpr") (path . "go/ast/index#UnaryExpr") (type . "go")) ((name . "ast.UnaryExpr.End()") (path . "go/ast/index#UnaryExpr.End") (type . "go")) ((name . "ast.UnaryExpr.Pos()") (path . "go/ast/index#UnaryExpr.Pos") (type . "go")) ((name . "ast.Unparen()") (path . "go/ast/index#Unparen") (type . "go")) ((name . "ast.ValueSpec") (path . "go/ast/index#ValueSpec") (type . "go")) ((name . "ast.ValueSpec.End()") (path . "go/ast/index#ValueSpec.End") (type . "go")) ((name . "ast.ValueSpec.Pos()") (path . "go/ast/index#ValueSpec.Pos") (type . "go")) ((name . "ast.Visitor") (path . "go/ast/index#Visitor") (type . "go")) ((name . "ast.Walk()") (path . "go/ast/index#Walk") (type . "go")) ((name . "atomic.AddInt32()") (path . "sync/atomic/index#AddInt32") (type . "sync")) ((name . "atomic.AddInt64()") (path . "sync/atomic/index#AddInt64") (type . "sync")) ((name . "atomic.AddUint32()") (path . "sync/atomic/index#AddUint32") (type . "sync")) ((name . "atomic.AddUint64()") (path . "sync/atomic/index#AddUint64") (type . "sync")) ((name . "atomic.AddUintptr()") (path . "sync/atomic/index#AddUintptr") (type . "sync")) ((name . "atomic.Bool") (path . "sync/atomic/index#Bool") (type . "sync")) ((name . "atomic.Bool.CompareAndSwap()") (path . "sync/atomic/index#Bool.CompareAndSwap") (type . "sync")) ((name . "atomic.Bool.Load()") (path . "sync/atomic/index#Bool.Load") (type . "sync")) ((name . "atomic.Bool.Store()") (path . "sync/atomic/index#Bool.Store") (type . "sync")) ((name . "atomic.Bool.Swap()") (path . "sync/atomic/index#Bool.Swap") (type . "sync")) ((name . "atomic.CompareAndSwapInt32()") (path . "sync/atomic/index#CompareAndSwapInt32") (type . "sync")) ((name . "atomic.CompareAndSwapInt64()") (path . "sync/atomic/index#CompareAndSwapInt64") (type . "sync")) ((name . "atomic.CompareAndSwapPointer()") (path . "sync/atomic/index#CompareAndSwapPointer") (type . "sync")) ((name . "atomic.CompareAndSwapUint32()") (path . "sync/atomic/index#CompareAndSwapUint32") (type . "sync")) ((name . "atomic.CompareAndSwapUint64()") (path . "sync/atomic/index#CompareAndSwapUint64") (type . "sync")) ((name . "atomic.CompareAndSwapUintptr()") (path . "sync/atomic/index#CompareAndSwapUintptr") (type . "sync")) ((name . "atomic.Int32") (path . "sync/atomic/index#Int32") (type . "sync")) ((name . "atomic.Int32.Add()") (path . "sync/atomic/index#Int32.Add") (type . "sync")) ((name . "atomic.Int32.CompareAndSwap()") (path . "sync/atomic/index#Int32.CompareAndSwap") (type . "sync")) ((name . "atomic.Int32.Load()") (path . "sync/atomic/index#Int32.Load") (type . "sync")) ((name . "atomic.Int32.Store()") (path . "sync/atomic/index#Int32.Store") (type . "sync")) ((name . "atomic.Int32.Swap()") (path . "sync/atomic/index#Int32.Swap") (type . "sync")) ((name . "atomic.Int64") (path . "sync/atomic/index#Int64") (type . "sync")) ((name . "atomic.Int64.Add()") (path . "sync/atomic/index#Int64.Add") (type . "sync")) ((name . "atomic.Int64.CompareAndSwap()") (path . "sync/atomic/index#Int64.CompareAndSwap") (type . "sync")) ((name . "atomic.Int64.Load()") (path . "sync/atomic/index#Int64.Load") (type . "sync")) ((name . "atomic.Int64.Store()") (path . "sync/atomic/index#Int64.Store") (type . "sync")) ((name . "atomic.Int64.Swap()") (path . "sync/atomic/index#Int64.Swap") (type . "sync")) ((name . "atomic.LoadInt32()") (path . "sync/atomic/index#LoadInt32") (type . "sync")) ((name . "atomic.LoadInt64()") (path . "sync/atomic/index#LoadInt64") (type . "sync")) ((name . "atomic.LoadPointer()") (path . "sync/atomic/index#LoadPointer") (type . "sync")) ((name . "atomic.LoadUint32()") (path . "sync/atomic/index#LoadUint32") (type . "sync")) ((name . "atomic.LoadUint64()") (path . "sync/atomic/index#LoadUint64") (type . "sync")) ((name . "atomic.LoadUintptr()") (path . "sync/atomic/index#LoadUintptr") (type . "sync")) ((name . "atomic.Pointer") (path . "sync/atomic/index#Pointer") (type . "sync")) ((name . "atomic.Pointer.CompareAndSwap()") (path . "sync/atomic/index#Pointer.CompareAndSwap") (type . "sync")) ((name . "atomic.Pointer.Load()") (path . "sync/atomic/index#Pointer.Load") (type . "sync")) ((name . "atomic.Pointer.Store()") (path . "sync/atomic/index#Pointer.Store") (type . "sync")) ((name . "atomic.Pointer.Swap()") (path . "sync/atomic/index#Pointer.Swap") (type . "sync")) ((name . "atomic.StoreInt32()") (path . "sync/atomic/index#StoreInt32") (type . "sync")) ((name . "atomic.StoreInt64()") (path . "sync/atomic/index#StoreInt64") (type . "sync")) ((name . "atomic.StorePointer()") (path . "sync/atomic/index#StorePointer") (type . "sync")) ((name . "atomic.StoreUint32()") (path . "sync/atomic/index#StoreUint32") (type . "sync")) ((name . "atomic.StoreUint64()") (path . "sync/atomic/index#StoreUint64") (type . "sync")) ((name . "atomic.StoreUintptr()") (path . "sync/atomic/index#StoreUintptr") (type . "sync")) ((name . "atomic.SwapInt32()") (path . "sync/atomic/index#SwapInt32") (type . "sync")) ((name . "atomic.SwapInt64()") (path . "sync/atomic/index#SwapInt64") (type . "sync")) ((name . "atomic.SwapPointer()") (path . "sync/atomic/index#SwapPointer") (type . "sync")) ((name . "atomic.SwapUint32()") (path . "sync/atomic/index#SwapUint32") (type . "sync")) ((name . "atomic.SwapUint64()") (path . "sync/atomic/index#SwapUint64") (type . "sync")) ((name . "atomic.SwapUintptr()") (path . "sync/atomic/index#SwapUintptr") (type . "sync")) ((name . "atomic.Uint32") (path . "sync/atomic/index#Uint32") (type . "sync")) ((name . "atomic.Uint32.Add()") (path . "sync/atomic/index#Uint32.Add") (type . "sync")) ((name . "atomic.Uint32.CompareAndSwap()") (path . "sync/atomic/index#Uint32.CompareAndSwap") (type . "sync")) ((name . "atomic.Uint32.Load()") (path . "sync/atomic/index#Uint32.Load") (type . "sync")) ((name . "atomic.Uint32.Store()") (path . "sync/atomic/index#Uint32.Store") (type . "sync")) ((name . "atomic.Uint32.Swap()") (path . "sync/atomic/index#Uint32.Swap") (type . "sync")) ((name . "atomic.Uint64") (path . "sync/atomic/index#Uint64") (type . "sync")) ((name . "atomic.Uint64.Add()") (path . "sync/atomic/index#Uint64.Add") (type . "sync")) ((name . "atomic.Uint64.CompareAndSwap()") (path . "sync/atomic/index#Uint64.CompareAndSwap") (type . "sync")) ((name . "atomic.Uint64.Load()") (path . "sync/atomic/index#Uint64.Load") (type . "sync")) ((name . "atomic.Uint64.Store()") (path . "sync/atomic/index#Uint64.Store") (type . "sync")) ((name . "atomic.Uint64.Swap()") (path . "sync/atomic/index#Uint64.Swap") (type . "sync")) ((name . "atomic.Uintptr") (path . "sync/atomic/index#Uintptr") (type . "sync")) ((name . "atomic.Uintptr.Add()") (path . "sync/atomic/index#Uintptr.Add") (type . "sync")) ((name . "atomic.Uintptr.CompareAndSwap()") (path . "sync/atomic/index#Uintptr.CompareAndSwap") (type . "sync")) ((name . "atomic.Uintptr.Load()") (path . "sync/atomic/index#Uintptr.Load") (type . "sync")) ((name . "atomic.Uintptr.Store()") (path . "sync/atomic/index#Uintptr.Store") (type . "sync")) ((name . "atomic.Uintptr.Swap()") (path . "sync/atomic/index#Uintptr.Swap") (type . "sync")) ((name . "atomic.Value") (path . "sync/atomic/index#Value") (type . "sync")) ((name . "atomic.Value.CompareAndSwap()") (path . "sync/atomic/index#Value.CompareAndSwap") (type . "sync")) ((name . "atomic.Value.Load()") (path . "sync/atomic/index#Value.Load") (type . "sync")) ((name . "atomic.Value.Store()") (path . "sync/atomic/index#Value.Store") (type . "sync")) ((name . "atomic.Value.Swap()") (path . "sync/atomic/index#Value.Swap") (type . "sync")) ((name . "base32.CorruptInputError") (path . "encoding/base32/index#CorruptInputError") (type . "encoding")) ((name . "base32.CorruptInputError.Error()") (path . "encoding/base32/index#CorruptInputError.Error") (type . "encoding")) ((name . "base32.Encoding") (path . "encoding/base32/index#Encoding") (type . "encoding")) ((name . "base32.Encoding.AppendDecode()") (path . "encoding/base32/index#Encoding.AppendDecode") (type . "encoding")) ((name . "base32.Encoding.AppendEncode()") (path . "encoding/base32/index#Encoding.AppendEncode") (type . "encoding")) ((name . "base32.Encoding.Decode()") (path . "encoding/base32/index#Encoding.Decode") (type . "encoding")) ((name . "base32.Encoding.DecodedLen()") (path . "encoding/base32/index#Encoding.DecodedLen") (type . "encoding")) ((name . "base32.Encoding.DecodeString()") (path . "encoding/base32/index#Encoding.DecodeString") (type . "encoding")) ((name . "base32.Encoding.Encode()") (path . "encoding/base32/index#Encoding.Encode") (type . "encoding")) ((name . "base32.Encoding.EncodedLen()") (path . "encoding/base32/index#Encoding.EncodedLen") (type . "encoding")) ((name . "base32.Encoding.EncodeToString()") (path . "encoding/base32/index#Encoding.EncodeToString") (type . "encoding")) ((name . "base32.Encoding.WithPadding()") (path . "encoding/base32/index#Encoding.WithPadding") (type . "encoding")) ((name . "base32.NewDecoder()") (path . "encoding/base32/index#NewDecoder") (type . "encoding")) ((name . "base32.NewEncoder()") (path . "encoding/base32/index#NewEncoder") (type . "encoding")) ((name . "base32.NewEncoding()") (path . "encoding/base32/index#NewEncoding") (type . "encoding")) ((name . "base64.CorruptInputError") (path . "encoding/base64/index#CorruptInputError") (type . "encoding")) ((name . "base64.CorruptInputError.Error()") (path . "encoding/base64/index#CorruptInputError.Error") (type . "encoding")) ((name . "base64.Encoding") (path . "encoding/base64/index#Encoding") (type . "encoding")) ((name . "base64.Encoding.AppendDecode()") (path . "encoding/base64/index#Encoding.AppendDecode") (type . "encoding")) ((name . "base64.Encoding.AppendEncode()") (path . "encoding/base64/index#Encoding.AppendEncode") (type . "encoding")) ((name . "base64.Encoding.Decode()") (path . "encoding/base64/index#Encoding.Decode") (type . "encoding")) ((name . "base64.Encoding.DecodedLen()") (path . "encoding/base64/index#Encoding.DecodedLen") (type . "encoding")) ((name . "base64.Encoding.DecodeString()") (path . "encoding/base64/index#Encoding.DecodeString") (type . "encoding")) ((name . "base64.Encoding.Encode()") (path . "encoding/base64/index#Encoding.Encode") (type . "encoding")) ((name . "base64.Encoding.EncodedLen()") (path . "encoding/base64/index#Encoding.EncodedLen") (type . "encoding")) ((name . "base64.Encoding.EncodeToString()") (path . "encoding/base64/index#Encoding.EncodeToString") (type . "encoding")) ((name . "base64.Encoding.Strict()") (path . "encoding/base64/index#Encoding.Strict") (type . "encoding")) ((name . "base64.Encoding.WithPadding()") (path . "encoding/base64/index#Encoding.WithPadding") (type . "encoding")) ((name . "base64.NewDecoder()") (path . "encoding/base64/index#NewDecoder") (type . "encoding")) ((name . "base64.NewEncoder()") (path . "encoding/base64/index#NewEncoder") (type . "encoding")) ((name . "base64.NewEncoding()") (path . "encoding/base64/index#NewEncoding") (type . "encoding")) ((name . "big.Accuracy") (path . "math/big/index#Accuracy") (type . "math/big")) ((name . "big.Accuracy.String()") (path . "math/big/index#Accuracy.String") (type . "math/big")) ((name . "big.ErrNaN") (path . "math/big/index#ErrNaN") (type . "math/big")) ((name . "big.ErrNaN.Error()") (path . "math/big/index#ErrNaN.Error") (type . "math/big")) ((name . "big.Float") (path . "math/big/index#Float") (type . "math/big")) ((name . "big.Float.Abs()") (path . "math/big/index#Float.Abs") (type . "math/big")) ((name . "big.Float.Acc()") (path . "math/big/index#Float.Acc") (type . "math/big")) ((name . "big.Float.Add()") (path . "math/big/index#Float.Add") (type . "math/big")) ((name . "big.Float.Append()") (path . "math/big/index#Float.Append") (type . "math/big")) ((name . "big.Float.Cmp()") (path . "math/big/index#Float.Cmp") (type . "math/big")) ((name . "big.Float.Copy()") (path . "math/big/index#Float.Copy") (type . "math/big")) ((name . "big.Float.Float32()") (path . "math/big/index#Float.Float32") (type . "math/big")) ((name . "big.Float.Float64()") (path . "math/big/index#Float.Float64") (type . "math/big")) ((name . "big.Float.Format()") (path . "math/big/index#Float.Format") (type . "math/big")) ((name . "big.Float.GobDecode()") (path . "math/big/index#Float.GobDecode") (type . "math/big")) ((name . "big.Float.GobEncode()") (path . "math/big/index#Float.GobEncode") (type . "math/big")) ((name . "big.Float.Int()") (path . "math/big/index#Float.Int") (type . "math/big")) ((name . "big.Float.Int64()") (path . "math/big/index#Float.Int64") (type . "math/big")) ((name . "big.Float.IsInf()") (path . "math/big/index#Float.IsInf") (type . "math/big")) ((name . "big.Float.IsInt()") (path . "math/big/index#Float.IsInt") (type . "math/big")) ((name . "big.Float.MantExp()") (path . "math/big/index#Float.MantExp") (type . "math/big")) ((name . "big.Float.MarshalText()") (path . "math/big/index#Float.MarshalText") (type . "math/big")) ((name . "big.Float.MinPrec()") (path . "math/big/index#Float.MinPrec") (type . "math/big")) ((name . "big.Float.Mode()") (path . "math/big/index#Float.Mode") (type . "math/big")) ((name . "big.Float.Mul()") (path . "math/big/index#Float.Mul") (type . "math/big")) ((name . "big.Float.Neg()") (path . "math/big/index#Float.Neg") (type . "math/big")) ((name . "big.Float.Parse()") (path . "math/big/index#Float.Parse") (type . "math/big")) ((name . "big.Float.Prec()") (path . "math/big/index#Float.Prec") (type . "math/big")) ((name . "big.Float.Quo()") (path . "math/big/index#Float.Quo") (type . "math/big")) ((name . "big.Float.Rat()") (path . "math/big/index#Float.Rat") (type . "math/big")) ((name . "big.Float.Scan()") (path . "math/big/index#Float.Scan") (type . "math/big")) ((name . "big.Float.Set()") (path . "math/big/index#Float.Set") (type . "math/big")) ((name . "big.Float.SetFloat64()") (path . "math/big/index#Float.SetFloat64") (type . "math/big")) ((name . "big.Float.SetInf()") (path . "math/big/index#Float.SetInf") (type . "math/big")) ((name . "big.Float.SetInt()") (path . "math/big/index#Float.SetInt") (type . "math/big")) ((name . "big.Float.SetInt64()") (path . "math/big/index#Float.SetInt64") (type . "math/big")) ((name . "big.Float.SetMantExp()") (path . "math/big/index#Float.SetMantExp") (type . "math/big")) ((name . "big.Float.SetMode()") (path . "math/big/index#Float.SetMode") (type . "math/big")) ((name . "big.Float.SetPrec()") (path . "math/big/index#Float.SetPrec") (type . "math/big")) ((name . "big.Float.SetRat()") (path . "math/big/index#Float.SetRat") (type . "math/big")) ((name . "big.Float.SetString()") (path . "math/big/index#Float.SetString") (type . "math/big")) ((name . "big.Float.SetUint64()") (path . "math/big/index#Float.SetUint64") (type . "math/big")) ((name . "big.Float.Sign()") (path . "math/big/index#Float.Sign") (type . "math/big")) ((name . "big.Float.Signbit()") (path . "math/big/index#Float.Signbit") (type . "math/big")) ((name . "big.Float.Sqrt()") (path . "math/big/index#Float.Sqrt") (type . "math/big")) ((name . "big.Float.String()") (path . "math/big/index#Float.String") (type . "math/big")) ((name . "big.Float.Sub()") (path . "math/big/index#Float.Sub") (type . "math/big")) ((name . "big.Float.Text()") (path . "math/big/index#Float.Text") (type . "math/big")) ((name . "big.Float.Uint64()") (path . "math/big/index#Float.Uint64") (type . "math/big")) ((name . "big.Float.UnmarshalText()") (path . "math/big/index#Float.UnmarshalText") (type . "math/big")) ((name . "big.Int") (path . "math/big/index#Int") (type . "math/big")) ((name . "big.Int.Abs()") (path . "math/big/index#Int.Abs") (type . "math/big")) ((name . "big.Int.Add()") (path . "math/big/index#Int.Add") (type . "math/big")) ((name . "big.Int.And()") (path . "math/big/index#Int.And") (type . "math/big")) ((name . "big.Int.AndNot()") (path . "math/big/index#Int.AndNot") (type . "math/big")) ((name . "big.Int.Append()") (path . "math/big/index#Int.Append") (type . "math/big")) ((name . "big.Int.Binomial()") (path . "math/big/index#Int.Binomial") (type . "math/big")) ((name . "big.Int.Bit()") (path . "math/big/index#Int.Bit") (type . "math/big")) ((name . "big.Int.BitLen()") (path . "math/big/index#Int.BitLen") (type . "math/big")) ((name . "big.Int.Bits()") (path . "math/big/index#Int.Bits") (type . "math/big")) ((name . "big.Int.Bytes()") (path . "math/big/index#Int.Bytes") (type . "math/big")) ((name . "big.Int.Cmp()") (path . "math/big/index#Int.Cmp") (type . "math/big")) ((name . "big.Int.CmpAbs()") (path . "math/big/index#Int.CmpAbs") (type . "math/big")) ((name . "big.Int.Div()") (path . "math/big/index#Int.Div") (type . "math/big")) ((name . "big.Int.DivMod()") (path . "math/big/index#Int.DivMod") (type . "math/big")) ((name . "big.Int.Exp()") (path . "math/big/index#Int.Exp") (type . "math/big")) ((name . "big.Int.FillBytes()") (path . "math/big/index#Int.FillBytes") (type . "math/big")) ((name . "big.Int.Float64()") (path . "math/big/index#Int.Float64") (type . "math/big")) ((name . "big.Int.Format()") (path . "math/big/index#Int.Format") (type . "math/big")) ((name . "big.Int.GCD()") (path . "math/big/index#Int.GCD") (type . "math/big")) ((name . "big.Int.GobDecode()") (path . "math/big/index#Int.GobDecode") (type . "math/big")) ((name . "big.Int.GobEncode()") (path . "math/big/index#Int.GobEncode") (type . "math/big")) ((name . "big.Int.Int64()") (path . "math/big/index#Int.Int64") (type . "math/big")) ((name . "big.Int.IsInt64()") (path . "math/big/index#Int.IsInt64") (type . "math/big")) ((name . "big.Int.IsUint64()") (path . "math/big/index#Int.IsUint64") (type . "math/big")) ((name . "big.Int.Lsh()") (path . "math/big/index#Int.Lsh") (type . "math/big")) ((name . "big.Int.MarshalJSON()") (path . "math/big/index#Int.MarshalJSON") (type . "math/big")) ((name . "big.Int.MarshalText()") (path . "math/big/index#Int.MarshalText") (type . "math/big")) ((name . "big.Int.Mod()") (path . "math/big/index#Int.Mod") (type . "math/big")) ((name . "big.Int.ModInverse()") (path . "math/big/index#Int.ModInverse") (type . "math/big")) ((name . "big.Int.ModSqrt()") (path . "math/big/index#Int.ModSqrt") (type . "math/big")) ((name . "big.Int.Mul()") (path . "math/big/index#Int.Mul") (type . "math/big")) ((name . "big.Int.MulRange()") (path . "math/big/index#Int.MulRange") (type . "math/big")) ((name . "big.Int.Neg()") (path . "math/big/index#Int.Neg") (type . "math/big")) ((name . "big.Int.Not()") (path . "math/big/index#Int.Not") (type . "math/big")) ((name . "big.Int.Or()") (path . "math/big/index#Int.Or") (type . "math/big")) ((name . "big.Int.ProbablyPrime()") (path . "math/big/index#Int.ProbablyPrime") (type . "math/big")) ((name . "big.Int.Quo()") (path . "math/big/index#Int.Quo") (type . "math/big")) ((name . "big.Int.QuoRem()") (path . "math/big/index#Int.QuoRem") (type . "math/big")) ((name . "big.Int.Rand()") (path . "math/big/index#Int.Rand") (type . "math/big")) ((name . "big.Int.Rem()") (path . "math/big/index#Int.Rem") (type . "math/big")) ((name . "big.Int.Rsh()") (path . "math/big/index#Int.Rsh") (type . "math/big")) ((name . "big.Int.Scan()") (path . "math/big/index#Int.Scan") (type . "math/big")) ((name . "big.Int.Set()") (path . "math/big/index#Int.Set") (type . "math/big")) ((name . "big.Int.SetBit()") (path . "math/big/index#Int.SetBit") (type . "math/big")) ((name . "big.Int.SetBits()") (path . "math/big/index#Int.SetBits") (type . "math/big")) ((name . "big.Int.SetBytes()") (path . "math/big/index#Int.SetBytes") (type . "math/big")) ((name . "big.Int.SetInt64()") (path . "math/big/index#Int.SetInt64") (type . "math/big")) ((name . "big.Int.SetString()") (path . "math/big/index#Int.SetString") (type . "math/big")) ((name . "big.Int.SetUint64()") (path . "math/big/index#Int.SetUint64") (type . "math/big")) ((name . "big.Int.Sign()") (path . "math/big/index#Int.Sign") (type . "math/big")) ((name . "big.Int.Sqrt()") (path . "math/big/index#Int.Sqrt") (type . "math/big")) ((name . "big.Int.String()") (path . "math/big/index#Int.String") (type . "math/big")) ((name . "big.Int.Sub()") (path . "math/big/index#Int.Sub") (type . "math/big")) ((name . "big.Int.Text()") (path . "math/big/index#Int.Text") (type . "math/big")) ((name . "big.Int.TrailingZeroBits()") (path . "math/big/index#Int.TrailingZeroBits") (type . "math/big")) ((name . "big.Int.Uint64()") (path . "math/big/index#Int.Uint64") (type . "math/big")) ((name . "big.Int.UnmarshalJSON()") (path . "math/big/index#Int.UnmarshalJSON") (type . "math/big")) ((name . "big.Int.UnmarshalText()") (path . "math/big/index#Int.UnmarshalText") (type . "math/big")) ((name . "big.Int.Xor()") (path . "math/big/index#Int.Xor") (type . "math/big")) ((name . "big.Jacobi()") (path . "math/big/index#Jacobi") (type . "math/big")) ((name . "big.NewFloat()") (path . "math/big/index#NewFloat") (type . "math/big")) ((name . "big.NewInt()") (path . "math/big/index#NewInt") (type . "math/big")) ((name . "big.NewRat()") (path . "math/big/index#NewRat") (type . "math/big")) ((name . "big.ParseFloat()") (path . "math/big/index#ParseFloat") (type . "math/big")) ((name . "big.Rat") (path . "math/big/index#Rat") (type . "math/big")) ((name . "big.Rat.Abs()") (path . "math/big/index#Rat.Abs") (type . "math/big")) ((name . "big.Rat.Add()") (path . "math/big/index#Rat.Add") (type . "math/big")) ((name . "big.Rat.Cmp()") (path . "math/big/index#Rat.Cmp") (type . "math/big")) ((name . "big.Rat.Denom()") (path . "math/big/index#Rat.Denom") (type . "math/big")) ((name . "big.Rat.Float32()") (path . "math/big/index#Rat.Float32") (type . "math/big")) ((name . "big.Rat.Float64()") (path . "math/big/index#Rat.Float64") (type . "math/big")) ((name . "big.Rat.FloatPrec()") (path . "math/big/index#Rat.FloatPrec") (type . "math/big")) ((name . "big.Rat.FloatString()") (path . "math/big/index#Rat.FloatString") (type . "math/big")) ((name . "big.Rat.GobDecode()") (path . "math/big/index#Rat.GobDecode") (type . "math/big")) ((name . "big.Rat.GobEncode()") (path . "math/big/index#Rat.GobEncode") (type . "math/big")) ((name . "big.Rat.Inv()") (path . "math/big/index#Rat.Inv") (type . "math/big")) ((name . "big.Rat.IsInt()") (path . "math/big/index#Rat.IsInt") (type . "math/big")) ((name . "big.Rat.MarshalText()") (path . "math/big/index#Rat.MarshalText") (type . "math/big")) ((name . "big.Rat.Mul()") (path . "math/big/index#Rat.Mul") (type . "math/big")) ((name . "big.Rat.Neg()") (path . "math/big/index#Rat.Neg") (type . "math/big")) ((name . "big.Rat.Num()") (path . "math/big/index#Rat.Num") (type . "math/big")) ((name . "big.Rat.Quo()") (path . "math/big/index#Rat.Quo") (type . "math/big")) ((name . "big.Rat.RatString()") (path . "math/big/index#Rat.RatString") (type . "math/big")) ((name . "big.Rat.Scan()") (path . "math/big/index#Rat.Scan") (type . "math/big")) ((name . "big.Rat.Set()") (path . "math/big/index#Rat.Set") (type . "math/big")) ((name . "big.Rat.SetFloat64()") (path . "math/big/index#Rat.SetFloat64") (type . "math/big")) ((name . "big.Rat.SetFrac()") (path . "math/big/index#Rat.SetFrac") (type . "math/big")) ((name . "big.Rat.SetFrac64()") (path . "math/big/index#Rat.SetFrac64") (type . "math/big")) ((name . "big.Rat.SetInt()") (path . "math/big/index#Rat.SetInt") (type . "math/big")) ((name . "big.Rat.SetInt64()") (path . "math/big/index#Rat.SetInt64") (type . "math/big")) ((name . "big.Rat.SetString()") (path . "math/big/index#Rat.SetString") (type . "math/big")) ((name . "big.Rat.SetUint64()") (path . "math/big/index#Rat.SetUint64") (type . "math/big")) ((name . "big.Rat.Sign()") (path . "math/big/index#Rat.Sign") (type . "math/big")) ((name . "big.Rat.String()") (path . "math/big/index#Rat.String") (type . "math/big")) ((name . "big.Rat.Sub()") (path . "math/big/index#Rat.Sub") (type . "math/big")) ((name . "big.Rat.UnmarshalText()") (path . "math/big/index#Rat.UnmarshalText") (type . "math/big")) ((name . "big.RoundingMode") (path . "math/big/index#RoundingMode") (type . "math/big")) ((name . "big.RoundingMode.String()") (path . "math/big/index#RoundingMode.String") (type . "math/big")) ((name . "big.Word") (path . "math/big/index#Word") (type . "math/big")) ((name . "binary.AppendByteOrder") (path . "encoding/binary/index#AppendByteOrder") (type . "encoding")) ((name . "binary.AppendUvarint()") (path . "encoding/binary/index#AppendUvarint") (type . "encoding")) ((name . "binary.AppendVarint()") (path . "encoding/binary/index#AppendVarint") (type . "encoding")) ((name . "binary.ByteOrder") (path . "encoding/binary/index#ByteOrder") (type . "encoding")) ((name . "binary.PutUvarint()") (path . "encoding/binary/index#PutUvarint") (type . "encoding")) ((name . "binary.PutVarint()") (path . "encoding/binary/index#PutVarint") (type . "encoding")) ((name . "binary.Read()") (path . "encoding/binary/index#Read") (type . "encoding")) ((name . "binary.ReadUvarint()") (path . "encoding/binary/index#ReadUvarint") (type . "encoding")) ((name . "binary.ReadVarint()") (path . "encoding/binary/index#ReadVarint") (type . "encoding")) ((name . "binary.Size()") (path . "encoding/binary/index#Size") (type . "encoding")) ((name . "binary.Uvarint()") (path . "encoding/binary/index#Uvarint") (type . "encoding")) ((name . "binary.Varint()") (path . "encoding/binary/index#Varint") (type . "encoding")) ((name . "binary.Write()") (path . "encoding/binary/index#Write") (type . "encoding")) ((name . "bits.Add()") (path . "math/bits/index#Add") (type . "math/bits")) ((name . "bits.Add32()") (path . "math/bits/index#Add32") (type . "math/bits")) ((name . "bits.Add64()") (path . "math/bits/index#Add64") (type . "math/bits")) ((name . "bits.Div()") (path . "math/bits/index#Div") (type . "math/bits")) ((name . "bits.Div32()") (path . "math/bits/index#Div32") (type . "math/bits")) ((name . "bits.Div64()") (path . "math/bits/index#Div64") (type . "math/bits")) ((name . "bits.LeadingZeros()") (path . "math/bits/index#LeadingZeros") (type . "math/bits")) ((name . "bits.LeadingZeros16()") (path . "math/bits/index#LeadingZeros16") (type . "math/bits")) ((name . "bits.LeadingZeros32()") (path . "math/bits/index#LeadingZeros32") (type . "math/bits")) ((name . "bits.LeadingZeros64()") (path . "math/bits/index#LeadingZeros64") (type . "math/bits")) ((name . "bits.LeadingZeros8()") (path . "math/bits/index#LeadingZeros8") (type . "math/bits")) ((name . "bits.Len()") (path . "math/bits/index#Len") (type . "math/bits")) ((name . "bits.Len16()") (path . "math/bits/index#Len16") (type . "math/bits")) ((name . "bits.Len32()") (path . "math/bits/index#Len32") (type . "math/bits")) ((name . "bits.Len64()") (path . "math/bits/index#Len64") (type . "math/bits")) ((name . "bits.Len8()") (path . "math/bits/index#Len8") (type . "math/bits")) ((name . "bits.Mul()") (path . "math/bits/index#Mul") (type . "math/bits")) ((name . "bits.Mul32()") (path . "math/bits/index#Mul32") (type . "math/bits")) ((name . "bits.Mul64()") (path . "math/bits/index#Mul64") (type . "math/bits")) ((name . "bits.OnesCount()") (path . "math/bits/index#OnesCount") (type . "math/bits")) ((name . "bits.OnesCount16()") (path . "math/bits/index#OnesCount16") (type . "math/bits")) ((name . "bits.OnesCount32()") (path . "math/bits/index#OnesCount32") (type . "math/bits")) ((name . "bits.OnesCount64()") (path . "math/bits/index#OnesCount64") (type . "math/bits")) ((name . "bits.OnesCount8()") (path . "math/bits/index#OnesCount8") (type . "math/bits")) ((name . "bits.Rem()") (path . "math/bits/index#Rem") (type . "math/bits")) ((name . "bits.Rem32()") (path . "math/bits/index#Rem32") (type . "math/bits")) ((name . "bits.Rem64()") (path . "math/bits/index#Rem64") (type . "math/bits")) ((name . "bits.Reverse()") (path . "math/bits/index#Reverse") (type . "math/bits")) ((name . "bits.Reverse16()") (path . "math/bits/index#Reverse16") (type . "math/bits")) ((name . "bits.Reverse32()") (path . "math/bits/index#Reverse32") (type . "math/bits")) ((name . "bits.Reverse64()") (path . "math/bits/index#Reverse64") (type . "math/bits")) ((name . "bits.Reverse8()") (path . "math/bits/index#Reverse8") (type . "math/bits")) ((name . "bits.ReverseBytes()") (path . "math/bits/index#ReverseBytes") (type . "math/bits")) ((name . "bits.ReverseBytes16()") (path . "math/bits/index#ReverseBytes16") (type . "math/bits")) ((name . "bits.ReverseBytes32()") (path . "math/bits/index#ReverseBytes32") (type . "math/bits")) ((name . "bits.ReverseBytes64()") (path . "math/bits/index#ReverseBytes64") (type . "math/bits")) ((name . "bits.RotateLeft()") (path . "math/bits/index#RotateLeft") (type . "math/bits")) ((name . "bits.RotateLeft16()") (path . "math/bits/index#RotateLeft16") (type . "math/bits")) ((name . "bits.RotateLeft32()") (path . "math/bits/index#RotateLeft32") (type . "math/bits")) ((name . "bits.RotateLeft64()") (path . "math/bits/index#RotateLeft64") (type . "math/bits")) ((name . "bits.RotateLeft8()") (path . "math/bits/index#RotateLeft8") (type . "math/bits")) ((name . "bits.Sub()") (path . "math/bits/index#Sub") (type . "math/bits")) ((name . "bits.Sub32()") (path . "math/bits/index#Sub32") (type . "math/bits")) ((name . "bits.Sub64()") (path . "math/bits/index#Sub64") (type . "math/bits")) ((name . "bits.TrailingZeros()") (path . "math/bits/index#TrailingZeros") (type . "math/bits")) ((name . "bits.TrailingZeros16()") (path . "math/bits/index#TrailingZeros16") (type . "math/bits")) ((name . "bits.TrailingZeros32()") (path . "math/bits/index#TrailingZeros32") (type . "math/bits")) ((name . "bits.TrailingZeros64()") (path . "math/bits/index#TrailingZeros64") (type . "math/bits")) ((name . "bits.TrailingZeros8()") (path . "math/bits/index#TrailingZeros8") (type . "math/bits")) ((name . "bufio") (path . "bufio/index") (type . "bufio")) ((name . "bufio constants") (path . "bufio/index#pkg-constants") (type . "bufio")) ((name . "bufio variables") (path . "bufio/index#pkg-variables") (type . "bufio")) ((name . "bufio.NewReader()") (path . "bufio/index#NewReader") (type . "bufio")) ((name . "bufio.NewReaderSize()") (path . "bufio/index#NewReaderSize") (type . "bufio")) ((name . "bufio.NewReadWriter()") (path . "bufio/index#NewReadWriter") (type . "bufio")) ((name . "bufio.NewScanner()") (path . "bufio/index#NewScanner") (type . "bufio")) ((name . "bufio.NewWriter()") (path . "bufio/index#NewWriter") (type . "bufio")) ((name . "bufio.NewWriterSize()") (path . "bufio/index#NewWriterSize") (type . "bufio")) ((name . "bufio.Reader") (path . "bufio/index#Reader") (type . "bufio")) ((name . "bufio.Reader.Buffered()") (path . "bufio/index#Reader.Buffered") (type . "bufio")) ((name . "bufio.Reader.Discard()") (path . "bufio/index#Reader.Discard") (type . "bufio")) ((name . "bufio.Reader.Peek()") (path . "bufio/index#Reader.Peek") (type . "bufio")) ((name . "bufio.Reader.Read()") (path . "bufio/index#Reader.Read") (type . "bufio")) ((name . "bufio.Reader.ReadByte()") (path . "bufio/index#Reader.ReadByte") (type . "bufio")) ((name . "bufio.Reader.ReadBytes()") (path . "bufio/index#Reader.ReadBytes") (type . "bufio")) ((name . "bufio.Reader.ReadLine()") (path . "bufio/index#Reader.ReadLine") (type . "bufio")) ((name . "bufio.Reader.ReadRune()") (path . "bufio/index#Reader.ReadRune") (type . "bufio")) ((name . "bufio.Reader.ReadSlice()") (path . "bufio/index#Reader.ReadSlice") (type . "bufio")) ((name . "bufio.Reader.ReadString()") (path . "bufio/index#Reader.ReadString") (type . "bufio")) ((name . "bufio.Reader.Reset()") (path . "bufio/index#Reader.Reset") (type . "bufio")) ((name . "bufio.Reader.Size()") (path . "bufio/index#Reader.Size") (type . "bufio")) ((name . "bufio.Reader.UnreadByte()") (path . "bufio/index#Reader.UnreadByte") (type . "bufio")) ((name . "bufio.Reader.UnreadRune()") (path . "bufio/index#Reader.UnreadRune") (type . "bufio")) ((name . "bufio.Reader.WriteTo()") (path . "bufio/index#Reader.WriteTo") (type . "bufio")) ((name . "bufio.ReadWriter") (path . "bufio/index#ReadWriter") (type . "bufio")) ((name . "bufio.ScanBytes()") (path . "bufio/index#ScanBytes") (type . "bufio")) ((name . "bufio.ScanLines()") (path . "bufio/index#ScanLines") (type . "bufio")) ((name . "bufio.Scanner") (path . "bufio/index#Scanner") (type . "bufio")) ((name . "bufio.Scanner.Buffer()") (path . "bufio/index#Scanner.Buffer") (type . "bufio")) ((name . "bufio.Scanner.Bytes()") (path . "bufio/index#Scanner.Bytes") (type . "bufio")) ((name . "bufio.Scanner.Err()") (path . "bufio/index#Scanner.Err") (type . "bufio")) ((name . "bufio.Scanner.Scan()") (path . "bufio/index#Scanner.Scan") (type . "bufio")) ((name . "bufio.Scanner.Split()") (path . "bufio/index#Scanner.Split") (type . "bufio")) ((name . "bufio.Scanner.Text()") (path . "bufio/index#Scanner.Text") (type . "bufio")) ((name . "bufio.ScanRunes()") (path . "bufio/index#ScanRunes") (type . "bufio")) ((name . "bufio.ScanWords()") (path . "bufio/index#ScanWords") (type . "bufio")) ((name . "bufio.SplitFunc") (path . "bufio/index#SplitFunc") (type . "bufio")) ((name . "bufio.Writer") (path . "bufio/index#Writer") (type . "bufio")) ((name . "bufio.Writer.Available()") (path . "bufio/index#Writer.Available") (type . "bufio")) ((name . "bufio.Writer.AvailableBuffer()") (path . "bufio/index#Writer.AvailableBuffer") (type . "bufio")) ((name . "bufio.Writer.Buffered()") (path . "bufio/index#Writer.Buffered") (type . "bufio")) ((name . "bufio.Writer.Flush()") (path . "bufio/index#Writer.Flush") (type . "bufio")) ((name . "bufio.Writer.ReadFrom()") (path . "bufio/index#Writer.ReadFrom") (type . "bufio")) ((name . "bufio.Writer.Reset()") (path . "bufio/index#Writer.Reset") (type . "bufio")) ((name . "bufio.Writer.Size()") (path . "bufio/index#Writer.Size") (type . "bufio")) ((name . "bufio.Writer.Write()") (path . "bufio/index#Writer.Write") (type . "bufio")) ((name . "bufio.Writer.WriteByte()") (path . "bufio/index#Writer.WriteByte") (type . "bufio")) ((name . "bufio.Writer.WriteRune()") (path . "bufio/index#Writer.WriteRune") (type . "bufio")) ((name . "bufio.Writer.WriteString()") (path . "bufio/index#Writer.WriteString") (type . "bufio")) ((name . "build.ArchChar()") (path . "go/build/index#ArchChar") (type . "go")) ((name . "build.Context") (path . "go/build/index#Context") (type . "go")) ((name . "build.Context.Import()") (path . "go/build/index#Context.Import") (type . "go")) ((name . "build.Context.ImportDir()") (path . "go/build/index#Context.ImportDir") (type . "go")) ((name . "build.Context.MatchFile()") (path . "go/build/index#Context.MatchFile") (type . "go")) ((name . "build.Context.SrcDirs()") (path . "go/build/index#Context.SrcDirs") (type . "go")) ((name . "build.Directive") (path . "go/build/index#Directive") (type . "go")) ((name . "build.Import()") (path . "go/build/index#Import") (type . "go")) ((name . "build.ImportDir()") (path . "go/build/index#ImportDir") (type . "go")) ((name . "build.ImportMode") (path . "go/build/index#ImportMode") (type . "go")) ((name . "build.IsLocalImport()") (path . "go/build/index#IsLocalImport") (type . "go")) ((name . "build.MultiplePackageError") (path . "go/build/index#MultiplePackageError") (type . "go")) ((name . "build.MultiplePackageError.Error()") (path . "go/build/index#MultiplePackageError.Error") (type . "go")) ((name . "build.NoGoError") (path . "go/build/index#NoGoError") (type . "go")) ((name . "build.NoGoError.Error()") (path . "go/build/index#NoGoError.Error") (type . "go")) ((name . "build.Package") (path . "go/build/index#Package") (type . "go")) ((name . "build.Package.IsCommand()") (path . "go/build/index#Package.IsCommand") (type . "go")) ((name . "buildinfo.BuildInfo") (path . "debug/buildinfo/index#BuildInfo") (type . "debug")) ((name . "buildinfo.Read()") (path . "debug/buildinfo/index#Read") (type . "debug")) ((name . "buildinfo.ReadFile()") (path . "debug/buildinfo/index#ReadFile") (type . "debug")) ((name . "builtin") (path . "builtin/index") (type . "builtin")) ((name . "builtin constants") (path . "builtin/index#pkg-constants") (type . "builtin")) ((name . "builtin variables") (path . "builtin/index#pkg-variables") (type . "builtin")) ((name . "builtin.any") (path . "builtin/index#any") (type . "builtin")) ((name . "builtin.append()") (path . "builtin/index#append") (type . "builtin")) ((name . "builtin.bool") (path . "builtin/index#bool") (type . "builtin")) ((name . "builtin.byte") (path . "builtin/index#byte") (type . "builtin")) ((name . "builtin.cap()") (path . "builtin/index#cap") (type . "builtin")) ((name . "builtin.clear()") (path . "builtin/index#clear") (type . "builtin")) ((name . "builtin.close()") (path . "builtin/index#close") (type . "builtin")) ((name . "builtin.comparable") (path . "builtin/index#comparable") (type . "builtin")) ((name . "builtin.complex()") (path . "builtin/index#complex") (type . "builtin")) ((name . "builtin.complex128") (path . "builtin/index#complex128") (type . "builtin")) ((name . "builtin.complex64") (path . "builtin/index#complex64") (type . "builtin")) ((name . "builtin.ComplexType") (path . "builtin/index#ComplexType") (type . "builtin")) ((name . "builtin.copy()") (path . "builtin/index#copy") (type . "builtin")) ((name . "builtin.delete()") (path . "builtin/index#delete") (type . "builtin")) ((name . "builtin.error") (path . "builtin/index#error") (type . "builtin")) ((name . "builtin.float32") (path . "builtin/index#float32") (type . "builtin")) ((name . "builtin.float64") (path . "builtin/index#float64") (type . "builtin")) ((name . "builtin.FloatType") (path . "builtin/index#FloatType") (type . "builtin")) ((name . "builtin.imag()") (path . "builtin/index#imag") (type . "builtin")) ((name . "builtin.int") (path . "builtin/index#int") (type . "builtin")) ((name . "builtin.int16") (path . "builtin/index#int16") (type . "builtin")) ((name . "builtin.int32") (path . "builtin/index#int32") (type . "builtin")) ((name . "builtin.int64") (path . "builtin/index#int64") (type . "builtin")) ((name . "builtin.int8") (path . "builtin/index#int8") (type . "builtin")) ((name . "builtin.IntegerType") (path . "builtin/index#IntegerType") (type . "builtin")) ((name . "builtin.len()") (path . "builtin/index#len") (type . "builtin")) ((name . "builtin.make()") (path . "builtin/index#make") (type . "builtin")) ((name . "builtin.max()") (path . "builtin/index#max") (type . "builtin")) ((name . "builtin.min()") (path . "builtin/index#min") (type . "builtin")) ((name . "builtin.new()") (path . "builtin/index#new") (type . "builtin")) ((name . "builtin.panic()") (path . "builtin/index#panic") (type . "builtin")) ((name . "builtin.print()") (path . "builtin/index#print") (type . "builtin")) ((name . "builtin.println()") (path . "builtin/index#println") (type . "builtin")) ((name . "builtin.real()") (path . "builtin/index#real") (type . "builtin")) ((name . "builtin.recover()") (path . "builtin/index#recover") (type . "builtin")) ((name . "builtin.rune") (path . "builtin/index#rune") (type . "builtin")) ((name . "builtin.string") (path . "builtin/index#string") (type . "builtin")) ((name . "builtin.Type") (path . "builtin/index#Type") (type . "builtin")) ((name . "builtin.Type1") (path . "builtin/index#Type1") (type . "builtin")) ((name . "builtin.uint") (path . "builtin/index#uint") (type . "builtin")) ((name . "builtin.uint16") (path . "builtin/index#uint16") (type . "builtin")) ((name . "builtin.uint32") (path . "builtin/index#uint32") (type . "builtin")) ((name . "builtin.uint64") (path . "builtin/index#uint64") (type . "builtin")) ((name . "builtin.uint8") (path . "builtin/index#uint8") (type . "builtin")) ((name . "builtin.uintptr") (path . "builtin/index#uintptr") (type . "builtin")) ((name . "bytes") (path . "bytes/index") (type . "bytes")) ((name . "bytes constants") (path . "bytes/index#pkg-constants") (type . "bytes")) ((name . "bytes variables") (path . "bytes/index#pkg-variables") (type . "bytes")) ((name . "bytes.Buffer") (path . "bytes/index#Buffer") (type . "bytes")) ((name . "bytes.Buffer.Available()") (path . "bytes/index#Buffer.Available") (type . "bytes")) ((name . "bytes.Buffer.AvailableBuffer()") (path . "bytes/index#Buffer.AvailableBuffer") (type . "bytes")) ((name . "bytes.Buffer.Bytes()") (path . "bytes/index#Buffer.Bytes") (type . "bytes")) ((name . "bytes.Buffer.Cap()") (path . "bytes/index#Buffer.Cap") (type . "bytes")) ((name . "bytes.Buffer.Grow()") (path . "bytes/index#Buffer.Grow") (type . "bytes")) ((name . "bytes.Buffer.Len()") (path . "bytes/index#Buffer.Len") (type . "bytes")) ((name . "bytes.Buffer.Next()") (path . "bytes/index#Buffer.Next") (type . "bytes")) ((name . "bytes.Buffer.Read()") (path . "bytes/index#Buffer.Read") (type . "bytes")) ((name . "bytes.Buffer.ReadByte()") (path . "bytes/index#Buffer.ReadByte") (type . "bytes")) ((name . "bytes.Buffer.ReadBytes()") (path . "bytes/index#Buffer.ReadBytes") (type . "bytes")) ((name . "bytes.Buffer.ReadFrom()") (path . "bytes/index#Buffer.ReadFrom") (type . "bytes")) ((name . "bytes.Buffer.ReadRune()") (path . "bytes/index#Buffer.ReadRune") (type . "bytes")) ((name . "bytes.Buffer.ReadString()") (path . "bytes/index#Buffer.ReadString") (type . "bytes")) ((name . "bytes.Buffer.Reset()") (path . "bytes/index#Buffer.Reset") (type . "bytes")) ((name . "bytes.Buffer.String()") (path . "bytes/index#Buffer.String") (type . "bytes")) ((name . "bytes.Buffer.Truncate()") (path . "bytes/index#Buffer.Truncate") (type . "bytes")) ((name . "bytes.Buffer.UnreadByte()") (path . "bytes/index#Buffer.UnreadByte") (type . "bytes")) ((name . "bytes.Buffer.UnreadRune()") (path . "bytes/index#Buffer.UnreadRune") (type . "bytes")) ((name . "bytes.Buffer.Write()") (path . "bytes/index#Buffer.Write") (type . "bytes")) ((name . "bytes.Buffer.WriteByte()") (path . "bytes/index#Buffer.WriteByte") (type . "bytes")) ((name . "bytes.Buffer.WriteRune()") (path . "bytes/index#Buffer.WriteRune") (type . "bytes")) ((name . "bytes.Buffer.WriteString()") (path . "bytes/index#Buffer.WriteString") (type . "bytes")) ((name . "bytes.Buffer.WriteTo()") (path . "bytes/index#Buffer.WriteTo") (type . "bytes")) ((name . "bytes.Clone()") (path . "bytes/index#Clone") (type . "bytes")) ((name . "bytes.Compare()") (path . "bytes/index#Compare") (type . "bytes")) ((name . "bytes.Contains()") (path . "bytes/index#Contains") (type . "bytes")) ((name . "bytes.ContainsAny()") (path . "bytes/index#ContainsAny") (type . "bytes")) ((name . "bytes.ContainsFunc()") (path . "bytes/index#ContainsFunc") (type . "bytes")) ((name . "bytes.ContainsRune()") (path . "bytes/index#ContainsRune") (type . "bytes")) ((name . "bytes.Count()") (path . "bytes/index#Count") (type . "bytes")) ((name . "bytes.Cut()") (path . "bytes/index#Cut") (type . "bytes")) ((name . "bytes.CutPrefix()") (path . "bytes/index#CutPrefix") (type . "bytes")) ((name . "bytes.CutSuffix()") (path . "bytes/index#CutSuffix") (type . "bytes")) ((name . "bytes.Equal()") (path . "bytes/index#Equal") (type . "bytes")) ((name . "bytes.EqualFold()") (path . "bytes/index#EqualFold") (type . "bytes")) ((name . "bytes.Fields()") (path . "bytes/index#Fields") (type . "bytes")) ((name . "bytes.FieldsFunc()") (path . "bytes/index#FieldsFunc") (type . "bytes")) ((name . "bytes.HasPrefix()") (path . "bytes/index#HasPrefix") (type . "bytes")) ((name . "bytes.HasSuffix()") (path . "bytes/index#HasSuffix") (type . "bytes")) ((name . "bytes.Index()") (path . "bytes/index#Index") (type . "bytes")) ((name . "bytes.IndexAny()") (path . "bytes/index#IndexAny") (type . "bytes")) ((name . "bytes.IndexByte()") (path . "bytes/index#IndexByte") (type . "bytes")) ((name . "bytes.IndexFunc()") (path . "bytes/index#IndexFunc") (type . "bytes")) ((name . "bytes.IndexRune()") (path . "bytes/index#IndexRune") (type . "bytes")) ((name . "bytes.Join()") (path . "bytes/index#Join") (type . "bytes")) ((name . "bytes.LastIndex()") (path . "bytes/index#LastIndex") (type . "bytes")) ((name . "bytes.LastIndexAny()") (path . "bytes/index#LastIndexAny") (type . "bytes")) ((name . "bytes.LastIndexByte()") (path . "bytes/index#LastIndexByte") (type . "bytes")) ((name . "bytes.LastIndexFunc()") (path . "bytes/index#LastIndexFunc") (type . "bytes")) ((name . "bytes.Map()") (path . "bytes/index#Map") (type . "bytes")) ((name . "bytes.NewBuffer()") (path . "bytes/index#NewBuffer") (type . "bytes")) ((name . "bytes.NewBufferString()") (path . "bytes/index#NewBufferString") (type . "bytes")) ((name . "bytes.NewReader()") (path . "bytes/index#NewReader") (type . "bytes")) ((name . "bytes.Reader") (path . "bytes/index#Reader") (type . "bytes")) ((name . "bytes.Reader.Len()") (path . "bytes/index#Reader.Len") (type . "bytes")) ((name . "bytes.Reader.Read()") (path . "bytes/index#Reader.Read") (type . "bytes")) ((name . "bytes.Reader.ReadAt()") (path . "bytes/index#Reader.ReadAt") (type . "bytes")) ((name . "bytes.Reader.ReadByte()") (path . "bytes/index#Reader.ReadByte") (type . "bytes")) ((name . "bytes.Reader.ReadRune()") (path . "bytes/index#Reader.ReadRune") (type . "bytes")) ((name . "bytes.Reader.Reset()") (path . "bytes/index#Reader.Reset") (type . "bytes")) ((name . "bytes.Reader.Seek()") (path . "bytes/index#Reader.Seek") (type . "bytes")) ((name . "bytes.Reader.Size()") (path . "bytes/index#Reader.Size") (type . "bytes")) ((name . "bytes.Reader.UnreadByte()") (path . "bytes/index#Reader.UnreadByte") (type . "bytes")) ((name . "bytes.Reader.UnreadRune()") (path . "bytes/index#Reader.UnreadRune") (type . "bytes")) ((name . "bytes.Reader.WriteTo()") (path . "bytes/index#Reader.WriteTo") (type . "bytes")) ((name . "bytes.Repeat()") (path . "bytes/index#Repeat") (type . "bytes")) ((name . "bytes.Replace()") (path . "bytes/index#Replace") (type . "bytes")) ((name . "bytes.ReplaceAll()") (path . "bytes/index#ReplaceAll") (type . "bytes")) ((name . "bytes.Runes()") (path . "bytes/index#Runes") (type . "bytes")) ((name . "bytes.Split()") (path . "bytes/index#Split") (type . "bytes")) ((name . "bytes.SplitAfter()") (path . "bytes/index#SplitAfter") (type . "bytes")) ((name . "bytes.SplitAfterN()") (path . "bytes/index#SplitAfterN") (type . "bytes")) ((name . "bytes.SplitN()") (path . "bytes/index#SplitN") (type . "bytes")) ((name . "bytes.Title()") (path . "bytes/index#Title") (type . "bytes")) ((name . "bytes.ToLower()") (path . "bytes/index#ToLower") (type . "bytes")) ((name . "bytes.ToLowerSpecial()") (path . "bytes/index#ToLowerSpecial") (type . "bytes")) ((name . "bytes.ToTitle()") (path . "bytes/index#ToTitle") (type . "bytes")) ((name . "bytes.ToTitleSpecial()") (path . "bytes/index#ToTitleSpecial") (type . "bytes")) ((name . "bytes.ToUpper()") (path . "bytes/index#ToUpper") (type . "bytes")) ((name . "bytes.ToUpperSpecial()") (path . "bytes/index#ToUpperSpecial") (type . "bytes")) ((name . "bytes.ToValidUTF8()") (path . "bytes/index#ToValidUTF8") (type . "bytes")) ((name . "bytes.Trim()") (path . "bytes/index#Trim") (type . "bytes")) ((name . "bytes.TrimFunc()") (path . "bytes/index#TrimFunc") (type . "bytes")) ((name . "bytes.TrimLeft()") (path . "bytes/index#TrimLeft") (type . "bytes")) ((name . "bytes.TrimLeftFunc()") (path . "bytes/index#TrimLeftFunc") (type . "bytes")) ((name . "bytes.TrimPrefix()") (path . "bytes/index#TrimPrefix") (type . "bytes")) ((name . "bytes.TrimRight()") (path . "bytes/index#TrimRight") (type . "bytes")) ((name . "bytes.TrimRightFunc()") (path . "bytes/index#TrimRightFunc") (type . "bytes")) ((name . "bytes.TrimSpace()") (path . "bytes/index#TrimSpace") (type . "bytes")) ((name . "bytes.TrimSuffix()") (path . "bytes/index#TrimSuffix") (type . "bytes")) ((name . "bzip2.NewReader()") (path . "compress/bzip2/index#NewReader") (type . "compress")) ((name . "bzip2.StructuralError") (path . "compress/bzip2/index#StructuralError") (type . "compress")) ((name . "bzip2.StructuralError.Error()") (path . "compress/bzip2/index#StructuralError.Error") (type . "compress")) ((name . "cgi.Handler") (path . "net/http/cgi/index#Handler") (type . "net/http")) ((name . "cgi.Handler.ServeHTTP()") (path . "net/http/cgi/index#Handler.ServeHTTP") (type . "net/http")) ((name . "cgi.Request()") (path . "net/http/cgi/index#Request") (type . "net/http")) ((name . "cgi.RequestFromMap()") (path . "net/http/cgi/index#RequestFromMap") (type . "net/http")) ((name . "cgi.Serve()") (path . "net/http/cgi/index#Serve") (type . "net/http")) ((name . "cgo.Handle") (path . "runtime/cgo/index#Handle") (type . "runtime")) ((name . "cgo.Handle.Delete()") (path . "runtime/cgo/index#Handle.Delete") (type . "runtime")) ((name . "cgo.Handle.Value()") (path . "runtime/cgo/index#Handle.Value") (type . "runtime")) ((name . "cgo.Incomplete") (path . "runtime/cgo/index#Incomplete") (type . "runtime")) ((name . "cgo.NewHandle()") (path . "runtime/cgo/index#NewHandle") (type . "runtime")) ((name . "cipher.AEAD") (path . "crypto/cipher/index#AEAD") (type . "crypto")) ((name . "cipher.Block") (path . "crypto/cipher/index#Block") (type . "crypto")) ((name . "cipher.BlockMode") (path . "crypto/cipher/index#BlockMode") (type . "crypto")) ((name . "cipher.NewCBCDecrypter()") (path . "crypto/cipher/index#NewCBCDecrypter") (type . "crypto")) ((name . "cipher.NewCBCEncrypter()") (path . "crypto/cipher/index#NewCBCEncrypter") (type . "crypto")) ((name . "cipher.NewCFBDecrypter()") (path . "crypto/cipher/index#NewCFBDecrypter") (type . "crypto")) ((name . "cipher.NewCFBEncrypter()") (path . "crypto/cipher/index#NewCFBEncrypter") (type . "crypto")) ((name . "cipher.NewCTR()") (path . "crypto/cipher/index#NewCTR") (type . "crypto")) ((name . "cipher.NewGCM()") (path . "crypto/cipher/index#NewGCM") (type . "crypto")) ((name . "cipher.NewGCMWithNonceSize()") (path . "crypto/cipher/index#NewGCMWithNonceSize") (type . "crypto")) ((name . "cipher.NewGCMWithTagSize()") (path . "crypto/cipher/index#NewGCMWithTagSize") (type . "crypto")) ((name . "cipher.NewOFB()") (path . "crypto/cipher/index#NewOFB") (type . "crypto")) ((name . "cipher.Stream") (path . "crypto/cipher/index#Stream") (type . "crypto")) ((name . "cipher.StreamReader") (path . "crypto/cipher/index#StreamReader") (type . "crypto")) ((name . "cipher.StreamReader.Read()") (path . "crypto/cipher/index#StreamReader.Read") (type . "crypto")) ((name . "cipher.StreamWriter") (path . "crypto/cipher/index#StreamWriter") (type . "crypto")) ((name . "cipher.StreamWriter.Close()") (path . "crypto/cipher/index#StreamWriter.Close") (type . "crypto")) ((name . "cipher.StreamWriter.Write()") (path . "crypto/cipher/index#StreamWriter.Write") (type . "crypto")) ((name . "cmp") (path . "cmp/index") (type . "cmp")) ((name . "cmp.Compare()") (path . "cmp/index#Compare") (type . "cmp")) ((name . "cmp.Less()") (path . "cmp/index#Less") (type . "cmp")) ((name . "cmp.Or()") (path . "cmp/index#Or") (type . "cmp")) ((name . "cmp.Ordered") (path . "cmp/index#Ordered") (type . "cmp")) ((name . "cmplx.Abs()") (path . "math/cmplx/index#Abs") (type . "math/cmplx")) ((name . "cmplx.Acos()") (path . "math/cmplx/index#Acos") (type . "math/cmplx")) ((name . "cmplx.Acosh()") (path . "math/cmplx/index#Acosh") (type . "math/cmplx")) ((name . "cmplx.Asin()") (path . "math/cmplx/index#Asin") (type . "math/cmplx")) ((name . "cmplx.Asinh()") (path . "math/cmplx/index#Asinh") (type . "math/cmplx")) ((name . "cmplx.Atan()") (path . "math/cmplx/index#Atan") (type . "math/cmplx")) ((name . "cmplx.Atanh()") (path . "math/cmplx/index#Atanh") (type . "math/cmplx")) ((name . "cmplx.Conj()") (path . "math/cmplx/index#Conj") (type . "math/cmplx")) ((name . "cmplx.Cos()") (path . "math/cmplx/index#Cos") (type . "math/cmplx")) ((name . "cmplx.Cosh()") (path . "math/cmplx/index#Cosh") (type . "math/cmplx")) ((name . "cmplx.Cot()") (path . "math/cmplx/index#Cot") (type . "math/cmplx")) ((name . "cmplx.Exp()") (path . "math/cmplx/index#Exp") (type . "math/cmplx")) ((name . "cmplx.Inf()") (path . "math/cmplx/index#Inf") (type . "math/cmplx")) ((name . "cmplx.IsInf()") (path . "math/cmplx/index#IsInf") (type . "math/cmplx")) ((name . "cmplx.IsNaN()") (path . "math/cmplx/index#IsNaN") (type . "math/cmplx")) ((name . "cmplx.Log()") (path . "math/cmplx/index#Log") (type . "math/cmplx")) ((name . "cmplx.Log10()") (path . "math/cmplx/index#Log10") (type . "math/cmplx")) ((name . "cmplx.NaN()") (path . "math/cmplx/index#NaN") (type . "math/cmplx")) ((name . "cmplx.Phase()") (path . "math/cmplx/index#Phase") (type . "math/cmplx")) ((name . "cmplx.Polar()") (path . "math/cmplx/index#Polar") (type . "math/cmplx")) ((name . "cmplx.Pow()") (path . "math/cmplx/index#Pow") (type . "math/cmplx")) ((name . "cmplx.Rect()") (path . "math/cmplx/index#Rect") (type . "math/cmplx")) ((name . "cmplx.Sin()") (path . "math/cmplx/index#Sin") (type . "math/cmplx")) ((name . "cmplx.Sinh()") (path . "math/cmplx/index#Sinh") (type . "math/cmplx")) ((name . "cmplx.Sqrt()") (path . "math/cmplx/index#Sqrt") (type . "math/cmplx")) ((name . "cmplx.Tan()") (path . "math/cmplx/index#Tan") (type . "math/cmplx")) ((name . "cmplx.Tanh()") (path . "math/cmplx/index#Tanh") (type . "math/cmplx")) ((name . "color.Alpha") (path . "image/color/index#Alpha") (type . "image")) ((name . "color.Alpha.RGBA()") (path . "image/color/index#Alpha.RGBA") (type . "image")) ((name . "color.Alpha16") (path . "image/color/index#Alpha16") (type . "image")) ((name . "color.Alpha16.RGBA()") (path . "image/color/index#Alpha16.RGBA") (type . "image")) ((name . "color.CMYK") (path . "image/color/index#CMYK") (type . "image")) ((name . "color.CMYK.RGBA()") (path . "image/color/index#CMYK.RGBA") (type . "image")) ((name . "color.CMYKToRGB()") (path . "image/color/index#CMYKToRGB") (type . "image")) ((name . "color.Color") (path . "image/color/index#Color") (type . "image")) ((name . "color.Gray") (path . "image/color/index#Gray") (type . "image")) ((name . "color.Gray.RGBA()") (path . "image/color/index#Gray.RGBA") (type . "image")) ((name . "color.Gray16") (path . "image/color/index#Gray16") (type . "image")) ((name . "color.Gray16.RGBA()") (path . "image/color/index#Gray16.RGBA") (type . "image")) ((name . "color.Model") (path . "image/color/index#Model") (type . "image")) ((name . "color.ModelFunc()") (path . "image/color/index#ModelFunc") (type . "image")) ((name . "color.NRGBA") (path . "image/color/index#NRGBA") (type . "image")) ((name . "color.NRGBA.RGBA()") (path . "image/color/index#NRGBA.RGBA") (type . "image")) ((name . "color.NRGBA64") (path . "image/color/index#NRGBA64") (type . "image")) ((name . "color.NRGBA64.RGBA()") (path . "image/color/index#NRGBA64.RGBA") (type . "image")) ((name . "color.NYCbCrA") (path . "image/color/index#NYCbCrA") (type . "image")) ((name . "color.NYCbCrA.RGBA()") (path . "image/color/index#NYCbCrA.RGBA") (type . "image")) ((name . "color.Palette") (path . "image/color/index#Palette") (type . "image")) ((name . "color.Palette.Convert()") (path . "image/color/index#Palette.Convert") (type . "image")) ((name . "color.Palette.Index()") (path . "image/color/index#Palette.Index") (type . "image")) ((name . "color.RGBA") (path . "image/color/index#RGBA") (type . "image")) ((name . "color.RGBA.RGBA()") (path . "image/color/index#RGBA.RGBA") (type . "image")) ((name . "color.RGBA64") (path . "image/color/index#RGBA64") (type . "image")) ((name . "color.RGBA64.RGBA()") (path . "image/color/index#RGBA64.RGBA") (type . "image")) ((name . "color.RGBToCMYK()") (path . "image/color/index#RGBToCMYK") (type . "image")) ((name . "color.RGBToYCbCr()") (path . "image/color/index#RGBToYCbCr") (type . "image")) ((name . "color.YCbCr") (path . "image/color/index#YCbCr") (type . "image")) ((name . "color.YCbCr.RGBA()") (path . "image/color/index#YCbCr.RGBA") (type . "image")) ((name . "color.YCbCrToRGB()") (path . "image/color/index#YCbCrToRGB") (type . "image")) ((name . "Command arena") (path . "arena/index") (type . "arena")) ((name . "Command asan") (path . "runtime/asan/index") (type . "runtime")) ((name . "Command boring") (path . "crypto/boring/index") (type . "crypto")) ((name . "Command fipsonly") (path . "crypto/tls/fipsonly/index") (type . "crypto")) ((name . "Command iter") (path . "iter/index") (type . "iter")) ((name . "comment.Block") (path . "go/doc/comment/index#Block") (type . "go")) ((name . "comment.Code") (path . "go/doc/comment/index#Code") (type . "go")) ((name . "comment.DefaultLookupPackage()") (path . "go/doc/comment/index#DefaultLookupPackage") (type . "go")) ((name . "comment.Doc") (path . "go/doc/comment/index#Doc") (type . "go")) ((name . "comment.DocLink") (path . "go/doc/comment/index#DocLink") (type . "go")) ((name . "comment.DocLink.DefaultURL()") (path . "go/doc/comment/index#DocLink.DefaultURL") (type . "go")) ((name . "comment.Heading") (path . "go/doc/comment/index#Heading") (type . "go")) ((name . "comment.Heading.DefaultID()") (path . "go/doc/comment/index#Heading.DefaultID") (type . "go")) ((name . "comment.Italic") (path . "go/doc/comment/index#Italic") (type . "go")) ((name . "comment.Link") (path . "go/doc/comment/index#Link") (type . "go")) ((name . "comment.LinkDef") (path . "go/doc/comment/index#LinkDef") (type . "go")) ((name . "comment.List") (path . "go/doc/comment/index#List") (type . "go")) ((name . "comment.List.BlankBefore()") (path . "go/doc/comment/index#List.BlankBefore") (type . "go")) ((name . "comment.List.BlankBetween()") (path . "go/doc/comment/index#List.BlankBetween") (type . "go")) ((name . "comment.ListItem") (path . "go/doc/comment/index#ListItem") (type . "go")) ((name . "comment.Paragraph") (path . "go/doc/comment/index#Paragraph") (type . "go")) ((name . "comment.Parser") (path . "go/doc/comment/index#Parser") (type . "go")) ((name . "comment.Parser.Parse()") (path . "go/doc/comment/index#Parser.Parse") (type . "go")) ((name . "comment.Plain") (path . "go/doc/comment/index#Plain") (type . "go")) ((name . "comment.Printer") (path . "go/doc/comment/index#Printer") (type . "go")) ((name . "comment.Printer.Comment()") (path . "go/doc/comment/index#Printer.Comment") (type . "go")) ((name . "comment.Printer.HTML()") (path . "go/doc/comment/index#Printer.HTML") (type . "go")) ((name . "comment.Printer.Markdown()") (path . "go/doc/comment/index#Printer.Markdown") (type . "go")) ((name . "comment.Printer.Text()") (path . "go/doc/comment/index#Printer.Text") (type . "go")) ((name . "comment.Text") (path . "go/doc/comment/index#Text") (type . "go")) ((name . "compress/bzip2") (path . "compress/bzip2/index") (type . "compress")) ((name . "compress/flate") (path . "compress/flate/index") (type . "compress")) ((name . "compress/flate constants") (path . "compress/flate/index#pkg-constants") (type . "compress")) ((name . "compress/gzip") (path . "compress/gzip/index") (type . "compress")) ((name . "compress/gzip constants") (path . "compress/gzip/index#pkg-constants") (type . "compress")) ((name . "compress/gzip variables") (path . "compress/gzip/index#pkg-variables") (type . "compress")) ((name . "compress/lzw") (path . "compress/lzw/index") (type . "compress")) ((name . "compress/zlib") (path . "compress/zlib/index") (type . "compress")) ((name . "compress/zlib constants") (path . "compress/zlib/index#pkg-constants") (type . "compress")) ((name . "compress/zlib variables") (path . "compress/zlib/index#pkg-variables") (type . "compress")) ((name . "constant.BinaryOp()") (path . "go/constant/index#BinaryOp") (type . "go")) ((name . "constant.BitLen()") (path . "go/constant/index#BitLen") (type . "go")) ((name . "constant.BoolVal()") (path . "go/constant/index#BoolVal") (type . "go")) ((name . "constant.Bytes()") (path . "go/constant/index#Bytes") (type . "go")) ((name . "constant.Compare()") (path . "go/constant/index#Compare") (type . "go")) ((name . "constant.Denom()") (path . "go/constant/index#Denom") (type . "go")) ((name . "constant.Float32Val()") (path . "go/constant/index#Float32Val") (type . "go")) ((name . "constant.Float64Val()") (path . "go/constant/index#Float64Val") (type . "go")) ((name . "constant.Imag()") (path . "go/constant/index#Imag") (type . "go")) ((name . "constant.Int64Val()") (path . "go/constant/index#Int64Val") (type . "go")) ((name . "constant.Kind") (path . "go/constant/index#Kind") (type . "go")) ((name . "constant.Kind.String()") (path . "go/constant/index#Kind.String") (type . "go")) ((name . "constant.Make()") (path . "go/constant/index#Make") (type . "go")) ((name . "constant.MakeBool()") (path . "go/constant/index#MakeBool") (type . "go")) ((name . "constant.MakeFloat64()") (path . "go/constant/index#MakeFloat64") (type . "go")) ((name . "constant.MakeFromBytes()") (path . "go/constant/index#MakeFromBytes") (type . "go")) ((name . "constant.MakeFromLiteral()") (path . "go/constant/index#MakeFromLiteral") (type . "go")) ((name . "constant.MakeImag()") (path . "go/constant/index#MakeImag") (type . "go")) ((name . "constant.MakeInt64()") (path . "go/constant/index#MakeInt64") (type . "go")) ((name . "constant.MakeString()") (path . "go/constant/index#MakeString") (type . "go")) ((name . "constant.MakeUint64()") (path . "go/constant/index#MakeUint64") (type . "go")) ((name . "constant.MakeUnknown()") (path . "go/constant/index#MakeUnknown") (type . "go")) ((name . "constant.Num()") (path . "go/constant/index#Num") (type . "go")) ((name . "constant.Real()") (path . "go/constant/index#Real") (type . "go")) ((name . "constant.Shift()") (path . "go/constant/index#Shift") (type . "go")) ((name . "constant.Sign()") (path . "go/constant/index#Sign") (type . "go")) ((name . "constant.StringVal()") (path . "go/constant/index#StringVal") (type . "go")) ((name . "constant.ToComplex()") (path . "go/constant/index#ToComplex") (type . "go")) ((name . "constant.ToFloat()") (path . "go/constant/index#ToFloat") (type . "go")) ((name . "constant.ToInt()") (path . "go/constant/index#ToInt") (type . "go")) ((name . "constant.Uint64Val()") (path . "go/constant/index#Uint64Val") (type . "go")) ((name . "constant.UnaryOp()") (path . "go/constant/index#UnaryOp") (type . "go")) ((name . "constant.Val()") (path . "go/constant/index#Val") (type . "go")) ((name . "constant.Value") (path . "go/constant/index#Value") (type . "go")) ((name . "constraint.AndExpr") (path . "go/build/constraint/index#AndExpr") (type . "go")) ((name . "constraint.AndExpr.Eval()") (path . "go/build/constraint/index#AndExpr.Eval") (type . "go")) ((name . "constraint.AndExpr.String()") (path . "go/build/constraint/index#AndExpr.String") (type . "go")) ((name . "constraint.Expr") (path . "go/build/constraint/index#Expr") (type . "go")) ((name . "constraint.GoVersion()") (path . "go/build/constraint/index#GoVersion") (type . "go")) ((name . "constraint.IsGoBuild()") (path . "go/build/constraint/index#IsGoBuild") (type . "go")) ((name . "constraint.IsPlusBuild()") (path . "go/build/constraint/index#IsPlusBuild") (type . "go")) ((name . "constraint.NotExpr") (path . "go/build/constraint/index#NotExpr") (type . "go")) ((name . "constraint.NotExpr.Eval()") (path . "go/build/constraint/index#NotExpr.Eval") (type . "go")) ((name . "constraint.NotExpr.String()") (path . "go/build/constraint/index#NotExpr.String") (type . "go")) ((name . "constraint.OrExpr") (path . "go/build/constraint/index#OrExpr") (type . "go")) ((name . "constraint.OrExpr.Eval()") (path . "go/build/constraint/index#OrExpr.Eval") (type . "go")) ((name . "constraint.OrExpr.String()") (path . "go/build/constraint/index#OrExpr.String") (type . "go")) ((name . "constraint.Parse()") (path . "go/build/constraint/index#Parse") (type . "go")) ((name . "constraint.PlusBuildLines()") (path . "go/build/constraint/index#PlusBuildLines") (type . "go")) ((name . "constraint.SyntaxError") (path . "go/build/constraint/index#SyntaxError") (type . "go")) ((name . "constraint.SyntaxError.Error()") (path . "go/build/constraint/index#SyntaxError.Error") (type . "go")) ((name . "constraint.TagExpr") (path . "go/build/constraint/index#TagExpr") (type . "go")) ((name . "constraint.TagExpr.Eval()") (path . "go/build/constraint/index#TagExpr.Eval") (type . "go")) ((name . "constraint.TagExpr.String()") (path . "go/build/constraint/index#TagExpr.String") (type . "go")) ((name . "container/heap") (path . "container/heap/index") (type . "container")) ((name . "container/list") (path . "container/list/index") (type . "container")) ((name . "container/ring") (path . "container/ring/index") (type . "container")) ((name . "context") (path . "context/index") (type . "context")) ((name . "context variables") (path . "context/index#pkg-variables") (type . "context")) ((name . "context.AfterFunc()") (path . "context/index#AfterFunc") (type . "context")) ((name . "context.Background()") (path . "context/index#Background") (type . "context")) ((name . "context.CancelCauseFunc") (path . "context/index#CancelCauseFunc") (type . "context")) ((name . "context.CancelFunc") (path . "context/index#CancelFunc") (type . "context")) ((name . "context.Cause()") (path . "context/index#Cause") (type . "context")) ((name . "context.Context") (path . "context/index#Context") (type . "context")) ((name . "context.TODO()") (path . "context/index#TODO") (type . "context")) ((name . "context.WithCancel()") (path . "context/index#WithCancel") (type . "context")) ((name . "context.WithCancelCause()") (path . "context/index#WithCancelCause") (type . "context")) ((name . "context.WithDeadline()") (path . "context/index#WithDeadline") (type . "context")) ((name . "context.WithDeadlineCause()") (path . "context/index#WithDeadlineCause") (type . "context")) ((name . "context.WithoutCancel()") (path . "context/index#WithoutCancel") (type . "context")) ((name . "context.WithTimeout()") (path . "context/index#WithTimeout") (type . "context")) ((name . "context.WithTimeoutCause()") (path . "context/index#WithTimeoutCause") (type . "context")) ((name . "context.WithValue()") (path . "context/index#WithValue") (type . "context")) ((name . "cookiejar.Jar") (path . "net/http/cookiejar/index#Jar") (type . "net/http")) ((name . "cookiejar.Jar.Cookies()") (path . "net/http/cookiejar/index#Jar.Cookies") (type . "net/http")) ((name . "cookiejar.Jar.SetCookies()") (path . "net/http/cookiejar/index#Jar.SetCookies") (type . "net/http")) ((name . "cookiejar.New()") (path . "net/http/cookiejar/index#New") (type . "net/http")) ((name . "cookiejar.Options") (path . "net/http/cookiejar/index#Options") (type . "net/http")) ((name . "cookiejar.PublicSuffixList") (path . "net/http/cookiejar/index#PublicSuffixList") (type . "net/http")) ((name . "coverage.ClearCounters()") (path . "runtime/coverage/index#ClearCounters") (type . "runtime")) ((name . "coverage.WriteCounters()") (path . "runtime/coverage/index#WriteCounters") (type . "runtime")) ((name . "coverage.WriteCountersDir()") (path . "runtime/coverage/index#WriteCountersDir") (type . "runtime")) ((name . "coverage.WriteMeta()") (path . "runtime/coverage/index#WriteMeta") (type . "runtime")) ((name . "coverage.WriteMetaDir()") (path . "runtime/coverage/index#WriteMetaDir") (type . "runtime")) ((name . "crc32.Checksum()") (path . "hash/crc32/index#Checksum") (type . "hash")) ((name . "crc32.ChecksumIEEE()") (path . "hash/crc32/index#ChecksumIEEE") (type . "hash")) ((name . "crc32.MakeTable()") (path . "hash/crc32/index#MakeTable") (type . "hash")) ((name . "crc32.New()") (path . "hash/crc32/index#New") (type . "hash")) ((name . "crc32.NewIEEE()") (path . "hash/crc32/index#NewIEEE") (type . "hash")) ((name . "crc32.Table") (path . "hash/crc32/index#Table") (type . "hash")) ((name . "crc32.Update()") (path . "hash/crc32/index#Update") (type . "hash")) ((name . "crc64.Checksum()") (path . "hash/crc64/index#Checksum") (type . "hash")) ((name . "crc64.MakeTable()") (path . "hash/crc64/index#MakeTable") (type . "hash")) ((name . "crc64.New()") (path . "hash/crc64/index#New") (type . "hash")) ((name . "crc64.Table") (path . "hash/crc64/index#Table") (type . "hash")) ((name . "crc64.Update()") (path . "hash/crc64/index#Update") (type . "hash")) ((name . "crypto") (path . "crypto/index") (type . "crypto")) ((name . "crypto.Decrypter") (path . "crypto/index#Decrypter") (type . "crypto")) ((name . "crypto.DecrypterOpts") (path . "crypto/index#DecrypterOpts") (type . "crypto")) ((name . "crypto.Hash") (path . "crypto/index#Hash") (type . "crypto")) ((name . "crypto.Hash.Available()") (path . "crypto/index#Hash.Available") (type . "crypto")) ((name . "crypto.Hash.HashFunc()") (path . "crypto/index#Hash.HashFunc") (type . "crypto")) ((name . "crypto.Hash.New()") (path . "crypto/index#Hash.New") (type . "crypto")) ((name . "crypto.Hash.Size()") (path . "crypto/index#Hash.Size") (type . "crypto")) ((name . "crypto.Hash.String()") (path . "crypto/index#Hash.String") (type . "crypto")) ((name . "crypto.PrivateKey") (path . "crypto/index#PrivateKey") (type . "crypto")) ((name . "crypto.PublicKey") (path . "crypto/index#PublicKey") (type . "crypto")) ((name . "crypto.RegisterHash()") (path . "crypto/index#RegisterHash") (type . "crypto")) ((name . "crypto.Signer") (path . "crypto/index#Signer") (type . "crypto")) ((name . "crypto.SignerOpts") (path . "crypto/index#SignerOpts") (type . "crypto")) ((name . "crypto/aes") (path . "crypto/aes/index") (type . "crypto")) ((name . "crypto/aes constants") (path . "crypto/aes/index#pkg-constants") (type . "crypto")) ((name . "crypto/cipher") (path . "crypto/cipher/index") (type . "crypto")) ((name . "crypto/des") (path . "crypto/des/index") (type . "crypto")) ((name . "crypto/des constants") (path . "crypto/des/index#pkg-constants") (type . "crypto")) ((name . "crypto/dsa") (path . "crypto/dsa/index") (type . "crypto")) ((name . "crypto/dsa variables") (path . "crypto/dsa/index#pkg-variables") (type . "crypto")) ((name . "crypto/ecdh") (path . "crypto/ecdh/index") (type . "crypto")) ((name . "crypto/ecdsa") (path . "crypto/ecdsa/index") (type . "crypto")) ((name . "crypto/ed25519") (path . "crypto/ed25519/index") (type . "crypto")) ((name . "crypto/ed25519 constants") (path . "crypto/ed25519/index#pkg-constants") (type . "crypto")) ((name . "crypto/elliptic") (path . "crypto/elliptic/index") (type . "crypto")) ((name . "crypto/hmac") (path . "crypto/hmac/index") (type . "crypto")) ((name . "crypto/md5") (path . "crypto/md5/index") (type . "crypto")) ((name . "crypto/md5 constants") (path . "crypto/md5/index#pkg-constants") (type . "crypto")) ((name . "crypto/rand") (path . "crypto/rand/index") (type . "crypto")) ((name . "crypto/rand variables") (path . "crypto/rand/index#pkg-variables") (type . "crypto")) ((name . "crypto/rc4") (path . "crypto/rc4/index") (type . "crypto")) ((name . "crypto/rsa") (path . "crypto/rsa/index") (type . "crypto")) ((name . "crypto/rsa constants") (path . "crypto/rsa/index#pkg-constants") (type . "crypto")) ((name . "crypto/rsa variables") (path . "crypto/rsa/index#pkg-variables") (type . "crypto")) ((name . "crypto/sha1") (path . "crypto/sha1/index") (type . "crypto")) ((name . "crypto/sha1 constants") (path . "crypto/sha1/index#pkg-constants") (type . "crypto")) ((name . "crypto/sha256") (path . "crypto/sha256/index") (type . "crypto")) ((name . "crypto/sha256 constants") (path . "crypto/sha256/index#pkg-constants") (type . "crypto")) ((name . "crypto/sha512") (path . "crypto/sha512/index") (type . "crypto")) ((name . "crypto/sha512 constants") (path . "crypto/sha512/index#pkg-constants") (type . "crypto")) ((name . "crypto/subtle") (path . "crypto/subtle/index") (type . "crypto")) ((name . "crypto/tls") (path . "crypto/tls/index") (type . "crypto")) ((name . "crypto/tls constants") (path . "crypto/tls/index#pkg-constants") (type . "crypto")) ((name . "crypto/x509") (path . "crypto/x509/index") (type . "crypto")) ((name . "crypto/x509 variables") (path . "crypto/x509/index#pkg-variables") (type . "crypto")) ((name . "crypto/x509/pkix") (path . "crypto/x509/pkix/index") (type . "crypto")) ((name . "csv.NewReader()") (path . "encoding/csv/index#NewReader") (type . "encoding")) ((name . "csv.NewWriter()") (path . "encoding/csv/index#NewWriter") (type . "encoding")) ((name . "csv.ParseError") (path . "encoding/csv/index#ParseError") (type . "encoding")) ((name . "csv.ParseError.Error()") (path . "encoding/csv/index#ParseError.Error") (type . "encoding")) ((name . "csv.ParseError.Unwrap()") (path . "encoding/csv/index#ParseError.Unwrap") (type . "encoding")) ((name . "csv.Reader") (path . "encoding/csv/index#Reader") (type . "encoding")) ((name . "csv.Reader.FieldPos()") (path . "encoding/csv/index#Reader.FieldPos") (type . "encoding")) ((name . "csv.Reader.InputOffset()") (path . "encoding/csv/index#Reader.InputOffset") (type . "encoding")) ((name . "csv.Reader.Read()") (path . "encoding/csv/index#Reader.Read") (type . "encoding")) ((name . "csv.Reader.ReadAll()") (path . "encoding/csv/index#Reader.ReadAll") (type . "encoding")) ((name . "csv.Writer") (path . "encoding/csv/index#Writer") (type . "encoding")) ((name . "csv.Writer.Error()") (path . "encoding/csv/index#Writer.Error") (type . "encoding")) ((name . "csv.Writer.Flush()") (path . "encoding/csv/index#Writer.Flush") (type . "encoding")) ((name . "csv.Writer.Write()") (path . "encoding/csv/index#Writer.Write") (type . "encoding")) ((name . "csv.Writer.WriteAll()") (path . "encoding/csv/index#Writer.WriteAll") (type . "encoding")) ((name . "database/sql") (path . "database/sql/index") (type . "database")) ((name . "database/sql variables") (path . "database/sql/index#pkg-variables") (type . "database")) ((name . "database/sql/driver") (path . "database/sql/driver/index") (type . "database")) ((name . "database/sql/driver variables") (path . "database/sql/driver/index#pkg-variables") (type . "database")) ((name . "debug.BuildInfo") (path . "runtime/debug/index#BuildInfo") (type . "runtime")) ((name . "debug.BuildInfo.String()") (path . "runtime/debug/index#BuildInfo.String") (type . "runtime")) ((name . "debug.BuildSetting") (path . "runtime/debug/index#BuildSetting") (type . "runtime")) ((name . "debug.FreeOSMemory()") (path . "runtime/debug/index#FreeOSMemory") (type . "runtime")) ((name . "debug.GCStats") (path . "runtime/debug/index#GCStats") (type . "runtime")) ((name . "debug.Module") (path . "runtime/debug/index#Module") (type . "runtime")) ((name . "debug.ParseBuildInfo()") (path . "runtime/debug/index#ParseBuildInfo") (type . "runtime")) ((name . "debug.PrintStack()") (path . "runtime/debug/index#PrintStack") (type . "runtime")) ((name . "debug.ReadBuildInfo()") (path . "runtime/debug/index#ReadBuildInfo") (type . "runtime")) ((name . "debug.ReadGCStats()") (path . "runtime/debug/index#ReadGCStats") (type . "runtime")) ((name . "debug.SetGCPercent()") (path . "runtime/debug/index#SetGCPercent") (type . "runtime")) ((name . "debug.SetMaxStack()") (path . "runtime/debug/index#SetMaxStack") (type . "runtime")) ((name . "debug.SetMaxThreads()") (path . "runtime/debug/index#SetMaxThreads") (type . "runtime")) ((name . "debug.SetMemoryLimit()") (path . "runtime/debug/index#SetMemoryLimit") (type . "runtime")) ((name . "debug.SetPanicOnFault()") (path . "runtime/debug/index#SetPanicOnFault") (type . "runtime")) ((name . "debug.SetTraceback()") (path . "runtime/debug/index#SetTraceback") (type . "runtime")) ((name . "debug.Stack()") (path . "runtime/debug/index#Stack") (type . "runtime")) ((name . "debug.WriteHeapDump()") (path . "runtime/debug/index#WriteHeapDump") (type . "runtime")) ((name . "debug/buildinfo") (path . "debug/buildinfo/index") (type . "debug")) ((name . "debug/dwarf") (path . "debug/dwarf/index") (type . "debug")) ((name . "debug/dwarf variables") (path . "debug/dwarf/index#pkg-variables") (type . "debug")) ((name . "debug/elf") (path . "debug/elf/index") (type . "debug")) ((name . "debug/elf constants") (path . "debug/elf/index#pkg-constants") (type . "debug")) ((name . "debug/elf variables") (path . "debug/elf/index#pkg-variables") (type . "debug")) ((name . "debug/gosym") (path . "debug/gosym/index") (type . "debug")) ((name . "debug/macho") (path . "debug/macho/index") (type . "debug")) ((name . "debug/macho constants") (path . "debug/macho/index#pkg-constants") (type . "debug")) ((name . "debug/macho variables") (path . "debug/macho/index#pkg-variables") (type . "debug")) ((name . "debug/pe") (path . "debug/pe/index") (type . "debug")) ((name . "debug/pe constants") (path . "debug/pe/index#pkg-constants") (type . "debug")) ((name . "debug/plan9obj") (path . "debug/plan9obj/index") (type . "debug")) ((name . "debug/plan9obj constants") (path . "debug/plan9obj/index#pkg-constants") (type . "debug")) ((name . "debug/plan9obj variables") (path . "debug/plan9obj/index#pkg-variables") (type . "debug")) ((name . "des.KeySizeError") (path . "crypto/des/index#KeySizeError") (type . "crypto")) ((name . "des.KeySizeError.Error()") (path . "crypto/des/index#KeySizeError.Error") (type . "crypto")) ((name . "des.NewCipher()") (path . "crypto/des/index#NewCipher") (type . "crypto")) ((name . "des.NewTripleDESCipher()") (path . "crypto/des/index#NewTripleDESCipher") (type . "crypto")) ((name . "doc.Example") (path . "go/doc/index#Example") (type . "go")) ((name . "doc.Examples()") (path . "go/doc/index#Examples") (type . "go")) ((name . "doc.Filter") (path . "go/doc/index#Filter") (type . "go")) ((name . "doc.Func") (path . "go/doc/index#Func") (type . "go")) ((name . "doc.IsPredeclared()") (path . "go/doc/index#IsPredeclared") (type . "go")) ((name . "doc.Mode") (path . "go/doc/index#Mode") (type . "go")) ((name . "doc.New()") (path . "go/doc/index#New") (type . "go")) ((name . "doc.NewFromFiles()") (path . "go/doc/index#NewFromFiles") (type . "go")) ((name . "doc.Note") (path . "go/doc/index#Note") (type . "go")) ((name . "doc.Package") (path . "go/doc/index#Package") (type . "go")) ((name . "doc.Package.Filter()") (path . "go/doc/index#Package.Filter") (type . "go")) ((name . "doc.Package.HTML()") (path . "go/doc/index#Package.HTML") (type . "go")) ((name . "doc.Package.Markdown()") (path . "go/doc/index#Package.Markdown") (type . "go")) ((name . "doc.Package.Parser()") (path . "go/doc/index#Package.Parser") (type . "go")) ((name . "doc.Package.Printer()") (path . "go/doc/index#Package.Printer") (type . "go")) ((name . "doc.Package.Synopsis()") (path . "go/doc/index#Package.Synopsis") (type . "go")) ((name . "doc.Package.Text()") (path . "go/doc/index#Package.Text") (type . "go")) ((name . "doc.Synopsis()") (path . "go/doc/index#Synopsis") (type . "go")) ((name . "doc.ToHTML()") (path . "go/doc/index#ToHTML") (type . "go")) ((name . "doc.ToText()") (path . "go/doc/index#ToText") (type . "go")) ((name . "doc.Type") (path . "go/doc/index#Type") (type . "go")) ((name . "doc.Value") (path . "go/doc/index#Value") (type . "go")) ((name . "draw.Draw()") (path . "image/draw/index#Draw") (type . "image")) ((name . "draw.Drawer") (path . "image/draw/index#Drawer") (type . "image")) ((name . "draw.DrawMask()") (path . "image/draw/index#DrawMask") (type . "image")) ((name . "draw.Image") (path . "image/draw/index#Image") (type . "image")) ((name . "draw.Op") (path . "image/draw/index#Op") (type . "image")) ((name . "draw.Op.Draw()") (path . "image/draw/index#Op.Draw") (type . "image")) ((name . "draw.Quantizer") (path . "image/draw/index#Quantizer") (type . "image")) ((name . "draw.RGBA64Image") (path . "image/draw/index#RGBA64Image") (type . "image")) ((name . "driver.ColumnConverter") (path . "database/sql/driver/index#ColumnConverter") (type . "database")) ((name . "driver.Conn") (path . "database/sql/driver/index#Conn") (type . "database")) ((name . "driver.ConnBeginTx") (path . "database/sql/driver/index#ConnBeginTx") (type . "database")) ((name . "driver.Connector") (path . "database/sql/driver/index#Connector") (type . "database")) ((name . "driver.ConnPrepareContext") (path . "database/sql/driver/index#ConnPrepareContext") (type . "database")) ((name . "driver.Driver") (path . "database/sql/driver/index#Driver") (type . "database")) ((name . "driver.DriverContext") (path . "database/sql/driver/index#DriverContext") (type . "database")) ((name . "driver.Execer") (path . "database/sql/driver/index#Execer") (type . "database")) ((name . "driver.ExecerContext") (path . "database/sql/driver/index#ExecerContext") (type . "database")) ((name . "driver.IsolationLevel") (path . "database/sql/driver/index#IsolationLevel") (type . "database")) ((name . "driver.IsScanValue()") (path . "database/sql/driver/index#IsScanValue") (type . "database")) ((name . "driver.IsValue()") (path . "database/sql/driver/index#IsValue") (type . "database")) ((name . "driver.NamedValue") (path . "database/sql/driver/index#NamedValue") (type . "database")) ((name . "driver.NamedValueChecker") (path . "database/sql/driver/index#NamedValueChecker") (type . "database")) ((name . "driver.NotNull") (path . "database/sql/driver/index#NotNull") (type . "database")) ((name . "driver.NotNull.ConvertValue()") (path . "database/sql/driver/index#NotNull.ConvertValue") (type . "database")) ((name . "driver.Null") (path . "database/sql/driver/index#Null") (type . "database")) ((name . "driver.Null.ConvertValue()") (path . "database/sql/driver/index#Null.ConvertValue") (type . "database")) ((name . "driver.Pinger") (path . "database/sql/driver/index#Pinger") (type . "database")) ((name . "driver.Queryer") (path . "database/sql/driver/index#Queryer") (type . "database")) ((name . "driver.QueryerContext") (path . "database/sql/driver/index#QueryerContext") (type . "database")) ((name . "driver.Result") (path . "database/sql/driver/index#Result") (type . "database")) ((name . "driver.Rows") (path . "database/sql/driver/index#Rows") (type . "database")) ((name . "driver.RowsAffected") (path . "database/sql/driver/index#RowsAffected") (type . "database")) ((name . "driver.RowsAffected.LastInsertId()") (path . "database/sql/driver/index#RowsAffected.LastInsertId") (type . "database")) ((name . "driver.RowsAffected.RowsAffected()") (path . "database/sql/driver/index#RowsAffected.RowsAffected") (type . "database")) ((name . "driver.RowsColumnTypeDatabaseTypeName") (path . "database/sql/driver/index#RowsColumnTypeDatabaseTypeName") (type . "database")) ((name . "driver.RowsColumnTypeLength") (path . "database/sql/driver/index#RowsColumnTypeLength") (type . "database")) ((name . "driver.RowsColumnTypeNullable") (path . "database/sql/driver/index#RowsColumnTypeNullable") (type . "database")) ((name . "driver.RowsColumnTypePrecisionScale") (path . "database/sql/driver/index#RowsColumnTypePrecisionScale") (type . "database")) ((name . "driver.RowsColumnTypeScanType") (path . "database/sql/driver/index#RowsColumnTypeScanType") (type . "database")) ((name . "driver.RowsNextResultSet") (path . "database/sql/driver/index#RowsNextResultSet") (type . "database")) ((name . "driver.SessionResetter") (path . "database/sql/driver/index#SessionResetter") (type . "database")) ((name . "driver.Stmt") (path . "database/sql/driver/index#Stmt") (type . "database")) ((name . "driver.StmtExecContext") (path . "database/sql/driver/index#StmtExecContext") (type . "database")) ((name . "driver.StmtQueryContext") (path . "database/sql/driver/index#StmtQueryContext") (type . "database")) ((name . "driver.Tx") (path . "database/sql/driver/index#Tx") (type . "database")) ((name . "driver.TxOptions") (path . "database/sql/driver/index#TxOptions") (type . "database")) ((name . "driver.Validator") (path . "database/sql/driver/index#Validator") (type . "database")) ((name . "driver.Value") (path . "database/sql/driver/index#Value") (type . "database")) ((name . "driver.ValueConverter") (path . "database/sql/driver/index#ValueConverter") (type . "database")) ((name . "driver.Valuer") (path . "database/sql/driver/index#Valuer") (type . "database")) ((name . "dsa.GenerateKey()") (path . "crypto/dsa/index#GenerateKey") (type . "crypto")) ((name . "dsa.GenerateParameters()") (path . "crypto/dsa/index#GenerateParameters") (type . "crypto")) ((name . "dsa.Parameters") (path . "crypto/dsa/index#Parameters") (type . "crypto")) ((name . "dsa.ParameterSizes") (path . "crypto/dsa/index#ParameterSizes") (type . "crypto")) ((name . "dsa.PrivateKey") (path . "crypto/dsa/index#PrivateKey") (type . "crypto")) ((name . "dsa.PublicKey") (path . "crypto/dsa/index#PublicKey") (type . "crypto")) ((name . "dsa.Sign()") (path . "crypto/dsa/index#Sign") (type . "crypto")) ((name . "dsa.Verify()") (path . "crypto/dsa/index#Verify") (type . "crypto")) ((name . "dwarf.AddrType") (path . "debug/dwarf/index#AddrType") (type . "debug")) ((name . "dwarf.ArrayType") (path . "debug/dwarf/index#ArrayType") (type . "debug")) ((name . "dwarf.ArrayType.Size()") (path . "debug/dwarf/index#ArrayType.Size") (type . "debug")) ((name . "dwarf.ArrayType.String()") (path . "debug/dwarf/index#ArrayType.String") (type . "debug")) ((name . "dwarf.Attr") (path . "debug/dwarf/index#Attr") (type . "debug")) ((name . "dwarf.Attr.GoString()") (path . "debug/dwarf/index#Attr.GoString") (type . "debug")) ((name . "dwarf.Attr.String()") (path . "debug/dwarf/index#Attr.String") (type . "debug")) ((name . "dwarf.BasicType") (path . "debug/dwarf/index#BasicType") (type . "debug")) ((name . "dwarf.BasicType.Basic()") (path . "debug/dwarf/index#BasicType.Basic") (type . "debug")) ((name . "dwarf.BasicType.String()") (path . "debug/dwarf/index#BasicType.String") (type . "debug")) ((name . "dwarf.BoolType") (path . "debug/dwarf/index#BoolType") (type . "debug")) ((name . "dwarf.CharType") (path . "debug/dwarf/index#CharType") (type . "debug")) ((name . "dwarf.Class") (path . "debug/dwarf/index#Class") (type . "debug")) ((name . "dwarf.Class.GoString()") (path . "debug/dwarf/index#Class.GoString") (type . "debug")) ((name . "dwarf.Class.String()") (path . "debug/dwarf/index#Class.String") (type . "debug")) ((name . "dwarf.CommonType") (path . "debug/dwarf/index#CommonType") (type . "debug")) ((name . "dwarf.CommonType.Common()") (path . "debug/dwarf/index#CommonType.Common") (type . "debug")) ((name . "dwarf.CommonType.Size()") (path . "debug/dwarf/index#CommonType.Size") (type . "debug")) ((name . "dwarf.ComplexType") (path . "debug/dwarf/index#ComplexType") (type . "debug")) ((name . "dwarf.Data") (path . "debug/dwarf/index#Data") (type . "debug")) ((name . "dwarf.Data.AddSection()") (path . "debug/dwarf/index#Data.AddSection") (type . "debug")) ((name . "dwarf.Data.AddTypes()") (path . "debug/dwarf/index#Data.AddTypes") (type . "debug")) ((name . "dwarf.Data.LineReader()") (path . "debug/dwarf/index#Data.LineReader") (type . "debug")) ((name . "dwarf.Data.Ranges()") (path . "debug/dwarf/index#Data.Ranges") (type . "debug")) ((name . "dwarf.Data.Reader()") (path . "debug/dwarf/index#Data.Reader") (type . "debug")) ((name . "dwarf.Data.Type()") (path . "debug/dwarf/index#Data.Type") (type . "debug")) ((name . "dwarf.DecodeError") (path . "debug/dwarf/index#DecodeError") (type . "debug")) ((name . "dwarf.DecodeError.Error()") (path . "debug/dwarf/index#DecodeError.Error") (type . "debug")) ((name . "dwarf.DotDotDotType") (path . "debug/dwarf/index#DotDotDotType") (type . "debug")) ((name . "dwarf.DotDotDotType.String()") (path . "debug/dwarf/index#DotDotDotType.String") (type . "debug")) ((name . "dwarf.Entry") (path . "debug/dwarf/index#Entry") (type . "debug")) ((name . "dwarf.Entry.AttrField()") (path . "debug/dwarf/index#Entry.AttrField") (type . "debug")) ((name . "dwarf.Entry.Val()") (path . "debug/dwarf/index#Entry.Val") (type . "debug")) ((name . "dwarf.EnumType") (path . "debug/dwarf/index#EnumType") (type . "debug")) ((name . "dwarf.EnumType.String()") (path . "debug/dwarf/index#EnumType.String") (type . "debug")) ((name . "dwarf.EnumValue") (path . "debug/dwarf/index#EnumValue") (type . "debug")) ((name . "dwarf.Field") (path . "debug/dwarf/index#Field") (type . "debug")) ((name . "dwarf.FloatType") (path . "debug/dwarf/index#FloatType") (type . "debug")) ((name . "dwarf.FuncType") (path . "debug/dwarf/index#FuncType") (type . "debug")) ((name . "dwarf.FuncType.String()") (path . "debug/dwarf/index#FuncType.String") (type . "debug")) ((name . "dwarf.IntType") (path . "debug/dwarf/index#IntType") (type . "debug")) ((name . "dwarf.LineEntry") (path . "debug/dwarf/index#LineEntry") (type . "debug")) ((name . "dwarf.LineFile") (path . "debug/dwarf/index#LineFile") (type . "debug")) ((name . "dwarf.LineReader") (path . "debug/dwarf/index#LineReader") (type . "debug")) ((name . "dwarf.LineReader.Files()") (path . "debug/dwarf/index#LineReader.Files") (type . "debug")) ((name . "dwarf.LineReader.Next()") (path . "debug/dwarf/index#LineReader.Next") (type . "debug")) ((name . "dwarf.LineReader.Reset()") (path . "debug/dwarf/index#LineReader.Reset") (type . "debug")) ((name . "dwarf.LineReader.Seek()") (path . "debug/dwarf/index#LineReader.Seek") (type . "debug")) ((name . "dwarf.LineReader.SeekPC()") (path . "debug/dwarf/index#LineReader.SeekPC") (type . "debug")) ((name . "dwarf.LineReader.Tell()") (path . "debug/dwarf/index#LineReader.Tell") (type . "debug")) ((name . "dwarf.LineReaderPos") (path . "debug/dwarf/index#LineReaderPos") (type . "debug")) ((name . "dwarf.New()") (path . "debug/dwarf/index#New") (type . "debug")) ((name . "dwarf.Offset") (path . "debug/dwarf/index#Offset") (type . "debug")) ((name . "dwarf.PtrType") (path . "debug/dwarf/index#PtrType") (type . "debug")) ((name . "dwarf.PtrType.String()") (path . "debug/dwarf/index#PtrType.String") (type . "debug")) ((name . "dwarf.QualType") (path . "debug/dwarf/index#QualType") (type . "debug")) ((name . "dwarf.QualType.Size()") (path . "debug/dwarf/index#QualType.Size") (type . "debug")) ((name . "dwarf.QualType.String()") (path . "debug/dwarf/index#QualType.String") (type . "debug")) ((name . "dwarf.Reader") (path . "debug/dwarf/index#Reader") (type . "debug")) ((name . "dwarf.Reader.AddressSize()") (path . "debug/dwarf/index#Reader.AddressSize") (type . "debug")) ((name . "dwarf.Reader.ByteOrder()") (path . "debug/dwarf/index#Reader.ByteOrder") (type . "debug")) ((name . "dwarf.Reader.Next()") (path . "debug/dwarf/index#Reader.Next") (type . "debug")) ((name . "dwarf.Reader.Seek()") (path . "debug/dwarf/index#Reader.Seek") (type . "debug")) ((name . "dwarf.Reader.SeekPC()") (path . "debug/dwarf/index#Reader.SeekPC") (type . "debug")) ((name . "dwarf.Reader.SkipChildren()") (path . "debug/dwarf/index#Reader.SkipChildren") (type . "debug")) ((name . "dwarf.StructField") (path . "debug/dwarf/index#StructField") (type . "debug")) ((name . "dwarf.StructType") (path . "debug/dwarf/index#StructType") (type . "debug")) ((name . "dwarf.StructType.Defn()") (path . "debug/dwarf/index#StructType.Defn") (type . "debug")) ((name . "dwarf.StructType.String()") (path . "debug/dwarf/index#StructType.String") (type . "debug")) ((name . "dwarf.Tag") (path . "debug/dwarf/index#Tag") (type . "debug")) ((name . "dwarf.Tag.GoString()") (path . "debug/dwarf/index#Tag.GoString") (type . "debug")) ((name . "dwarf.Tag.String()") (path . "debug/dwarf/index#Tag.String") (type . "debug")) ((name . "dwarf.Type") (path . "debug/dwarf/index#Type") (type . "debug")) ((name . "dwarf.TypedefType") (path . "debug/dwarf/index#TypedefType") (type . "debug")) ((name . "dwarf.TypedefType.Size()") (path . "debug/dwarf/index#TypedefType.Size") (type . "debug")) ((name . "dwarf.TypedefType.String()") (path . "debug/dwarf/index#TypedefType.String") (type . "debug")) ((name . "dwarf.UcharType") (path . "debug/dwarf/index#UcharType") (type . "debug")) ((name . "dwarf.UintType") (path . "debug/dwarf/index#UintType") (type . "debug")) ((name . "dwarf.UnspecifiedType") (path . "debug/dwarf/index#UnspecifiedType") (type . "debug")) ((name . "dwarf.UnsupportedType") (path . "debug/dwarf/index#UnsupportedType") (type . "debug")) ((name . "dwarf.UnsupportedType.String()") (path . "debug/dwarf/index#UnsupportedType.String") (type . "debug")) ((name . "dwarf.VoidType") (path . "debug/dwarf/index#VoidType") (type . "debug")) ((name . "dwarf.VoidType.String()") (path . "debug/dwarf/index#VoidType.String") (type . "debug")) ((name . "ecdh.Curve") (path . "crypto/ecdh/index#Curve") (type . "crypto")) ((name . "ecdh.P256()") (path . "crypto/ecdh/index#P256") (type . "crypto")) ((name . "ecdh.P384()") (path . "crypto/ecdh/index#P384") (type . "crypto")) ((name . "ecdh.P521()") (path . "crypto/ecdh/index#P521") (type . "crypto")) ((name . "ecdh.PrivateKey") (path . "crypto/ecdh/index#PrivateKey") (type . "crypto")) ((name . "ecdh.PrivateKey.Bytes()") (path . "crypto/ecdh/index#PrivateKey.Bytes") (type . "crypto")) ((name . "ecdh.PrivateKey.Curve()") (path . "crypto/ecdh/index#PrivateKey.Curve") (type . "crypto")) ((name . "ecdh.PrivateKey.ECDH()") (path . "crypto/ecdh/index#PrivateKey.ECDH") (type . "crypto")) ((name . "ecdh.PrivateKey.Equal()") (path . "crypto/ecdh/index#PrivateKey.Equal") (type . "crypto")) ((name . "ecdh.PrivateKey.Public()") (path . "crypto/ecdh/index#PrivateKey.Public") (type . "crypto")) ((name . "ecdh.PrivateKey.PublicKey()") (path . "crypto/ecdh/index#PrivateKey.PublicKey") (type . "crypto")) ((name . "ecdh.PublicKey") (path . "crypto/ecdh/index#PublicKey") (type . "crypto")) ((name . "ecdh.PublicKey.Bytes()") (path . "crypto/ecdh/index#PublicKey.Bytes") (type . "crypto")) ((name . "ecdh.PublicKey.Curve()") (path . "crypto/ecdh/index#PublicKey.Curve") (type . "crypto")) ((name . "ecdh.PublicKey.Equal()") (path . "crypto/ecdh/index#PublicKey.Equal") (type . "crypto")) ((name . "ecdh.X25519()") (path . "crypto/ecdh/index#X25519") (type . "crypto")) ((name . "ecdsa.GenerateKey()") (path . "crypto/ecdsa/index#GenerateKey") (type . "crypto")) ((name . "ecdsa.PrivateKey") (path . "crypto/ecdsa/index#PrivateKey") (type . "crypto")) ((name . "ecdsa.PrivateKey.ECDH()") (path . "crypto/ecdsa/index#PrivateKey.ECDH") (type . "crypto")) ((name . "ecdsa.PrivateKey.Equal()") (path . "crypto/ecdsa/index#PrivateKey.Equal") (type . "crypto")) ((name . "ecdsa.PrivateKey.Public()") (path . "crypto/ecdsa/index#PrivateKey.Public") (type . "crypto")) ((name . "ecdsa.PrivateKey.Sign()") (path . "crypto/ecdsa/index#PrivateKey.Sign") (type . "crypto")) ((name . "ecdsa.PublicKey") (path . "crypto/ecdsa/index#PublicKey") (type . "crypto")) ((name . "ecdsa.PublicKey.ECDH()") (path . "crypto/ecdsa/index#PublicKey.ECDH") (type . "crypto")) ((name . "ecdsa.PublicKey.Equal()") (path . "crypto/ecdsa/index#PublicKey.Equal") (type . "crypto")) ((name . "ecdsa.Sign()") (path . "crypto/ecdsa/index#Sign") (type . "crypto")) ((name . "ecdsa.SignASN1()") (path . "crypto/ecdsa/index#SignASN1") (type . "crypto")) ((name . "ecdsa.Verify()") (path . "crypto/ecdsa/index#Verify") (type . "crypto")) ((name . "ecdsa.VerifyASN1()") (path . "crypto/ecdsa/index#VerifyASN1") (type . "crypto")) ((name . "ed25519.GenerateKey()") (path . "crypto/ed25519/index#GenerateKey") (type . "crypto")) ((name . "ed25519.NewKeyFromSeed()") (path . "crypto/ed25519/index#NewKeyFromSeed") (type . "crypto")) ((name . "ed25519.Options") (path . "crypto/ed25519/index#Options") (type . "crypto")) ((name . "ed25519.Options.HashFunc()") (path . "crypto/ed25519/index#Options.HashFunc") (type . "crypto")) ((name . "ed25519.PrivateKey") (path . "crypto/ed25519/index#PrivateKey") (type . "crypto")) ((name . "ed25519.PrivateKey.Equal()") (path . "crypto/ed25519/index#PrivateKey.Equal") (type . "crypto")) ((name . "ed25519.PrivateKey.Public()") (path . "crypto/ed25519/index#PrivateKey.Public") (type . "crypto")) ((name . "ed25519.PrivateKey.Seed()") (path . "crypto/ed25519/index#PrivateKey.Seed") (type . "crypto")) ((name . "ed25519.PrivateKey.Sign()") (path . "crypto/ed25519/index#PrivateKey.Sign") (type . "crypto")) ((name . "ed25519.PublicKey") (path . "crypto/ed25519/index#PublicKey") (type . "crypto")) ((name . "ed25519.PublicKey.Equal()") (path . "crypto/ed25519/index#PublicKey.Equal") (type . "crypto")) ((name . "ed25519.Sign()") (path . "crypto/ed25519/index#Sign") (type . "crypto")) ((name . "ed25519.Verify()") (path . "crypto/ed25519/index#Verify") (type . "crypto")) ((name . "ed25519.VerifyWithOptions()") (path . "crypto/ed25519/index#VerifyWithOptions") (type . "crypto")) ((name . "elf.Chdr32") (path . "debug/elf/index#Chdr32") (type . "debug")) ((name . "elf.Chdr64") (path . "debug/elf/index#Chdr64") (type . "debug")) ((name . "elf.Class") (path . "debug/elf/index#Class") (type . "debug")) ((name . "elf.Class.GoString()") (path . "debug/elf/index#Class.GoString") (type . "debug")) ((name . "elf.Class.String()") (path . "debug/elf/index#Class.String") (type . "debug")) ((name . "elf.CompressionType") (path . "debug/elf/index#CompressionType") (type . "debug")) ((name . "elf.CompressionType.GoString()") (path . "debug/elf/index#CompressionType.GoString") (type . "debug")) ((name . "elf.CompressionType.String()") (path . "debug/elf/index#CompressionType.String") (type . "debug")) ((name . "elf.Data") (path . "debug/elf/index#Data") (type . "debug")) ((name . "elf.Data.GoString()") (path . "debug/elf/index#Data.GoString") (type . "debug")) ((name . "elf.Data.String()") (path . "debug/elf/index#Data.String") (type . "debug")) ((name . "elf.Dyn32") (path . "debug/elf/index#Dyn32") (type . "debug")) ((name . "elf.Dyn64") (path . "debug/elf/index#Dyn64") (type . "debug")) ((name . "elf.DynFlag") (path . "debug/elf/index#DynFlag") (type . "debug")) ((name . "elf.DynFlag.GoString()") (path . "debug/elf/index#DynFlag.GoString") (type . "debug")) ((name . "elf.DynFlag.String()") (path . "debug/elf/index#DynFlag.String") (type . "debug")) ((name . "elf.DynFlag1") (path . "debug/elf/index#DynFlag1") (type . "debug")) ((name . "elf.DynFlag1.GoString()") (path . "debug/elf/index#DynFlag1.GoString") (type . "debug")) ((name . "elf.DynFlag1.String()") (path . "debug/elf/index#DynFlag1.String") (type . "debug")) ((name . "elf.DynTag") (path . "debug/elf/index#DynTag") (type . "debug")) ((name . "elf.DynTag.GoString()") (path . "debug/elf/index#DynTag.GoString") (type . "debug")) ((name . "elf.DynTag.String()") (path . "debug/elf/index#DynTag.String") (type . "debug")) ((name . "elf.File") (path . "debug/elf/index#File") (type . "debug")) ((name . "elf.File.Close()") (path . "debug/elf/index#File.Close") (type . "debug")) ((name . "elf.File.DWARF()") (path . "debug/elf/index#File.DWARF") (type . "debug")) ((name . "elf.File.DynamicSymbols()") (path . "debug/elf/index#File.DynamicSymbols") (type . "debug")) ((name . "elf.File.DynString()") (path . "debug/elf/index#File.DynString") (type . "debug")) ((name . "elf.File.DynValue()") (path . "debug/elf/index#File.DynValue") (type . "debug")) ((name . "elf.File.ImportedLibraries()") (path . "debug/elf/index#File.ImportedLibraries") (type . "debug")) ((name . "elf.File.ImportedSymbols()") (path . "debug/elf/index#File.ImportedSymbols") (type . "debug")) ((name . "elf.File.Section()") (path . "debug/elf/index#File.Section") (type . "debug")) ((name . "elf.File.SectionByType()") (path . "debug/elf/index#File.SectionByType") (type . "debug")) ((name . "elf.File.Symbols()") (path . "debug/elf/index#File.Symbols") (type . "debug")) ((name . "elf.FileHeader") (path . "debug/elf/index#FileHeader") (type . "debug")) ((name . "elf.FormatError") (path . "debug/elf/index#FormatError") (type . "debug")) ((name . "elf.FormatError.Error()") (path . "debug/elf/index#FormatError.Error") (type . "debug")) ((name . "elf.Header32") (path . "debug/elf/index#Header32") (type . "debug")) ((name . "elf.Header64") (path . "debug/elf/index#Header64") (type . "debug")) ((name . "elf.ImportedSymbol") (path . "debug/elf/index#ImportedSymbol") (type . "debug")) ((name . "elf.Machine") (path . "debug/elf/index#Machine") (type . "debug")) ((name . "elf.Machine.GoString()") (path . "debug/elf/index#Machine.GoString") (type . "debug")) ((name . "elf.Machine.String()") (path . "debug/elf/index#Machine.String") (type . "debug")) ((name . "elf.NewFile()") (path . "debug/elf/index#NewFile") (type . "debug")) ((name . "elf.NType") (path . "debug/elf/index#NType") (type . "debug")) ((name . "elf.NType.GoString()") (path . "debug/elf/index#NType.GoString") (type . "debug")) ((name . "elf.NType.String()") (path . "debug/elf/index#NType.String") (type . "debug")) ((name . "elf.Open()") (path . "debug/elf/index#Open") (type . "debug")) ((name . "elf.OSABI") (path . "debug/elf/index#OSABI") (type . "debug")) ((name . "elf.OSABI.GoString()") (path . "debug/elf/index#OSABI.GoString") (type . "debug")) ((name . "elf.OSABI.String()") (path . "debug/elf/index#OSABI.String") (type . "debug")) ((name . "elf.Prog") (path . "debug/elf/index#Prog") (type . "debug")) ((name . "elf.Prog.Open()") (path . "debug/elf/index#Prog.Open") (type . "debug")) ((name . "elf.Prog32") (path . "debug/elf/index#Prog32") (type . "debug")) ((name . "elf.Prog64") (path . "debug/elf/index#Prog64") (type . "debug")) ((name . "elf.ProgFlag") (path . "debug/elf/index#ProgFlag") (type . "debug")) ((name . "elf.ProgFlag.GoString()") (path . "debug/elf/index#ProgFlag.GoString") (type . "debug")) ((name . "elf.ProgFlag.String()") (path . "debug/elf/index#ProgFlag.String") (type . "debug")) ((name . "elf.ProgHeader") (path . "debug/elf/index#ProgHeader") (type . "debug")) ((name . "elf.ProgType") (path . "debug/elf/index#ProgType") (type . "debug")) ((name . "elf.ProgType.GoString()") (path . "debug/elf/index#ProgType.GoString") (type . "debug")) ((name . "elf.ProgType.String()") (path . "debug/elf/index#ProgType.String") (type . "debug")) ((name . "elf.R_386") (path . "debug/elf/index#R_386") (type . "debug")) ((name . "elf.R_386.GoString()") (path . "debug/elf/index#R_386.GoString") (type . "debug")) ((name . "elf.R_386.String()") (path . "debug/elf/index#R_386.String") (type . "debug")) ((name . "elf.R_390") (path . "debug/elf/index#R_390") (type . "debug")) ((name . "elf.R_390.GoString()") (path . "debug/elf/index#R_390.GoString") (type . "debug")) ((name . "elf.R_390.String()") (path . "debug/elf/index#R_390.String") (type . "debug")) ((name . "elf.R_AARCH64") (path . "debug/elf/index#R_AARCH64") (type . "debug")) ((name . "elf.R_AARCH64.GoString()") (path . "debug/elf/index#R_AARCH64.GoString") (type . "debug")) ((name . "elf.R_AARCH64.String()") (path . "debug/elf/index#R_AARCH64.String") (type . "debug")) ((name . "elf.R_ALPHA") (path . "debug/elf/index#R_ALPHA") (type . "debug")) ((name . "elf.R_ALPHA.GoString()") (path . "debug/elf/index#R_ALPHA.GoString") (type . "debug")) ((name . "elf.R_ALPHA.String()") (path . "debug/elf/index#R_ALPHA.String") (type . "debug")) ((name . "elf.R_ARM") (path . "debug/elf/index#R_ARM") (type . "debug")) ((name . "elf.R_ARM.GoString()") (path . "debug/elf/index#R_ARM.GoString") (type . "debug")) ((name . "elf.R_ARM.String()") (path . "debug/elf/index#R_ARM.String") (type . "debug")) ((name . "elf.R_INFO()") (path . "debug/elf/index#R_INFO") (type . "debug")) ((name . "elf.R_INFO32()") (path . "debug/elf/index#R_INFO32") (type . "debug")) ((name . "elf.R_LARCH") (path . "debug/elf/index#R_LARCH") (type . "debug")) ((name . "elf.R_LARCH.GoString()") (path . "debug/elf/index#R_LARCH.GoString") (type . "debug")) ((name . "elf.R_LARCH.String()") (path . "debug/elf/index#R_LARCH.String") (type . "debug")) ((name . "elf.R_MIPS") (path . "debug/elf/index#R_MIPS") (type . "debug")) ((name . "elf.R_MIPS.GoString()") (path . "debug/elf/index#R_MIPS.GoString") (type . "debug")) ((name . "elf.R_MIPS.String()") (path . "debug/elf/index#R_MIPS.String") (type . "debug")) ((name . "elf.R_PPC") (path . "debug/elf/index#R_PPC") (type . "debug")) ((name . "elf.R_PPC.GoString()") (path . "debug/elf/index#R_PPC.GoString") (type . "debug")) ((name . "elf.R_PPC.String()") (path . "debug/elf/index#R_PPC.String") (type . "debug")) ((name . "elf.R_PPC64") (path . "debug/elf/index#R_PPC64") (type . "debug")) ((name . "elf.R_PPC64.GoString()") (path . "debug/elf/index#R_PPC64.GoString") (type . "debug")) ((name . "elf.R_PPC64.String()") (path . "debug/elf/index#R_PPC64.String") (type . "debug")) ((name . "elf.R_RISCV") (path . "debug/elf/index#R_RISCV") (type . "debug")) ((name . "elf.R_RISCV.GoString()") (path . "debug/elf/index#R_RISCV.GoString") (type . "debug")) ((name . "elf.R_RISCV.String()") (path . "debug/elf/index#R_RISCV.String") (type . "debug")) ((name . "elf.R_SPARC") (path . "debug/elf/index#R_SPARC") (type . "debug")) ((name . "elf.R_SPARC.GoString()") (path . "debug/elf/index#R_SPARC.GoString") (type . "debug")) ((name . "elf.R_SPARC.String()") (path . "debug/elf/index#R_SPARC.String") (type . "debug")) ((name . "elf.R_SYM32()") (path . "debug/elf/index#R_SYM32") (type . "debug")) ((name . "elf.R_SYM64()") (path . "debug/elf/index#R_SYM64") (type . "debug")) ((name . "elf.R_TYPE32()") (path . "debug/elf/index#R_TYPE32") (type . "debug")) ((name . "elf.R_TYPE64()") (path . "debug/elf/index#R_TYPE64") (type . "debug")) ((name . "elf.R_X86_64") (path . "debug/elf/index#R_X86_64") (type . "debug")) ((name . "elf.R_X86_64.GoString()") (path . "debug/elf/index#R_X86_64.GoString") (type . "debug")) ((name . "elf.R_X86_64.String()") (path . "debug/elf/index#R_X86_64.String") (type . "debug")) ((name . "elf.Rel32") (path . "debug/elf/index#Rel32") (type . "debug")) ((name . "elf.Rel64") (path . "debug/elf/index#Rel64") (type . "debug")) ((name . "elf.Rela32") (path . "debug/elf/index#Rela32") (type . "debug")) ((name . "elf.Rela64") (path . "debug/elf/index#Rela64") (type . "debug")) ((name . "elf.Section") (path . "debug/elf/index#Section") (type . "debug")) ((name . "elf.Section.Data()") (path . "debug/elf/index#Section.Data") (type . "debug")) ((name . "elf.Section.Open()") (path . "debug/elf/index#Section.Open") (type . "debug")) ((name . "elf.Section32") (path . "debug/elf/index#Section32") (type . "debug")) ((name . "elf.Section64") (path . "debug/elf/index#Section64") (type . "debug")) ((name . "elf.SectionFlag") (path . "debug/elf/index#SectionFlag") (type . "debug")) ((name . "elf.SectionFlag.GoString()") (path . "debug/elf/index#SectionFlag.GoString") (type . "debug")) ((name . "elf.SectionFlag.String()") (path . "debug/elf/index#SectionFlag.String") (type . "debug")) ((name . "elf.SectionHeader") (path . "debug/elf/index#SectionHeader") (type . "debug")) ((name . "elf.SectionIndex") (path . "debug/elf/index#SectionIndex") (type . "debug")) ((name . "elf.SectionIndex.GoString()") (path . "debug/elf/index#SectionIndex.GoString") (type . "debug")) ((name . "elf.SectionIndex.String()") (path . "debug/elf/index#SectionIndex.String") (type . "debug")) ((name . "elf.SectionType") (path . "debug/elf/index#SectionType") (type . "debug")) ((name . "elf.SectionType.GoString()") (path . "debug/elf/index#SectionType.GoString") (type . "debug")) ((name . "elf.SectionType.String()") (path . "debug/elf/index#SectionType.String") (type . "debug")) ((name . "elf.ST_BIND()") (path . "debug/elf/index#ST_BIND") (type . "debug")) ((name . "elf.ST_INFO()") (path . "debug/elf/index#ST_INFO") (type . "debug")) ((name . "elf.ST_TYPE()") (path . "debug/elf/index#ST_TYPE") (type . "debug")) ((name . "elf.ST_VISIBILITY()") (path . "debug/elf/index#ST_VISIBILITY") (type . "debug")) ((name . "elf.Sym32") (path . "debug/elf/index#Sym32") (type . "debug")) ((name . "elf.Sym64") (path . "debug/elf/index#Sym64") (type . "debug")) ((name . "elf.SymBind") (path . "debug/elf/index#SymBind") (type . "debug")) ((name . "elf.SymBind.GoString()") (path . "debug/elf/index#SymBind.GoString") (type . "debug")) ((name . "elf.SymBind.String()") (path . "debug/elf/index#SymBind.String") (type . "debug")) ((name . "elf.Symbol") (path . "debug/elf/index#Symbol") (type . "debug")) ((name . "elf.SymType") (path . "debug/elf/index#SymType") (type . "debug")) ((name . "elf.SymType.GoString()") (path . "debug/elf/index#SymType.GoString") (type . "debug")) ((name . "elf.SymType.String()") (path . "debug/elf/index#SymType.String") (type . "debug")) ((name . "elf.SymVis") (path . "debug/elf/index#SymVis") (type . "debug")) ((name . "elf.SymVis.GoString()") (path . "debug/elf/index#SymVis.GoString") (type . "debug")) ((name . "elf.SymVis.String()") (path . "debug/elf/index#SymVis.String") (type . "debug")) ((name . "elf.Type") (path . "debug/elf/index#Type") (type . "debug")) ((name . "elf.Type.GoString()") (path . "debug/elf/index#Type.GoString") (type . "debug")) ((name . "elf.Type.String()") (path . "debug/elf/index#Type.String") (type . "debug")) ((name . "elf.Version") (path . "debug/elf/index#Version") (type . "debug")) ((name . "elf.Version.GoString()") (path . "debug/elf/index#Version.GoString") (type . "debug")) ((name . "elf.Version.String()") (path . "debug/elf/index#Version.String") (type . "debug")) ((name . "elliptic.Curve") (path . "crypto/elliptic/index#Curve") (type . "crypto")) ((name . "elliptic.CurveParams") (path . "crypto/elliptic/index#CurveParams") (type . "crypto")) ((name . "elliptic.CurveParams.Add()") (path . "crypto/elliptic/index#CurveParams.Add") (type . "crypto")) ((name . "elliptic.CurveParams.Double()") (path . "crypto/elliptic/index#CurveParams.Double") (type . "crypto")) ((name . "elliptic.CurveParams.IsOnCurve()") (path . "crypto/elliptic/index#CurveParams.IsOnCurve") (type . "crypto")) ((name . "elliptic.CurveParams.Params()") (path . "crypto/elliptic/index#CurveParams.Params") (type . "crypto")) ((name . "elliptic.CurveParams.ScalarBaseMult()") (path . "crypto/elliptic/index#CurveParams.ScalarBaseMult") (type . "crypto")) ((name . "elliptic.CurveParams.ScalarMult()") (path . "crypto/elliptic/index#CurveParams.ScalarMult") (type . "crypto")) ((name . "elliptic.GenerateKey()") (path . "crypto/elliptic/index#GenerateKey") (type . "crypto")) ((name . "elliptic.Marshal()") (path . "crypto/elliptic/index#Marshal") (type . "crypto")) ((name . "elliptic.MarshalCompressed()") (path . "crypto/elliptic/index#MarshalCompressed") (type . "crypto")) ((name . "elliptic.P224()") (path . "crypto/elliptic/index#P224") (type . "crypto")) ((name . "elliptic.P256()") (path . "crypto/elliptic/index#P256") (type . "crypto")) ((name . "elliptic.P384()") (path . "crypto/elliptic/index#P384") (type . "crypto")) ((name . "elliptic.P521()") (path . "crypto/elliptic/index#P521") (type . "crypto")) ((name . "elliptic.Unmarshal()") (path . "crypto/elliptic/index#Unmarshal") (type . "crypto")) ((name . "elliptic.UnmarshalCompressed()") (path . "crypto/elliptic/index#UnmarshalCompressed") (type . "crypto")) ((name . "embed") (path . "embed/index") (type . "embed")) ((name . "embed.FS") (path . "embed/index#FS") (type . "embed")) ((name . "embed.FS.Open()") (path . "embed/index#FS.Open") (type . "embed")) ((name . "embed.FS.ReadDir()") (path . "embed/index#FS.ReadDir") (type . "embed")) ((name . "embed.FS.ReadFile()") (path . "embed/index#FS.ReadFile") (type . "embed")) ((name . "encoding") (path . "encoding/index") (type . "encoding")) ((name . "encoding.BinaryMarshaler") (path . "encoding/index#BinaryMarshaler") (type . "encoding")) ((name . "encoding.BinaryUnmarshaler") (path . "encoding/index#BinaryUnmarshaler") (type . "encoding")) ((name . "encoding.TextMarshaler") (path . "encoding/index#TextMarshaler") (type . "encoding")) ((name . "encoding.TextUnmarshaler") (path . "encoding/index#TextUnmarshaler") (type . "encoding")) ((name . "encoding/ascii85") (path . "encoding/ascii85/index") (type . "encoding")) ((name . "encoding/asn1") (path . "encoding/asn1/index") (type . "encoding")) ((name . "encoding/asn1 constants") (path . "encoding/asn1/index#pkg-constants") (type . "encoding")) ((name . "encoding/asn1 variables") (path . "encoding/asn1/index#pkg-variables") (type . "encoding")) ((name . "encoding/base32") (path . "encoding/base32/index") (type . "encoding")) ((name . "encoding/base32 constants") (path . "encoding/base32/index#pkg-constants") (type . "encoding")) ((name . "encoding/base32 variables") (path . "encoding/base32/index#pkg-variables") (type . "encoding")) ((name . "encoding/base64") (path . "encoding/base64/index") (type . "encoding")) ((name . "encoding/base64 constants") (path . "encoding/base64/index#pkg-constants") (type . "encoding")) ((name . "encoding/base64 variables") (path . "encoding/base64/index#pkg-variables") (type . "encoding")) ((name . "encoding/binary") (path . "encoding/binary/index") (type . "encoding")) ((name . "encoding/binary constants") (path . "encoding/binary/index#pkg-constants") (type . "encoding")) ((name . "encoding/binary variables") (path . "encoding/binary/index#pkg-variables") (type . "encoding")) ((name . "encoding/csv") (path . "encoding/csv/index") (type . "encoding")) ((name . "encoding/csv variables") (path . "encoding/csv/index#pkg-variables") (type . "encoding")) ((name . "encoding/gob") (path . "encoding/gob/index") (type . "encoding")) ((name . "encoding/hex") (path . "encoding/hex/index") (type . "encoding")) ((name . "encoding/hex variables") (path . "encoding/hex/index#pkg-variables") (type . "encoding")) ((name . "encoding/json") (path . "encoding/json/index") (type . "encoding")) ((name . "encoding/pem") (path . "encoding/pem/index") (type . "encoding")) ((name . "encoding/xml") (path . "encoding/xml/index") (type . "encoding")) ((name . "encoding/xml constants") (path . "encoding/xml/index#pkg-constants") (type . "encoding")) ((name . "encoding/xml variables") (path . "encoding/xml/index#pkg-variables") (type . "encoding")) ((name . "errors") (path . "errors/index") (type . "errors")) ((name . "errors variables") (path . "errors/index#pkg-variables") (type . "errors")) ((name . "errors.As()") (path . "errors/index#As") (type . "errors")) ((name . "errors.Is()") (path . "errors/index#Is") (type . "errors")) ((name . "errors.Join()") (path . "errors/index#Join") (type . "errors")) ((name . "errors.New()") (path . "errors/index#New") (type . "errors")) ((name . "errors.Unwrap()") (path . "errors/index#Unwrap") (type . "errors")) ((name . "exec.Cmd") (path . "os/exec/index#Cmd") (type . "os")) ((name . "exec.Cmd.CombinedOutput()") (path . "os/exec/index#Cmd.CombinedOutput") (type . "os")) ((name . "exec.Cmd.Environ()") (path . "os/exec/index#Cmd.Environ") (type . "os")) ((name . "exec.Cmd.Output()") (path . "os/exec/index#Cmd.Output") (type . "os")) ((name . "exec.Cmd.Run()") (path . "os/exec/index#Cmd.Run") (type . "os")) ((name . "exec.Cmd.Start()") (path . "os/exec/index#Cmd.Start") (type . "os")) ((name . "exec.Cmd.StderrPipe()") (path . "os/exec/index#Cmd.StderrPipe") (type . "os")) ((name . "exec.Cmd.StdinPipe()") (path . "os/exec/index#Cmd.StdinPipe") (type . "os")) ((name . "exec.Cmd.StdoutPipe()") (path . "os/exec/index#Cmd.StdoutPipe") (type . "os")) ((name . "exec.Cmd.String()") (path . "os/exec/index#Cmd.String") (type . "os")) ((name . "exec.Cmd.Wait()") (path . "os/exec/index#Cmd.Wait") (type . "os")) ((name . "exec.Command()") (path . "os/exec/index#Command") (type . "os")) ((name . "exec.CommandContext()") (path . "os/exec/index#CommandContext") (type . "os")) ((name . "exec.Error") (path . "os/exec/index#Error") (type . "os")) ((name . "exec.Error.Error()") (path . "os/exec/index#Error.Error") (type . "os")) ((name . "exec.Error.Unwrap()") (path . "os/exec/index#Error.Unwrap") (type . "os")) ((name . "exec.ExitError") (path . "os/exec/index#ExitError") (type . "os")) ((name . "exec.ExitError.Error()") (path . "os/exec/index#ExitError.Error") (type . "os")) ((name . "exec.LookPath()") (path . "os/exec/index#LookPath") (type . "os")) ((name . "expvar") (path . "expvar/index") (type . "expvar")) ((name . "expvar.Do()") (path . "expvar/index#Do") (type . "expvar")) ((name . "expvar.Float") (path . "expvar/index#Float") (type . "expvar")) ((name . "expvar.Float.Add()") (path . "expvar/index#Float.Add") (type . "expvar")) ((name . "expvar.Float.Set()") (path . "expvar/index#Float.Set") (type . "expvar")) ((name . "expvar.Float.String()") (path . "expvar/index#Float.String") (type . "expvar")) ((name . "expvar.Float.Value()") (path . "expvar/index#Float.Value") (type . "expvar")) ((name . "expvar.Func") (path . "expvar/index#Func") (type . "expvar")) ((name . "expvar.Func.String()") (path . "expvar/index#Func.String") (type . "expvar")) ((name . "expvar.Func.Value()") (path . "expvar/index#Func.Value") (type . "expvar")) ((name . "expvar.Get()") (path . "expvar/index#Get") (type . "expvar")) ((name . "expvar.Handler()") (path . "expvar/index#Handler") (type . "expvar")) ((name . "expvar.Int") (path . "expvar/index#Int") (type . "expvar")) ((name . "expvar.Int.Add()") (path . "expvar/index#Int.Add") (type . "expvar")) ((name . "expvar.Int.Set()") (path . "expvar/index#Int.Set") (type . "expvar")) ((name . "expvar.Int.String()") (path . "expvar/index#Int.String") (type . "expvar")) ((name . "expvar.Int.Value()") (path . "expvar/index#Int.Value") (type . "expvar")) ((name . "expvar.KeyValue") (path . "expvar/index#KeyValue") (type . "expvar")) ((name . "expvar.Map") (path . "expvar/index#Map") (type . "expvar")) ((name . "expvar.Map.Add()") (path . "expvar/index#Map.Add") (type . "expvar")) ((name . "expvar.Map.AddFloat()") (path . "expvar/index#Map.AddFloat") (type . "expvar")) ((name . "expvar.Map.Delete()") (path . "expvar/index#Map.Delete") (type . "expvar")) ((name . "expvar.Map.Do()") (path . "expvar/index#Map.Do") (type . "expvar")) ((name . "expvar.Map.Get()") (path . "expvar/index#Map.Get") (type . "expvar")) ((name . "expvar.Map.Init()") (path . "expvar/index#Map.Init") (type . "expvar")) ((name . "expvar.Map.Set()") (path . "expvar/index#Map.Set") (type . "expvar")) ((name . "expvar.Map.String()") (path . "expvar/index#Map.String") (type . "expvar")) ((name . "expvar.NewFloat()") (path . "expvar/index#NewFloat") (type . "expvar")) ((name . "expvar.NewInt()") (path . "expvar/index#NewInt") (type . "expvar")) ((name . "expvar.NewMap()") (path . "expvar/index#NewMap") (type . "expvar")) ((name . "expvar.NewString()") (path . "expvar/index#NewString") (type . "expvar")) ((name . "expvar.Publish()") (path . "expvar/index#Publish") (type . "expvar")) ((name . "expvar.String") (path . "expvar/index#String") (type . "expvar")) ((name . "expvar.String.Set()") (path . "expvar/index#String.Set") (type . "expvar")) ((name . "expvar.String.String()") (path . "expvar/index#String.String") (type . "expvar")) ((name . "expvar.String.Value()") (path . "expvar/index#String.Value") (type . "expvar")) ((name . "expvar.Var") (path . "expvar/index#Var") (type . "expvar")) ((name . "fcgi.ProcessEnv()") (path . "net/http/fcgi/index#ProcessEnv") (type . "net/http")) ((name . "fcgi.Serve()") (path . "net/http/fcgi/index#Serve") (type . "net/http")) ((name . "filepath.Abs()") (path . "path/filepath/index#Abs") (type . "path")) ((name . "filepath.Base()") (path . "path/filepath/index#Base") (type . "path")) ((name . "filepath.Clean()") (path . "path/filepath/index#Clean") (type . "path")) ((name . "filepath.Dir()") (path . "path/filepath/index#Dir") (type . "path")) ((name . "filepath.EvalSymlinks()") (path . "path/filepath/index#EvalSymlinks") (type . "path")) ((name . "filepath.Ext()") (path . "path/filepath/index#Ext") (type . "path")) ((name . "filepath.FromSlash()") (path . "path/filepath/index#FromSlash") (type . "path")) ((name . "filepath.Glob()") (path . "path/filepath/index#Glob") (type . "path")) ((name . "filepath.HasPrefix()") (path . "path/filepath/index#HasPrefix") (type . "path")) ((name . "filepath.IsAbs()") (path . "path/filepath/index#IsAbs") (type . "path")) ((name . "filepath.IsLocal()") (path . "path/filepath/index#IsLocal") (type . "path")) ((name . "filepath.Join()") (path . "path/filepath/index#Join") (type . "path")) ((name . "filepath.Match()") (path . "path/filepath/index#Match") (type . "path")) ((name . "filepath.Rel()") (path . "path/filepath/index#Rel") (type . "path")) ((name . "filepath.Split()") (path . "path/filepath/index#Split") (type . "path")) ((name . "filepath.SplitList()") (path . "path/filepath/index#SplitList") (type . "path")) ((name . "filepath.ToSlash()") (path . "path/filepath/index#ToSlash") (type . "path")) ((name . "filepath.VolumeName()") (path . "path/filepath/index#VolumeName") (type . "path")) ((name . "filepath.Walk()") (path . "path/filepath/index#Walk") (type . "path")) ((name . "filepath.WalkDir()") (path . "path/filepath/index#WalkDir") (type . "path")) ((name . "filepath.WalkFunc") (path . "path/filepath/index#WalkFunc") (type . "path")) ((name . "flag") (path . "flag/index") (type . "flag")) ((name . "flag variables") (path . "flag/index#pkg-variables") (type . "flag")) ((name . "flag.Arg()") (path . "flag/index#Arg") (type . "flag")) ((name . "flag.Args()") (path . "flag/index#Args") (type . "flag")) ((name . "flag.Bool()") (path . "flag/index#Bool") (type . "flag")) ((name . "flag.BoolFunc()") (path . "flag/index#BoolFunc") (type . "flag")) ((name . "flag.BoolVar()") (path . "flag/index#BoolVar") (type . "flag")) ((name . "flag.Duration()") (path . "flag/index#Duration") (type . "flag")) ((name . "flag.DurationVar()") (path . "flag/index#DurationVar") (type . "flag")) ((name . "flag.ErrorHandling") (path . "flag/index#ErrorHandling") (type . "flag")) ((name . "flag.Flag") (path . "flag/index#Flag") (type . "flag")) ((name . "flag.FlagSet") (path . "flag/index#FlagSet") (type . "flag")) ((name . "flag.FlagSet.Arg()") (path . "flag/index#FlagSet.Arg") (type . "flag")) ((name . "flag.FlagSet.Args()") (path . "flag/index#FlagSet.Args") (type . "flag")) ((name . "flag.FlagSet.Bool()") (path . "flag/index#FlagSet.Bool") (type . "flag")) ((name . "flag.FlagSet.BoolFunc()") (path . "flag/index#FlagSet.BoolFunc") (type . "flag")) ((name . "flag.FlagSet.BoolVar()") (path . "flag/index#FlagSet.BoolVar") (type . "flag")) ((name . "flag.FlagSet.Duration()") (path . "flag/index#FlagSet.Duration") (type . "flag")) ((name . "flag.FlagSet.DurationVar()") (path . "flag/index#FlagSet.DurationVar") (type . "flag")) ((name . "flag.FlagSet.ErrorHandling()") (path . "flag/index#FlagSet.ErrorHandling") (type . "flag")) ((name . "flag.FlagSet.Float64()") (path . "flag/index#FlagSet.Float64") (type . "flag")) ((name . "flag.FlagSet.Float64Var()") (path . "flag/index#FlagSet.Float64Var") (type . "flag")) ((name . "flag.FlagSet.Func()") (path . "flag/index#FlagSet.Func") (type . "flag")) ((name . "flag.FlagSet.Init()") (path . "flag/index#FlagSet.Init") (type . "flag")) ((name . "flag.FlagSet.Int()") (path . "flag/index#FlagSet.Int") (type . "flag")) ((name . "flag.FlagSet.Int64()") (path . "flag/index#FlagSet.Int64") (type . "flag")) ((name . "flag.FlagSet.Int64Var()") (path . "flag/index#FlagSet.Int64Var") (type . "flag")) ((name . "flag.FlagSet.IntVar()") (path . "flag/index#FlagSet.IntVar") (type . "flag")) ((name . "flag.FlagSet.Lookup()") (path . "flag/index#FlagSet.Lookup") (type . "flag")) ((name . "flag.FlagSet.Name()") (path . "flag/index#FlagSet.Name") (type . "flag")) ((name . "flag.FlagSet.NArg()") (path . "flag/index#FlagSet.NArg") (type . "flag")) ((name . "flag.FlagSet.NFlag()") (path . "flag/index#FlagSet.NFlag") (type . "flag")) ((name . "flag.FlagSet.Output()") (path . "flag/index#FlagSet.Output") (type . "flag")) ((name . "flag.FlagSet.Parse()") (path . "flag/index#FlagSet.Parse") (type . "flag")) ((name . "flag.FlagSet.Parsed()") (path . "flag/index#FlagSet.Parsed") (type . "flag")) ((name . "flag.FlagSet.PrintDefaults()") (path . "flag/index#FlagSet.PrintDefaults") (type . "flag")) ((name . "flag.FlagSet.Set()") (path . "flag/index#FlagSet.Set") (type . "flag")) ((name . "flag.FlagSet.SetOutput()") (path . "flag/index#FlagSet.SetOutput") (type . "flag")) ((name . "flag.FlagSet.String()") (path . "flag/index#FlagSet.String") (type . "flag")) ((name . "flag.FlagSet.StringVar()") (path . "flag/index#FlagSet.StringVar") (type . "flag")) ((name . "flag.FlagSet.TextVar()") (path . "flag/index#FlagSet.TextVar") (type . "flag")) ((name . "flag.FlagSet.Uint()") (path . "flag/index#FlagSet.Uint") (type . "flag")) ((name . "flag.FlagSet.Uint64()") (path . "flag/index#FlagSet.Uint64") (type . "flag")) ((name . "flag.FlagSet.Uint64Var()") (path . "flag/index#FlagSet.Uint64Var") (type . "flag")) ((name . "flag.FlagSet.UintVar()") (path . "flag/index#FlagSet.UintVar") (type . "flag")) ((name . "flag.FlagSet.Var()") (path . "flag/index#FlagSet.Var") (type . "flag")) ((name . "flag.FlagSet.Visit()") (path . "flag/index#FlagSet.Visit") (type . "flag")) ((name . "flag.FlagSet.VisitAll()") (path . "flag/index#FlagSet.VisitAll") (type . "flag")) ((name . "flag.Float64()") (path . "flag/index#Float64") (type . "flag")) ((name . "flag.Float64Var()") (path . "flag/index#Float64Var") (type . "flag")) ((name . "flag.Func()") (path . "flag/index#Func") (type . "flag")) ((name . "flag.Getter") (path . "flag/index#Getter") (type . "flag")) ((name . "flag.Int()") (path . "flag/index#Int") (type . "flag")) ((name . "flag.Int64()") (path . "flag/index#Int64") (type . "flag")) ((name . "flag.Int64Var()") (path . "flag/index#Int64Var") (type . "flag")) ((name . "flag.IntVar()") (path . "flag/index#IntVar") (type . "flag")) ((name . "flag.Lookup()") (path . "flag/index#Lookup") (type . "flag")) ((name . "flag.NArg()") (path . "flag/index#NArg") (type . "flag")) ((name . "flag.NewFlagSet()") (path . "flag/index#NewFlagSet") (type . "flag")) ((name . "flag.NFlag()") (path . "flag/index#NFlag") (type . "flag")) ((name . "flag.Parse()") (path . "flag/index#Parse") (type . "flag")) ((name . "flag.Parsed()") (path . "flag/index#Parsed") (type . "flag")) ((name . "flag.PrintDefaults()") (path . "flag/index#PrintDefaults") (type . "flag")) ((name . "flag.Set()") (path . "flag/index#Set") (type . "flag")) ((name . "flag.String()") (path . "flag/index#String") (type . "flag")) ((name . "flag.StringVar()") (path . "flag/index#StringVar") (type . "flag")) ((name . "flag.TextVar()") (path . "flag/index#TextVar") (type . "flag")) ((name . "flag.Uint()") (path . "flag/index#Uint") (type . "flag")) ((name . "flag.Uint64()") (path . "flag/index#Uint64") (type . "flag")) ((name . "flag.Uint64Var()") (path . "flag/index#Uint64Var") (type . "flag")) ((name . "flag.UintVar()") (path . "flag/index#UintVar") (type . "flag")) ((name . "flag.UnquoteUsage()") (path . "flag/index#UnquoteUsage") (type . "flag")) ((name . "flag.Value") (path . "flag/index#Value") (type . "flag")) ((name . "flag.Var()") (path . "flag/index#Var") (type . "flag")) ((name . "flag.Visit()") (path . "flag/index#Visit") (type . "flag")) ((name . "flag.VisitAll()") (path . "flag/index#VisitAll") (type . "flag")) ((name . "flate.CorruptInputError") (path . "compress/flate/index#CorruptInputError") (type . "compress")) ((name . "flate.CorruptInputError.Error()") (path . "compress/flate/index#CorruptInputError.Error") (type . "compress")) ((name . "flate.InternalError") (path . "compress/flate/index#InternalError") (type . "compress")) ((name . "flate.InternalError.Error()") (path . "compress/flate/index#InternalError.Error") (type . "compress")) ((name . "flate.NewReader()") (path . "compress/flate/index#NewReader") (type . "compress")) ((name . "flate.NewReaderDict()") (path . "compress/flate/index#NewReaderDict") (type . "compress")) ((name . "flate.NewWriter()") (path . "compress/flate/index#NewWriter") (type . "compress")) ((name . "flate.NewWriterDict()") (path . "compress/flate/index#NewWriterDict") (type . "compress")) ((name . "flate.Reader") (path . "compress/flate/index#Reader") (type . "compress")) ((name . "flate.ReadError") (path . "compress/flate/index#ReadError") (type . "compress")) ((name . "flate.ReadError.Error()") (path . "compress/flate/index#ReadError.Error") (type . "compress")) ((name . "flate.Resetter") (path . "compress/flate/index#Resetter") (type . "compress")) ((name . "flate.WriteError") (path . "compress/flate/index#WriteError") (type . "compress")) ((name . "flate.WriteError.Error()") (path . "compress/flate/index#WriteError.Error") (type . "compress")) ((name . "flate.Writer") (path . "compress/flate/index#Writer") (type . "compress")) ((name . "flate.Writer.Close()") (path . "compress/flate/index#Writer.Close") (type . "compress")) ((name . "flate.Writer.Flush()") (path . "compress/flate/index#Writer.Flush") (type . "compress")) ((name . "flate.Writer.Reset()") (path . "compress/flate/index#Writer.Reset") (type . "compress")) ((name . "flate.Writer.Write()") (path . "compress/flate/index#Writer.Write") (type . "compress")) ((name . "fmt") (path . "fmt/index") (type . "fmt")) ((name . "fmt.Append()") (path . "fmt/index#Append") (type . "fmt")) ((name . "fmt.Appendf()") (path . "fmt/index#Appendf") (type . "fmt")) ((name . "fmt.Appendln()") (path . "fmt/index#Appendln") (type . "fmt")) ((name . "fmt.Errorf()") (path . "fmt/index#Errorf") (type . "fmt")) ((name . "fmt.FormatString()") (path . "fmt/index#FormatString") (type . "fmt")) ((name . "fmt.Formatter") (path . "fmt/index#Formatter") (type . "fmt")) ((name . "fmt.Fprint()") (path . "fmt/index#Fprint") (type . "fmt")) ((name . "fmt.Fprintf()") (path . "fmt/index#Fprintf") (type . "fmt")) ((name . "fmt.Fprintln()") (path . "fmt/index#Fprintln") (type . "fmt")) ((name . "fmt.Fscan()") (path . "fmt/index#Fscan") (type . "fmt")) ((name . "fmt.Fscanf()") (path . "fmt/index#Fscanf") (type . "fmt")) ((name . "fmt.Fscanln()") (path . "fmt/index#Fscanln") (type . "fmt")) ((name . "fmt.GoStringer") (path . "fmt/index#GoStringer") (type . "fmt")) ((name . "fmt.Print()") (path . "fmt/index#Print") (type . "fmt")) ((name . "fmt.Printf()") (path . "fmt/index#Printf") (type . "fmt")) ((name . "fmt.Println()") (path . "fmt/index#Println") (type . "fmt")) ((name . "fmt.Scan()") (path . "fmt/index#Scan") (type . "fmt")) ((name . "fmt.Scanf()") (path . "fmt/index#Scanf") (type . "fmt")) ((name . "fmt.Scanln()") (path . "fmt/index#Scanln") (type . "fmt")) ((name . "fmt.Scanner") (path . "fmt/index#Scanner") (type . "fmt")) ((name . "fmt.ScanState") (path . "fmt/index#ScanState") (type . "fmt")) ((name . "fmt.Sprint()") (path . "fmt/index#Sprint") (type . "fmt")) ((name . "fmt.Sprintf()") (path . "fmt/index#Sprintf") (type . "fmt")) ((name . "fmt.Sprintln()") (path . "fmt/index#Sprintln") (type . "fmt")) ((name . "fmt.Sscan()") (path . "fmt/index#Sscan") (type . "fmt")) ((name . "fmt.Sscanf()") (path . "fmt/index#Sscanf") (type . "fmt")) ((name . "fmt.Sscanln()") (path . "fmt/index#Sscanln") (type . "fmt")) ((name . "fmt.State") (path . "fmt/index#State") (type . "fmt")) ((name . "fmt.Stringer") (path . "fmt/index#Stringer") (type . "fmt")) ((name . "fnv.New128()") (path . "hash/fnv/index#New128") (type . "hash")) ((name . "fnv.New128a()") (path . "hash/fnv/index#New128a") (type . "hash")) ((name . "fnv.New32()") (path . "hash/fnv/index#New32") (type . "hash")) ((name . "fnv.New32a()") (path . "hash/fnv/index#New32a") (type . "hash")) ((name . "fnv.New64()") (path . "hash/fnv/index#New64") (type . "hash")) ((name . "fnv.New64a()") (path . "hash/fnv/index#New64a") (type . "hash")) ((name . "format.Node()") (path . "go/format/index#Node") (type . "go")) ((name . "format.Source()") (path . "go/format/index#Source") (type . "go")) ((name . "fs.DirEntry") (path . "io/fs/index#DirEntry") (type . "io")) ((name . "fs.File") (path . "io/fs/index#File") (type . "io")) ((name . "fs.FileInfo") (path . "io/fs/index#FileInfo") (type . "io")) ((name . "fs.FileInfoToDirEntry()") (path . "io/fs/index#FileInfoToDirEntry") (type . "io")) ((name . "fs.FileMode") (path . "io/fs/index#FileMode") (type . "io")) ((name . "fs.FileMode.IsDir()") (path . "io/fs/index#FileMode.IsDir") (type . "io")) ((name . "fs.FileMode.IsRegular()") (path . "io/fs/index#FileMode.IsRegular") (type . "io")) ((name . "fs.FileMode.Perm()") (path . "io/fs/index#FileMode.Perm") (type . "io")) ((name . "fs.FileMode.String()") (path . "io/fs/index#FileMode.String") (type . "io")) ((name . "fs.FileMode.Type()") (path . "io/fs/index#FileMode.Type") (type . "io")) ((name . "fs.FormatDirEntry()") (path . "io/fs/index#FormatDirEntry") (type . "io")) ((name . "fs.FormatFileInfo()") (path . "io/fs/index#FormatFileInfo") (type . "io")) ((name . "fs.FS") (path . "io/fs/index#FS") (type . "io")) ((name . "fs.Glob()") (path . "io/fs/index#Glob") (type . "io")) ((name . "fs.GlobFS") (path . "io/fs/index#GlobFS") (type . "io")) ((name . "fs.PathError") (path . "io/fs/index#PathError") (type . "io")) ((name . "fs.PathError.Error()") (path . "io/fs/index#PathError.Error") (type . "io")) ((name . "fs.PathError.Timeout()") (path . "io/fs/index#PathError.Timeout") (type . "io")) ((name . "fs.PathError.Unwrap()") (path . "io/fs/index#PathError.Unwrap") (type . "io")) ((name . "fs.ReadDir()") (path . "io/fs/index#ReadDir") (type . "io")) ((name . "fs.ReadDirFile") (path . "io/fs/index#ReadDirFile") (type . "io")) ((name . "fs.ReadDirFS") (path . "io/fs/index#ReadDirFS") (type . "io")) ((name . "fs.ReadFile()") (path . "io/fs/index#ReadFile") (type . "io")) ((name . "fs.ReadFileFS") (path . "io/fs/index#ReadFileFS") (type . "io")) ((name . "fs.Stat()") (path . "io/fs/index#Stat") (type . "io")) ((name . "fs.StatFS") (path . "io/fs/index#StatFS") (type . "io")) ((name . "fs.Sub()") (path . "io/fs/index#Sub") (type . "io")) ((name . "fs.SubFS") (path . "io/fs/index#SubFS") (type . "io")) ((name . "fs.ValidPath()") (path . "io/fs/index#ValidPath") (type . "io")) ((name . "fs.WalkDir()") (path . "io/fs/index#WalkDir") (type . "io")) ((name . "fs.WalkDirFunc") (path . "io/fs/index#WalkDirFunc") (type . "io")) ((name . "fstest.MapFile") (path . "testing/fstest/index#MapFile") (type . "testing")) ((name . "fstest.MapFS") (path . "testing/fstest/index#MapFS") (type . "testing")) ((name . "fstest.MapFS.Glob()") (path . "testing/fstest/index#MapFS.Glob") (type . "testing")) ((name . "fstest.MapFS.Open()") (path . "testing/fstest/index#MapFS.Open") (type . "testing")) ((name . "fstest.MapFS.ReadDir()") (path . "testing/fstest/index#MapFS.ReadDir") (type . "testing")) ((name . "fstest.MapFS.ReadFile()") (path . "testing/fstest/index#MapFS.ReadFile") (type . "testing")) ((name . "fstest.MapFS.Stat()") (path . "testing/fstest/index#MapFS.Stat") (type . "testing")) ((name . "fstest.MapFS.Sub()") (path . "testing/fstest/index#MapFS.Sub") (type . "testing")) ((name . "fstest.TestFS()") (path . "testing/fstest/index#TestFS") (type . "testing")) ((name . "gif.Decode()") (path . "image/gif/index#Decode") (type . "image")) ((name . "gif.DecodeAll()") (path . "image/gif/index#DecodeAll") (type . "image")) ((name . "gif.DecodeConfig()") (path . "image/gif/index#DecodeConfig") (type . "image")) ((name . "gif.Encode()") (path . "image/gif/index#Encode") (type . "image")) ((name . "gif.EncodeAll()") (path . "image/gif/index#EncodeAll") (type . "image")) ((name . "gif.GIF") (path . "image/gif/index#GIF") (type . "image")) ((name . "gif.Options") (path . "image/gif/index#Options") (type . "image")) ((name . "go/ast") (path . "go/ast/index") (type . "go")) ((name . "go/build") (path . "go/build/index") (type . "go")) ((name . "go/build variables") (path . "go/build/index#pkg-variables") (type . "go")) ((name . "go/build/constraint") (path . "go/build/constraint/index") (type . "go")) ((name . "go/constant") (path . "go/constant/index") (type . "go")) ((name . "go/doc") (path . "go/doc/index") (type . "go")) ((name . "go/doc variables") (path . "go/doc/index#pkg-variables") (type . "go")) ((name . "go/doc/comment") (path . "go/doc/comment/index") (type . "go")) ((name . "go/format") (path . "go/format/index") (type . "go")) ((name . "go/importer") (path . "go/importer/index") (type . "go")) ((name . "go/parser") (path . "go/parser/index") (type . "go")) ((name . "go/printer") (path . "go/printer/index") (type . "go")) ((name . "go/scanner") (path . "go/scanner/index") (type . "go")) ((name . "go/token") (path . "go/token/index") (type . "go")) ((name . "go/token constants") (path . "go/token/index#pkg-constants") (type . "go")) ((name . "go/types") (path . "go/types/index") (type . "go")) ((name . "go/types variables") (path . "go/types/index#pkg-variables") (type . "go")) ((name . "go/version") (path . "go/version/index") (type . "go")) ((name . "goarch.ArchFamilyType") (path . "internal/goarch/index#ArchFamilyType") (type . "internal")) ((name . "gob.CommonType") (path . "encoding/gob/index#CommonType") (type . "encoding")) ((name . "gob.Decoder") (path . "encoding/gob/index#Decoder") (type . "encoding")) ((name . "gob.Decoder.Decode()") (path . "encoding/gob/index#Decoder.Decode") (type . "encoding")) ((name . "gob.Decoder.DecodeValue()") (path . "encoding/gob/index#Decoder.DecodeValue") (type . "encoding")) ((name . "gob.Encoder") (path . "encoding/gob/index#Encoder") (type . "encoding")) ((name . "gob.Encoder.Encode()") (path . "encoding/gob/index#Encoder.Encode") (type . "encoding")) ((name . "gob.Encoder.EncodeValue()") (path . "encoding/gob/index#Encoder.EncodeValue") (type . "encoding")) ((name . "gob.GobDecoder") (path . "encoding/gob/index#GobDecoder") (type . "encoding")) ((name . "gob.GobEncoder") (path . "encoding/gob/index#GobEncoder") (type . "encoding")) ((name . "gob.NewDecoder()") (path . "encoding/gob/index#NewDecoder") (type . "encoding")) ((name . "gob.NewEncoder()") (path . "encoding/gob/index#NewEncoder") (type . "encoding")) ((name . "gob.Register()") (path . "encoding/gob/index#Register") (type . "encoding")) ((name . "gob.RegisterName()") (path . "encoding/gob/index#RegisterName") (type . "encoding")) ((name . "gosym.DecodingError") (path . "debug/gosym/index#DecodingError") (type . "debug")) ((name . "gosym.DecodingError.Error()") (path . "debug/gosym/index#DecodingError.Error") (type . "debug")) ((name . "gosym.Func") (path . "debug/gosym/index#Func") (type . "debug")) ((name . "gosym.LineTable") (path . "debug/gosym/index#LineTable") (type . "debug")) ((name . "gosym.LineTable.LineToPC()") (path . "debug/gosym/index#LineTable.LineToPC") (type . "debug")) ((name . "gosym.LineTable.PCToLine()") (path . "debug/gosym/index#LineTable.PCToLine") (type . "debug")) ((name . "gosym.NewLineTable()") (path . "debug/gosym/index#NewLineTable") (type . "debug")) ((name . "gosym.NewTable()") (path . "debug/gosym/index#NewTable") (type . "debug")) ((name . "gosym.Obj") (path . "debug/gosym/index#Obj") (type . "debug")) ((name . "gosym.Sym") (path . "debug/gosym/index#Sym") (type . "debug")) ((name . "gosym.Sym.BaseName()") (path . "debug/gosym/index#Sym.BaseName") (type . "debug")) ((name . "gosym.Sym.PackageName()") (path . "debug/gosym/index#Sym.PackageName") (type . "debug")) ((name . "gosym.Sym.ReceiverName()") (path . "debug/gosym/index#Sym.ReceiverName") (type . "debug")) ((name . "gosym.Sym.Static()") (path . "debug/gosym/index#Sym.Static") (type . "debug")) ((name . "gosym.Table") (path . "debug/gosym/index#Table") (type . "debug")) ((name . "gosym.Table.LineToPC()") (path . "debug/gosym/index#Table.LineToPC") (type . "debug")) ((name . "gosym.Table.LookupFunc()") (path . "debug/gosym/index#Table.LookupFunc") (type . "debug")) ((name . "gosym.Table.LookupSym()") (path . "debug/gosym/index#Table.LookupSym") (type . "debug")) ((name . "gosym.Table.PCToFunc()") (path . "debug/gosym/index#Table.PCToFunc") (type . "debug")) ((name . "gosym.Table.PCToLine()") (path . "debug/gosym/index#Table.PCToLine") (type . "debug")) ((name . "gosym.Table.SymByAddr()") (path . "debug/gosym/index#Table.SymByAddr") (type . "debug")) ((name . "gosym.UnknownFileError") (path . "debug/gosym/index#UnknownFileError") (type . "debug")) ((name . "gosym.UnknownFileError.Error()") (path . "debug/gosym/index#UnknownFileError.Error") (type . "debug")) ((name . "gosym.UnknownLineError") (path . "debug/gosym/index#UnknownLineError") (type . "debug")) ((name . "gosym.UnknownLineError.Error()") (path . "debug/gosym/index#UnknownLineError.Error") (type . "debug")) ((name . "gzip.Header") (path . "compress/gzip/index#Header") (type . "compress")) ((name . "gzip.NewReader()") (path . "compress/gzip/index#NewReader") (type . "compress")) ((name . "gzip.NewWriter()") (path . "compress/gzip/index#NewWriter") (type . "compress")) ((name . "gzip.NewWriterLevel()") (path . "compress/gzip/index#NewWriterLevel") (type . "compress")) ((name . "gzip.Reader") (path . "compress/gzip/index#Reader") (type . "compress")) ((name . "gzip.Reader.Close()") (path . "compress/gzip/index#Reader.Close") (type . "compress")) ((name . "gzip.Reader.Multistream()") (path . "compress/gzip/index#Reader.Multistream") (type . "compress")) ((name . "gzip.Reader.Read()") (path . "compress/gzip/index#Reader.Read") (type . "compress")) ((name . "gzip.Reader.Reset()") (path . "compress/gzip/index#Reader.Reset") (type . "compress")) ((name . "gzip.Writer") (path . "compress/gzip/index#Writer") (type . "compress")) ((name . "gzip.Writer.Close()") (path . "compress/gzip/index#Writer.Close") (type . "compress")) ((name . "gzip.Writer.Flush()") (path . "compress/gzip/index#Writer.Flush") (type . "compress")) ((name . "gzip.Writer.Reset()") (path . "compress/gzip/index#Writer.Reset") (type . "compress")) ((name . "gzip.Writer.Write()") (path . "compress/gzip/index#Writer.Write") (type . "compress")) ((name . "hash") (path . "hash/index") (type . "hash")) ((name . "hash.Hash") (path . "hash/index#Hash") (type . "hash")) ((name . "hash.Hash32") (path . "hash/index#Hash32") (type . "hash")) ((name . "hash.Hash64") (path . "hash/index#Hash64") (type . "hash")) ((name . "hash/adler32") (path . "hash/adler32/index") (type . "hash")) ((name . "hash/adler32 constants") (path . "hash/adler32/index#pkg-constants") (type . "hash")) ((name . "hash/crc32") (path . "hash/crc32/index") (type . "hash")) ((name . "hash/crc32 constants") (path . "hash/crc32/index#pkg-constants") (type . "hash")) ((name . "hash/crc32 variables") (path . "hash/crc32/index#pkg-variables") (type . "hash")) ((name . "hash/crc64") (path . "hash/crc64/index") (type . "hash")) ((name . "hash/crc64 constants") (path . "hash/crc64/index#pkg-constants") (type . "hash")) ((name . "hash/fnv") (path . "hash/fnv/index") (type . "hash")) ((name . "hash/maphash") (path . "hash/maphash/index") (type . "hash")) ((name . "heap.Fix()") (path . "container/heap/index#Fix") (type . "container")) ((name . "heap.Init()") (path . "container/heap/index#Init") (type . "container")) ((name . "heap.Interface") (path . "container/heap/index#Interface") (type . "container")) ((name . "heap.Pop()") (path . "container/heap/index#Pop") (type . "container")) ((name . "heap.Push()") (path . "container/heap/index#Push") (type . "container")) ((name . "heap.Remove()") (path . "container/heap/index#Remove") (type . "container")) ((name . "hex.AppendDecode()") (path . "encoding/hex/index#AppendDecode") (type . "encoding")) ((name . "hex.AppendEncode()") (path . "encoding/hex/index#AppendEncode") (type . "encoding")) ((name . "hex.Decode()") (path . "encoding/hex/index#Decode") (type . "encoding")) ((name . "hex.DecodedLen()") (path . "encoding/hex/index#DecodedLen") (type . "encoding")) ((name . "hex.DecodeString()") (path . "encoding/hex/index#DecodeString") (type . "encoding")) ((name . "hex.Dump()") (path . "encoding/hex/index#Dump") (type . "encoding")) ((name . "hex.Dumper()") (path . "encoding/hex/index#Dumper") (type . "encoding")) ((name . "hex.Encode()") (path . "encoding/hex/index#Encode") (type . "encoding")) ((name . "hex.EncodedLen()") (path . "encoding/hex/index#EncodedLen") (type . "encoding")) ((name . "hex.EncodeToString()") (path . "encoding/hex/index#EncodeToString") (type . "encoding")) ((name . "hex.InvalidByteError") (path . "encoding/hex/index#InvalidByteError") (type . "encoding")) ((name . "hex.InvalidByteError.Error()") (path . "encoding/hex/index#InvalidByteError.Error") (type . "encoding")) ((name . "hex.NewDecoder()") (path . "encoding/hex/index#NewDecoder") (type . "encoding")) ((name . "hex.NewEncoder()") (path . "encoding/hex/index#NewEncoder") (type . "encoding")) ((name . "hmac.Equal()") (path . "crypto/hmac/index#Equal") (type . "crypto")) ((name . "hmac.New()") (path . "crypto/hmac/index#New") (type . "crypto")) ((name . "html") (path . "html/index") (type . "html")) ((name . "html.EscapeString()") (path . "html/index#EscapeString") (type . "html")) ((name . "html.UnescapeString()") (path . "html/index#UnescapeString") (type . "html")) ((name . "html/template") (path . "html/template/index") (type . "html")) ((name . "http.AllowQuerySemicolons()") (path . "net/http/index#AllowQuerySemicolons") (type . "net/http")) ((name . "http.CanonicalHeaderKey()") (path . "net/http/index#CanonicalHeaderKey") (type . "net/http")) ((name . "http.Client") (path . "net/http/index#Client") (type . "net/http")) ((name . "http.Client.CloseIdleConnections()") (path . "net/http/index#Client.CloseIdleConnections") (type . "net/http")) ((name . "http.Client.Do()") (path . "net/http/index#Client.Do") (type . "net/http")) ((name . "http.Client.Get()") (path . "net/http/index#Client.Get") (type . "net/http")) ((name . "http.Client.Head()") (path . "net/http/index#Client.Head") (type . "net/http")) ((name . "http.Client.Post()") (path . "net/http/index#Client.Post") (type . "net/http")) ((name . "http.Client.PostForm()") (path . "net/http/index#Client.PostForm") (type . "net/http")) ((name . "http.CloseNotifier") (path . "net/http/index#CloseNotifier") (type . "net/http")) ((name . "http.ConnState") (path . "net/http/index#ConnState") (type . "net/http")) ((name . "http.ConnState.String()") (path . "net/http/index#ConnState.String") (type . "net/http")) ((name . "http.Cookie") (path . "net/http/index#Cookie") (type . "net/http")) ((name . "http.Cookie.String()") (path . "net/http/index#Cookie.String") (type . "net/http")) ((name . "http.Cookie.Valid()") (path . "net/http/index#Cookie.Valid") (type . "net/http")) ((name . "http.CookieJar") (path . "net/http/index#CookieJar") (type . "net/http")) ((name . "http.DetectContentType()") (path . "net/http/index#DetectContentType") (type . "net/http")) ((name . "http.Dir") (path . "net/http/index#Dir") (type . "net/http")) ((name . "http.Dir.Open()") (path . "net/http/index#Dir.Open") (type . "net/http")) ((name . "http.Error()") (path . "net/http/index#Error") (type . "net/http")) ((name . "http.File") (path . "net/http/index#File") (type . "net/http")) ((name . "http.FileServer()") (path . "net/http/index#FileServer") (type . "net/http")) ((name . "http.FileServerFS()") (path . "net/http/index#FileServerFS") (type . "net/http")) ((name . "http.FileSystem") (path . "net/http/index#FileSystem") (type . "net/http")) ((name . "http.Flusher") (path . "net/http/index#Flusher") (type . "net/http")) ((name . "http.FS()") (path . "net/http/index#FS") (type . "net/http")) ((name . "http.Get()") (path . "net/http/index#Get") (type . "net/http")) ((name . "http.Handle()") (path . "net/http/index#Handle") (type . "net/http")) ((name . "http.HandleFunc()") (path . "net/http/index#HandleFunc") (type . "net/http")) ((name . "http.Handler") (path . "net/http/index#Handler") (type . "net/http")) ((name . "http.HandlerFunc") (path . "net/http/index#HandlerFunc") (type . "net/http")) ((name . "http.HandlerFunc.ServeHTTP()") (path . "net/http/index#HandlerFunc.ServeHTTP") (type . "net/http")) ((name . "http.Head()") (path . "net/http/index#Head") (type . "net/http")) ((name . "http.Header") (path . "net/http/index#Header") (type . "net/http")) ((name . "http.Header.Add()") (path . "net/http/index#Header.Add") (type . "net/http")) ((name . "http.Header.Clone()") (path . "net/http/index#Header.Clone") (type . "net/http")) ((name . "http.Header.Del()") (path . "net/http/index#Header.Del") (type . "net/http")) ((name . "http.Header.Get()") (path . "net/http/index#Header.Get") (type . "net/http")) ((name . "http.Header.Set()") (path . "net/http/index#Header.Set") (type . "net/http")) ((name . "http.Header.Values()") (path . "net/http/index#Header.Values") (type . "net/http")) ((name . "http.Header.Write()") (path . "net/http/index#Header.Write") (type . "net/http")) ((name . "http.Header.WriteSubset()") (path . "net/http/index#Header.WriteSubset") (type . "net/http")) ((name . "http.Hijacker") (path . "net/http/index#Hijacker") (type . "net/http")) ((name . "http.ListenAndServe()") (path . "net/http/index#ListenAndServe") (type . "net/http")) ((name . "http.ListenAndServeTLS()") (path . "net/http/index#ListenAndServeTLS") (type . "net/http")) ((name . "http.MaxBytesError") (path . "net/http/index#MaxBytesError") (type . "net/http")) ((name . "http.MaxBytesError.Error()") (path . "net/http/index#MaxBytesError.Error") (type . "net/http")) ((name . "http.MaxBytesHandler()") (path . "net/http/index#MaxBytesHandler") (type . "net/http")) ((name . "http.MaxBytesReader()") (path . "net/http/index#MaxBytesReader") (type . "net/http")) ((name . "http.NewFileTransport()") (path . "net/http/index#NewFileTransport") (type . "net/http")) ((name . "http.NewFileTransportFS()") (path . "net/http/index#NewFileTransportFS") (type . "net/http")) ((name . "http.NewRequest()") (path . "net/http/index#NewRequest") (type . "net/http")) ((name . "http.NewRequestWithContext()") (path . "net/http/index#NewRequestWithContext") (type . "net/http")) ((name . "http.NewResponseController()") (path . "net/http/index#NewResponseController") (type . "net/http")) ((name . "http.NewServeMux()") (path . "net/http/index#NewServeMux") (type . "net/http")) ((name . "http.NotFound()") (path . "net/http/index#NotFound") (type . "net/http")) ((name . "http.NotFoundHandler()") (path . "net/http/index#NotFoundHandler") (type . "net/http")) ((name . "http.ParseHTTPVersion()") (path . "net/http/index#ParseHTTPVersion") (type . "net/http")) ((name . "http.ParseTime()") (path . "net/http/index#ParseTime") (type . "net/http")) ((name . "http.Post()") (path . "net/http/index#Post") (type . "net/http")) ((name . "http.PostForm()") (path . "net/http/index#PostForm") (type . "net/http")) ((name . "http.ProtocolError") (path . "net/http/index#ProtocolError") (type . "net/http")) ((name . "http.ProtocolError.Error()") (path . "net/http/index#ProtocolError.Error") (type . "net/http")) ((name . "http.ProtocolError.Is()") (path . "net/http/index#ProtocolError.Is") (type . "net/http")) ((name . "http.ProxyFromEnvironment()") (path . "net/http/index#ProxyFromEnvironment") (type . "net/http")) ((name . "http.ProxyURL()") (path . "net/http/index#ProxyURL") (type . "net/http")) ((name . "http.Pusher") (path . "net/http/index#Pusher") (type . "net/http")) ((name . "http.PushOptions") (path . "net/http/index#PushOptions") (type . "net/http")) ((name . "http.ReadRequest()") (path . "net/http/index#ReadRequest") (type . "net/http")) ((name . "http.ReadResponse()") (path . "net/http/index#ReadResponse") (type . "net/http")) ((name . "http.Redirect()") (path . "net/http/index#Redirect") (type . "net/http")) ((name . "http.RedirectHandler()") (path . "net/http/index#RedirectHandler") (type . "net/http")) ((name . "http.Request") (path . "net/http/index#Request") (type . "net/http")) ((name . "http.Request.AddCookie()") (path . "net/http/index#Request.AddCookie") (type . "net/http")) ((name . "http.Request.BasicAuth()") (path . "net/http/index#Request.BasicAuth") (type . "net/http")) ((name . "http.Request.Clone()") (path . "net/http/index#Request.Clone") (type . "net/http")) ((name . "http.Request.Context()") (path . "net/http/index#Request.Context") (type . "net/http")) ((name . "http.Request.Cookie()") (path . "net/http/index#Request.Cookie") (type . "net/http")) ((name . "http.Request.Cookies()") (path . "net/http/index#Request.Cookies") (type . "net/http")) ((name . "http.Request.FormFile()") (path . "net/http/index#Request.FormFile") (type . "net/http")) ((name . "http.Request.FormValue()") (path . "net/http/index#Request.FormValue") (type . "net/http")) ((name . "http.Request.MultipartReader()") (path . "net/http/index#Request.MultipartReader") (type . "net/http")) ((name . "http.Request.ParseForm()") (path . "net/http/index#Request.ParseForm") (type . "net/http")) ((name . "http.Request.ParseMultipartForm()") (path . "net/http/index#Request.ParseMultipartForm") (type . "net/http")) ((name . "http.Request.PathValue()") (path . "net/http/index#Request.PathValue") (type . "net/http")) ((name . "http.Request.PostFormValue()") (path . "net/http/index#Request.PostFormValue") (type . "net/http")) ((name . "http.Request.ProtoAtLeast()") (path . "net/http/index#Request.ProtoAtLeast") (type . "net/http")) ((name . "http.Request.Referer()") (path . "net/http/index#Request.Referer") (type . "net/http")) ((name . "http.Request.SetBasicAuth()") (path . "net/http/index#Request.SetBasicAuth") (type . "net/http")) ((name . "http.Request.SetPathValue()") (path . "net/http/index#Request.SetPathValue") (type . "net/http")) ((name . "http.Request.UserAgent()") (path . "net/http/index#Request.UserAgent") (type . "net/http")) ((name . "http.Request.WithContext()") (path . "net/http/index#Request.WithContext") (type . "net/http")) ((name . "http.Request.Write()") (path . "net/http/index#Request.Write") (type . "net/http")) ((name . "http.Request.WriteProxy()") (path . "net/http/index#Request.WriteProxy") (type . "net/http")) ((name . "http.Response") (path . "net/http/index#Response") (type . "net/http")) ((name . "http.Response.Cookies()") (path . "net/http/index#Response.Cookies") (type . "net/http")) ((name . "http.Response.Location()") (path . "net/http/index#Response.Location") (type . "net/http")) ((name . "http.Response.ProtoAtLeast()") (path . "net/http/index#Response.ProtoAtLeast") (type . "net/http")) ((name . "http.Response.Write()") (path . "net/http/index#Response.Write") (type . "net/http")) ((name . "http.ResponseController") (path . "net/http/index#ResponseController") (type . "net/http")) ((name . "http.ResponseController.EnableFullDuplex()") (path . "net/http/index#ResponseController.EnableFullDuplex") (type . "net/http")) ((name . "http.ResponseController.Flush()") (path . "net/http/index#ResponseController.Flush") (type . "net/http")) ((name . "http.ResponseController.Hijack()") (path . "net/http/index#ResponseController.Hijack") (type . "net/http")) ((name . "http.ResponseController.SetReadDeadline()") (path . "net/http/index#ResponseController.SetReadDeadline") (type . "net/http")) ((name . "http.ResponseController.SetWriteDeadline()") (path . "net/http/index#ResponseController.SetWriteDeadline") (type . "net/http")) ((name . "http.ResponseWriter") (path . "net/http/index#ResponseWriter") (type . "net/http")) ((name . "http.RoundTripper") (path . "net/http/index#RoundTripper") (type . "net/http")) ((name . "http.SameSite") (path . "net/http/index#SameSite") (type . "net/http")) ((name . "http.Serve()") (path . "net/http/index#Serve") (type . "net/http")) ((name . "http.ServeContent()") (path . "net/http/index#ServeContent") (type . "net/http")) ((name . "http.ServeFile()") (path . "net/http/index#ServeFile") (type . "net/http")) ((name . "http.ServeFileFS()") (path . "net/http/index#ServeFileFS") (type . "net/http")) ((name . "http.ServeMux") (path . "net/http/index#ServeMux") (type . "net/http")) ((name . "http.ServeMux.Handle()") (path . "net/http/index#ServeMux.Handle") (type . "net/http")) ((name . "http.ServeMux.HandleFunc()") (path . "net/http/index#ServeMux.HandleFunc") (type . "net/http")) ((name . "http.ServeMux.Handler()") (path . "net/http/index#ServeMux.Handler") (type . "net/http")) ((name . "http.ServeMux.ServeHTTP()") (path . "net/http/index#ServeMux.ServeHTTP") (type . "net/http")) ((name . "http.Server") (path . "net/http/index#Server") (type . "net/http")) ((name . "http.Server.Close()") (path . "net/http/index#Server.Close") (type . "net/http")) ((name . "http.Server.ListenAndServe()") (path . "net/http/index#Server.ListenAndServe") (type . "net/http")) ((name . "http.Server.ListenAndServeTLS()") (path . "net/http/index#Server.ListenAndServeTLS") (type . "net/http")) ((name . "http.Server.RegisterOnShutdown()") (path . "net/http/index#Server.RegisterOnShutdown") (type . "net/http")) ((name . "http.Server.Serve()") (path . "net/http/index#Server.Serve") (type . "net/http")) ((name . "http.Server.ServeTLS()") (path . "net/http/index#Server.ServeTLS") (type . "net/http")) ((name . "http.Server.SetKeepAlivesEnabled()") (path . "net/http/index#Server.SetKeepAlivesEnabled") (type . "net/http")) ((name . "http.Server.Shutdown()") (path . "net/http/index#Server.Shutdown") (type . "net/http")) ((name . "http.ServeTLS()") (path . "net/http/index#ServeTLS") (type . "net/http")) ((name . "http.SetCookie()") (path . "net/http/index#SetCookie") (type . "net/http")) ((name . "http.StatusText()") (path . "net/http/index#StatusText") (type . "net/http")) ((name . "http.StripPrefix()") (path . "net/http/index#StripPrefix") (type . "net/http")) ((name . "http.TimeoutHandler()") (path . "net/http/index#TimeoutHandler") (type . "net/http")) ((name . "http.Transport") (path . "net/http/index#Transport") (type . "net/http")) ((name . "http.Transport.CancelRequest()") (path . "net/http/index#Transport.CancelRequest") (type . "net/http")) ((name . "http.Transport.Clone()") (path . "net/http/index#Transport.Clone") (type . "net/http")) ((name . "http.Transport.CloseIdleConnections()") (path . "net/http/index#Transport.CloseIdleConnections") (type . "net/http")) ((name . "http.Transport.RegisterProtocol()") (path . "net/http/index#Transport.RegisterProtocol") (type . "net/http")) ((name . "http.Transport.RoundTrip()") (path . "net/http/index#Transport.RoundTrip") (type . "net/http")) ((name . "httptest.NewRecorder()") (path . "net/http/httptest/index#NewRecorder") (type . "net/http")) ((name . "httptest.NewRequest()") (path . "net/http/httptest/index#NewRequest") (type . "net/http")) ((name . "httptest.NewServer()") (path . "net/http/httptest/index#NewServer") (type . "net/http")) ((name . "httptest.NewTLSServer()") (path . "net/http/httptest/index#NewTLSServer") (type . "net/http")) ((name . "httptest.NewUnstartedServer()") (path . "net/http/httptest/index#NewUnstartedServer") (type . "net/http")) ((name . "httptest.ResponseRecorder") (path . "net/http/httptest/index#ResponseRecorder") (type . "net/http")) ((name . "httptest.ResponseRecorder.Flush()") (path . "net/http/httptest/index#ResponseRecorder.Flush") (type . "net/http")) ((name . "httptest.ResponseRecorder.Header()") (path . "net/http/httptest/index#ResponseRecorder.Header") (type . "net/http")) ((name . "httptest.ResponseRecorder.Result()") (path . "net/http/httptest/index#ResponseRecorder.Result") (type . "net/http")) ((name . "httptest.ResponseRecorder.Write()") (path . "net/http/httptest/index#ResponseRecorder.Write") (type . "net/http")) ((name . "httptest.ResponseRecorder.WriteHeader()") (path . "net/http/httptest/index#ResponseRecorder.WriteHeader") (type . "net/http")) ((name . "httptest.ResponseRecorder.WriteString()") (path . "net/http/httptest/index#ResponseRecorder.WriteString") (type . "net/http")) ((name . "httptest.Server") (path . "net/http/httptest/index#Server") (type . "net/http")) ((name . "httptest.Server.Certificate()") (path . "net/http/httptest/index#Server.Certificate") (type . "net/http")) ((name . "httptest.Server.Client()") (path . "net/http/httptest/index#Server.Client") (type . "net/http")) ((name . "httptest.Server.Close()") (path . "net/http/httptest/index#Server.Close") (type . "net/http")) ((name . "httptest.Server.CloseClientConnections()") (path . "net/http/httptest/index#Server.CloseClientConnections") (type . "net/http")) ((name . "httptest.Server.Start()") (path . "net/http/httptest/index#Server.Start") (type . "net/http")) ((name . "httptest.Server.StartTLS()") (path . "net/http/httptest/index#Server.StartTLS") (type . "net/http")) ((name . "httptrace.ClientTrace") (path . "net/http/httptrace/index#ClientTrace") (type . "net/http")) ((name . "httptrace.ContextClientTrace()") (path . "net/http/httptrace/index#ContextClientTrace") (type . "net/http")) ((name . "httptrace.DNSDoneInfo") (path . "net/http/httptrace/index#DNSDoneInfo") (type . "net/http")) ((name . "httptrace.DNSStartInfo") (path . "net/http/httptrace/index#DNSStartInfo") (type . "net/http")) ((name . "httptrace.GotConnInfo") (path . "net/http/httptrace/index#GotConnInfo") (type . "net/http")) ((name . "httptrace.WithClientTrace()") (path . "net/http/httptrace/index#WithClientTrace") (type . "net/http")) ((name . "httptrace.WroteRequestInfo") (path . "net/http/httptrace/index#WroteRequestInfo") (type . "net/http")) ((name . "httputil.BufferPool") (path . "net/http/httputil/index#BufferPool") (type . "net/http")) ((name . "httputil.ClientConn") (path . "net/http/httputil/index#ClientConn") (type . "net/http")) ((name . "httputil.ClientConn.Close()") (path . "net/http/httputil/index#ClientConn.Close") (type . "net/http")) ((name . "httputil.ClientConn.Do()") (path . "net/http/httputil/index#ClientConn.Do") (type . "net/http")) ((name . "httputil.ClientConn.Hijack()") (path . "net/http/httputil/index#ClientConn.Hijack") (type . "net/http")) ((name . "httputil.ClientConn.Pending()") (path . "net/http/httputil/index#ClientConn.Pending") (type . "net/http")) ((name . "httputil.ClientConn.Read()") (path . "net/http/httputil/index#ClientConn.Read") (type . "net/http")) ((name . "httputil.ClientConn.Write()") (path . "net/http/httputil/index#ClientConn.Write") (type . "net/http")) ((name . "httputil.DumpRequest()") (path . "net/http/httputil/index#DumpRequest") (type . "net/http")) ((name . "httputil.DumpRequestOut()") (path . "net/http/httputil/index#DumpRequestOut") (type . "net/http")) ((name . "httputil.DumpResponse()") (path . "net/http/httputil/index#DumpResponse") (type . "net/http")) ((name . "httputil.NewChunkedReader()") (path . "net/http/httputil/index#NewChunkedReader") (type . "net/http")) ((name . "httputil.NewChunkedWriter()") (path . "net/http/httputil/index#NewChunkedWriter") (type . "net/http")) ((name . "httputil.NewClientConn()") (path . "net/http/httputil/index#NewClientConn") (type . "net/http")) ((name . "httputil.NewProxyClientConn()") (path . "net/http/httputil/index#NewProxyClientConn") (type . "net/http")) ((name . "httputil.NewServerConn()") (path . "net/http/httputil/index#NewServerConn") (type . "net/http")) ((name . "httputil.NewSingleHostReverseProxy()") (path . "net/http/httputil/index#NewSingleHostReverseProxy") (type . "net/http")) ((name . "httputil.ProxyRequest") (path . "net/http/httputil/index#ProxyRequest") (type . "net/http")) ((name . "httputil.ProxyRequest.SetURL()") (path . "net/http/httputil/index#ProxyRequest.SetURL") (type . "net/http")) ((name . "httputil.ProxyRequest.SetXForwarded()") (path . "net/http/httputil/index#ProxyRequest.SetXForwarded") (type . "net/http")) ((name . "httputil.ReverseProxy") (path . "net/http/httputil/index#ReverseProxy") (type . "net/http")) ((name . "httputil.ReverseProxy.ServeHTTP()") (path . "net/http/httputil/index#ReverseProxy.ServeHTTP") (type . "net/http")) ((name . "httputil.ServerConn") (path . "net/http/httputil/index#ServerConn") (type . "net/http")) ((name . "httputil.ServerConn.Close()") (path . "net/http/httputil/index#ServerConn.Close") (type . "net/http")) ((name . "httputil.ServerConn.Hijack()") (path . "net/http/httputil/index#ServerConn.Hijack") (type . "net/http")) ((name . "httputil.ServerConn.Pending()") (path . "net/http/httputil/index#ServerConn.Pending") (type . "net/http")) ((name . "httputil.ServerConn.Read()") (path . "net/http/httputil/index#ServerConn.Read") (type . "net/http")) ((name . "httputil.ServerConn.Write()") (path . "net/http/httputil/index#ServerConn.Write") (type . "net/http")) ((name . "image") (path . "image/index") (type . "image")) ((name . "image variables") (path . "image/index#pkg-variables") (type . "image")) ((name . "image.Alpha") (path . "image/index#Alpha") (type . "image")) ((name . "image.Alpha.AlphaAt()") (path . "image/index#Alpha.AlphaAt") (type . "image")) ((name . "image.Alpha.At()") (path . "image/index#Alpha.At") (type . "image")) ((name . "image.Alpha.Bounds()") (path . "image/index#Alpha.Bounds") (type . "image")) ((name . "image.Alpha.ColorModel()") (path . "image/index#Alpha.ColorModel") (type . "image")) ((name . "image.Alpha.Opaque()") (path . "image/index#Alpha.Opaque") (type . "image")) ((name . "image.Alpha.PixOffset()") (path . "image/index#Alpha.PixOffset") (type . "image")) ((name . "image.Alpha.RGBA64At()") (path . "image/index#Alpha.RGBA64At") (type . "image")) ((name . "image.Alpha.Set()") (path . "image/index#Alpha.Set") (type . "image")) ((name . "image.Alpha.SetAlpha()") (path . "image/index#Alpha.SetAlpha") (type . "image")) ((name . "image.Alpha.SetRGBA64()") (path . "image/index#Alpha.SetRGBA64") (type . "image")) ((name . "image.Alpha.SubImage()") (path . "image/index#Alpha.SubImage") (type . "image")) ((name . "image.Alpha16") (path . "image/index#Alpha16") (type . "image")) ((name . "image.Alpha16.Alpha16At()") (path . "image/index#Alpha16.Alpha16At") (type . "image")) ((name . "image.Alpha16.At()") (path . "image/index#Alpha16.At") (type . "image")) ((name . "image.Alpha16.Bounds()") (path . "image/index#Alpha16.Bounds") (type . "image")) ((name . "image.Alpha16.ColorModel()") (path . "image/index#Alpha16.ColorModel") (type . "image")) ((name . "image.Alpha16.Opaque()") (path . "image/index#Alpha16.Opaque") (type . "image")) ((name . "image.Alpha16.PixOffset()") (path . "image/index#Alpha16.PixOffset") (type . "image")) ((name . "image.Alpha16.RGBA64At()") (path . "image/index#Alpha16.RGBA64At") (type . "image")) ((name . "image.Alpha16.Set()") (path . "image/index#Alpha16.Set") (type . "image")) ((name . "image.Alpha16.SetAlpha16()") (path . "image/index#Alpha16.SetAlpha16") (type . "image")) ((name . "image.Alpha16.SetRGBA64()") (path . "image/index#Alpha16.SetRGBA64") (type . "image")) ((name . "image.Alpha16.SubImage()") (path . "image/index#Alpha16.SubImage") (type . "image")) ((name . "image.CMYK") (path . "image/index#CMYK") (type . "image")) ((name . "image.CMYK.At()") (path . "image/index#CMYK.At") (type . "image")) ((name . "image.CMYK.Bounds()") (path . "image/index#CMYK.Bounds") (type . "image")) ((name . "image.CMYK.CMYKAt()") (path . "image/index#CMYK.CMYKAt") (type . "image")) ((name . "image.CMYK.ColorModel()") (path . "image/index#CMYK.ColorModel") (type . "image")) ((name . "image.CMYK.Opaque()") (path . "image/index#CMYK.Opaque") (type . "image")) ((name . "image.CMYK.PixOffset()") (path . "image/index#CMYK.PixOffset") (type . "image")) ((name . "image.CMYK.RGBA64At()") (path . "image/index#CMYK.RGBA64At") (type . "image")) ((name . "image.CMYK.Set()") (path . "image/index#CMYK.Set") (type . "image")) ((name . "image.CMYK.SetCMYK()") (path . "image/index#CMYK.SetCMYK") (type . "image")) ((name . "image.CMYK.SetRGBA64()") (path . "image/index#CMYK.SetRGBA64") (type . "image")) ((name . "image.CMYK.SubImage()") (path . "image/index#CMYK.SubImage") (type . "image")) ((name . "image.Config") (path . "image/index#Config") (type . "image")) ((name . "image.Decode()") (path . "image/index#Decode") (type . "image")) ((name . "image.DecodeConfig()") (path . "image/index#DecodeConfig") (type . "image")) ((name . "image.Gray") (path . "image/index#Gray") (type . "image")) ((name . "image.Gray.At()") (path . "image/index#Gray.At") (type . "image")) ((name . "image.Gray.Bounds()") (path . "image/index#Gray.Bounds") (type . "image")) ((name . "image.Gray.ColorModel()") (path . "image/index#Gray.ColorModel") (type . "image")) ((name . "image.Gray.GrayAt()") (path . "image/index#Gray.GrayAt") (type . "image")) ((name . "image.Gray.Opaque()") (path . "image/index#Gray.Opaque") (type . "image")) ((name . "image.Gray.PixOffset()") (path . "image/index#Gray.PixOffset") (type . "image")) ((name . "image.Gray.RGBA64At()") (path . "image/index#Gray.RGBA64At") (type . "image")) ((name . "image.Gray.Set()") (path . "image/index#Gray.Set") (type . "image")) ((name . "image.Gray.SetGray()") (path . "image/index#Gray.SetGray") (type . "image")) ((name . "image.Gray.SetRGBA64()") (path . "image/index#Gray.SetRGBA64") (type . "image")) ((name . "image.Gray.SubImage()") (path . "image/index#Gray.SubImage") (type . "image")) ((name . "image.Gray16") (path . "image/index#Gray16") (type . "image")) ((name . "image.Gray16.At()") (path . "image/index#Gray16.At") (type . "image")) ((name . "image.Gray16.Bounds()") (path . "image/index#Gray16.Bounds") (type . "image")) ((name . "image.Gray16.ColorModel()") (path . "image/index#Gray16.ColorModel") (type . "image")) ((name . "image.Gray16.Gray16At()") (path . "image/index#Gray16.Gray16At") (type . "image")) ((name . "image.Gray16.Opaque()") (path . "image/index#Gray16.Opaque") (type . "image")) ((name . "image.Gray16.PixOffset()") (path . "image/index#Gray16.PixOffset") (type . "image")) ((name . "image.Gray16.RGBA64At()") (path . "image/index#Gray16.RGBA64At") (type . "image")) ((name . "image.Gray16.Set()") (path . "image/index#Gray16.Set") (type . "image")) ((name . "image.Gray16.SetGray16()") (path . "image/index#Gray16.SetGray16") (type . "image")) ((name . "image.Gray16.SetRGBA64()") (path . "image/index#Gray16.SetRGBA64") (type . "image")) ((name . "image.Gray16.SubImage()") (path . "image/index#Gray16.SubImage") (type . "image")) ((name . "image.Image") (path . "image/index#Image") (type . "image")) ((name . "image.NewAlpha()") (path . "image/index#NewAlpha") (type . "image")) ((name . "image.NewAlpha16()") (path . "image/index#NewAlpha16") (type . "image")) ((name . "image.NewCMYK()") (path . "image/index#NewCMYK") (type . "image")) ((name . "image.NewGray()") (path . "image/index#NewGray") (type . "image")) ((name . "image.NewGray16()") (path . "image/index#NewGray16") (type . "image")) ((name . "image.NewNRGBA()") (path . "image/index#NewNRGBA") (type . "image")) ((name . "image.NewNRGBA64()") (path . "image/index#NewNRGBA64") (type . "image")) ((name . "image.NewNYCbCrA()") (path . "image/index#NewNYCbCrA") (type . "image")) ((name . "image.NewPaletted()") (path . "image/index#NewPaletted") (type . "image")) ((name . "image.NewRGBA()") (path . "image/index#NewRGBA") (type . "image")) ((name . "image.NewRGBA64()") (path . "image/index#NewRGBA64") (type . "image")) ((name . "image.NewUniform()") (path . "image/index#NewUniform") (type . "image")) ((name . "image.NewYCbCr()") (path . "image/index#NewYCbCr") (type . "image")) ((name . "image.NRGBA") (path . "image/index#NRGBA") (type . "image")) ((name . "image.NRGBA.At()") (path . "image/index#NRGBA.At") (type . "image")) ((name . "image.NRGBA.Bounds()") (path . "image/index#NRGBA.Bounds") (type . "image")) ((name . "image.NRGBA.ColorModel()") (path . "image/index#NRGBA.ColorModel") (type . "image")) ((name . "image.NRGBA.NRGBAAt()") (path . "image/index#NRGBA.NRGBAAt") (type . "image")) ((name . "image.NRGBA.Opaque()") (path . "image/index#NRGBA.Opaque") (type . "image")) ((name . "image.NRGBA.PixOffset()") (path . "image/index#NRGBA.PixOffset") (type . "image")) ((name . "image.NRGBA.RGBA64At()") (path . "image/index#NRGBA.RGBA64At") (type . "image")) ((name . "image.NRGBA.Set()") (path . "image/index#NRGBA.Set") (type . "image")) ((name . "image.NRGBA.SetNRGBA()") (path . "image/index#NRGBA.SetNRGBA") (type . "image")) ((name . "image.NRGBA.SetRGBA64()") (path . "image/index#NRGBA.SetRGBA64") (type . "image")) ((name . "image.NRGBA.SubImage()") (path . "image/index#NRGBA.SubImage") (type . "image")) ((name . "image.NRGBA64") (path . "image/index#NRGBA64") (type . "image")) ((name . "image.NRGBA64.At()") (path . "image/index#NRGBA64.At") (type . "image")) ((name . "image.NRGBA64.Bounds()") (path . "image/index#NRGBA64.Bounds") (type . "image")) ((name . "image.NRGBA64.ColorModel()") (path . "image/index#NRGBA64.ColorModel") (type . "image")) ((name . "image.NRGBA64.NRGBA64At()") (path . "image/index#NRGBA64.NRGBA64At") (type . "image")) ((name . "image.NRGBA64.Opaque()") (path . "image/index#NRGBA64.Opaque") (type . "image")) ((name . "image.NRGBA64.PixOffset()") (path . "image/index#NRGBA64.PixOffset") (type . "image")) ((name . "image.NRGBA64.RGBA64At()") (path . "image/index#NRGBA64.RGBA64At") (type . "image")) ((name . "image.NRGBA64.Set()") (path . "image/index#NRGBA64.Set") (type . "image")) ((name . "image.NRGBA64.SetNRGBA64()") (path . "image/index#NRGBA64.SetNRGBA64") (type . "image")) ((name . "image.NRGBA64.SetRGBA64()") (path . "image/index#NRGBA64.SetRGBA64") (type . "image")) ((name . "image.NRGBA64.SubImage()") (path . "image/index#NRGBA64.SubImage") (type . "image")) ((name . "image.NYCbCrA") (path . "image/index#NYCbCrA") (type . "image")) ((name . "image.NYCbCrA.AOffset()") (path . "image/index#NYCbCrA.AOffset") (type . "image")) ((name . "image.NYCbCrA.At()") (path . "image/index#NYCbCrA.At") (type . "image")) ((name . "image.NYCbCrA.ColorModel()") (path . "image/index#NYCbCrA.ColorModel") (type . "image")) ((name . "image.NYCbCrA.NYCbCrAAt()") (path . "image/index#NYCbCrA.NYCbCrAAt") (type . "image")) ((name . "image.NYCbCrA.Opaque()") (path . "image/index#NYCbCrA.Opaque") (type . "image")) ((name . "image.NYCbCrA.RGBA64At()") (path . "image/index#NYCbCrA.RGBA64At") (type . "image")) ((name . "image.NYCbCrA.SubImage()") (path . "image/index#NYCbCrA.SubImage") (type . "image")) ((name . "image.Paletted") (path . "image/index#Paletted") (type . "image")) ((name . "image.Paletted.At()") (path . "image/index#Paletted.At") (type . "image")) ((name . "image.Paletted.Bounds()") (path . "image/index#Paletted.Bounds") (type . "image")) ((name . "image.Paletted.ColorIndexAt()") (path . "image/index#Paletted.ColorIndexAt") (type . "image")) ((name . "image.Paletted.ColorModel()") (path . "image/index#Paletted.ColorModel") (type . "image")) ((name . "image.Paletted.Opaque()") (path . "image/index#Paletted.Opaque") (type . "image")) ((name . "image.Paletted.PixOffset()") (path . "image/index#Paletted.PixOffset") (type . "image")) ((name . "image.Paletted.RGBA64At()") (path . "image/index#Paletted.RGBA64At") (type . "image")) ((name . "image.Paletted.Set()") (path . "image/index#Paletted.Set") (type . "image")) ((name . "image.Paletted.SetColorIndex()") (path . "image/index#Paletted.SetColorIndex") (type . "image")) ((name . "image.Paletted.SetRGBA64()") (path . "image/index#Paletted.SetRGBA64") (type . "image")) ((name . "image.Paletted.SubImage()") (path . "image/index#Paletted.SubImage") (type . "image")) ((name . "image.PalettedImage") (path . "image/index#PalettedImage") (type . "image")) ((name . "image.Point") (path . "image/index#Point") (type . "image")) ((name . "image.Point.Add()") (path . "image/index#Point.Add") (type . "image")) ((name . "image.Point.Div()") (path . "image/index#Point.Div") (type . "image")) ((name . "image.Point.Eq()") (path . "image/index#Point.Eq") (type . "image")) ((name . "image.Point.In()") (path . "image/index#Point.In") (type . "image")) ((name . "image.Point.Mod()") (path . "image/index#Point.Mod") (type . "image")) ((name . "image.Point.Mul()") (path . "image/index#Point.Mul") (type . "image")) ((name . "image.Point.String()") (path . "image/index#Point.String") (type . "image")) ((name . "image.Point.Sub()") (path . "image/index#Point.Sub") (type . "image")) ((name . "image.Pt()") (path . "image/index#Pt") (type . "image")) ((name . "image.Rect()") (path . "image/index#Rect") (type . "image")) ((name . "image.Rectangle") (path . "image/index#Rectangle") (type . "image")) ((name . "image.Rectangle.Add()") (path . "image/index#Rectangle.Add") (type . "image")) ((name . "image.Rectangle.At()") (path . "image/index#Rectangle.At") (type . "image")) ((name . "image.Rectangle.Bounds()") (path . "image/index#Rectangle.Bounds") (type . "image")) ((name . "image.Rectangle.Canon()") (path . "image/index#Rectangle.Canon") (type . "image")) ((name . "image.Rectangle.ColorModel()") (path . "image/index#Rectangle.ColorModel") (type . "image")) ((name . "image.Rectangle.Dx()") (path . "image/index#Rectangle.Dx") (type . "image")) ((name . "image.Rectangle.Dy()") (path . "image/index#Rectangle.Dy") (type . "image")) ((name . "image.Rectangle.Empty()") (path . "image/index#Rectangle.Empty") (type . "image")) ((name . "image.Rectangle.Eq()") (path . "image/index#Rectangle.Eq") (type . "image")) ((name . "image.Rectangle.In()") (path . "image/index#Rectangle.In") (type . "image")) ((name . "image.Rectangle.Inset()") (path . "image/index#Rectangle.Inset") (type . "image")) ((name . "image.Rectangle.Intersect()") (path . "image/index#Rectangle.Intersect") (type . "image")) ((name . "image.Rectangle.Overlaps()") (path . "image/index#Rectangle.Overlaps") (type . "image")) ((name . "image.Rectangle.RGBA64At()") (path . "image/index#Rectangle.RGBA64At") (type . "image")) ((name . "image.Rectangle.Size()") (path . "image/index#Rectangle.Size") (type . "image")) ((name . "image.Rectangle.String()") (path . "image/index#Rectangle.String") (type . "image")) ((name . "image.Rectangle.Sub()") (path . "image/index#Rectangle.Sub") (type . "image")) ((name . "image.Rectangle.Union()") (path . "image/index#Rectangle.Union") (type . "image")) ((name . "image.RegisterFormat()") (path . "image/index#RegisterFormat") (type . "image")) ((name . "image.RGBA") (path . "image/index#RGBA") (type . "image")) ((name . "image.RGBA.At()") (path . "image/index#RGBA.At") (type . "image")) ((name . "image.RGBA.Bounds()") (path . "image/index#RGBA.Bounds") (type . "image")) ((name . "image.RGBA.ColorModel()") (path . "image/index#RGBA.ColorModel") (type . "image")) ((name . "image.RGBA.Opaque()") (path . "image/index#RGBA.Opaque") (type . "image")) ((name . "image.RGBA.PixOffset()") (path . "image/index#RGBA.PixOffset") (type . "image")) ((name . "image.RGBA.RGBA64At()") (path . "image/index#RGBA.RGBA64At") (type . "image")) ((name . "image.RGBA.RGBAAt()") (path . "image/index#RGBA.RGBAAt") (type . "image")) ((name . "image.RGBA.Set()") (path . "image/index#RGBA.Set") (type . "image")) ((name . "image.RGBA.SetRGBA()") (path . "image/index#RGBA.SetRGBA") (type . "image")) ((name . "image.RGBA.SetRGBA64()") (path . "image/index#RGBA.SetRGBA64") (type . "image")) ((name . "image.RGBA.SubImage()") (path . "image/index#RGBA.SubImage") (type . "image")) ((name . "image.RGBA64") (path . "image/index#RGBA64") (type . "image")) ((name . "image.RGBA64.At()") (path . "image/index#RGBA64.At") (type . "image")) ((name . "image.RGBA64.Bounds()") (path . "image/index#RGBA64.Bounds") (type . "image")) ((name . "image.RGBA64.ColorModel()") (path . "image/index#RGBA64.ColorModel") (type . "image")) ((name . "image.RGBA64.Opaque()") (path . "image/index#RGBA64.Opaque") (type . "image")) ((name . "image.RGBA64.PixOffset()") (path . "image/index#RGBA64.PixOffset") (type . "image")) ((name . "image.RGBA64.RGBA64At()") (path . "image/index#RGBA64.RGBA64At") (type . "image")) ((name . "image.RGBA64.Set()") (path . "image/index#RGBA64.Set") (type . "image")) ((name . "image.RGBA64.SetRGBA64()") (path . "image/index#RGBA64.SetRGBA64") (type . "image")) ((name . "image.RGBA64.SubImage()") (path . "image/index#RGBA64.SubImage") (type . "image")) ((name . "image.RGBA64Image") (path . "image/index#RGBA64Image") (type . "image")) ((name . "image.Uniform") (path . "image/index#Uniform") (type . "image")) ((name . "image.Uniform.At()") (path . "image/index#Uniform.At") (type . "image")) ((name . "image.Uniform.Bounds()") (path . "image/index#Uniform.Bounds") (type . "image")) ((name . "image.Uniform.ColorModel()") (path . "image/index#Uniform.ColorModel") (type . "image")) ((name . "image.Uniform.Convert()") (path . "image/index#Uniform.Convert") (type . "image")) ((name . "image.Uniform.Opaque()") (path . "image/index#Uniform.Opaque") (type . "image")) ((name . "image.Uniform.RGBA()") (path . "image/index#Uniform.RGBA") (type . "image")) ((name . "image.Uniform.RGBA64At()") (path . "image/index#Uniform.RGBA64At") (type . "image")) ((name . "image.YCbCr") (path . "image/index#YCbCr") (type . "image")) ((name . "image.YCbCr.At()") (path . "image/index#YCbCr.At") (type . "image")) ((name . "image.YCbCr.Bounds()") (path . "image/index#YCbCr.Bounds") (type . "image")) ((name . "image.YCbCr.COffset()") (path . "image/index#YCbCr.COffset") (type . "image")) ((name . "image.YCbCr.ColorModel()") (path . "image/index#YCbCr.ColorModel") (type . "image")) ((name . "image.YCbCr.Opaque()") (path . "image/index#YCbCr.Opaque") (type . "image")) ((name . "image.YCbCr.RGBA64At()") (path . "image/index#YCbCr.RGBA64At") (type . "image")) ((name . "image.YCbCr.SubImage()") (path . "image/index#YCbCr.SubImage") (type . "image")) ((name . "image.YCbCr.YCbCrAt()") (path . "image/index#YCbCr.YCbCrAt") (type . "image")) ((name . "image.YCbCr.YOffset()") (path . "image/index#YCbCr.YOffset") (type . "image")) ((name . "image.YCbCrSubsampleRatio") (path . "image/index#YCbCrSubsampleRatio") (type . "image")) ((name . "image.YCbCrSubsampleRatio.String()") (path . "image/index#YCbCrSubsampleRatio.String") (type . "image")) ((name . "image/color") (path . "image/color/index") (type . "image")) ((name . "image/color variables") (path . "image/color/index#pkg-variables") (type . "image")) ((name . "image/color/palette") (path . "image/color/palette/index") (type . "image")) ((name . "image/color/palette variables") (path . "image/color/palette/index#pkg-variables") (type . "image")) ((name . "image/draw") (path . "image/draw/index") (type . "image")) ((name . "image/gif") (path . "image/gif/index") (type . "image")) ((name . "image/gif constants") (path . "image/gif/index#pkg-constants") (type . "image")) ((name . "image/jpeg") (path . "image/jpeg/index") (type . "image")) ((name . "image/jpeg constants") (path . "image/jpeg/index#pkg-constants") (type . "image")) ((name . "image/png") (path . "image/png/index") (type . "image")) ((name . "importer.Default()") (path . "go/importer/index#Default") (type . "go")) ((name . "importer.For()") (path . "go/importer/index#For") (type . "go")) ((name . "importer.ForCompiler()") (path . "go/importer/index#ForCompiler") (type . "go")) ((name . "importer.Lookup") (path . "go/importer/index#Lookup") (type . "go")) ((name . "index/suffixarray") (path . "index/suffixarray/index") (type . "index")) ((name . "internal.FlushAfterChunkWriter") (path . "net/http/internal/index#FlushAfterChunkWriter") (type . "net/http")) ((name . "internal.NewChunkedReader()") (path . "net/http/internal/index#NewChunkedReader") (type . "net/http")) ((name . "internal.NewChunkedWriter()") (path . "net/http/internal/index#NewChunkedWriter") (type . "net/http")) ((name . "internal/goarch") (path . "internal/goarch/index") (type . "internal")) ((name . "internal/goarch constants") (path . "internal/goarch/index#pkg-constants") (type . "internal")) ((name . "internal/goos") (path . "internal/goos/index") (type . "internal")) ((name . "internal/goos constants") (path . "internal/goos/index#pkg-constants") (type . "internal")) ((name . "io") (path . "io/index") (type . "io")) ((name . "io constants") (path . "io/index#pkg-constants") (type . "io")) ((name . "io variables") (path . "io/index#pkg-variables") (type . "io")) ((name . "io.ByteReader") (path . "io/index#ByteReader") (type . "io")) ((name . "io.ByteScanner") (path . "io/index#ByteScanner") (type . "io")) ((name . "io.ByteWriter") (path . "io/index#ByteWriter") (type . "io")) ((name . "io.Closer") (path . "io/index#Closer") (type . "io")) ((name . "io.Copy()") (path . "io/index#Copy") (type . "io")) ((name . "io.CopyBuffer()") (path . "io/index#CopyBuffer") (type . "io")) ((name . "io.CopyN()") (path . "io/index#CopyN") (type . "io")) ((name . "io.LimitedReader") (path . "io/index#LimitedReader") (type . "io")) ((name . "io.LimitedReader.Read()") (path . "io/index#LimitedReader.Read") (type . "io")) ((name . "io.LimitReader()") (path . "io/index#LimitReader") (type . "io")) ((name . "io.MultiReader()") (path . "io/index#MultiReader") (type . "io")) ((name . "io.MultiWriter()") (path . "io/index#MultiWriter") (type . "io")) ((name . "io.NewOffsetWriter()") (path . "io/index#NewOffsetWriter") (type . "io")) ((name . "io.NewSectionReader()") (path . "io/index#NewSectionReader") (type . "io")) ((name . "io.NopCloser()") (path . "io/index#NopCloser") (type . "io")) ((name . "io.OffsetWriter") (path . "io/index#OffsetWriter") (type . "io")) ((name . "io.OffsetWriter.Seek()") (path . "io/index#OffsetWriter.Seek") (type . "io")) ((name . "io.OffsetWriter.Write()") (path . "io/index#OffsetWriter.Write") (type . "io")) ((name . "io.OffsetWriter.WriteAt()") (path . "io/index#OffsetWriter.WriteAt") (type . "io")) ((name . "io.Pipe()") (path . "io/index#Pipe") (type . "io")) ((name . "io.PipeReader") (path . "io/index#PipeReader") (type . "io")) ((name . "io.PipeReader.Close()") (path . "io/index#PipeReader.Close") (type . "io")) ((name . "io.PipeReader.CloseWithError()") (path . "io/index#PipeReader.CloseWithError") (type . "io")) ((name . "io.PipeReader.Read()") (path . "io/index#PipeReader.Read") (type . "io")) ((name . "io.PipeWriter") (path . "io/index#PipeWriter") (type . "io")) ((name . "io.PipeWriter.Close()") (path . "io/index#PipeWriter.Close") (type . "io")) ((name . "io.PipeWriter.CloseWithError()") (path . "io/index#PipeWriter.CloseWithError") (type . "io")) ((name . "io.PipeWriter.Write()") (path . "io/index#PipeWriter.Write") (type . "io")) ((name . "io.ReadAll()") (path . "io/index#ReadAll") (type . "io")) ((name . "io.ReadAtLeast()") (path . "io/index#ReadAtLeast") (type . "io")) ((name . "io.ReadCloser") (path . "io/index#ReadCloser") (type . "io")) ((name . "io.Reader") (path . "io/index#Reader") (type . "io")) ((name . "io.ReaderAt") (path . "io/index#ReaderAt") (type . "io")) ((name . "io.ReaderFrom") (path . "io/index#ReaderFrom") (type . "io")) ((name . "io.ReadFull()") (path . "io/index#ReadFull") (type . "io")) ((name . "io.ReadSeekCloser") (path . "io/index#ReadSeekCloser") (type . "io")) ((name . "io.ReadSeeker") (path . "io/index#ReadSeeker") (type . "io")) ((name . "io.ReadWriteCloser") (path . "io/index#ReadWriteCloser") (type . "io")) ((name . "io.ReadWriter") (path . "io/index#ReadWriter") (type . "io")) ((name . "io.ReadWriteSeeker") (path . "io/index#ReadWriteSeeker") (type . "io")) ((name . "io.RuneReader") (path . "io/index#RuneReader") (type . "io")) ((name . "io.RuneScanner") (path . "io/index#RuneScanner") (type . "io")) ((name . "io.SectionReader") (path . "io/index#SectionReader") (type . "io")) ((name . "io.SectionReader.Outer()") (path . "io/index#SectionReader.Outer") (type . "io")) ((name . "io.SectionReader.Read()") (path . "io/index#SectionReader.Read") (type . "io")) ((name . "io.SectionReader.ReadAt()") (path . "io/index#SectionReader.ReadAt") (type . "io")) ((name . "io.SectionReader.Seek()") (path . "io/index#SectionReader.Seek") (type . "io")) ((name . "io.SectionReader.Size()") (path . "io/index#SectionReader.Size") (type . "io")) ((name . "io.Seeker") (path . "io/index#Seeker") (type . "io")) ((name . "io.StringWriter") (path . "io/index#StringWriter") (type . "io")) ((name . "io.TeeReader()") (path . "io/index#TeeReader") (type . "io")) ((name . "io.WriteCloser") (path . "io/index#WriteCloser") (type . "io")) ((name . "io.Writer") (path . "io/index#Writer") (type . "io")) ((name . "io.WriterAt") (path . "io/index#WriterAt") (type . "io")) ((name . "io.WriterTo") (path . "io/index#WriterTo") (type . "io")) ((name . "io.WriteSeeker") (path . "io/index#WriteSeeker") (type . "io")) ((name . "io.WriteString()") (path . "io/index#WriteString") (type . "io")) ((name . "io/fs") (path . "io/fs/index") (type . "io")) ((name . "io/fs variables") (path . "io/fs/index#pkg-variables") (type . "io")) ((name . "io/ioutil") (path . "io/ioutil/index") (type . "io")) ((name . "io/ioutil variables") (path . "io/ioutil/index#pkg-variables") (type . "io")) ((name . "iotest.DataErrReader()") (path . "testing/iotest/index#DataErrReader") (type . "testing")) ((name . "iotest.ErrReader()") (path . "testing/iotest/index#ErrReader") (type . "testing")) ((name . "iotest.HalfReader()") (path . "testing/iotest/index#HalfReader") (type . "testing")) ((name . "iotest.NewReadLogger()") (path . "testing/iotest/index#NewReadLogger") (type . "testing")) ((name . "iotest.NewWriteLogger()") (path . "testing/iotest/index#NewWriteLogger") (type . "testing")) ((name . "iotest.OneByteReader()") (path . "testing/iotest/index#OneByteReader") (type . "testing")) ((name . "iotest.TestReader()") (path . "testing/iotest/index#TestReader") (type . "testing")) ((name . "iotest.TimeoutReader()") (path . "testing/iotest/index#TimeoutReader") (type . "testing")) ((name . "iotest.TruncateWriter()") (path . "testing/iotest/index#TruncateWriter") (type . "testing")) ((name . "ioutil.NopCloser()") (path . "io/ioutil/index#NopCloser") (type . "io")) ((name . "ioutil.ReadAll()") (path . "io/ioutil/index#ReadAll") (type . "io")) ((name . "ioutil.ReadDir()") (path . "io/ioutil/index#ReadDir") (type . "io")) ((name . "ioutil.ReadFile()") (path . "io/ioutil/index#ReadFile") (type . "io")) ((name . "ioutil.TempDir()") (path . "io/ioutil/index#TempDir") (type . "io")) ((name . "ioutil.TempFile()") (path . "io/ioutil/index#TempFile") (type . "io")) ((name . "ioutil.WriteFile()") (path . "io/ioutil/index#WriteFile") (type . "io")) ((name . "jpeg.Decode()") (path . "image/jpeg/index#Decode") (type . "image")) ((name . "jpeg.DecodeConfig()") (path . "image/jpeg/index#DecodeConfig") (type . "image")) ((name . "jpeg.Encode()") (path . "image/jpeg/index#Encode") (type . "image")) ((name . "jpeg.FormatError") (path . "image/jpeg/index#FormatError") (type . "image")) ((name . "jpeg.FormatError.Error()") (path . "image/jpeg/index#FormatError.Error") (type . "image")) ((name . "jpeg.Options") (path . "image/jpeg/index#Options") (type . "image")) ((name . "jpeg.Reader") (path . "image/jpeg/index#Reader") (type . "image")) ((name . "jpeg.UnsupportedError") (path . "image/jpeg/index#UnsupportedError") (type . "image")) ((name . "jpeg.UnsupportedError.Error()") (path . "image/jpeg/index#UnsupportedError.Error") (type . "image")) ((name . "js.CopyBytesToGo()") (path . "syscall/js/index#CopyBytesToGo") (type . "syscall")) ((name . "js.CopyBytesToJS()") (path . "syscall/js/index#CopyBytesToJS") (type . "syscall")) ((name . "js.Error") (path . "syscall/js/index#Error") (type . "syscall")) ((name . "js.Error.Error()") (path . "syscall/js/index#Error.Error") (type . "syscall")) ((name . "js.Func") (path . "syscall/js/index#Func") (type . "syscall")) ((name . "js.Func.Release()") (path . "syscall/js/index#Func.Release") (type . "syscall")) ((name . "js.FuncOf()") (path . "syscall/js/index#FuncOf") (type . "syscall")) ((name . "js.Global()") (path . "syscall/js/index#Global") (type . "syscall")) ((name . "js.Null()") (path . "syscall/js/index#Null") (type . "syscall")) ((name . "js.Type") (path . "syscall/js/index#Type") (type . "syscall")) ((name . "js.Type.String()") (path . "syscall/js/index#Type.String") (type . "syscall")) ((name . "js.Undefined()") (path . "syscall/js/index#Undefined") (type . "syscall")) ((name . "js.Value") (path . "syscall/js/index#Value") (type . "syscall")) ((name . "js.Value.Bool()") (path . "syscall/js/index#Value.Bool") (type . "syscall")) ((name . "js.Value.Call()") (path . "syscall/js/index#Value.Call") (type . "syscall")) ((name . "js.Value.Delete()") (path . "syscall/js/index#Value.Delete") (type . "syscall")) ((name . "js.Value.Equal()") (path . "syscall/js/index#Value.Equal") (type . "syscall")) ((name . "js.Value.Float()") (path . "syscall/js/index#Value.Float") (type . "syscall")) ((name . "js.Value.Get()") (path . "syscall/js/index#Value.Get") (type . "syscall")) ((name . "js.Value.Index()") (path . "syscall/js/index#Value.Index") (type . "syscall")) ((name . "js.Value.InstanceOf()") (path . "syscall/js/index#Value.InstanceOf") (type . "syscall")) ((name . "js.Value.Int()") (path . "syscall/js/index#Value.Int") (type . "syscall")) ((name . "js.Value.Invoke()") (path . "syscall/js/index#Value.Invoke") (type . "syscall")) ((name . "js.Value.IsNaN()") (path . "syscall/js/index#Value.IsNaN") (type . "syscall")) ((name . "js.Value.IsNull()") (path . "syscall/js/index#Value.IsNull") (type . "syscall")) ((name . "js.Value.IsUndefined()") (path . "syscall/js/index#Value.IsUndefined") (type . "syscall")) ((name . "js.Value.Length()") (path . "syscall/js/index#Value.Length") (type . "syscall")) ((name . "js.Value.New()") (path . "syscall/js/index#Value.New") (type . "syscall")) ((name . "js.Value.Set()") (path . "syscall/js/index#Value.Set") (type . "syscall")) ((name . "js.Value.SetIndex()") (path . "syscall/js/index#Value.SetIndex") (type . "syscall")) ((name . "js.Value.String()") (path . "syscall/js/index#Value.String") (type . "syscall")) ((name . "js.Value.Truthy()") (path . "syscall/js/index#Value.Truthy") (type . "syscall")) ((name . "js.Value.Type()") (path . "syscall/js/index#Value.Type") (type . "syscall")) ((name . "js.ValueError") (path . "syscall/js/index#ValueError") (type . "syscall")) ((name . "js.ValueError.Error()") (path . "syscall/js/index#ValueError.Error") (type . "syscall")) ((name . "js.ValueOf()") (path . "syscall/js/index#ValueOf") (type . "syscall")) ((name . "json.Compact()") (path . "encoding/json/index#Compact") (type . "encoding")) ((name . "json.Decoder") (path . "encoding/json/index#Decoder") (type . "encoding")) ((name . "json.Decoder.Buffered()") (path . "encoding/json/index#Decoder.Buffered") (type . "encoding")) ((name . "json.Decoder.Decode()") (path . "encoding/json/index#Decoder.Decode") (type . "encoding")) ((name . "json.Decoder.DisallowUnknownFields()") (path . "encoding/json/index#Decoder.DisallowUnknownFields") (type . "encoding")) ((name . "json.Decoder.InputOffset()") (path . "encoding/json/index#Decoder.InputOffset") (type . "encoding")) ((name . "json.Decoder.More()") (path . "encoding/json/index#Decoder.More") (type . "encoding")) ((name . "json.Decoder.Token()") (path . "encoding/json/index#Decoder.Token") (type . "encoding")) ((name . "json.Decoder.UseNumber()") (path . "encoding/json/index#Decoder.UseNumber") (type . "encoding")) ((name . "json.Delim") (path . "encoding/json/index#Delim") (type . "encoding")) ((name . "json.Delim.String()") (path . "encoding/json/index#Delim.String") (type . "encoding")) ((name . "json.Encoder") (path . "encoding/json/index#Encoder") (type . "encoding")) ((name . "json.Encoder.Encode()") (path . "encoding/json/index#Encoder.Encode") (type . "encoding")) ((name . "json.Encoder.SetEscapeHTML()") (path . "encoding/json/index#Encoder.SetEscapeHTML") (type . "encoding")) ((name . "json.Encoder.SetIndent()") (path . "encoding/json/index#Encoder.SetIndent") (type . "encoding")) ((name . "json.HTMLEscape()") (path . "encoding/json/index#HTMLEscape") (type . "encoding")) ((name . "json.Indent()") (path . "encoding/json/index#Indent") (type . "encoding")) ((name . "json.InvalidUnmarshalError") (path . "encoding/json/index#InvalidUnmarshalError") (type . "encoding")) ((name . "json.InvalidUnmarshalError.Error()") (path . "encoding/json/index#InvalidUnmarshalError.Error") (type . "encoding")) ((name . "json.InvalidUTF8Error") (path . "encoding/json/index#InvalidUTF8Error") (type . "encoding")) ((name . "json.InvalidUTF8Error.Error()") (path . "encoding/json/index#InvalidUTF8Error.Error") (type . "encoding")) ((name . "json.Marshal()") (path . "encoding/json/index#Marshal") (type . "encoding")) ((name . "json.Marshaler") (path . "encoding/json/index#Marshaler") (type . "encoding")) ((name . "json.MarshalerError") (path . "encoding/json/index#MarshalerError") (type . "encoding")) ((name . "json.MarshalerError.Error()") (path . "encoding/json/index#MarshalerError.Error") (type . "encoding")) ((name . "json.MarshalerError.Unwrap()") (path . "encoding/json/index#MarshalerError.Unwrap") (type . "encoding")) ((name . "json.MarshalIndent()") (path . "encoding/json/index#MarshalIndent") (type . "encoding")) ((name . "json.NewDecoder()") (path . "encoding/json/index#NewDecoder") (type . "encoding")) ((name . "json.NewEncoder()") (path . "encoding/json/index#NewEncoder") (type . "encoding")) ((name . "json.Number") (path . "encoding/json/index#Number") (type . "encoding")) ((name . "json.Number.Float64()") (path . "encoding/json/index#Number.Float64") (type . "encoding")) ((name . "json.Number.Int64()") (path . "encoding/json/index#Number.Int64") (type . "encoding")) ((name . "json.Number.String()") (path . "encoding/json/index#Number.String") (type . "encoding")) ((name . "json.RawMessage") (path . "encoding/json/index#RawMessage") (type . "encoding")) ((name . "json.RawMessage.MarshalJSON()") (path . "encoding/json/index#RawMessage.MarshalJSON") (type . "encoding")) ((name . "json.RawMessage.UnmarshalJSON()") (path . "encoding/json/index#RawMessage.UnmarshalJSON") (type . "encoding")) ((name . "json.SyntaxError") (path . "encoding/json/index#SyntaxError") (type . "encoding")) ((name . "json.SyntaxError.Error()") (path . "encoding/json/index#SyntaxError.Error") (type . "encoding")) ((name . "json.Token") (path . "encoding/json/index#Token") (type . "encoding")) ((name . "json.Unmarshal()") (path . "encoding/json/index#Unmarshal") (type . "encoding")) ((name . "json.Unmarshaler") (path . "encoding/json/index#Unmarshaler") (type . "encoding")) ((name . "json.UnmarshalFieldError") (path . "encoding/json/index#UnmarshalFieldError") (type . "encoding")) ((name . "json.UnmarshalFieldError.Error()") (path . "encoding/json/index#UnmarshalFieldError.Error") (type . "encoding")) ((name . "json.UnmarshalTypeError") (path . "encoding/json/index#UnmarshalTypeError") (type . "encoding")) ((name . "json.UnmarshalTypeError.Error()") (path . "encoding/json/index#UnmarshalTypeError.Error") (type . "encoding")) ((name . "json.UnsupportedTypeError") (path . "encoding/json/index#UnsupportedTypeError") (type . "encoding")) ((name . "json.UnsupportedTypeError.Error()") (path . "encoding/json/index#UnsupportedTypeError.Error") (type . "encoding")) ((name . "json.UnsupportedValueError") (path . "encoding/json/index#UnsupportedValueError") (type . "encoding")) ((name . "json.UnsupportedValueError.Error()") (path . "encoding/json/index#UnsupportedValueError.Error") (type . "encoding")) ((name . "json.Valid()") (path . "encoding/json/index#Valid") (type . "encoding")) ((name . "jsonrpc.Dial()") (path . "net/rpc/jsonrpc/index#Dial") (type . "net/rpc")) ((name . "jsonrpc.NewClient()") (path . "net/rpc/jsonrpc/index#NewClient") (type . "net/rpc")) ((name . "jsonrpc.NewClientCodec()") (path . "net/rpc/jsonrpc/index#NewClientCodec") (type . "net/rpc")) ((name . "jsonrpc.NewServerCodec()") (path . "net/rpc/jsonrpc/index#NewServerCodec") (type . "net/rpc")) ((name . "jsonrpc.ServeConn()") (path . "net/rpc/jsonrpc/index#ServeConn") (type . "net/rpc")) ((name . "list.Element") (path . "container/list/index#Element") (type . "container")) ((name . "list.Element.Next()") (path . "container/list/index#Element.Next") (type . "container")) ((name . "list.Element.Prev()") (path . "container/list/index#Element.Prev") (type . "container")) ((name . "list.List") (path . "container/list/index#List") (type . "container")) ((name . "list.List.Back()") (path . "container/list/index#List.Back") (type . "container")) ((name . "list.List.Front()") (path . "container/list/index#List.Front") (type . "container")) ((name . "list.List.Init()") (path . "container/list/index#List.Init") (type . "container")) ((name . "list.List.InsertAfter()") (path . "container/list/index#List.InsertAfter") (type . "container")) ((name . "list.List.InsertBefore()") (path . "container/list/index#List.InsertBefore") (type . "container")) ((name . "list.List.Len()") (path . "container/list/index#List.Len") (type . "container")) ((name . "list.List.MoveAfter()") (path . "container/list/index#List.MoveAfter") (type . "container")) ((name . "list.List.MoveBefore()") (path . "container/list/index#List.MoveBefore") (type . "container")) ((name . "list.List.MoveToBack()") (path . "container/list/index#List.MoveToBack") (type . "container")) ((name . "list.List.MoveToFront()") (path . "container/list/index#List.MoveToFront") (type . "container")) ((name . "list.List.PushBack()") (path . "container/list/index#List.PushBack") (type . "container")) ((name . "list.List.PushBackList()") (path . "container/list/index#List.PushBackList") (type . "container")) ((name . "list.List.PushFront()") (path . "container/list/index#List.PushFront") (type . "container")) ((name . "list.List.PushFrontList()") (path . "container/list/index#List.PushFrontList") (type . "container")) ((name . "list.List.Remove()") (path . "container/list/index#List.Remove") (type . "container")) ((name . "list.New()") (path . "container/list/index#New") (type . "container")) ((name . "log") (path . "log/index") (type . "log")) ((name . "log constants") (path . "log/index#pkg-constants") (type . "log")) ((name . "log.Default()") (path . "log/index#Default") (type . "log")) ((name . "log.Fatal()") (path . "log/index#Fatal") (type . "log")) ((name . "log.Fatalf()") (path . "log/index#Fatalf") (type . "log")) ((name . "log.Fatalln()") (path . "log/index#Fatalln") (type . "log")) ((name . "log.Flags()") (path . "log/index#Flags") (type . "log")) ((name . "log.Logger") (path . "log/index#Logger") (type . "log")) ((name . "log.Logger.Fatal()") (path . "log/index#Logger.Fatal") (type . "log")) ((name . "log.Logger.Fatalf()") (path . "log/index#Logger.Fatalf") (type . "log")) ((name . "log.Logger.Fatalln()") (path . "log/index#Logger.Fatalln") (type . "log")) ((name . "log.Logger.Flags()") (path . "log/index#Logger.Flags") (type . "log")) ((name . "log.Logger.Output()") (path . "log/index#Logger.Output") (type . "log")) ((name . "log.Logger.Panic()") (path . "log/index#Logger.Panic") (type . "log")) ((name . "log.Logger.Panicf()") (path . "log/index#Logger.Panicf") (type . "log")) ((name . "log.Logger.Panicln()") (path . "log/index#Logger.Panicln") (type . "log")) ((name . "log.Logger.Prefix()") (path . "log/index#Logger.Prefix") (type . "log")) ((name . "log.Logger.Print()") (path . "log/index#Logger.Print") (type . "log")) ((name . "log.Logger.Printf()") (path . "log/index#Logger.Printf") (type . "log")) ((name . "log.Logger.Println()") (path . "log/index#Logger.Println") (type . "log")) ((name . "log.Logger.SetFlags()") (path . "log/index#Logger.SetFlags") (type . "log")) ((name . "log.Logger.SetOutput()") (path . "log/index#Logger.SetOutput") (type . "log")) ((name . "log.Logger.SetPrefix()") (path . "log/index#Logger.SetPrefix") (type . "log")) ((name . "log.Logger.Writer()") (path . "log/index#Logger.Writer") (type . "log")) ((name . "log.New()") (path . "log/index#New") (type . "log")) ((name . "log.Output()") (path . "log/index#Output") (type . "log")) ((name . "log.Panic()") (path . "log/index#Panic") (type . "log")) ((name . "log.Panicf()") (path . "log/index#Panicf") (type . "log")) ((name . "log.Panicln()") (path . "log/index#Panicln") (type . "log")) ((name . "log.Prefix()") (path . "log/index#Prefix") (type . "log")) ((name . "log.Print()") (path . "log/index#Print") (type . "log")) ((name . "log.Printf()") (path . "log/index#Printf") (type . "log")) ((name . "log.Println()") (path . "log/index#Println") (type . "log")) ((name . "log.SetFlags()") (path . "log/index#SetFlags") (type . "log")) ((name . "log.SetOutput()") (path . "log/index#SetOutput") (type . "log")) ((name . "log.SetPrefix()") (path . "log/index#SetPrefix") (type . "log")) ((name . "log.Writer()") (path . "log/index#Writer") (type . "log")) ((name . "log/slog") (path . "log/slog/index") (type . "log")) ((name . "log/slog constants") (path . "log/slog/index#pkg-constants") (type . "log")) ((name . "log/syslog") (path . "log/syslog/index") (type . "log")) ((name . "lzw.NewReader()") (path . "compress/lzw/index#NewReader") (type . "compress")) ((name . "lzw.NewWriter()") (path . "compress/lzw/index#NewWriter") (type . "compress")) ((name . "lzw.Order") (path . "compress/lzw/index#Order") (type . "compress")) ((name . "lzw.Reader") (path . "compress/lzw/index#Reader") (type . "compress")) ((name . "lzw.Reader.Close()") (path . "compress/lzw/index#Reader.Close") (type . "compress")) ((name . "lzw.Reader.Read()") (path . "compress/lzw/index#Reader.Read") (type . "compress")) ((name . "lzw.Reader.Reset()") (path . "compress/lzw/index#Reader.Reset") (type . "compress")) ((name . "lzw.Writer") (path . "compress/lzw/index#Writer") (type . "compress")) ((name . "lzw.Writer.Close()") (path . "compress/lzw/index#Writer.Close") (type . "compress")) ((name . "lzw.Writer.Reset()") (path . "compress/lzw/index#Writer.Reset") (type . "compress")) ((name . "lzw.Writer.Write()") (path . "compress/lzw/index#Writer.Write") (type . "compress")) ((name . "macho.Cpu") (path . "debug/macho/index#Cpu") (type . "debug")) ((name . "macho.Cpu.GoString()") (path . "debug/macho/index#Cpu.GoString") (type . "debug")) ((name . "macho.Cpu.String()") (path . "debug/macho/index#Cpu.String") (type . "debug")) ((name . "macho.Dylib") (path . "debug/macho/index#Dylib") (type . "debug")) ((name . "macho.DylibCmd") (path . "debug/macho/index#DylibCmd") (type . "debug")) ((name . "macho.Dysymtab") (path . "debug/macho/index#Dysymtab") (type . "debug")) ((name . "macho.DysymtabCmd") (path . "debug/macho/index#DysymtabCmd") (type . "debug")) ((name . "macho.FatArch") (path . "debug/macho/index#FatArch") (type . "debug")) ((name . "macho.FatArchHeader") (path . "debug/macho/index#FatArchHeader") (type . "debug")) ((name . "macho.FatFile") (path . "debug/macho/index#FatFile") (type . "debug")) ((name . "macho.FatFile.Close()") (path . "debug/macho/index#FatFile.Close") (type . "debug")) ((name . "macho.File") (path . "debug/macho/index#File") (type . "debug")) ((name . "macho.File.Close()") (path . "debug/macho/index#File.Close") (type . "debug")) ((name . "macho.File.DWARF()") (path . "debug/macho/index#File.DWARF") (type . "debug")) ((name . "macho.File.ImportedLibraries()") (path . "debug/macho/index#File.ImportedLibraries") (type . "debug")) ((name . "macho.File.ImportedSymbols()") (path . "debug/macho/index#File.ImportedSymbols") (type . "debug")) ((name . "macho.File.Section()") (path . "debug/macho/index#File.Section") (type . "debug")) ((name . "macho.File.Segment()") (path . "debug/macho/index#File.Segment") (type . "debug")) ((name . "macho.FileHeader") (path . "debug/macho/index#FileHeader") (type . "debug")) ((name . "macho.FormatError") (path . "debug/macho/index#FormatError") (type . "debug")) ((name . "macho.FormatError.Error()") (path . "debug/macho/index#FormatError.Error") (type . "debug")) ((name . "macho.Load") (path . "debug/macho/index#Load") (type . "debug")) ((name . "macho.LoadBytes") (path . "debug/macho/index#LoadBytes") (type . "debug")) ((name . "macho.LoadBytes.Raw()") (path . "debug/macho/index#LoadBytes.Raw") (type . "debug")) ((name . "macho.LoadCmd") (path . "debug/macho/index#LoadCmd") (type . "debug")) ((name . "macho.LoadCmd.GoString()") (path . "debug/macho/index#LoadCmd.GoString") (type . "debug")) ((name . "macho.LoadCmd.String()") (path . "debug/macho/index#LoadCmd.String") (type . "debug")) ((name . "macho.NewFatFile()") (path . "debug/macho/index#NewFatFile") (type . "debug")) ((name . "macho.NewFile()") (path . "debug/macho/index#NewFile") (type . "debug")) ((name . "macho.Nlist32") (path . "debug/macho/index#Nlist32") (type . "debug")) ((name . "macho.Nlist64") (path . "debug/macho/index#Nlist64") (type . "debug")) ((name . "macho.Open()") (path . "debug/macho/index#Open") (type . "debug")) ((name . "macho.OpenFat()") (path . "debug/macho/index#OpenFat") (type . "debug")) ((name . "macho.Regs386") (path . "debug/macho/index#Regs386") (type . "debug")) ((name . "macho.RegsAMD64") (path . "debug/macho/index#RegsAMD64") (type . "debug")) ((name . "macho.Reloc") (path . "debug/macho/index#Reloc") (type . "debug")) ((name . "macho.RelocTypeARM") (path . "debug/macho/index#RelocTypeARM") (type . "debug")) ((name . "macho.RelocTypeARM.GoString()") (path . "debug/macho/index#RelocTypeARM.GoString") (type . "debug")) ((name . "macho.RelocTypeARM.String()") (path . "debug/macho/index#RelocTypeARM.String") (type . "debug")) ((name . "macho.RelocTypeARM64") (path . "debug/macho/index#RelocTypeARM64") (type . "debug")) ((name . "macho.RelocTypeARM64.GoString()") (path . "debug/macho/index#RelocTypeARM64.GoString") (type . "debug")) ((name . "macho.RelocTypeARM64.String()") (path . "debug/macho/index#RelocTypeARM64.String") (type . "debug")) ((name . "macho.RelocTypeGeneric") (path . "debug/macho/index#RelocTypeGeneric") (type . "debug")) ((name . "macho.RelocTypeGeneric.GoString()") (path . "debug/macho/index#RelocTypeGeneric.GoString") (type . "debug")) ((name . "macho.RelocTypeGeneric.String()") (path . "debug/macho/index#RelocTypeGeneric.String") (type . "debug")) ((name . "macho.RelocTypeX86_64") (path . "debug/macho/index#RelocTypeX86_64") (type . "debug")) ((name . "macho.RelocTypeX86_64.GoString()") (path . "debug/macho/index#RelocTypeX86_64.GoString") (type . "debug")) ((name . "macho.RelocTypeX86_64.String()") (path . "debug/macho/index#RelocTypeX86_64.String") (type . "debug")) ((name . "macho.Rpath") (path . "debug/macho/index#Rpath") (type . "debug")) ((name . "macho.RpathCmd") (path . "debug/macho/index#RpathCmd") (type . "debug")) ((name . "macho.Section") (path . "debug/macho/index#Section") (type . "debug")) ((name . "macho.Section.Data()") (path . "debug/macho/index#Section.Data") (type . "debug")) ((name . "macho.Section.Open()") (path . "debug/macho/index#Section.Open") (type . "debug")) ((name . "macho.Section32") (path . "debug/macho/index#Section32") (type . "debug")) ((name . "macho.Section64") (path . "debug/macho/index#Section64") (type . "debug")) ((name . "macho.SectionHeader") (path . "debug/macho/index#SectionHeader") (type . "debug")) ((name . "macho.Segment") (path . "debug/macho/index#Segment") (type . "debug")) ((name . "macho.Segment.Data()") (path . "debug/macho/index#Segment.Data") (type . "debug")) ((name . "macho.Segment.Open()") (path . "debug/macho/index#Segment.Open") (type . "debug")) ((name . "macho.Segment32") (path . "debug/macho/index#Segment32") (type . "debug")) ((name . "macho.Segment64") (path . "debug/macho/index#Segment64") (type . "debug")) ((name . "macho.SegmentHeader") (path . "debug/macho/index#SegmentHeader") (type . "debug")) ((name . "macho.Symbol") (path . "debug/macho/index#Symbol") (type . "debug")) ((name . "macho.Symtab") (path . "debug/macho/index#Symtab") (type . "debug")) ((name . "macho.SymtabCmd") (path . "debug/macho/index#SymtabCmd") (type . "debug")) ((name . "macho.Thread") (path . "debug/macho/index#Thread") (type . "debug")) ((name . "macho.Type") (path . "debug/macho/index#Type") (type . "debug")) ((name . "macho.Type.GoString()") (path . "debug/macho/index#Type.GoString") (type . "debug")) ((name . "macho.Type.String()") (path . "debug/macho/index#Type.String") (type . "debug")) ((name . "mail.Address") (path . "net/mail/index#Address") (type . "net/mail")) ((name . "mail.Address.String()") (path . "net/mail/index#Address.String") (type . "net/mail")) ((name . "mail.AddressParser") (path . "net/mail/index#AddressParser") (type . "net/mail")) ((name . "mail.AddressParser.Parse()") (path . "net/mail/index#AddressParser.Parse") (type . "net/mail")) ((name . "mail.AddressParser.ParseList()") (path . "net/mail/index#AddressParser.ParseList") (type . "net/mail")) ((name . "mail.Header") (path . "net/mail/index#Header") (type . "net/mail")) ((name . "mail.Header.AddressList()") (path . "net/mail/index#Header.AddressList") (type . "net/mail")) ((name . "mail.Header.Date()") (path . "net/mail/index#Header.Date") (type . "net/mail")) ((name . "mail.Header.Get()") (path . "net/mail/index#Header.Get") (type . "net/mail")) ((name . "mail.Message") (path . "net/mail/index#Message") (type . "net/mail")) ((name . "mail.ParseAddress()") (path . "net/mail/index#ParseAddress") (type . "net/mail")) ((name . "mail.ParseAddressList()") (path . "net/mail/index#ParseAddressList") (type . "net/mail")) ((name . "mail.ParseDate()") (path . "net/mail/index#ParseDate") (type . "net/mail")) ((name . "mail.ReadMessage()") (path . "net/mail/index#ReadMessage") (type . "net/mail")) ((name . "maphash.Bytes()") (path . "hash/maphash/index#Bytes") (type . "hash")) ((name . "maphash.Hash") (path . "hash/maphash/index#Hash") (type . "hash")) ((name . "maphash.Hash.BlockSize()") (path . "hash/maphash/index#Hash.BlockSize") (type . "hash")) ((name . "maphash.Hash.Reset()") (path . "hash/maphash/index#Hash.Reset") (type . "hash")) ((name . "maphash.Hash.Seed()") (path . "hash/maphash/index#Hash.Seed") (type . "hash")) ((name . "maphash.Hash.SetSeed()") (path . "hash/maphash/index#Hash.SetSeed") (type . "hash")) ((name . "maphash.Hash.Size()") (path . "hash/maphash/index#Hash.Size") (type . "hash")) ((name . "maphash.Hash.Sum()") (path . "hash/maphash/index#Hash.Sum") (type . "hash")) ((name . "maphash.Hash.Sum64()") (path . "hash/maphash/index#Hash.Sum64") (type . "hash")) ((name . "maphash.Hash.Write()") (path . "hash/maphash/index#Hash.Write") (type . "hash")) ((name . "maphash.Hash.WriteByte()") (path . "hash/maphash/index#Hash.WriteByte") (type . "hash")) ((name . "maphash.Hash.WriteString()") (path . "hash/maphash/index#Hash.WriteString") (type . "hash")) ((name . "maphash.MakeSeed()") (path . "hash/maphash/index#MakeSeed") (type . "hash")) ((name . "maphash.Seed") (path . "hash/maphash/index#Seed") (type . "hash")) ((name . "maphash.String()") (path . "hash/maphash/index#String") (type . "hash")) ((name . "maps") (path . "maps/index") (type . "maps")) ((name . "maps.Clone()") (path . "maps/index#Clone") (type . "maps")) ((name . "maps.Copy()") (path . "maps/index#Copy") (type . "maps")) ((name . "maps.DeleteFunc()") (path . "maps/index#DeleteFunc") (type . "maps")) ((name . "maps.Equal()") (path . "maps/index#Equal") (type . "maps")) ((name . "maps.EqualFunc()") (path . "maps/index#EqualFunc") (type . "maps")) ((name . "math") (path . "math/index") (type . "math")) ((name . "math constants") (path . "math/index#pkg-constants") (type . "math")) ((name . "math.Abs()") (path . "math/index#Abs") (type . "math")) ((name . "math.Acos()") (path . "math/index#Acos") (type . "math")) ((name . "math.Acosh()") (path . "math/index#Acosh") (type . "math")) ((name . "math.Asin()") (path . "math/index#Asin") (type . "math")) ((name . "math.Asinh()") (path . "math/index#Asinh") (type . "math")) ((name . "math.Atan()") (path . "math/index#Atan") (type . "math")) ((name . "math.Atan2()") (path . "math/index#Atan2") (type . "math")) ((name . "math.Atanh()") (path . "math/index#Atanh") (type . "math")) ((name . "math.Cbrt()") (path . "math/index#Cbrt") (type . "math")) ((name . "math.Ceil()") (path . "math/index#Ceil") (type . "math")) ((name . "math.Copysign()") (path . "math/index#Copysign") (type . "math")) ((name . "math.Cos()") (path . "math/index#Cos") (type . "math")) ((name . "math.Cosh()") (path . "math/index#Cosh") (type . "math")) ((name . "math.Dim()") (path . "math/index#Dim") (type . "math")) ((name . "math.Erf()") (path . "math/index#Erf") (type . "math")) ((name . "math.Erfc()") (path . "math/index#Erfc") (type . "math")) ((name . "math.Erfcinv()") (path . "math/index#Erfcinv") (type . "math")) ((name . "math.Erfinv()") (path . "math/index#Erfinv") (type . "math")) ((name . "math.Exp()") (path . "math/index#Exp") (type . "math")) ((name . "math.Exp2()") (path . "math/index#Exp2") (type . "math")) ((name . "math.Expm1()") (path . "math/index#Expm1") (type . "math")) ((name . "math.Float32bits()") (path . "math/index#Float32bits") (type . "math")) ((name . "math.Float32frombits()") (path . "math/index#Float32frombits") (type . "math")) ((name . "math.Float64bits()") (path . "math/index#Float64bits") (type . "math")) ((name . "math.Float64frombits()") (path . "math/index#Float64frombits") (type . "math")) ((name . "math.Floor()") (path . "math/index#Floor") (type . "math")) ((name . "math.FMA()") (path . "math/index#FMA") (type . "math")) ((name . "math.Frexp()") (path . "math/index#Frexp") (type . "math")) ((name . "math.Gamma()") (path . "math/index#Gamma") (type . "math")) ((name . "math.Hypot()") (path . "math/index#Hypot") (type . "math")) ((name . "math.Ilogb()") (path . "math/index#Ilogb") (type . "math")) ((name . "math.Inf()") (path . "math/index#Inf") (type . "math")) ((name . "math.IsInf()") (path . "math/index#IsInf") (type . "math")) ((name . "math.IsNaN()") (path . "math/index#IsNaN") (type . "math")) ((name . "math.J0()") (path . "math/index#J0") (type . "math")) ((name . "math.J1()") (path . "math/index#J1") (type . "math")) ((name . "math.Jn()") (path . "math/index#Jn") (type . "math")) ((name . "math.Ldexp()") (path . "math/index#Ldexp") (type . "math")) ((name . "math.Lgamma()") (path . "math/index#Lgamma") (type . "math")) ((name . "math.Log()") (path . "math/index#Log") (type . "math")) ((name . "math.Log10()") (path . "math/index#Log10") (type . "math")) ((name . "math.Log1p()") (path . "math/index#Log1p") (type . "math")) ((name . "math.Log2()") (path . "math/index#Log2") (type . "math")) ((name . "math.Logb()") (path . "math/index#Logb") (type . "math")) ((name . "math.Max()") (path . "math/index#Max") (type . "math")) ((name . "math.Min()") (path . "math/index#Min") (type . "math")) ((name . "math.Mod()") (path . "math/index#Mod") (type . "math")) ((name . "math.Modf()") (path . "math/index#Modf") (type . "math")) ((name . "math.NaN()") (path . "math/index#NaN") (type . "math")) ((name . "math.Nextafter()") (path . "math/index#Nextafter") (type . "math")) ((name . "math.Nextafter32()") (path . "math/index#Nextafter32") (type . "math")) ((name . "math.Pow()") (path . "math/index#Pow") (type . "math")) ((name . "math.Pow10()") (path . "math/index#Pow10") (type . "math")) ((name . "math.Remainder()") (path . "math/index#Remainder") (type . "math")) ((name . "math.Round()") (path . "math/index#Round") (type . "math")) ((name . "math.RoundToEven()") (path . "math/index#RoundToEven") (type . "math")) ((name . "math.Signbit()") (path . "math/index#Signbit") (type . "math")) ((name . "math.Sin()") (path . "math/index#Sin") (type . "math")) ((name . "math.Sincos()") (path . "math/index#Sincos") (type . "math")) ((name . "math.Sinh()") (path . "math/index#Sinh") (type . "math")) ((name . "math.Sqrt()") (path . "math/index#Sqrt") (type . "math")) ((name . "math.Tan()") (path . "math/index#Tan") (type . "math")) ((name . "math.Tanh()") (path . "math/index#Tanh") (type . "math")) ((name . "math.Trunc()") (path . "math/index#Trunc") (type . "math")) ((name . "math.Y0()") (path . "math/index#Y0") (type . "math")) ((name . "math.Y1()") (path . "math/index#Y1") (type . "math")) ((name . "math.Yn()") (path . "math/index#Yn") (type . "math")) ((name . "math/big") (path . "math/big/index") (type . "math/big")) ((name . "math/big constants") (path . "math/big/index#pkg-constants") (type . "math/big")) ((name . "math/bits") (path . "math/bits/index") (type . "math/bits")) ((name . "math/bits constants") (path . "math/bits/index#pkg-constants") (type . "math/bits")) ((name . "math/cmplx") (path . "math/cmplx/index") (type . "math/cmplx")) ((name . "math/rand") (path . "math/rand/index") (type . "math/rand")) ((name . "math/rand/v2") (path . "math/rand/v2/index") (type . "math/rand")) ((name . "md5.New()") (path . "crypto/md5/index#New") (type . "crypto")) ((name . "md5.Sum()") (path . "crypto/md5/index#Sum") (type . "crypto")) ((name . "metrics.All()") (path . "runtime/metrics/index#All") (type . "runtime")) ((name . "metrics.Description") (path . "runtime/metrics/index#Description") (type . "runtime")) ((name . "metrics.Float64Histogram") (path . "runtime/metrics/index#Float64Histogram") (type . "runtime")) ((name . "metrics.Read()") (path . "runtime/metrics/index#Read") (type . "runtime")) ((name . "metrics.Sample") (path . "runtime/metrics/index#Sample") (type . "runtime")) ((name . "metrics.Value") (path . "runtime/metrics/index#Value") (type . "runtime")) ((name . "metrics.Value.Float64()") (path . "runtime/metrics/index#Value.Float64") (type . "runtime")) ((name . "metrics.Value.Float64Histogram()") (path . "runtime/metrics/index#Value.Float64Histogram") (type . "runtime")) ((name . "metrics.Value.Kind()") (path . "runtime/metrics/index#Value.Kind") (type . "runtime")) ((name . "metrics.Value.Uint64()") (path . "runtime/metrics/index#Value.Uint64") (type . "runtime")) ((name . "metrics.ValueKind") (path . "runtime/metrics/index#ValueKind") (type . "runtime")) ((name . "mime") (path . "mime/index") (type . "mime")) ((name . "mime constants") (path . "mime/index#pkg-constants") (type . "mime")) ((name . "mime variables") (path . "mime/index#pkg-variables") (type . "mime")) ((name . "mime.AddExtensionType()") (path . "mime/index#AddExtensionType") (type . "mime")) ((name . "mime.ExtensionsByType()") (path . "mime/index#ExtensionsByType") (type . "mime")) ((name . "mime.FormatMediaType()") (path . "mime/index#FormatMediaType") (type . "mime")) ((name . "mime.string") (path . "mime/index#ParseMediaType") (type . "mime")) ((name . "mime.TypeByExtension()") (path . "mime/index#TypeByExtension") (type . "mime")) ((name . "mime.WordDecoder") (path . "mime/index#WordDecoder") (type . "mime")) ((name . "mime.WordDecoder.Decode()") (path . "mime/index#WordDecoder.Decode") (type . "mime")) ((name . "mime.WordDecoder.DecodeHeader()") (path . "mime/index#WordDecoder.DecodeHeader") (type . "mime")) ((name . "mime.WordEncoder") (path . "mime/index#WordEncoder") (type . "mime")) ((name . "mime.WordEncoder.Encode()") (path . "mime/index#WordEncoder.Encode") (type . "mime")) ((name . "mime/multipart") (path . "mime/multipart/index") (type . "mime")) ((name . "mime/multipart variables") (path . "mime/multipart/index#pkg-variables") (type . "mime")) ((name . "mime/quotedprintable") (path . "mime/quotedprintable/index") (type . "mime")) ((name . "multipart.File") (path . "mime/multipart/index#File") (type . "mime")) ((name . "multipart.FileHeader") (path . "mime/multipart/index#FileHeader") (type . "mime")) ((name . "multipart.FileHeader.Open()") (path . "mime/multipart/index#FileHeader.Open") (type . "mime")) ((name . "multipart.Form") (path . "mime/multipart/index#Form") (type . "mime")) ((name . "multipart.Form.RemoveAll()") (path . "mime/multipart/index#Form.RemoveAll") (type . "mime")) ((name . "multipart.NewReader()") (path . "mime/multipart/index#NewReader") (type . "mime")) ((name . "multipart.NewWriter()") (path . "mime/multipart/index#NewWriter") (type . "mime")) ((name . "multipart.Part") (path . "mime/multipart/index#Part") (type . "mime")) ((name . "multipart.Part.Close()") (path . "mime/multipart/index#Part.Close") (type . "mime")) ((name . "multipart.Part.FileName()") (path . "mime/multipart/index#Part.FileName") (type . "mime")) ((name . "multipart.Part.FormName()") (path . "mime/multipart/index#Part.FormName") (type . "mime")) ((name . "multipart.Part.Read()") (path . "mime/multipart/index#Part.Read") (type . "mime")) ((name . "multipart.Reader") (path . "mime/multipart/index#Reader") (type . "mime")) ((name . "multipart.Reader.NextPart()") (path . "mime/multipart/index#Reader.NextPart") (type . "mime")) ((name . "multipart.Reader.NextRawPart()") (path . "mime/multipart/index#Reader.NextRawPart") (type . "mime")) ((name . "multipart.Reader.ReadForm()") (path . "mime/multipart/index#Reader.ReadForm") (type . "mime")) ((name . "multipart.Writer") (path . "mime/multipart/index#Writer") (type . "mime")) ((name . "multipart.Writer.Boundary()") (path . "mime/multipart/index#Writer.Boundary") (type . "mime")) ((name . "multipart.Writer.Close()") (path . "mime/multipart/index#Writer.Close") (type . "mime")) ((name . "multipart.Writer.CreateFormField()") (path . "mime/multipart/index#Writer.CreateFormField") (type . "mime")) ((name . "multipart.Writer.CreateFormFile()") (path . "mime/multipart/index#Writer.CreateFormFile") (type . "mime")) ((name . "multipart.Writer.CreatePart()") (path . "mime/multipart/index#Writer.CreatePart") (type . "mime")) ((name . "multipart.Writer.FormDataContentType()") (path . "mime/multipart/index#Writer.FormDataContentType") (type . "mime")) ((name . "multipart.Writer.SetBoundary()") (path . "mime/multipart/index#Writer.SetBoundary") (type . "mime")) ((name . "multipart.Writer.WriteField()") (path . "mime/multipart/index#Writer.WriteField") (type . "mime")) ((name . "net") (path . "net/index") (type . "net")) ((name . "net constants") (path . "net/index#pkg-constants") (type . "net")) ((name . "net variables") (path . "net/index#pkg-variables") (type . "net")) ((name . "net.Addr") (path . "net/index#Addr") (type . "net")) ((name . "net.AddrError") (path . "net/index#AddrError") (type . "net")) ((name . "net.AddrError.Error()") (path . "net/index#AddrError.Error") (type . "net")) ((name . "net.AddrError.Temporary()") (path . "net/index#AddrError.Temporary") (type . "net")) ((name . "net.AddrError.Timeout()") (path . "net/index#AddrError.Timeout") (type . "net")) ((name . "net.Buffers") (path . "net/index#Buffers") (type . "net")) ((name . "net.Buffers.Read()") (path . "net/index#Buffers.Read") (type . "net")) ((name . "net.Buffers.WriteTo()") (path . "net/index#Buffers.WriteTo") (type . "net")) ((name . "net.CIDRMask()") (path . "net/index#CIDRMask") (type . "net")) ((name . "net.Conn") (path . "net/index#Conn") (type . "net")) ((name . "net.Dial()") (path . "net/index#Dial") (type . "net")) ((name . "net.Dialer") (path . "net/index#Dialer") (type . "net")) ((name . "net.Dialer.Dial()") (path . "net/index#Dialer.Dial") (type . "net")) ((name . "net.Dialer.DialContext()") (path . "net/index#Dialer.DialContext") (type . "net")) ((name . "net.Dialer.MultipathTCP()") (path . "net/index#Dialer.MultipathTCP") (type . "net")) ((name . "net.Dialer.SetMultipathTCP()") (path . "net/index#Dialer.SetMultipathTCP") (type . "net")) ((name . "net.DialIP()") (path . "net/index#DialIP") (type . "net")) ((name . "net.DialTCP()") (path . "net/index#DialTCP") (type . "net")) ((name . "net.DialTimeout()") (path . "net/index#DialTimeout") (type . "net")) ((name . "net.DialUDP()") (path . "net/index#DialUDP") (type . "net")) ((name . "net.DialUnix()") (path . "net/index#DialUnix") (type . "net")) ((name . "net.DNSConfigError") (path . "net/index#DNSConfigError") (type . "net")) ((name . "net.DNSConfigError.Error()") (path . "net/index#DNSConfigError.Error") (type . "net")) ((name . "net.DNSConfigError.Temporary()") (path . "net/index#DNSConfigError.Temporary") (type . "net")) ((name . "net.DNSConfigError.Timeout()") (path . "net/index#DNSConfigError.Timeout") (type . "net")) ((name . "net.DNSConfigError.Unwrap()") (path . "net/index#DNSConfigError.Unwrap") (type . "net")) ((name . "net.DNSError") (path . "net/index#DNSError") (type . "net")) ((name . "net.DNSError.Error()") (path . "net/index#DNSError.Error") (type . "net")) ((name . "net.DNSError.Temporary()") (path . "net/index#DNSError.Temporary") (type . "net")) ((name . "net.DNSError.Timeout()") (path . "net/index#DNSError.Timeout") (type . "net")) ((name . "net.Error") (path . "net/index#Error") (type . "net")) ((name . "net.FileConn()") (path . "net/index#FileConn") (type . "net")) ((name . "net.FileListener()") (path . "net/index#FileListener") (type . "net")) ((name . "net.FilePacketConn()") (path . "net/index#FilePacketConn") (type . "net")) ((name . "net.Flags") (path . "net/index#Flags") (type . "net")) ((name . "net.Flags.String()") (path . "net/index#Flags.String") (type . "net")) ((name . "net.HardwareAddr") (path . "net/index#HardwareAddr") (type . "net")) ((name . "net.HardwareAddr.String()") (path . "net/index#HardwareAddr.String") (type . "net")) ((name . "net.Interface") (path . "net/index#Interface") (type . "net")) ((name . "net.Interface.Addrs()") (path . "net/index#Interface.Addrs") (type . "net")) ((name . "net.Interface.MulticastAddrs()") (path . "net/index#Interface.MulticastAddrs") (type . "net")) ((name . "net.InterfaceAddrs()") (path . "net/index#InterfaceAddrs") (type . "net")) ((name . "net.InterfaceByIndex()") (path . "net/index#InterfaceByIndex") (type . "net")) ((name . "net.InterfaceByName()") (path . "net/index#InterfaceByName") (type . "net")) ((name . "net.Interfaces()") (path . "net/index#Interfaces") (type . "net")) ((name . "net.InvalidAddrError") (path . "net/index#InvalidAddrError") (type . "net")) ((name . "net.InvalidAddrError.Error()") (path . "net/index#InvalidAddrError.Error") (type . "net")) ((name . "net.InvalidAddrError.Temporary()") (path . "net/index#InvalidAddrError.Temporary") (type . "net")) ((name . "net.InvalidAddrError.Timeout()") (path . "net/index#InvalidAddrError.Timeout") (type . "net")) ((name . "net.IP") (path . "net/index#IP") (type . "net")) ((name . "net.IP.DefaultMask()") (path . "net/index#IP.DefaultMask") (type . "net")) ((name . "net.IP.Equal()") (path . "net/index#IP.Equal") (type . "net")) ((name . "net.IP.IsGlobalUnicast()") (path . "net/index#IP.IsGlobalUnicast") (type . "net")) ((name . "net.IP.IsInterfaceLocalMulticast()") (path . "net/index#IP.IsInterfaceLocalMulticast") (type . "net")) ((name . "net.IP.IsLinkLocalMulticast()") (path . "net/index#IP.IsLinkLocalMulticast") (type . "net")) ((name . "net.IP.IsLinkLocalUnicast()") (path . "net/index#IP.IsLinkLocalUnicast") (type . "net")) ((name . "net.IP.IsLoopback()") (path . "net/index#IP.IsLoopback") (type . "net")) ((name . "net.IP.IsMulticast()") (path . "net/index#IP.IsMulticast") (type . "net")) ((name . "net.IP.IsPrivate()") (path . "net/index#IP.IsPrivate") (type . "net")) ((name . "net.IP.IsUnspecified()") (path . "net/index#IP.IsUnspecified") (type . "net")) ((name . "net.IP.MarshalText()") (path . "net/index#IP.MarshalText") (type . "net")) ((name . "net.IP.Mask()") (path . "net/index#IP.Mask") (type . "net")) ((name . "net.IP.String()") (path . "net/index#IP.String") (type . "net")) ((name . "net.IP.To16()") (path . "net/index#IP.To16") (type . "net")) ((name . "net.IP.To4()") (path . "net/index#IP.To4") (type . "net")) ((name . "net.IP.UnmarshalText()") (path . "net/index#IP.UnmarshalText") (type . "net")) ((name . "net.IPAddr") (path . "net/index#IPAddr") (type . "net")) ((name . "net.IPAddr.Network()") (path . "net/index#IPAddr.Network") (type . "net")) ((name . "net.IPAddr.String()") (path . "net/index#IPAddr.String") (type . "net")) ((name . "net.IPConn") (path . "net/index#IPConn") (type . "net")) ((name . "net.IPConn.Close()") (path . "net/index#IPConn.Close") (type . "net")) ((name . "net.IPConn.File()") (path . "net/index#IPConn.File") (type . "net")) ((name . "net.IPConn.LocalAddr()") (path . "net/index#IPConn.LocalAddr") (type . "net")) ((name . "net.IPConn.Read()") (path . "net/index#IPConn.Read") (type . "net")) ((name . "net.IPConn.ReadFrom()") (path . "net/index#IPConn.ReadFrom") (type . "net")) ((name . "net.IPConn.ReadFromIP()") (path . "net/index#IPConn.ReadFromIP") (type . "net")) ((name . "net.IPConn.ReadMsgIP()") (path . "net/index#IPConn.ReadMsgIP") (type . "net")) ((name . "net.IPConn.RemoteAddr()") (path . "net/index#IPConn.RemoteAddr") (type . "net")) ((name . "net.IPConn.SetDeadline()") (path . "net/index#IPConn.SetDeadline") (type . "net")) ((name . "net.IPConn.SetReadBuffer()") (path . "net/index#IPConn.SetReadBuffer") (type . "net")) ((name . "net.IPConn.SetReadDeadline()") (path . "net/index#IPConn.SetReadDeadline") (type . "net")) ((name . "net.IPConn.SetWriteBuffer()") (path . "net/index#IPConn.SetWriteBuffer") (type . "net")) ((name . "net.IPConn.SetWriteDeadline()") (path . "net/index#IPConn.SetWriteDeadline") (type . "net")) ((name . "net.IPConn.SyscallConn()") (path . "net/index#IPConn.SyscallConn") (type . "net")) ((name . "net.IPConn.Write()") (path . "net/index#IPConn.Write") (type . "net")) ((name . "net.IPConn.WriteMsgIP()") (path . "net/index#IPConn.WriteMsgIP") (type . "net")) ((name . "net.IPConn.WriteTo()") (path . "net/index#IPConn.WriteTo") (type . "net")) ((name . "net.IPConn.WriteToIP()") (path . "net/index#IPConn.WriteToIP") (type . "net")) ((name . "net.IPMask") (path . "net/index#IPMask") (type . "net")) ((name . "net.IPMask.Size()") (path . "net/index#IPMask.Size") (type . "net")) ((name . "net.IPMask.String()") (path . "net/index#IPMask.String") (type . "net")) ((name . "net.IPNet") (path . "net/index#IPNet") (type . "net")) ((name . "net.IPNet.Contains()") (path . "net/index#IPNet.Contains") (type . "net")) ((name . "net.IPNet.Network()") (path . "net/index#IPNet.Network") (type . "net")) ((name . "net.IPNet.String()") (path . "net/index#IPNet.String") (type . "net")) ((name . "net.IPv4()") (path . "net/index#IPv4") (type . "net")) ((name . "net.IPv4Mask()") (path . "net/index#IPv4Mask") (type . "net")) ((name . "net.JoinHostPort()") (path . "net/index#JoinHostPort") (type . "net")) ((name . "net.Listen()") (path . "net/index#Listen") (type . "net")) ((name . "net.ListenConfig") (path . "net/index#ListenConfig") (type . "net")) ((name . "net.ListenConfig.Listen()") (path . "net/index#ListenConfig.Listen") (type . "net")) ((name . "net.ListenConfig.ListenPacket()") (path . "net/index#ListenConfig.ListenPacket") (type . "net")) ((name . "net.ListenConfig.MultipathTCP()") (path . "net/index#ListenConfig.MultipathTCP") (type . "net")) ((name . "net.ListenConfig.SetMultipathTCP()") (path . "net/index#ListenConfig.SetMultipathTCP") (type . "net")) ((name . "net.Listener") (path . "net/index#Listener") (type . "net")) ((name . "net.ListenIP()") (path . "net/index#ListenIP") (type . "net")) ((name . "net.ListenMulticastUDP()") (path . "net/index#ListenMulticastUDP") (type . "net")) ((name . "net.ListenPacket()") (path . "net/index#ListenPacket") (type . "net")) ((name . "net.ListenTCP()") (path . "net/index#ListenTCP") (type . "net")) ((name . "net.ListenUDP()") (path . "net/index#ListenUDP") (type . "net")) ((name . "net.ListenUnix()") (path . "net/index#ListenUnix") (type . "net")) ((name . "net.ListenUnixgram()") (path . "net/index#ListenUnixgram") (type . "net")) ((name . "net.LookupAddr()") (path . "net/index#LookupAddr") (type . "net")) ((name . "net.LookupCNAME()") (path . "net/index#LookupCNAME") (type . "net")) ((name . "net.LookupHost()") (path . "net/index#LookupHost") (type . "net")) ((name . "net.LookupIP()") (path . "net/index#LookupIP") (type . "net")) ((name . "net.LookupMX()") (path . "net/index#LookupMX") (type . "net")) ((name . "net.LookupNS()") (path . "net/index#LookupNS") (type . "net")) ((name . "net.LookupPort()") (path . "net/index#LookupPort") (type . "net")) ((name . "net.LookupSRV()") (path . "net/index#LookupSRV") (type . "net")) ((name . "net.LookupTXT()") (path . "net/index#LookupTXT") (type . "net")) ((name . "net.MX") (path . "net/index#MX") (type . "net")) ((name . "net.NS") (path . "net/index#NS") (type . "net")) ((name . "net.OpError") (path . "net/index#OpError") (type . "net")) ((name . "net.OpError.Error()") (path . "net/index#OpError.Error") (type . "net")) ((name . "net.OpError.Temporary()") (path . "net/index#OpError.Temporary") (type . "net")) ((name . "net.OpError.Timeout()") (path . "net/index#OpError.Timeout") (type . "net")) ((name . "net.OpError.Unwrap()") (path . "net/index#OpError.Unwrap") (type . "net")) ((name . "net.PacketConn") (path . "net/index#PacketConn") (type . "net")) ((name . "net.ParseCIDR()") (path . "net/index#ParseCIDR") (type . "net")) ((name . "net.ParseError") (path . "net/index#ParseError") (type . "net")) ((name . "net.ParseError.Error()") (path . "net/index#ParseError.Error") (type . "net")) ((name . "net.ParseError.Temporary()") (path . "net/index#ParseError.Temporary") (type . "net")) ((name . "net.ParseError.Timeout()") (path . "net/index#ParseError.Timeout") (type . "net")) ((name . "net.ParseIP()") (path . "net/index#ParseIP") (type . "net")) ((name . "net.ParseMAC()") (path . "net/index#ParseMAC") (type . "net")) ((name . "net.Pipe()") (path . "net/index#Pipe") (type . "net")) ((name . "net.ResolveIPAddr()") (path . "net/index#ResolveIPAddr") (type . "net")) ((name . "net.Resolver") (path . "net/index#Resolver") (type . "net")) ((name . "net.Resolver.LookupAddr()") (path . "net/index#Resolver.LookupAddr") (type . "net")) ((name . "net.Resolver.LookupCNAME()") (path . "net/index#Resolver.LookupCNAME") (type . "net")) ((name . "net.Resolver.LookupHost()") (path . "net/index#Resolver.LookupHost") (type . "net")) ((name . "net.Resolver.LookupIP()") (path . "net/index#Resolver.LookupIP") (type . "net")) ((name . "net.Resolver.LookupIPAddr()") (path . "net/index#Resolver.LookupIPAddr") (type . "net")) ((name . "net.Resolver.LookupMX()") (path . "net/index#Resolver.LookupMX") (type . "net")) ((name . "net.Resolver.LookupNetIP()") (path . "net/index#Resolver.LookupNetIP") (type . "net")) ((name . "net.Resolver.LookupNS()") (path . "net/index#Resolver.LookupNS") (type . "net")) ((name . "net.Resolver.LookupPort()") (path . "net/index#Resolver.LookupPort") (type . "net")) ((name . "net.Resolver.LookupSRV()") (path . "net/index#Resolver.LookupSRV") (type . "net")) ((name . "net.Resolver.LookupTXT()") (path . "net/index#Resolver.LookupTXT") (type . "net")) ((name . "net.ResolveTCPAddr()") (path . "net/index#ResolveTCPAddr") (type . "net")) ((name . "net.ResolveUDPAddr()") (path . "net/index#ResolveUDPAddr") (type . "net")) ((name . "net.ResolveUnixAddr()") (path . "net/index#ResolveUnixAddr") (type . "net")) ((name . "net.SplitHostPort()") (path . "net/index#SplitHostPort") (type . "net")) ((name . "net.SRV") (path . "net/index#SRV") (type . "net")) ((name . "net.TCPAddr") (path . "net/index#TCPAddr") (type . "net")) ((name . "net.TCPAddr.AddrPort()") (path . "net/index#TCPAddr.AddrPort") (type . "net")) ((name . "net.TCPAddr.Network()") (path . "net/index#TCPAddr.Network") (type . "net")) ((name . "net.TCPAddr.String()") (path . "net/index#TCPAddr.String") (type . "net")) ((name . "net.TCPAddrFromAddrPort()") (path . "net/index#TCPAddrFromAddrPort") (type . "net")) ((name . "net.TCPConn") (path . "net/index#TCPConn") (type . "net")) ((name . "net.TCPConn.Close()") (path . "net/index#TCPConn.Close") (type . "net")) ((name . "net.TCPConn.CloseRead()") (path . "net/index#TCPConn.CloseRead") (type . "net")) ((name . "net.TCPConn.CloseWrite()") (path . "net/index#TCPConn.CloseWrite") (type . "net")) ((name . "net.TCPConn.File()") (path . "net/index#TCPConn.File") (type . "net")) ((name . "net.TCPConn.LocalAddr()") (path . "net/index#TCPConn.LocalAddr") (type . "net")) ((name . "net.TCPConn.MultipathTCP()") (path . "net/index#TCPConn.MultipathTCP") (type . "net")) ((name . "net.TCPConn.Read()") (path . "net/index#TCPConn.Read") (type . "net")) ((name . "net.TCPConn.ReadFrom()") (path . "net/index#TCPConn.ReadFrom") (type . "net")) ((name . "net.TCPConn.RemoteAddr()") (path . "net/index#TCPConn.RemoteAddr") (type . "net")) ((name . "net.TCPConn.SetDeadline()") (path . "net/index#TCPConn.SetDeadline") (type . "net")) ((name . "net.TCPConn.SetKeepAlive()") (path . "net/index#TCPConn.SetKeepAlive") (type . "net")) ((name . "net.TCPConn.SetKeepAlivePeriod()") (path . "net/index#TCPConn.SetKeepAlivePeriod") (type . "net")) ((name . "net.TCPConn.SetLinger()") (path . "net/index#TCPConn.SetLinger") (type . "net")) ((name . "net.TCPConn.SetNoDelay()") (path . "net/index#TCPConn.SetNoDelay") (type . "net")) ((name . "net.TCPConn.SetReadBuffer()") (path . "net/index#TCPConn.SetReadBuffer") (type . "net")) ((name . "net.TCPConn.SetReadDeadline()") (path . "net/index#TCPConn.SetReadDeadline") (type . "net")) ((name . "net.TCPConn.SetWriteBuffer()") (path . "net/index#TCPConn.SetWriteBuffer") (type . "net")) ((name . "net.TCPConn.SetWriteDeadline()") (path . "net/index#TCPConn.SetWriteDeadline") (type . "net")) ((name . "net.TCPConn.SyscallConn()") (path . "net/index#TCPConn.SyscallConn") (type . "net")) ((name . "net.TCPConn.Write()") (path . "net/index#TCPConn.Write") (type . "net")) ((name . "net.TCPConn.WriteTo()") (path . "net/index#TCPConn.WriteTo") (type . "net")) ((name . "net.TCPListener") (path . "net/index#TCPListener") (type . "net")) ((name . "net.TCPListener.Accept()") (path . "net/index#TCPListener.Accept") (type . "net")) ((name . "net.TCPListener.AcceptTCP()") (path . "net/index#TCPListener.AcceptTCP") (type . "net")) ((name . "net.TCPListener.Addr()") (path . "net/index#TCPListener.Addr") (type . "net")) ((name . "net.TCPListener.Close()") (path . "net/index#TCPListener.Close") (type . "net")) ((name . "net.TCPListener.File()") (path . "net/index#TCPListener.File") (type . "net")) ((name . "net.TCPListener.SetDeadline()") (path . "net/index#TCPListener.SetDeadline") (type . "net")) ((name . "net.TCPListener.SyscallConn()") (path . "net/index#TCPListener.SyscallConn") (type . "net")) ((name . "net.UDPAddr") (path . "net/index#UDPAddr") (type . "net")) ((name . "net.UDPAddr.AddrPort()") (path . "net/index#UDPAddr.AddrPort") (type . "net")) ((name . "net.UDPAddr.Network()") (path . "net/index#UDPAddr.Network") (type . "net")) ((name . "net.UDPAddr.String()") (path . "net/index#UDPAddr.String") (type . "net")) ((name . "net.UDPAddrFromAddrPort()") (path . "net/index#UDPAddrFromAddrPort") (type . "net")) ((name . "net.UDPConn") (path . "net/index#UDPConn") (type . "net")) ((name . "net.UDPConn.Close()") (path . "net/index#UDPConn.Close") (type . "net")) ((name . "net.UDPConn.File()") (path . "net/index#UDPConn.File") (type . "net")) ((name . "net.UDPConn.LocalAddr()") (path . "net/index#UDPConn.LocalAddr") (type . "net")) ((name . "net.UDPConn.Read()") (path . "net/index#UDPConn.Read") (type . "net")) ((name . "net.UDPConn.ReadFrom()") (path . "net/index#UDPConn.ReadFrom") (type . "net")) ((name . "net.UDPConn.ReadFromUDP()") (path . "net/index#UDPConn.ReadFromUDP") (type . "net")) ((name . "net.UDPConn.ReadFromUDPAddrPort()") (path . "net/index#UDPConn.ReadFromUDPAddrPort") (type . "net")) ((name . "net.UDPConn.ReadMsgUDP()") (path . "net/index#UDPConn.ReadMsgUDP") (type . "net")) ((name . "net.UDPConn.ReadMsgUDPAddrPort()") (path . "net/index#UDPConn.ReadMsgUDPAddrPort") (type . "net")) ((name . "net.UDPConn.RemoteAddr()") (path . "net/index#UDPConn.RemoteAddr") (type . "net")) ((name . "net.UDPConn.SetDeadline()") (path . "net/index#UDPConn.SetDeadline") (type . "net")) ((name . "net.UDPConn.SetReadBuffer()") (path . "net/index#UDPConn.SetReadBuffer") (type . "net")) ((name . "net.UDPConn.SetReadDeadline()") (path . "net/index#UDPConn.SetReadDeadline") (type . "net")) ((name . "net.UDPConn.SetWriteBuffer()") (path . "net/index#UDPConn.SetWriteBuffer") (type . "net")) ((name . "net.UDPConn.SetWriteDeadline()") (path . "net/index#UDPConn.SetWriteDeadline") (type . "net")) ((name . "net.UDPConn.SyscallConn()") (path . "net/index#UDPConn.SyscallConn") (type . "net")) ((name . "net.UDPConn.Write()") (path . "net/index#UDPConn.Write") (type . "net")) ((name . "net.UDPConn.WriteMsgUDP()") (path . "net/index#UDPConn.WriteMsgUDP") (type . "net")) ((name . "net.UDPConn.WriteMsgUDPAddrPort()") (path . "net/index#UDPConn.WriteMsgUDPAddrPort") (type . "net")) ((name . "net.UDPConn.WriteTo()") (path . "net/index#UDPConn.WriteTo") (type . "net")) ((name . "net.UDPConn.WriteToUDP()") (path . "net/index#UDPConn.WriteToUDP") (type . "net")) ((name . "net.UDPConn.WriteToUDPAddrPort()") (path . "net/index#UDPConn.WriteToUDPAddrPort") (type . "net")) ((name . "net.UnixAddr") (path . "net/index#UnixAddr") (type . "net")) ((name . "net.UnixAddr.Network()") (path . "net/index#UnixAddr.Network") (type . "net")) ((name . "net.UnixAddr.String()") (path . "net/index#UnixAddr.String") (type . "net")) ((name . "net.UnixConn") (path . "net/index#UnixConn") (type . "net")) ((name . "net.UnixConn.Close()") (path . "net/index#UnixConn.Close") (type . "net")) ((name . "net.UnixConn.CloseRead()") (path . "net/index#UnixConn.CloseRead") (type . "net")) ((name . "net.UnixConn.CloseWrite()") (path . "net/index#UnixConn.CloseWrite") (type . "net")) ((name . "net.UnixConn.File()") (path . "net/index#UnixConn.File") (type . "net")) ((name . "net.UnixConn.LocalAddr()") (path . "net/index#UnixConn.LocalAddr") (type . "net")) ((name . "net.UnixConn.Read()") (path . "net/index#UnixConn.Read") (type . "net")) ((name . "net.UnixConn.ReadFrom()") (path . "net/index#UnixConn.ReadFrom") (type . "net")) ((name . "net.UnixConn.ReadFromUnix()") (path . "net/index#UnixConn.ReadFromUnix") (type . "net")) ((name . "net.UnixConn.ReadMsgUnix()") (path . "net/index#UnixConn.ReadMsgUnix") (type . "net")) ((name . "net.UnixConn.RemoteAddr()") (path . "net/index#UnixConn.RemoteAddr") (type . "net")) ((name . "net.UnixConn.SetDeadline()") (path . "net/index#UnixConn.SetDeadline") (type . "net")) ((name . "net.UnixConn.SetReadBuffer()") (path . "net/index#UnixConn.SetReadBuffer") (type . "net")) ((name . "net.UnixConn.SetReadDeadline()") (path . "net/index#UnixConn.SetReadDeadline") (type . "net")) ((name . "net.UnixConn.SetWriteBuffer()") (path . "net/index#UnixConn.SetWriteBuffer") (type . "net")) ((name . "net.UnixConn.SetWriteDeadline()") (path . "net/index#UnixConn.SetWriteDeadline") (type . "net")) ((name . "net.UnixConn.SyscallConn()") (path . "net/index#UnixConn.SyscallConn") (type . "net")) ((name . "net.UnixConn.Write()") (path . "net/index#UnixConn.Write") (type . "net")) ((name . "net.UnixConn.WriteMsgUnix()") (path . "net/index#UnixConn.WriteMsgUnix") (type . "net")) ((name . "net.UnixConn.WriteTo()") (path . "net/index#UnixConn.WriteTo") (type . "net")) ((name . "net.UnixConn.WriteToUnix()") (path . "net/index#UnixConn.WriteToUnix") (type . "net")) ((name . "net.UnixListener") (path . "net/index#UnixListener") (type . "net")) ((name . "net.UnixListener.Accept()") (path . "net/index#UnixListener.Accept") (type . "net")) ((name . "net.UnixListener.AcceptUnix()") (path . "net/index#UnixListener.AcceptUnix") (type . "net")) ((name . "net.UnixListener.Addr()") (path . "net/index#UnixListener.Addr") (type . "net")) ((name . "net.UnixListener.Close()") (path . "net/index#UnixListener.Close") (type . "net")) ((name . "net.UnixListener.File()") (path . "net/index#UnixListener.File") (type . "net")) ((name . "net.UnixListener.SetDeadline()") (path . "net/index#UnixListener.SetDeadline") (type . "net")) ((name . "net.UnixListener.SetUnlinkOnClose()") (path . "net/index#UnixListener.SetUnlinkOnClose") (type . "net")) ((name . "net.UnixListener.SyscallConn()") (path . "net/index#UnixListener.SyscallConn") (type . "net")) ((name . "net.UnknownNetworkError") (path . "net/index#UnknownNetworkError") (type . "net")) ((name . "net.UnknownNetworkError.Error()") (path . "net/index#UnknownNetworkError.Error") (type . "net")) ((name . "net.UnknownNetworkError.Temporary()") (path . "net/index#UnknownNetworkError.Temporary") (type . "net")) ((name . "net.UnknownNetworkError.Timeout()") (path . "net/index#UnknownNetworkError.Timeout") (type . "net")) ((name . "net/http") (path . "net/http/index") (type . "net/http")) ((name . "net/http constants") (path . "net/http/index#pkg-constants") (type . "net/http")) ((name . "net/http variables") (path . "net/http/index#pkg-variables") (type . "net/http")) ((name . "net/http/cgi") (path . "net/http/cgi/index") (type . "net/http")) ((name . "net/http/cookiejar") (path . "net/http/cookiejar/index") (type . "net/http")) ((name . "net/http/fcgi") (path . "net/http/fcgi/index") (type . "net/http")) ((name . "net/http/fcgi variables") (path . "net/http/fcgi/index#pkg-variables") (type . "net/http")) ((name . "net/http/httptest") (path . "net/http/httptest/index") (type . "net/http")) ((name . "net/http/httptest constants") (path . "net/http/httptest/index#pkg-constants") (type . "net/http")) ((name . "net/http/httptrace") (path . "net/http/httptrace/index") (type . "net/http")) ((name . "net/http/httputil") (path . "net/http/httputil/index") (type . "net/http")) ((name . "net/http/httputil variables") (path . "net/http/httputil/index#pkg-variables") (type . "net/http")) ((name . "net/http/internal") (path . "net/http/internal/index") (type . "net/http")) ((name . "net/http/internal variables") (path . "net/http/internal/index#pkg-variables") (type . "net/http")) ((name . "net/http/pprof") (path . "net/http/pprof/index") (type . "net/http")) ((name . "net/mail") (path . "net/mail/index") (type . "net/mail")) ((name . "net/mail variables") (path . "net/mail/index#pkg-variables") (type . "net/mail")) ((name . "net/netip") (path . "net/netip/index") (type . "net/netip")) ((name . "net/rpc") (path . "net/rpc/index") (type . "net/rpc")) ((name . "net/rpc constants") (path . "net/rpc/index#pkg-constants") (type . "net/rpc")) ((name . "net/rpc variables") (path . "net/rpc/index#pkg-variables") (type . "net/rpc")) ((name . "net/rpc/jsonrpc") (path . "net/rpc/jsonrpc/index") (type . "net/rpc")) ((name . "net/smtp") (path . "net/smtp/index") (type . "net/smtp")) ((name . "net/textproto") (path . "net/textproto/index") (type . "net/textproto")) ((name . "net/url") (path . "net/url/index") (type . "net/url")) ((name . "netip.Addr") (path . "net/netip/index#Addr") (type . "net/netip")) ((name . "netip.Addr.AppendTo()") (path . "net/netip/index#Addr.AppendTo") (type . "net/netip")) ((name . "netip.Addr.As16()") (path . "net/netip/index#Addr.As16") (type . "net/netip")) ((name . "netip.Addr.As4()") (path . "net/netip/index#Addr.As4") (type . "net/netip")) ((name . "netip.Addr.AsSlice()") (path . "net/netip/index#Addr.AsSlice") (type . "net/netip")) ((name . "netip.Addr.BitLen()") (path . "net/netip/index#Addr.BitLen") (type . "net/netip")) ((name . "netip.Addr.Compare()") (path . "net/netip/index#Addr.Compare") (type . "net/netip")) ((name . "netip.Addr.Is4()") (path . "net/netip/index#Addr.Is4") (type . "net/netip")) ((name . "netip.Addr.Is4In6()") (path . "net/netip/index#Addr.Is4In6") (type . "net/netip")) ((name . "netip.Addr.Is6()") (path . "net/netip/index#Addr.Is6") (type . "net/netip")) ((name . "netip.Addr.IsGlobalUnicast()") (path . "net/netip/index#Addr.IsGlobalUnicast") (type . "net/netip")) ((name . "netip.Addr.IsInterfaceLocalMulticast()") (path . "net/netip/index#Addr.IsInterfaceLocalMulticast") (type . "net/netip")) ((name . "netip.Addr.IsLinkLocalMulticast()") (path . "net/netip/index#Addr.IsLinkLocalMulticast") (type . "net/netip")) ((name . "netip.Addr.IsLinkLocalUnicast()") (path . "net/netip/index#Addr.IsLinkLocalUnicast") (type . "net/netip")) ((name . "netip.Addr.IsLoopback()") (path . "net/netip/index#Addr.IsLoopback") (type . "net/netip")) ((name . "netip.Addr.IsMulticast()") (path . "net/netip/index#Addr.IsMulticast") (type . "net/netip")) ((name . "netip.Addr.IsPrivate()") (path . "net/netip/index#Addr.IsPrivate") (type . "net/netip")) ((name . "netip.Addr.IsUnspecified()") (path . "net/netip/index#Addr.IsUnspecified") (type . "net/netip")) ((name . "netip.Addr.IsValid()") (path . "net/netip/index#Addr.IsValid") (type . "net/netip")) ((name . "netip.Addr.Less()") (path . "net/netip/index#Addr.Less") (type . "net/netip")) ((name . "netip.Addr.MarshalBinary()") (path . "net/netip/index#Addr.MarshalBinary") (type . "net/netip")) ((name . "netip.Addr.MarshalText()") (path . "net/netip/index#Addr.MarshalText") (type . "net/netip")) ((name . "netip.Addr.Next()") (path . "net/netip/index#Addr.Next") (type . "net/netip")) ((name . "netip.Addr.Prefix()") (path . "net/netip/index#Addr.Prefix") (type . "net/netip")) ((name . "netip.Addr.Prev()") (path . "net/netip/index#Addr.Prev") (type . "net/netip")) ((name . "netip.Addr.String()") (path . "net/netip/index#Addr.String") (type . "net/netip")) ((name . "netip.Addr.StringExpanded()") (path . "net/netip/index#Addr.StringExpanded") (type . "net/netip")) ((name . "netip.Addr.Unmap()") (path . "net/netip/index#Addr.Unmap") (type . "net/netip")) ((name . "netip.Addr.UnmarshalBinary()") (path . "net/netip/index#Addr.UnmarshalBinary") (type . "net/netip")) ((name . "netip.Addr.UnmarshalText()") (path . "net/netip/index#Addr.UnmarshalText") (type . "net/netip")) ((name . "netip.Addr.WithZone()") (path . "net/netip/index#Addr.WithZone") (type . "net/netip")) ((name . "netip.Addr.Zone()") (path . "net/netip/index#Addr.Zone") (type . "net/netip")) ((name . "netip.AddrFrom16()") (path . "net/netip/index#AddrFrom16") (type . "net/netip")) ((name . "netip.AddrFrom4()") (path . "net/netip/index#AddrFrom4") (type . "net/netip")) ((name . "netip.AddrFromSlice()") (path . "net/netip/index#AddrFromSlice") (type . "net/netip")) ((name . "netip.AddrPort") (path . "net/netip/index#AddrPort") (type . "net/netip")) ((name . "netip.AddrPort.Addr()") (path . "net/netip/index#AddrPort.Addr") (type . "net/netip")) ((name . "netip.AddrPort.AppendTo()") (path . "net/netip/index#AddrPort.AppendTo") (type . "net/netip")) ((name . "netip.AddrPort.Compare()") (path . "net/netip/index#AddrPort.Compare") (type . "net/netip")) ((name . "netip.AddrPort.IsValid()") (path . "net/netip/index#AddrPort.IsValid") (type . "net/netip")) ((name . "netip.AddrPort.MarshalBinary()") (path . "net/netip/index#AddrPort.MarshalBinary") (type . "net/netip")) ((name . "netip.AddrPort.MarshalText()") (path . "net/netip/index#AddrPort.MarshalText") (type . "net/netip")) ((name . "netip.AddrPort.Port()") (path . "net/netip/index#AddrPort.Port") (type . "net/netip")) ((name . "netip.AddrPort.String()") (path . "net/netip/index#AddrPort.String") (type . "net/netip")) ((name . "netip.AddrPort.UnmarshalBinary()") (path . "net/netip/index#AddrPort.UnmarshalBinary") (type . "net/netip")) ((name . "netip.AddrPort.UnmarshalText()") (path . "net/netip/index#AddrPort.UnmarshalText") (type . "net/netip")) ((name . "netip.AddrPortFrom()") (path . "net/netip/index#AddrPortFrom") (type . "net/netip")) ((name . "netip.IPv4Unspecified()") (path . "net/netip/index#IPv4Unspecified") (type . "net/netip")) ((name . "netip.IPv6LinkLocalAllNodes()") (path . "net/netip/index#IPv6LinkLocalAllNodes") (type . "net/netip")) ((name . "netip.IPv6LinkLocalAllRouters()") (path . "net/netip/index#IPv6LinkLocalAllRouters") (type . "net/netip")) ((name . "netip.IPv6Loopback()") (path . "net/netip/index#IPv6Loopback") (type . "net/netip")) ((name . "netip.IPv6Unspecified()") (path . "net/netip/index#IPv6Unspecified") (type . "net/netip")) ((name . "netip.MustParseAddr()") (path . "net/netip/index#MustParseAddr") (type . "net/netip")) ((name . "netip.MustParseAddrPort()") (path . "net/netip/index#MustParseAddrPort") (type . "net/netip")) ((name . "netip.MustParsePrefix()") (path . "net/netip/index#MustParsePrefix") (type . "net/netip")) ((name . "netip.ParseAddr()") (path . "net/netip/index#ParseAddr") (type . "net/netip")) ((name . "netip.ParseAddrPort()") (path . "net/netip/index#ParseAddrPort") (type . "net/netip")) ((name . "netip.ParsePrefix()") (path . "net/netip/index#ParsePrefix") (type . "net/netip")) ((name . "netip.Prefix") (path . "net/netip/index#Prefix") (type . "net/netip")) ((name . "netip.Prefix.Addr()") (path . "net/netip/index#Prefix.Addr") (type . "net/netip")) ((name . "netip.Prefix.AppendTo()") (path . "net/netip/index#Prefix.AppendTo") (type . "net/netip")) ((name . "netip.Prefix.Bits()") (path . "net/netip/index#Prefix.Bits") (type . "net/netip")) ((name . "netip.Prefix.Contains()") (path . "net/netip/index#Prefix.Contains") (type . "net/netip")) ((name . "netip.Prefix.IsSingleIP()") (path . "net/netip/index#Prefix.IsSingleIP") (type . "net/netip")) ((name . "netip.Prefix.IsValid()") (path . "net/netip/index#Prefix.IsValid") (type . "net/netip")) ((name . "netip.Prefix.MarshalBinary()") (path . "net/netip/index#Prefix.MarshalBinary") (type . "net/netip")) ((name . "netip.Prefix.MarshalText()") (path . "net/netip/index#Prefix.MarshalText") (type . "net/netip")) ((name . "netip.Prefix.Masked()") (path . "net/netip/index#Prefix.Masked") (type . "net/netip")) ((name . "netip.Prefix.Overlaps()") (path . "net/netip/index#Prefix.Overlaps") (type . "net/netip")) ((name . "netip.Prefix.String()") (path . "net/netip/index#Prefix.String") (type . "net/netip")) ((name . "netip.Prefix.UnmarshalBinary()") (path . "net/netip/index#Prefix.UnmarshalBinary") (type . "net/netip")) ((name . "netip.Prefix.UnmarshalText()") (path . "net/netip/index#Prefix.UnmarshalText") (type . "net/netip")) ((name . "netip.PrefixFrom()") (path . "net/netip/index#PrefixFrom") (type . "net/netip")) ((name . "os") (path . "os/index") (type . "os")) ((name . "os constants") (path . "os/index#pkg-constants") (type . "os")) ((name . "os variables") (path . "os/index#pkg-variables") (type . "os")) ((name . "os.Chdir()") (path . "os/index#Chdir") (type . "os")) ((name . "os.Chmod()") (path . "os/index#Chmod") (type . "os")) ((name . "os.Chown()") (path . "os/index#Chown") (type . "os")) ((name . "os.Chtimes()") (path . "os/index#Chtimes") (type . "os")) ((name . "os.Clearenv()") (path . "os/index#Clearenv") (type . "os")) ((name . "os.Create()") (path . "os/index#Create") (type . "os")) ((name . "os.CreateTemp()") (path . "os/index#CreateTemp") (type . "os")) ((name . "os.DirEntry") (path . "os/index#DirEntry") (type . "os")) ((name . "os.DirFS()") (path . "os/index#DirFS") (type . "os")) ((name . "os.Environ()") (path . "os/index#Environ") (type . "os")) ((name . "os.Executable()") (path . "os/index#Executable") (type . "os")) ((name . "os.Exit()") (path . "os/index#Exit") (type . "os")) ((name . "os.Expand()") (path . "os/index#Expand") (type . "os")) ((name . "os.ExpandEnv()") (path . "os/index#ExpandEnv") (type . "os")) ((name . "os.File") (path . "os/index#File") (type . "os")) ((name . "os.File.Chdir()") (path . "os/index#File.Chdir") (type . "os")) ((name . "os.File.Chmod()") (path . "os/index#File.Chmod") (type . "os")) ((name . "os.File.Chown()") (path . "os/index#File.Chown") (type . "os")) ((name . "os.File.Close()") (path . "os/index#File.Close") (type . "os")) ((name . "os.File.Fd()") (path . "os/index#File.Fd") (type . "os")) ((name . "os.File.Name()") (path . "os/index#File.Name") (type . "os")) ((name . "os.File.Read()") (path . "os/index#File.Read") (type . "os")) ((name . "os.File.ReadAt()") (path . "os/index#File.ReadAt") (type . "os")) ((name . "os.File.ReadDir()") (path . "os/index#File.ReadDir") (type . "os")) ((name . "os.File.Readdir()") (path . "os/index#File.Readdir") (type . "os")) ((name . "os.File.Readdirnames()") (path . "os/index#File.Readdirnames") (type . "os")) ((name . "os.File.ReadFrom()") (path . "os/index#File.ReadFrom") (type . "os")) ((name . "os.File.Seek()") (path . "os/index#File.Seek") (type . "os")) ((name . "os.File.SetDeadline()") (path . "os/index#File.SetDeadline") (type . "os")) ((name . "os.File.SetReadDeadline()") (path . "os/index#File.SetReadDeadline") (type . "os")) ((name . "os.File.SetWriteDeadline()") (path . "os/index#File.SetWriteDeadline") (type . "os")) ((name . "os.File.Stat()") (path . "os/index#File.Stat") (type . "os")) ((name . "os.File.Sync()") (path . "os/index#File.Sync") (type . "os")) ((name . "os.File.SyscallConn()") (path . "os/index#File.SyscallConn") (type . "os")) ((name . "os.File.Truncate()") (path . "os/index#File.Truncate") (type . "os")) ((name . "os.File.Write()") (path . "os/index#File.Write") (type . "os")) ((name . "os.File.WriteAt()") (path . "os/index#File.WriteAt") (type . "os")) ((name . "os.File.WriteString()") (path . "os/index#File.WriteString") (type . "os")) ((name . "os.File.WriteTo()") (path . "os/index#File.WriteTo") (type . "os")) ((name . "os.FileInfo") (path . "os/index#FileInfo") (type . "os")) ((name . "os.FileMode") (path . "os/index#FileMode") (type . "os")) ((name . "os.FindProcess()") (path . "os/index#FindProcess") (type . "os")) ((name . "os.Getegid()") (path . "os/index#Getegid") (type . "os")) ((name . "os.Getenv()") (path . "os/index#Getenv") (type . "os")) ((name . "os.Geteuid()") (path . "os/index#Geteuid") (type . "os")) ((name . "os.Getgid()") (path . "os/index#Getgid") (type . "os")) ((name . "os.Getgroups()") (path . "os/index#Getgroups") (type . "os")) ((name . "os.Getpagesize()") (path . "os/index#Getpagesize") (type . "os")) ((name . "os.Getpid()") (path . "os/index#Getpid") (type . "os")) ((name . "os.Getppid()") (path . "os/index#Getppid") (type . "os")) ((name . "os.Getuid()") (path . "os/index#Getuid") (type . "os")) ((name . "os.Getwd()") (path . "os/index#Getwd") (type . "os")) ((name . "os.Hostname()") (path . "os/index#Hostname") (type . "os")) ((name . "os.IsExist()") (path . "os/index#IsExist") (type . "os")) ((name . "os.IsNotExist()") (path . "os/index#IsNotExist") (type . "os")) ((name . "os.IsPathSeparator()") (path . "os/index#IsPathSeparator") (type . "os")) ((name . "os.IsPermission()") (path . "os/index#IsPermission") (type . "os")) ((name . "os.IsTimeout()") (path . "os/index#IsTimeout") (type . "os")) ((name . "os.Lchown()") (path . "os/index#Lchown") (type . "os")) ((name . "os.Link()") (path . "os/index#Link") (type . "os")) ((name . "os.LinkError") (path . "os/index#LinkError") (type . "os")) ((name . "os.LinkError.Error()") (path . "os/index#LinkError.Error") (type . "os")) ((name . "os.LinkError.Unwrap()") (path . "os/index#LinkError.Unwrap") (type . "os")) ((name . "os.LookupEnv()") (path . "os/index#LookupEnv") (type . "os")) ((name . "os.Lstat()") (path . "os/index#Lstat") (type . "os")) ((name . "os.Mkdir()") (path . "os/index#Mkdir") (type . "os")) ((name . "os.MkdirAll()") (path . "os/index#MkdirAll") (type . "os")) ((name . "os.MkdirTemp()") (path . "os/index#MkdirTemp") (type . "os")) ((name . "os.NewFile()") (path . "os/index#NewFile") (type . "os")) ((name . "os.NewSyscallError()") (path . "os/index#NewSyscallError") (type . "os")) ((name . "os.Open()") (path . "os/index#Open") (type . "os")) ((name . "os.OpenFile()") (path . "os/index#OpenFile") (type . "os")) ((name . "os.PathError") (path . "os/index#PathError") (type . "os")) ((name . "os.Pipe()") (path . "os/index#Pipe") (type . "os")) ((name . "os.ProcAttr") (path . "os/index#ProcAttr") (type . "os")) ((name . "os.Process") (path . "os/index#Process") (type . "os")) ((name . "os.Process.Kill()") (path . "os/index#Process.Kill") (type . "os")) ((name . "os.Process.Release()") (path . "os/index#Process.Release") (type . "os")) ((name . "os.Process.Signal()") (path . "os/index#Process.Signal") (type . "os")) ((name . "os.Process.Wait()") (path . "os/index#Process.Wait") (type . "os")) ((name . "os.ProcessState") (path . "os/index#ProcessState") (type . "os")) ((name . "os.ProcessState.ExitCode()") (path . "os/index#ProcessState.ExitCode") (type . "os")) ((name . "os.ProcessState.Exited()") (path . "os/index#ProcessState.Exited") (type . "os")) ((name . "os.ProcessState.Pid()") (path . "os/index#ProcessState.Pid") (type . "os")) ((name . "os.ProcessState.String()") (path . "os/index#ProcessState.String") (type . "os")) ((name . "os.ProcessState.Success()") (path . "os/index#ProcessState.Success") (type . "os")) ((name . "os.ProcessState.Sys()") (path . "os/index#ProcessState.Sys") (type . "os")) ((name . "os.ProcessState.SystemTime()") (path . "os/index#ProcessState.SystemTime") (type . "os")) ((name . "os.ProcessState.SysUsage()") (path . "os/index#ProcessState.SysUsage") (type . "os")) ((name . "os.ProcessState.UserTime()") (path . "os/index#ProcessState.UserTime") (type . "os")) ((name . "os.ReadDir()") (path . "os/index#ReadDir") (type . "os")) ((name . "os.ReadFile()") (path . "os/index#ReadFile") (type . "os")) ((name . "os.Readlink()") (path . "os/index#Readlink") (type . "os")) ((name . "os.Remove()") (path . "os/index#Remove") (type . "os")) ((name . "os.RemoveAll()") (path . "os/index#RemoveAll") (type . "os")) ((name . "os.Rename()") (path . "os/index#Rename") (type . "os")) ((name . "os.SameFile()") (path . "os/index#SameFile") (type . "os")) ((name . "os.Setenv()") (path . "os/index#Setenv") (type . "os")) ((name . "os.Signal") (path . "os/index#Signal") (type . "os")) ((name . "os.StartProcess()") (path . "os/index#StartProcess") (type . "os")) ((name . "os.Stat()") (path . "os/index#Stat") (type . "os")) ((name . "os.Symlink()") (path . "os/index#Symlink") (type . "os")) ((name . "os.SyscallError") (path . "os/index#SyscallError") (type . "os")) ((name . "os.SyscallError.Error()") (path . "os/index#SyscallError.Error") (type . "os")) ((name . "os.SyscallError.Timeout()") (path . "os/index#SyscallError.Timeout") (type . "os")) ((name . "os.SyscallError.Unwrap()") (path . "os/index#SyscallError.Unwrap") (type . "os")) ((name . "os.TempDir()") (path . "os/index#TempDir") (type . "os")) ((name . "os.Truncate()") (path . "os/index#Truncate") (type . "os")) ((name . "os.Unsetenv()") (path . "os/index#Unsetenv") (type . "os")) ((name . "os.UserCacheDir()") (path . "os/index#UserCacheDir") (type . "os")) ((name . "os.UserConfigDir()") (path . "os/index#UserConfigDir") (type . "os")) ((name . "os.UserHomeDir()") (path . "os/index#UserHomeDir") (type . "os")) ((name . "os.WriteFile()") (path . "os/index#WriteFile") (type . "os")) ((name . "os/exec") (path . "os/exec/index") (type . "os")) ((name . "os/exec variables") (path . "os/exec/index#pkg-variables") (type . "os")) ((name . "os/signal") (path . "os/signal/index") (type . "os")) ((name . "os/user") (path . "os/user/index") (type . "os")) ((name . "parse.ActionNode") (path . "text/template/parse/index#ActionNode") (type . "text")) ((name . "parse.ActionNode.Copy()") (path . "text/template/parse/index#ActionNode.Copy") (type . "text")) ((name . "parse.ActionNode.String()") (path . "text/template/parse/index#ActionNode.String") (type . "text")) ((name . "parse.BoolNode") (path . "text/template/parse/index#BoolNode") (type . "text")) ((name . "parse.BoolNode.Copy()") (path . "text/template/parse/index#BoolNode.Copy") (type . "text")) ((name . "parse.BoolNode.String()") (path . "text/template/parse/index#BoolNode.String") (type . "text")) ((name . "parse.BranchNode") (path . "text/template/parse/index#BranchNode") (type . "text")) ((name . "parse.BranchNode.Copy()") (path . "text/template/parse/index#BranchNode.Copy") (type . "text")) ((name . "parse.BranchNode.String()") (path . "text/template/parse/index#BranchNode.String") (type . "text")) ((name . "parse.BreakNode") (path . "text/template/parse/index#BreakNode") (type . "text")) ((name . "parse.BreakNode.Copy()") (path . "text/template/parse/index#BreakNode.Copy") (type . "text")) ((name . "parse.BreakNode.String()") (path . "text/template/parse/index#BreakNode.String") (type . "text")) ((name . "parse.ChainNode") (path . "text/template/parse/index#ChainNode") (type . "text")) ((name . "parse.ChainNode.Add()") (path . "text/template/parse/index#ChainNode.Add") (type . "text")) ((name . "parse.ChainNode.Copy()") (path . "text/template/parse/index#ChainNode.Copy") (type . "text")) ((name . "parse.ChainNode.String()") (path . "text/template/parse/index#ChainNode.String") (type . "text")) ((name . "parse.CommandNode") (path . "text/template/parse/index#CommandNode") (type . "text")) ((name . "parse.CommandNode.Copy()") (path . "text/template/parse/index#CommandNode.Copy") (type . "text")) ((name . "parse.CommandNode.String()") (path . "text/template/parse/index#CommandNode.String") (type . "text")) ((name . "parse.CommentNode") (path . "text/template/parse/index#CommentNode") (type . "text")) ((name . "parse.CommentNode.Copy()") (path . "text/template/parse/index#CommentNode.Copy") (type . "text")) ((name . "parse.CommentNode.String()") (path . "text/template/parse/index#CommentNode.String") (type . "text")) ((name . "parse.ContinueNode") (path . "text/template/parse/index#ContinueNode") (type . "text")) ((name . "parse.ContinueNode.Copy()") (path . "text/template/parse/index#ContinueNode.Copy") (type . "text")) ((name . "parse.ContinueNode.String()") (path . "text/template/parse/index#ContinueNode.String") (type . "text")) ((name . "parse.DotNode") (path . "text/template/parse/index#DotNode") (type . "text")) ((name . "parse.DotNode.Copy()") (path . "text/template/parse/index#DotNode.Copy") (type . "text")) ((name . "parse.DotNode.String()") (path . "text/template/parse/index#DotNode.String") (type . "text")) ((name . "parse.DotNode.Type()") (path . "text/template/parse/index#DotNode.Type") (type . "text")) ((name . "parse.FieldNode") (path . "text/template/parse/index#FieldNode") (type . "text")) ((name . "parse.FieldNode.Copy()") (path . "text/template/parse/index#FieldNode.Copy") (type . "text")) ((name . "parse.FieldNode.String()") (path . "text/template/parse/index#FieldNode.String") (type . "text")) ((name . "parse.IdentifierNode") (path . "text/template/parse/index#IdentifierNode") (type . "text")) ((name . "parse.IdentifierNode.Copy()") (path . "text/template/parse/index#IdentifierNode.Copy") (type . "text")) ((name . "parse.IdentifierNode.SetPos()") (path . "text/template/parse/index#IdentifierNode.SetPos") (type . "text")) ((name . "parse.IdentifierNode.SetTree()") (path . "text/template/parse/index#IdentifierNode.SetTree") (type . "text")) ((name . "parse.IdentifierNode.String()") (path . "text/template/parse/index#IdentifierNode.String") (type . "text")) ((name . "parse.IfNode") (path . "text/template/parse/index#IfNode") (type . "text")) ((name . "parse.IfNode.Copy()") (path . "text/template/parse/index#IfNode.Copy") (type . "text")) ((name . "parse.IsEmptyTree()") (path . "text/template/parse/index#IsEmptyTree") (type . "text")) ((name . "parse.ListNode") (path . "text/template/parse/index#ListNode") (type . "text")) ((name . "parse.ListNode.Copy()") (path . "text/template/parse/index#ListNode.Copy") (type . "text")) ((name . "parse.ListNode.CopyList()") (path . "text/template/parse/index#ListNode.CopyList") (type . "text")) ((name . "parse.ListNode.String()") (path . "text/template/parse/index#ListNode.String") (type . "text")) ((name . "parse.Mode") (path . "text/template/parse/index#Mode") (type . "text")) ((name . "parse.New()") (path . "text/template/parse/index#New") (type . "text")) ((name . "parse.NewIdentifier()") (path . "text/template/parse/index#NewIdentifier") (type . "text")) ((name . "parse.NilNode") (path . "text/template/parse/index#NilNode") (type . "text")) ((name . "parse.NilNode.Copy()") (path . "text/template/parse/index#NilNode.Copy") (type . "text")) ((name . "parse.NilNode.String()") (path . "text/template/parse/index#NilNode.String") (type . "text")) ((name . "parse.NilNode.Type()") (path . "text/template/parse/index#NilNode.Type") (type . "text")) ((name . "parse.Node") (path . "text/template/parse/index#Node") (type . "text")) ((name . "parse.NodeType") (path . "text/template/parse/index#NodeType") (type . "text")) ((name . "parse.NodeType.Type()") (path . "text/template/parse/index#NodeType.Type") (type . "text")) ((name . "parse.NumberNode") (path . "text/template/parse/index#NumberNode") (type . "text")) ((name . "parse.NumberNode.Copy()") (path . "text/template/parse/index#NumberNode.Copy") (type . "text")) ((name . "parse.NumberNode.String()") (path . "text/template/parse/index#NumberNode.String") (type . "text")) ((name . "parse.Parse()") (path . "text/template/parse/index#Parse") (type . "text")) ((name . "parse.PipeNode") (path . "text/template/parse/index#PipeNode") (type . "text")) ((name . "parse.PipeNode.Copy()") (path . "text/template/parse/index#PipeNode.Copy") (type . "text")) ((name . "parse.PipeNode.CopyPipe()") (path . "text/template/parse/index#PipeNode.CopyPipe") (type . "text")) ((name . "parse.PipeNode.String()") (path . "text/template/parse/index#PipeNode.String") (type . "text")) ((name . "parse.Pos") (path . "text/template/parse/index#Pos") (type . "text")) ((name . "parse.Pos.Position()") (path . "text/template/parse/index#Pos.Position") (type . "text")) ((name . "parse.RangeNode") (path . "text/template/parse/index#RangeNode") (type . "text")) ((name . "parse.RangeNode.Copy()") (path . "text/template/parse/index#RangeNode.Copy") (type . "text")) ((name . "parse.StringNode") (path . "text/template/parse/index#StringNode") (type . "text")) ((name . "parse.StringNode.Copy()") (path . "text/template/parse/index#StringNode.Copy") (type . "text")) ((name . "parse.StringNode.String()") (path . "text/template/parse/index#StringNode.String") (type . "text")) ((name . "parse.TemplateNode") (path . "text/template/parse/index#TemplateNode") (type . "text")) ((name . "parse.TemplateNode.Copy()") (path . "text/template/parse/index#TemplateNode.Copy") (type . "text")) ((name . "parse.TemplateNode.String()") (path . "text/template/parse/index#TemplateNode.String") (type . "text")) ((name . "parse.TextNode") (path . "text/template/parse/index#TextNode") (type . "text")) ((name . "parse.TextNode.Copy()") (path . "text/template/parse/index#TextNode.Copy") (type . "text")) ((name . "parse.TextNode.String()") (path . "text/template/parse/index#TextNode.String") (type . "text")) ((name . "parse.Tree") (path . "text/template/parse/index#Tree") (type . "text")) ((name . "parse.Tree.Copy()") (path . "text/template/parse/index#Tree.Copy") (type . "text")) ((name . "parse.Tree.ErrorContext()") (path . "text/template/parse/index#Tree.ErrorContext") (type . "text")) ((name . "parse.Tree.Parse()") (path . "text/template/parse/index#Tree.Parse") (type . "text")) ((name . "parse.VariableNode") (path . "text/template/parse/index#VariableNode") (type . "text")) ((name . "parse.VariableNode.Copy()") (path . "text/template/parse/index#VariableNode.Copy") (type . "text")) ((name . "parse.VariableNode.String()") (path . "text/template/parse/index#VariableNode.String") (type . "text")) ((name . "parse.WithNode") (path . "text/template/parse/index#WithNode") (type . "text")) ((name . "parse.WithNode.Copy()") (path . "text/template/parse/index#WithNode.Copy") (type . "text")) ((name . "parser.Mode") (path . "go/parser/index#Mode") (type . "go")) ((name . "parser.ParseDir()") (path . "go/parser/index#ParseDir") (type . "go")) ((name . "parser.ParseExpr()") (path . "go/parser/index#ParseExpr") (type . "go")) ((name . "parser.ParseExprFrom()") (path . "go/parser/index#ParseExprFrom") (type . "go")) ((name . "parser.ParseFile()") (path . "go/parser/index#ParseFile") (type . "go")) ((name . "path") (path . "path/index") (type . "path")) ((name . "path variables") (path . "path/index#pkg-variables") (type . "path")) ((name . "path.Base()") (path . "path/index#Base") (type . "path")) ((name . "path.Clean()") (path . "path/index#Clean") (type . "path")) ((name . "path.Dir()") (path . "path/index#Dir") (type . "path")) ((name . "path.Ext()") (path . "path/index#Ext") (type . "path")) ((name . "path.IsAbs()") (path . "path/index#IsAbs") (type . "path")) ((name . "path.Join()") (path . "path/index#Join") (type . "path")) ((name . "path.Match()") (path . "path/index#Match") (type . "path")) ((name . "path.Split()") (path . "path/index#Split") (type . "path")) ((name . "path/filepath") (path . "path/filepath/index") (type . "path")) ((name . "path/filepath constants") (path . "path/filepath/index#pkg-constants") (type . "path")) ((name . "path/filepath variables") (path . "path/filepath/index#pkg-variables") (type . "path")) ((name . "pe.COFFSymbol") (path . "debug/pe/index#COFFSymbol") (type . "debug")) ((name . "pe.COFFSymbol.FullName()") (path . "debug/pe/index#COFFSymbol.FullName") (type . "debug")) ((name . "pe.COFFSymbolAuxFormat5") (path . "debug/pe/index#COFFSymbolAuxFormat5") (type . "debug")) ((name . "pe.DataDirectory") (path . "debug/pe/index#DataDirectory") (type . "debug")) ((name . "pe.File") (path . "debug/pe/index#File") (type . "debug")) ((name . "pe.File.Close()") (path . "debug/pe/index#File.Close") (type . "debug")) ((name . "pe.File.COFFSymbolReadSectionDefAux()") (path . "debug/pe/index#File.COFFSymbolReadSectionDefAux") (type . "debug")) ((name . "pe.File.DWARF()") (path . "debug/pe/index#File.DWARF") (type . "debug")) ((name . "pe.File.ImportedLibraries()") (path . "debug/pe/index#File.ImportedLibraries") (type . "debug")) ((name . "pe.File.ImportedSymbols()") (path . "debug/pe/index#File.ImportedSymbols") (type . "debug")) ((name . "pe.File.Section()") (path . "debug/pe/index#File.Section") (type . "debug")) ((name . "pe.FileHeader") (path . "debug/pe/index#FileHeader") (type . "debug")) ((name . "pe.FormatError") (path . "debug/pe/index#FormatError") (type . "debug")) ((name . "pe.FormatError.Error()") (path . "debug/pe/index#FormatError.Error") (type . "debug")) ((name . "pe.ImportDirectory") (path . "debug/pe/index#ImportDirectory") (type . "debug")) ((name . "pe.NewFile()") (path . "debug/pe/index#NewFile") (type . "debug")) ((name . "pe.Open()") (path . "debug/pe/index#Open") (type . "debug")) ((name . "pe.OptionalHeader32") (path . "debug/pe/index#OptionalHeader32") (type . "debug")) ((name . "pe.OptionalHeader64") (path . "debug/pe/index#OptionalHeader64") (type . "debug")) ((name . "pe.Reloc") (path . "debug/pe/index#Reloc") (type . "debug")) ((name . "pe.Section") (path . "debug/pe/index#Section") (type . "debug")) ((name . "pe.Section.Data()") (path . "debug/pe/index#Section.Data") (type . "debug")) ((name . "pe.Section.Open()") (path . "debug/pe/index#Section.Open") (type . "debug")) ((name . "pe.SectionHeader") (path . "debug/pe/index#SectionHeader") (type . "debug")) ((name . "pe.SectionHeader32") (path . "debug/pe/index#SectionHeader32") (type . "debug")) ((name . "pe.StringTable") (path . "debug/pe/index#StringTable") (type . "debug")) ((name . "pe.StringTable.String()") (path . "debug/pe/index#StringTable.String") (type . "debug")) ((name . "pe.Symbol") (path . "debug/pe/index#Symbol") (type . "debug")) ((name . "pem.Block") (path . "encoding/pem/index#Block") (type . "encoding")) ((name . "pem.Decode()") (path . "encoding/pem/index#Decode") (type . "encoding")) ((name . "pem.Encode()") (path . "encoding/pem/index#Encode") (type . "encoding")) ((name . "pem.EncodeToMemory()") (path . "encoding/pem/index#EncodeToMemory") (type . "encoding")) ((name . "pkix.AlgorithmIdentifier") (path . "crypto/x509/pkix/index#AlgorithmIdentifier") (type . "crypto")) ((name . "pkix.AttributeTypeAndValue") (path . "crypto/x509/pkix/index#AttributeTypeAndValue") (type . "crypto")) ((name . "pkix.AttributeTypeAndValueSET") (path . "crypto/x509/pkix/index#AttributeTypeAndValueSET") (type . "crypto")) ((name . "pkix.CertificateList") (path . "crypto/x509/pkix/index#CertificateList") (type . "crypto")) ((name . "pkix.CertificateList.HasExpired()") (path . "crypto/x509/pkix/index#CertificateList.HasExpired") (type . "crypto")) ((name . "pkix.Extension") (path . "crypto/x509/pkix/index#Extension") (type . "crypto")) ((name . "pkix.Name") (path . "crypto/x509/pkix/index#Name") (type . "crypto")) ((name . "pkix.Name.FillFromRDNSequence()") (path . "crypto/x509/pkix/index#Name.FillFromRDNSequence") (type . "crypto")) ((name . "pkix.Name.String()") (path . "crypto/x509/pkix/index#Name.String") (type . "crypto")) ((name . "pkix.Name.ToRDNSequence()") (path . "crypto/x509/pkix/index#Name.ToRDNSequence") (type . "crypto")) ((name . "pkix.RDNSequence") (path . "crypto/x509/pkix/index#RDNSequence") (type . "crypto")) ((name . "pkix.RDNSequence.String()") (path . "crypto/x509/pkix/index#RDNSequence.String") (type . "crypto")) ((name . "pkix.RelativeDistinguishedNameSET") (path . "crypto/x509/pkix/index#RelativeDistinguishedNameSET") (type . "crypto")) ((name . "pkix.RevokedCertificate") (path . "crypto/x509/pkix/index#RevokedCertificate") (type . "crypto")) ((name . "pkix.TBSCertificateList") (path . "crypto/x509/pkix/index#TBSCertificateList") (type . "crypto")) ((name . "plan9obj.File") (path . "debug/plan9obj/index#File") (type . "debug")) ((name . "plan9obj.File.Close()") (path . "debug/plan9obj/index#File.Close") (type . "debug")) ((name . "plan9obj.File.Section()") (path . "debug/plan9obj/index#File.Section") (type . "debug")) ((name . "plan9obj.File.Symbols()") (path . "debug/plan9obj/index#File.Symbols") (type . "debug")) ((name . "plan9obj.FileHeader") (path . "debug/plan9obj/index#FileHeader") (type . "debug")) ((name . "plan9obj.NewFile()") (path . "debug/plan9obj/index#NewFile") (type . "debug")) ((name . "plan9obj.Open()") (path . "debug/plan9obj/index#Open") (type . "debug")) ((name . "plan9obj.Section") (path . "debug/plan9obj/index#Section") (type . "debug")) ((name . "plan9obj.Section.Data()") (path . "debug/plan9obj/index#Section.Data") (type . "debug")) ((name . "plan9obj.Section.Open()") (path . "debug/plan9obj/index#Section.Open") (type . "debug")) ((name . "plan9obj.SectionHeader") (path . "debug/plan9obj/index#SectionHeader") (type . "debug")) ((name . "plan9obj.Sym") (path . "debug/plan9obj/index#Sym") (type . "debug")) ((name . "plugin") (path . "plugin/index") (type . "plugin")) ((name . "plugin.Open()") (path . "plugin/index#Open") (type . "plugin")) ((name . "plugin.Plugin") (path . "plugin/index#Plugin") (type . "plugin")) ((name . "plugin.Plugin.Lookup()") (path . "plugin/index#Plugin.Lookup") (type . "plugin")) ((name . "plugin.Symbol") (path . "plugin/index#Symbol") (type . "plugin")) ((name . "png.CompressionLevel") (path . "image/png/index#CompressionLevel") (type . "image")) ((name . "png.Decode()") (path . "image/png/index#Decode") (type . "image")) ((name . "png.DecodeConfig()") (path . "image/png/index#DecodeConfig") (type . "image")) ((name . "png.Encode()") (path . "image/png/index#Encode") (type . "image")) ((name . "png.Encoder") (path . "image/png/index#Encoder") (type . "image")) ((name . "png.Encoder.Encode()") (path . "image/png/index#Encoder.Encode") (type . "image")) ((name . "png.EncoderBuffer") (path . "image/png/index#EncoderBuffer") (type . "image")) ((name . "png.EncoderBufferPool") (path . "image/png/index#EncoderBufferPool") (type . "image")) ((name . "png.FormatError") (path . "image/png/index#FormatError") (type . "image")) ((name . "png.FormatError.Error()") (path . "image/png/index#FormatError.Error") (type . "image")) ((name . "png.UnsupportedError") (path . "image/png/index#UnsupportedError") (type . "image")) ((name . "png.UnsupportedError.Error()") (path . "image/png/index#UnsupportedError.Error") (type . "image")) ((name . "pprof.Cmdline()") (path . "net/http/pprof/index#Cmdline") (type . "net/http")) ((name . "pprof.Do()") (path . "runtime/pprof/index#Do") (type . "runtime")) ((name . "pprof.ForLabels()") (path . "runtime/pprof/index#ForLabels") (type . "runtime")) ((name . "pprof.Handler()") (path . "net/http/pprof/index#Handler") (type . "net/http")) ((name . "pprof.Index()") (path . "net/http/pprof/index#Index") (type . "net/http")) ((name . "pprof.Label()") (path . "runtime/pprof/index#Label") (type . "runtime")) ((name . "pprof.Labels()") (path . "runtime/pprof/index#Labels") (type . "runtime")) ((name . "pprof.LabelSet") (path . "runtime/pprof/index#LabelSet") (type . "runtime")) ((name . "pprof.Lookup()") (path . "runtime/pprof/index#Lookup") (type . "runtime")) ((name . "pprof.NewProfile()") (path . "runtime/pprof/index#NewProfile") (type . "runtime")) ((name . "pprof.Profile") (path . "runtime/pprof/index#Profile") (type . "runtime")) ((name . "pprof.Profile()") (path . "net/http/pprof/index#Profile") (type . "net/http")) ((name . "pprof.Profile.Add()") (path . "runtime/pprof/index#Profile.Add") (type . "runtime")) ((name . "pprof.Profile.Count()") (path . "runtime/pprof/index#Profile.Count") (type . "runtime")) ((name . "pprof.Profile.Name()") (path . "runtime/pprof/index#Profile.Name") (type . "runtime")) ((name . "pprof.Profile.Remove()") (path . "runtime/pprof/index#Profile.Remove") (type . "runtime")) ((name . "pprof.Profile.WriteTo()") (path . "runtime/pprof/index#Profile.WriteTo") (type . "runtime")) ((name . "pprof.Profiles()") (path . "runtime/pprof/index#Profiles") (type . "runtime")) ((name . "pprof.SetGoroutineLabels()") (path . "runtime/pprof/index#SetGoroutineLabels") (type . "runtime")) ((name . "pprof.StartCPUProfile()") (path . "runtime/pprof/index#StartCPUProfile") (type . "runtime")) ((name . "pprof.StopCPUProfile()") (path . "runtime/pprof/index#StopCPUProfile") (type . "runtime")) ((name . "pprof.Symbol()") (path . "net/http/pprof/index#Symbol") (type . "net/http")) ((name . "pprof.Trace()") (path . "net/http/pprof/index#Trace") (type . "net/http")) ((name . "pprof.WithLabels()") (path . "runtime/pprof/index#WithLabels") (type . "runtime")) ((name . "pprof.WriteHeapProfile()") (path . "runtime/pprof/index#WriteHeapProfile") (type . "runtime")) ((name . "printer.CommentedNode") (path . "go/printer/index#CommentedNode") (type . "go")) ((name . "printer.Config") (path . "go/printer/index#Config") (type . "go")) ((name . "printer.Config.Fprint()") (path . "go/printer/index#Config.Fprint") (type . "go")) ((name . "printer.Fprint()") (path . "go/printer/index#Fprint") (type . "go")) ((name . "printer.Mode") (path . "go/printer/index#Mode") (type . "go")) ((name . "quick.Check()") (path . "testing/quick/index#Check") (type . "testing")) ((name . "quick.CheckEqual()") (path . "testing/quick/index#CheckEqual") (type . "testing")) ((name . "quick.CheckEqualError") (path . "testing/quick/index#CheckEqualError") (type . "testing")) ((name . "quick.CheckEqualError.Error()") (path . "testing/quick/index#CheckEqualError.Error") (type . "testing")) ((name . "quick.CheckError") (path . "testing/quick/index#CheckError") (type . "testing")) ((name . "quick.CheckError.Error()") (path . "testing/quick/index#CheckError.Error") (type . "testing")) ((name . "quick.Config") (path . "testing/quick/index#Config") (type . "testing")) ((name . "quick.Generator") (path . "testing/quick/index#Generator") (type . "testing")) ((name . "quick.SetupError") (path . "testing/quick/index#SetupError") (type . "testing")) ((name . "quick.SetupError.Error()") (path . "testing/quick/index#SetupError.Error") (type . "testing")) ((name . "quick.Value()") (path . "testing/quick/index#Value") (type . "testing")) ((name . "quotedprintable.NewReader()") (path . "mime/quotedprintable/index#NewReader") (type . "mime")) ((name . "quotedprintable.NewWriter()") (path . "mime/quotedprintable/index#NewWriter") (type . "mime")) ((name . "quotedprintable.Reader") (path . "mime/quotedprintable/index#Reader") (type . "mime")) ((name . "quotedprintable.Reader.Read()") (path . "mime/quotedprintable/index#Reader.Read") (type . "mime")) ((name . "quotedprintable.Writer") (path . "mime/quotedprintable/index#Writer") (type . "mime")) ((name . "quotedprintable.Writer.Close()") (path . "mime/quotedprintable/index#Writer.Close") (type . "mime")) ((name . "quotedprintable.Writer.Write()") (path . "mime/quotedprintable/index#Writer.Write") (type . "mime")) ((name . "rand.ExpFloat64()") (path . "math/rand/index#ExpFloat64") (type . "math/rand")) ((name . "rand.Float32()") (path . "math/rand/index#Float32") (type . "math/rand")) ((name . "rand.Float64()") (path . "math/rand/index#Float64") (type . "math/rand")) ((name . "rand.Int()") (path . "crypto/rand/index#Int") (type . "crypto")) ((name . "rand.Int()") (path . "math/rand/index#Int") (type . "math/rand")) ((name . "rand.Int31()") (path . "math/rand/index#Int31") (type . "math/rand")) ((name . "rand.Int31n()") (path . "math/rand/index#Int31n") (type . "math/rand")) ((name . "rand.Int63()") (path . "math/rand/index#Int63") (type . "math/rand")) ((name . "rand.Int63n()") (path . "math/rand/index#Int63n") (type . "math/rand")) ((name . "rand.Intn()") (path . "math/rand/index#Intn") (type . "math/rand")) ((name . "rand.New()") (path . "math/rand/index#New") (type . "math/rand")) ((name . "rand.NewSource()") (path . "math/rand/index#NewSource") (type . "math/rand")) ((name . "rand.NewZipf()") (path . "math/rand/index#NewZipf") (type . "math/rand")) ((name . "rand.NormFloat64()") (path . "math/rand/index#NormFloat64") (type . "math/rand")) ((name . "rand.Perm()") (path . "math/rand/index#Perm") (type . "math/rand")) ((name . "rand.Prime()") (path . "crypto/rand/index#Prime") (type . "crypto")) ((name . "rand.Rand") (path . "math/rand/index#Rand") (type . "math/rand")) ((name . "rand.Rand.ExpFloat64()") (path . "math/rand/index#Rand.ExpFloat64") (type . "math/rand")) ((name . "rand.Rand.Float32()") (path . "math/rand/index#Rand.Float32") (type . "math/rand")) ((name . "rand.Rand.Float64()") (path . "math/rand/index#Rand.Float64") (type . "math/rand")) ((name . "rand.Rand.Int()") (path . "math/rand/index#Rand.Int") (type . "math/rand")) ((name . "rand.Rand.Int31()") (path . "math/rand/index#Rand.Int31") (type . "math/rand")) ((name . "rand.Rand.Int31n()") (path . "math/rand/index#Rand.Int31n") (type . "math/rand")) ((name . "rand.Rand.Int63()") (path . "math/rand/index#Rand.Int63") (type . "math/rand")) ((name . "rand.Rand.Int63n()") (path . "math/rand/index#Rand.Int63n") (type . "math/rand")) ((name . "rand.Rand.Intn()") (path . "math/rand/index#Rand.Intn") (type . "math/rand")) ((name . "rand.Rand.NormFloat64()") (path . "math/rand/index#Rand.NormFloat64") (type . "math/rand")) ((name . "rand.Rand.Perm()") (path . "math/rand/index#Rand.Perm") (type . "math/rand")) ((name . "rand.Rand.Read()") (path . "math/rand/index#Rand.Read") (type . "math/rand")) ((name . "rand.Rand.Seed()") (path . "math/rand/index#Rand.Seed") (type . "math/rand")) ((name . "rand.Rand.Shuffle()") (path . "math/rand/index#Rand.Shuffle") (type . "math/rand")) ((name . "rand.Rand.Uint32()") (path . "math/rand/index#Rand.Uint32") (type . "math/rand")) ((name . "rand.Rand.Uint64()") (path . "math/rand/index#Rand.Uint64") (type . "math/rand")) ((name . "rand.Read()") (path . "math/rand/index#Read") (type . "math/rand")) ((name . "rand.Read()") (path . "crypto/rand/index#Read") (type . "crypto")) ((name . "rand.Seed()") (path . "math/rand/index#Seed") (type . "math/rand")) ((name . "rand.Shuffle()") (path . "math/rand/index#Shuffle") (type . "math/rand")) ((name . "rand.Source") (path . "math/rand/index#Source") (type . "math/rand")) ((name . "rand.Source64") (path . "math/rand/index#Source64") (type . "math/rand")) ((name . "rand.Uint32()") (path . "math/rand/index#Uint32") (type . "math/rand")) ((name . "rand.Uint64()") (path . "math/rand/index#Uint64") (type . "math/rand")) ((name . "rand.Zipf") (path . "math/rand/index#Zipf") (type . "math/rand")) ((name . "rand.Zipf.Uint64()") (path . "math/rand/index#Zipf.Uint64") (type . "math/rand")) ((name . "rc4.Cipher") (path . "crypto/rc4/index#Cipher") (type . "crypto")) ((name . "rc4.Cipher.Reset()") (path . "crypto/rc4/index#Cipher.Reset") (type . "crypto")) ((name . "rc4.Cipher.XORKeyStream()") (path . "crypto/rc4/index#Cipher.XORKeyStream") (type . "crypto")) ((name . "rc4.KeySizeError") (path . "crypto/rc4/index#KeySizeError") (type . "crypto")) ((name . "rc4.KeySizeError.Error()") (path . "crypto/rc4/index#KeySizeError.Error") (type . "crypto")) ((name . "rc4.NewCipher()") (path . "crypto/rc4/index#NewCipher") (type . "crypto")) ((name . "reflect") (path . "reflect/index") (type . "reflect")) ((name . "reflect constants") (path . "reflect/index#pkg-constants") (type . "reflect")) ((name . "reflect.Append()") (path . "reflect/index#Append") (type . "reflect")) ((name . "reflect.AppendSlice()") (path . "reflect/index#AppendSlice") (type . "reflect")) ((name . "reflect.ArrayOf()") (path . "reflect/index#ArrayOf") (type . "reflect")) ((name . "reflect.ChanDir") (path . "reflect/index#ChanDir") (type . "reflect")) ((name . "reflect.ChanDir.String()") (path . "reflect/index#ChanDir.String") (type . "reflect")) ((name . "reflect.ChanOf()") (path . "reflect/index#ChanOf") (type . "reflect")) ((name . "reflect.Copy()") (path . "reflect/index#Copy") (type . "reflect")) ((name . "reflect.DeepEqual()") (path . "reflect/index#DeepEqual") (type . "reflect")) ((name . "reflect.FuncOf()") (path . "reflect/index#FuncOf") (type . "reflect")) ((name . "reflect.Indirect()") (path . "reflect/index#Indirect") (type . "reflect")) ((name . "reflect.Kind") (path . "reflect/index#Kind") (type . "reflect")) ((name . "reflect.Kind.String()") (path . "reflect/index#Kind.String") (type . "reflect")) ((name . "reflect.MakeChan()") (path . "reflect/index#MakeChan") (type . "reflect")) ((name . "reflect.MakeFunc()") (path . "reflect/index#MakeFunc") (type . "reflect")) ((name . "reflect.MakeMap()") (path . "reflect/index#MakeMap") (type . "reflect")) ((name . "reflect.MakeMapWithSize()") (path . "reflect/index#MakeMapWithSize") (type . "reflect")) ((name . "reflect.MakeSlice()") (path . "reflect/index#MakeSlice") (type . "reflect")) ((name . "reflect.MapIter") (path . "reflect/index#MapIter") (type . "reflect")) ((name . "reflect.MapIter.Key()") (path . "reflect/index#MapIter.Key") (type . "reflect")) ((name . "reflect.MapIter.Next()") (path . "reflect/index#MapIter.Next") (type . "reflect")) ((name . "reflect.MapIter.Reset()") (path . "reflect/index#MapIter.Reset") (type . "reflect")) ((name . "reflect.MapIter.Value()") (path . "reflect/index#MapIter.Value") (type . "reflect")) ((name . "reflect.MapOf()") (path . "reflect/index#MapOf") (type . "reflect")) ((name . "reflect.Method") (path . "reflect/index#Method") (type . "reflect")) ((name . "reflect.Method.IsExported()") (path . "reflect/index#Method.IsExported") (type . "reflect")) ((name . "reflect.New()") (path . "reflect/index#New") (type . "reflect")) ((name . "reflect.NewAt()") (path . "reflect/index#NewAt") (type . "reflect")) ((name . "reflect.PointerTo()") (path . "reflect/index#PointerTo") (type . "reflect")) ((name . "reflect.PtrTo()") (path . "reflect/index#PtrTo") (type . "reflect")) ((name . "reflect.Select()") (path . "reflect/index#Select") (type . "reflect")) ((name . "reflect.SelectCase") (path . "reflect/index#SelectCase") (type . "reflect")) ((name . "reflect.SelectDir") (path . "reflect/index#SelectDir") (type . "reflect")) ((name . "reflect.SliceHeader") (path . "reflect/index#SliceHeader") (type . "reflect")) ((name . "reflect.SliceOf()") (path . "reflect/index#SliceOf") (type . "reflect")) ((name . "reflect.StringHeader") (path . "reflect/index#StringHeader") (type . "reflect")) ((name . "reflect.StructField") (path . "reflect/index#StructField") (type . "reflect")) ((name . "reflect.StructField.IsExported()") (path . "reflect/index#StructField.IsExported") (type . "reflect")) ((name . "reflect.StructOf()") (path . "reflect/index#StructOf") (type . "reflect")) ((name . "reflect.StructTag") (path . "reflect/index#StructTag") (type . "reflect")) ((name . "reflect.StructTag.Get()") (path . "reflect/index#StructTag.Get") (type . "reflect")) ((name . "reflect.StructTag.Lookup()") (path . "reflect/index#StructTag.Lookup") (type . "reflect")) ((name . "reflect.Swapper()") (path . "reflect/index#Swapper") (type . "reflect")) ((name . "reflect.Type") (path . "reflect/index#Type") (type . "reflect")) ((name . "reflect.TypeFor()") (path . "reflect/index#TypeFor") (type . "reflect")) ((name . "reflect.TypeOf()") (path . "reflect/index#TypeOf") (type . "reflect")) ((name . "reflect.Value") (path . "reflect/index#Value") (type . "reflect")) ((name . "reflect.Value.Addr()") (path . "reflect/index#Value.Addr") (type . "reflect")) ((name . "reflect.Value.Bool()") (path . "reflect/index#Value.Bool") (type . "reflect")) ((name . "reflect.Value.Bytes()") (path . "reflect/index#Value.Bytes") (type . "reflect")) ((name . "reflect.Value.Call()") (path . "reflect/index#Value.Call") (type . "reflect")) ((name . "reflect.Value.CallSlice()") (path . "reflect/index#Value.CallSlice") (type . "reflect")) ((name . "reflect.Value.CanAddr()") (path . "reflect/index#Value.CanAddr") (type . "reflect")) ((name . "reflect.Value.CanComplex()") (path . "reflect/index#Value.CanComplex") (type . "reflect")) ((name . "reflect.Value.CanConvert()") (path . "reflect/index#Value.CanConvert") (type . "reflect")) ((name . "reflect.Value.CanFloat()") (path . "reflect/index#Value.CanFloat") (type . "reflect")) ((name . "reflect.Value.CanInt()") (path . "reflect/index#Value.CanInt") (type . "reflect")) ((name . "reflect.Value.CanInterface()") (path . "reflect/index#Value.CanInterface") (type . "reflect")) ((name . "reflect.Value.CanSet()") (path . "reflect/index#Value.CanSet") (type . "reflect")) ((name . "reflect.Value.CanUint()") (path . "reflect/index#Value.CanUint") (type . "reflect")) ((name . "reflect.Value.Cap()") (path . "reflect/index#Value.Cap") (type . "reflect")) ((name . "reflect.Value.Clear()") (path . "reflect/index#Value.Clear") (type . "reflect")) ((name . "reflect.Value.Close()") (path . "reflect/index#Value.Close") (type . "reflect")) ((name . "reflect.Value.Comparable()") (path . "reflect/index#Value.Comparable") (type . "reflect")) ((name . "reflect.Value.Complex()") (path . "reflect/index#Value.Complex") (type . "reflect")) ((name . "reflect.Value.Convert()") (path . "reflect/index#Value.Convert") (type . "reflect")) ((name . "reflect.Value.Elem()") (path . "reflect/index#Value.Elem") (type . "reflect")) ((name . "reflect.Value.Equal()") (path . "reflect/index#Value.Equal") (type . "reflect")) ((name . "reflect.Value.Field()") (path . "reflect/index#Value.Field") (type . "reflect")) ((name . "reflect.Value.FieldByIndex()") (path . "reflect/index#Value.FieldByIndex") (type . "reflect")) ((name . "reflect.Value.FieldByIndexErr()") (path . "reflect/index#Value.FieldByIndexErr") (type . "reflect")) ((name . "reflect.Value.FieldByName()") (path . "reflect/index#Value.FieldByName") (type . "reflect")) ((name . "reflect.Value.FieldByNameFunc()") (path . "reflect/index#Value.FieldByNameFunc") (type . "reflect")) ((name . "reflect.Value.Float()") (path . "reflect/index#Value.Float") (type . "reflect")) ((name . "reflect.Value.Grow()") (path . "reflect/index#Value.Grow") (type . "reflect")) ((name . "reflect.Value.Index()") (path . "reflect/index#Value.Index") (type . "reflect")) ((name . "reflect.Value.Int()") (path . "reflect/index#Value.Int") (type . "reflect")) ((name . "reflect.Value.Interface()") (path . "reflect/index#Value.Interface") (type . "reflect")) ((name . "reflect.Value.InterfaceData()") (path . "reflect/index#Value.InterfaceData") (type . "reflect")) ((name . "reflect.Value.IsNil()") (path . "reflect/index#Value.IsNil") (type . "reflect")) ((name . "reflect.Value.IsValid()") (path . "reflect/index#Value.IsValid") (type . "reflect")) ((name . "reflect.Value.IsZero()") (path . "reflect/index#Value.IsZero") (type . "reflect")) ((name . "reflect.Value.Kind()") (path . "reflect/index#Value.Kind") (type . "reflect")) ((name . "reflect.Value.Len()") (path . "reflect/index#Value.Len") (type . "reflect")) ((name . "reflect.Value.MapIndex()") (path . "reflect/index#Value.MapIndex") (type . "reflect")) ((name . "reflect.Value.MapKeys()") (path . "reflect/index#Value.MapKeys") (type . "reflect")) ((name . "reflect.Value.MapRange()") (path . "reflect/index#Value.MapRange") (type . "reflect")) ((name . "reflect.Value.Method()") (path . "reflect/index#Value.Method") (type . "reflect")) ((name . "reflect.Value.MethodByName()") (path . "reflect/index#Value.MethodByName") (type . "reflect")) ((name . "reflect.Value.NumField()") (path . "reflect/index#Value.NumField") (type . "reflect")) ((name . "reflect.Value.NumMethod()") (path . "reflect/index#Value.NumMethod") (type . "reflect")) ((name . "reflect.Value.OverflowComplex()") (path . "reflect/index#Value.OverflowComplex") (type . "reflect")) ((name . "reflect.Value.OverflowFloat()") (path . "reflect/index#Value.OverflowFloat") (type . "reflect")) ((name . "reflect.Value.OverflowInt()") (path . "reflect/index#Value.OverflowInt") (type . "reflect")) ((name . "reflect.Value.OverflowUint()") (path . "reflect/index#Value.OverflowUint") (type . "reflect")) ((name . "reflect.Value.Pointer()") (path . "reflect/index#Value.Pointer") (type . "reflect")) ((name . "reflect.Value.Recv()") (path . "reflect/index#Value.Recv") (type . "reflect")) ((name . "reflect.Value.Send()") (path . "reflect/index#Value.Send") (type . "reflect")) ((name . "reflect.Value.Set()") (path . "reflect/index#Value.Set") (type . "reflect")) ((name . "reflect.Value.SetBool()") (path . "reflect/index#Value.SetBool") (type . "reflect")) ((name . "reflect.Value.SetBytes()") (path . "reflect/index#Value.SetBytes") (type . "reflect")) ((name . "reflect.Value.SetCap()") (path . "reflect/index#Value.SetCap") (type . "reflect")) ((name . "reflect.Value.SetComplex()") (path . "reflect/index#Value.SetComplex") (type . "reflect")) ((name . "reflect.Value.SetFloat()") (path . "reflect/index#Value.SetFloat") (type . "reflect")) ((name . "reflect.Value.SetInt()") (path . "reflect/index#Value.SetInt") (type . "reflect")) ((name . "reflect.Value.SetIterKey()") (path . "reflect/index#Value.SetIterKey") (type . "reflect")) ((name . "reflect.Value.SetIterValue()") (path . "reflect/index#Value.SetIterValue") (type . "reflect")) ((name . "reflect.Value.SetLen()") (path . "reflect/index#Value.SetLen") (type . "reflect")) ((name . "reflect.Value.SetMapIndex()") (path . "reflect/index#Value.SetMapIndex") (type . "reflect")) ((name . "reflect.Value.SetPointer()") (path . "reflect/index#Value.SetPointer") (type . "reflect")) ((name . "reflect.Value.SetString()") (path . "reflect/index#Value.SetString") (type . "reflect")) ((name . "reflect.Value.SetUint()") (path . "reflect/index#Value.SetUint") (type . "reflect")) ((name . "reflect.Value.SetZero()") (path . "reflect/index#Value.SetZero") (type . "reflect")) ((name . "reflect.Value.Slice()") (path . "reflect/index#Value.Slice") (type . "reflect")) ((name . "reflect.Value.Slice3()") (path . "reflect/index#Value.Slice3") (type . "reflect")) ((name . "reflect.Value.String()") (path . "reflect/index#Value.String") (type . "reflect")) ((name . "reflect.Value.TryRecv()") (path . "reflect/index#Value.TryRecv") (type . "reflect")) ((name . "reflect.Value.TrySend()") (path . "reflect/index#Value.TrySend") (type . "reflect")) ((name . "reflect.Value.Type()") (path . "reflect/index#Value.Type") (type . "reflect")) ((name . "reflect.Value.Uint()") (path . "reflect/index#Value.Uint") (type . "reflect")) ((name . "reflect.Value.UnsafeAddr()") (path . "reflect/index#Value.UnsafeAddr") (type . "reflect")) ((name . "reflect.Value.UnsafePointer()") (path . "reflect/index#Value.UnsafePointer") (type . "reflect")) ((name . "reflect.ValueError") (path . "reflect/index#ValueError") (type . "reflect")) ((name . "reflect.ValueError.Error()") (path . "reflect/index#ValueError.Error") (type . "reflect")) ((name . "reflect.ValueOf()") (path . "reflect/index#ValueOf") (type . "reflect")) ((name . "reflect.VisibleFields()") (path . "reflect/index#VisibleFields") (type . "reflect")) ((name . "reflect.Zero()") (path . "reflect/index#Zero") (type . "reflect")) ((name . "regexp") (path . "regexp/index") (type . "regexp")) ((name . "regexp.Compile()") (path . "regexp/index#Compile") (type . "regexp")) ((name . "regexp.CompilePOSIX()") (path . "regexp/index#CompilePOSIX") (type . "regexp")) ((name . "regexp.Match()") (path . "regexp/index#Match") (type . "regexp")) ((name . "regexp.MatchReader()") (path . "regexp/index#MatchReader") (type . "regexp")) ((name . "regexp.MatchString()") (path . "regexp/index#MatchString") (type . "regexp")) ((name . "regexp.MustCompile()") (path . "regexp/index#MustCompile") (type . "regexp")) ((name . "regexp.MustCompilePOSIX()") (path . "regexp/index#MustCompilePOSIX") (type . "regexp")) ((name . "regexp.QuoteMeta()") (path . "regexp/index#QuoteMeta") (type . "regexp")) ((name . "regexp.Regexp") (path . "regexp/index#Regexp") (type . "regexp")) ((name . "regexp.Regexp.Copy()") (path . "regexp/index#Regexp.Copy") (type . "regexp")) ((name . "regexp.Regexp.Expand()") (path . "regexp/index#Regexp.Expand") (type . "regexp")) ((name . "regexp.Regexp.ExpandString()") (path . "regexp/index#Regexp.ExpandString") (type . "regexp")) ((name . "regexp.Regexp.Find()") (path . "regexp/index#Regexp.Find") (type . "regexp")) ((name . "regexp.Regexp.FindAll()") (path . "regexp/index#Regexp.FindAll") (type . "regexp")) ((name . "regexp.Regexp.FindAllIndex()") (path . "regexp/index#Regexp.FindAllIndex") (type . "regexp")) ((name . "regexp.Regexp.FindAllString()") (path . "regexp/index#Regexp.FindAllString") (type . "regexp")) ((name . "regexp.Regexp.FindAllStringIndex()") (path . "regexp/index#Regexp.FindAllStringIndex") (type . "regexp")) ((name . "regexp.Regexp.FindAllStringSubmatch()") (path . "regexp/index#Regexp.FindAllStringSubmatch") (type . "regexp")) ((name . "regexp.Regexp.FindAllStringSubmatchIndex()") (path . "regexp/index#Regexp.FindAllStringSubmatchIndex") (type . "regexp")) ((name . "regexp.Regexp.FindAllSubmatch()") (path . "regexp/index#Regexp.FindAllSubmatch") (type . "regexp")) ((name . "regexp.Regexp.FindAllSubmatchIndex()") (path . "regexp/index#Regexp.FindAllSubmatchIndex") (type . "regexp")) ((name . "regexp.Regexp.FindIndex()") (path . "regexp/index#Regexp.FindIndex") (type . "regexp")) ((name . "regexp.Regexp.FindReaderIndex()") (path . "regexp/index#Regexp.FindReaderIndex") (type . "regexp")) ((name . "regexp.Regexp.FindReaderSubmatchIndex()") (path . "regexp/index#Regexp.FindReaderSubmatchIndex") (type . "regexp")) ((name . "regexp.Regexp.FindString()") (path . "regexp/index#Regexp.FindString") (type . "regexp")) ((name . "regexp.Regexp.FindStringIndex()") (path . "regexp/index#Regexp.FindStringIndex") (type . "regexp")) ((name . "regexp.Regexp.FindStringSubmatch()") (path . "regexp/index#Regexp.FindStringSubmatch") (type . "regexp")) ((name . "regexp.Regexp.FindStringSubmatchIndex()") (path . "regexp/index#Regexp.FindStringSubmatchIndex") (type . "regexp")) ((name . "regexp.Regexp.FindSubmatch()") (path . "regexp/index#Regexp.FindSubmatch") (type . "regexp")) ((name . "regexp.Regexp.FindSubmatchIndex()") (path . "regexp/index#Regexp.FindSubmatchIndex") (type . "regexp")) ((name . "regexp.Regexp.LiteralPrefix()") (path . "regexp/index#Regexp.LiteralPrefix") (type . "regexp")) ((name . "regexp.Regexp.Longest()") (path . "regexp/index#Regexp.Longest") (type . "regexp")) ((name . "regexp.Regexp.MarshalText()") (path . "regexp/index#Regexp.MarshalText") (type . "regexp")) ((name . "regexp.Regexp.Match()") (path . "regexp/index#Regexp.Match") (type . "regexp")) ((name . "regexp.Regexp.MatchReader()") (path . "regexp/index#Regexp.MatchReader") (type . "regexp")) ((name . "regexp.Regexp.MatchString()") (path . "regexp/index#Regexp.MatchString") (type . "regexp")) ((name . "regexp.Regexp.NumSubexp()") (path . "regexp/index#Regexp.NumSubexp") (type . "regexp")) ((name . "regexp.Regexp.ReplaceAll()") (path . "regexp/index#Regexp.ReplaceAll") (type . "regexp")) ((name . "regexp.Regexp.ReplaceAllFunc()") (path . "regexp/index#Regexp.ReplaceAllFunc") (type . "regexp")) ((name . "regexp.Regexp.ReplaceAllLiteral()") (path . "regexp/index#Regexp.ReplaceAllLiteral") (type . "regexp")) ((name . "regexp.Regexp.ReplaceAllLiteralString()") (path . "regexp/index#Regexp.ReplaceAllLiteralString") (type . "regexp")) ((name . "regexp.Regexp.ReplaceAllString()") (path . "regexp/index#Regexp.ReplaceAllString") (type . "regexp")) ((name . "regexp.Regexp.ReplaceAllStringFunc()") (path . "regexp/index#Regexp.ReplaceAllStringFunc") (type . "regexp")) ((name . "regexp.Regexp.Split()") (path . "regexp/index#Regexp.Split") (type . "regexp")) ((name . "regexp.Regexp.String()") (path . "regexp/index#Regexp.String") (type . "regexp")) ((name . "regexp.Regexp.SubexpIndex()") (path . "regexp/index#Regexp.SubexpIndex") (type . "regexp")) ((name . "regexp.Regexp.SubexpNames()") (path . "regexp/index#Regexp.SubexpNames") (type . "regexp")) ((name . "regexp.Regexp.UnmarshalText()") (path . "regexp/index#Regexp.UnmarshalText") (type . "regexp")) ((name . "regexp/syntax") (path . "regexp/syntax/index") (type . "regexp")) ((name . "ring.New()") (path . "container/ring/index#New") (type . "container")) ((name . "ring.Ring") (path . "container/ring/index#Ring") (type . "container")) ((name . "ring.Ring.Do()") (path . "container/ring/index#Ring.Do") (type . "container")) ((name . "ring.Ring.Len()") (path . "container/ring/index#Ring.Len") (type . "container")) ((name . "ring.Ring.Link()") (path . "container/ring/index#Ring.Link") (type . "container")) ((name . "ring.Ring.Move()") (path . "container/ring/index#Ring.Move") (type . "container")) ((name . "ring.Ring.Next()") (path . "container/ring/index#Ring.Next") (type . "container")) ((name . "ring.Ring.Prev()") (path . "container/ring/index#Ring.Prev") (type . "container")) ((name . "ring.Ring.Unlink()") (path . "container/ring/index#Ring.Unlink") (type . "container")) ((name . "rpc.Accept()") (path . "net/rpc/index#Accept") (type . "net/rpc")) ((name . "rpc.Call") (path . "net/rpc/index#Call") (type . "net/rpc")) ((name . "rpc.Client") (path . "net/rpc/index#Client") (type . "net/rpc")) ((name . "rpc.Client.Call()") (path . "net/rpc/index#Client.Call") (type . "net/rpc")) ((name . "rpc.Client.Close()") (path . "net/rpc/index#Client.Close") (type . "net/rpc")) ((name . "rpc.Client.Go()") (path . "net/rpc/index#Client.Go") (type . "net/rpc")) ((name . "rpc.ClientCodec") (path . "net/rpc/index#ClientCodec") (type . "net/rpc")) ((name . "rpc.Dial()") (path . "net/rpc/index#Dial") (type . "net/rpc")) ((name . "rpc.DialHTTP()") (path . "net/rpc/index#DialHTTP") (type . "net/rpc")) ((name . "rpc.DialHTTPPath()") (path . "net/rpc/index#DialHTTPPath") (type . "net/rpc")) ((name . "rpc.HandleHTTP()") (path . "net/rpc/index#HandleHTTP") (type . "net/rpc")) ((name . "rpc.NewClient()") (path . "net/rpc/index#NewClient") (type . "net/rpc")) ((name . "rpc.NewClientWithCodec()") (path . "net/rpc/index#NewClientWithCodec") (type . "net/rpc")) ((name . "rpc.NewServer()") (path . "net/rpc/index#NewServer") (type . "net/rpc")) ((name . "rpc.Register()") (path . "net/rpc/index#Register") (type . "net/rpc")) ((name . "rpc.RegisterName()") (path . "net/rpc/index#RegisterName") (type . "net/rpc")) ((name . "rpc.Request") (path . "net/rpc/index#Request") (type . "net/rpc")) ((name . "rpc.Response") (path . "net/rpc/index#Response") (type . "net/rpc")) ((name . "rpc.ServeCodec()") (path . "net/rpc/index#ServeCodec") (type . "net/rpc")) ((name . "rpc.ServeConn()") (path . "net/rpc/index#ServeConn") (type . "net/rpc")) ((name . "rpc.Server") (path . "net/rpc/index#Server") (type . "net/rpc")) ((name . "rpc.Server.Accept()") (path . "net/rpc/index#Server.Accept") (type . "net/rpc")) ((name . "rpc.Server.HandleHTTP()") (path . "net/rpc/index#Server.HandleHTTP") (type . "net/rpc")) ((name . "rpc.Server.Register()") (path . "net/rpc/index#Server.Register") (type . "net/rpc")) ((name . "rpc.Server.RegisterName()") (path . "net/rpc/index#Server.RegisterName") (type . "net/rpc")) ((name . "rpc.Server.ServeCodec()") (path . "net/rpc/index#Server.ServeCodec") (type . "net/rpc")) ((name . "rpc.Server.ServeConn()") (path . "net/rpc/index#Server.ServeConn") (type . "net/rpc")) ((name . "rpc.Server.ServeHTTP()") (path . "net/rpc/index#Server.ServeHTTP") (type . "net/rpc")) ((name . "rpc.Server.ServeRequest()") (path . "net/rpc/index#Server.ServeRequest") (type . "net/rpc")) ((name . "rpc.ServerCodec") (path . "net/rpc/index#ServerCodec") (type . "net/rpc")) ((name . "rpc.ServeRequest()") (path . "net/rpc/index#ServeRequest") (type . "net/rpc")) ((name . "rpc.ServerError") (path . "net/rpc/index#ServerError") (type . "net/rpc")) ((name . "rpc.ServerError.Error()") (path . "net/rpc/index#ServerError.Error") (type . "net/rpc")) ((name . "rsa.CRTValue") (path . "crypto/rsa/index#CRTValue") (type . "crypto")) ((name . "rsa.DecryptOAEP()") (path . "crypto/rsa/index#DecryptOAEP") (type . "crypto")) ((name . "rsa.DecryptPKCS1v15()") (path . "crypto/rsa/index#DecryptPKCS1v15") (type . "crypto")) ((name . "rsa.DecryptPKCS1v15SessionKey()") (path . "crypto/rsa/index#DecryptPKCS1v15SessionKey") (type . "crypto")) ((name . "rsa.EncryptOAEP()") (path . "crypto/rsa/index#EncryptOAEP") (type . "crypto")) ((name . "rsa.EncryptPKCS1v15()") (path . "crypto/rsa/index#EncryptPKCS1v15") (type . "crypto")) ((name . "rsa.GenerateKey()") (path . "crypto/rsa/index#GenerateKey") (type . "crypto")) ((name . "rsa.GenerateMultiPrimeKey()") (path . "crypto/rsa/index#GenerateMultiPrimeKey") (type . "crypto")) ((name . "rsa.OAEPOptions") (path . "crypto/rsa/index#OAEPOptions") (type . "crypto")) ((name . "rsa.PKCS1v15DecryptOptions") (path . "crypto/rsa/index#PKCS1v15DecryptOptions") (type . "crypto")) ((name . "rsa.PrecomputedValues") (path . "crypto/rsa/index#PrecomputedValues") (type . "crypto")) ((name . "rsa.PrivateKey") (path . "crypto/rsa/index#PrivateKey") (type . "crypto")) ((name . "rsa.PrivateKey.Decrypt()") (path . "crypto/rsa/index#PrivateKey.Decrypt") (type . "crypto")) ((name . "rsa.PrivateKey.Equal()") (path . "crypto/rsa/index#PrivateKey.Equal") (type . "crypto")) ((name . "rsa.PrivateKey.Precompute()") (path . "crypto/rsa/index#PrivateKey.Precompute") (type . "crypto")) ((name . "rsa.PrivateKey.Public()") (path . "crypto/rsa/index#PrivateKey.Public") (type . "crypto")) ((name . "rsa.PrivateKey.Sign()") (path . "crypto/rsa/index#PrivateKey.Sign") (type . "crypto")) ((name . "rsa.PrivateKey.Validate()") (path . "crypto/rsa/index#PrivateKey.Validate") (type . "crypto")) ((name . "rsa.PSSOptions") (path . "crypto/rsa/index#PSSOptions") (type . "crypto")) ((name . "rsa.PSSOptions.HashFunc()") (path . "crypto/rsa/index#PSSOptions.HashFunc") (type . "crypto")) ((name . "rsa.PublicKey") (path . "crypto/rsa/index#PublicKey") (type . "crypto")) ((name . "rsa.PublicKey.Equal()") (path . "crypto/rsa/index#PublicKey.Equal") (type . "crypto")) ((name . "rsa.PublicKey.Size()") (path . "crypto/rsa/index#PublicKey.Size") (type . "crypto")) ((name . "rsa.SignPKCS1v15()") (path . "crypto/rsa/index#SignPKCS1v15") (type . "crypto")) ((name . "rsa.SignPSS()") (path . "crypto/rsa/index#SignPSS") (type . "crypto")) ((name . "rsa.VerifyPKCS1v15()") (path . "crypto/rsa/index#VerifyPKCS1v15") (type . "crypto")) ((name . "rsa.VerifyPSS()") (path . "crypto/rsa/index#VerifyPSS") (type . "crypto")) ((name . "runtime") (path . "runtime/index") (type . "runtime")) ((name . "runtime constants") (path . "runtime/index#pkg-constants") (type . "runtime")) ((name . "runtime variables") (path . "runtime/index#pkg-variables") (type . "runtime")) ((name . "runtime.BlockProfile()") (path . "runtime/index#BlockProfile") (type . "runtime")) ((name . "runtime.BlockProfileRecord") (path . "runtime/index#BlockProfileRecord") (type . "runtime")) ((name . "runtime.Breakpoint()") (path . "runtime/index#Breakpoint") (type . "runtime")) ((name . "runtime.Caller()") (path . "runtime/index#Caller") (type . "runtime")) ((name . "runtime.Callers()") (path . "runtime/index#Callers") (type . "runtime")) ((name . "runtime.CallersFrames()") (path . "runtime/index#CallersFrames") (type . "runtime")) ((name . "runtime.CPUProfile()") (path . "runtime/index#CPUProfile") (type . "runtime")) ((name . "runtime.Error") (path . "runtime/index#Error") (type . "runtime")) ((name . "runtime.Frame") (path . "runtime/index#Frame") (type . "runtime")) ((name . "runtime.Frames") (path . "runtime/index#Frames") (type . "runtime")) ((name . "runtime.Frames.Next()") (path . "runtime/index#Frames.Next") (type . "runtime")) ((name . "runtime.Func") (path . "runtime/index#Func") (type . "runtime")) ((name . "runtime.Func.Entry()") (path . "runtime/index#Func.Entry") (type . "runtime")) ((name . "runtime.Func.FileLine()") (path . "runtime/index#Func.FileLine") (type . "runtime")) ((name . "runtime.Func.Name()") (path . "runtime/index#Func.Name") (type . "runtime")) ((name . "runtime.FuncForPC()") (path . "runtime/index#FuncForPC") (type . "runtime")) ((name . "runtime.GC()") (path . "runtime/index#GC") (type . "runtime")) ((name . "runtime.Goexit()") (path . "runtime/index#Goexit") (type . "runtime")) ((name . "runtime.GOMAXPROCS()") (path . "runtime/index#GOMAXPROCS") (type . "runtime")) ((name . "runtime.GOROOT()") (path . "runtime/index#GOROOT") (type . "runtime")) ((name . "runtime.GoroutineProfile()") (path . "runtime/index#GoroutineProfile") (type . "runtime")) ((name . "runtime.Gosched()") (path . "runtime/index#Gosched") (type . "runtime")) ((name . "runtime.KeepAlive()") (path . "runtime/index#KeepAlive") (type . "runtime")) ((name . "runtime.LockOSThread()") (path . "runtime/index#LockOSThread") (type . "runtime")) ((name . "runtime.MemProfile()") (path . "runtime/index#MemProfile") (type . "runtime")) ((name . "runtime.MemProfileRecord") (path . "runtime/index#MemProfileRecord") (type . "runtime")) ((name . "runtime.MemProfileRecord.InUseBytes()") (path . "runtime/index#MemProfileRecord.InUseBytes") (type . "runtime")) ((name . "runtime.MemProfileRecord.InUseObjects()") (path . "runtime/index#MemProfileRecord.InUseObjects") (type . "runtime")) ((name . "runtime.MemProfileRecord.Stack()") (path . "runtime/index#MemProfileRecord.Stack") (type . "runtime")) ((name . "runtime.MemStats") (path . "runtime/index#MemStats") (type . "runtime")) ((name . "runtime.MutexProfile()") (path . "runtime/index#MutexProfile") (type . "runtime")) ((name . "runtime.NumCgoCall()") (path . "runtime/index#NumCgoCall") (type . "runtime")) ((name . "runtime.NumCPU()") (path . "runtime/index#NumCPU") (type . "runtime")) ((name . "runtime.NumGoroutine()") (path . "runtime/index#NumGoroutine") (type . "runtime")) ((name . "runtime.PanicNilError") (path . "runtime/index#PanicNilError") (type . "runtime")) ((name . "runtime.PanicNilError.Error()") (path . "runtime/index#PanicNilError.Error") (type . "runtime")) ((name . "runtime.PanicNilError.RuntimeError()") (path . "runtime/index#PanicNilError.RuntimeError") (type . "runtime")) ((name . "runtime.Pinner") (path . "runtime/index#Pinner") (type . "runtime")) ((name . "runtime.Pinner.Pin()") (path . "runtime/index#Pinner.Pin") (type . "runtime")) ((name . "runtime.Pinner.Unpin()") (path . "runtime/index#Pinner.Unpin") (type . "runtime")) ((name . "runtime.ReadMemStats()") (path . "runtime/index#ReadMemStats") (type . "runtime")) ((name . "runtime.ReadTrace()") (path . "runtime/index#ReadTrace") (type . "runtime")) ((name . "runtime.SetBlockProfileRate()") (path . "runtime/index#SetBlockProfileRate") (type . "runtime")) ((name . "runtime.SetCgoTraceback()") (path . "runtime/index#SetCgoTraceback") (type . "runtime")) ((name . "runtime.SetCPUProfileRate()") (path . "runtime/index#SetCPUProfileRate") (type . "runtime")) ((name . "runtime.SetFinalizer()") (path . "runtime/index#SetFinalizer") (type . "runtime")) ((name . "runtime.SetMutexProfileFraction()") (path . "runtime/index#SetMutexProfileFraction") (type . "runtime")) ((name . "runtime.Stack()") (path . "runtime/index#Stack") (type . "runtime")) ((name . "runtime.StackRecord") (path . "runtime/index#StackRecord") (type . "runtime")) ((name . "runtime.StackRecord.Stack()") (path . "runtime/index#StackRecord.Stack") (type . "runtime")) ((name . "runtime.StartTrace()") (path . "runtime/index#StartTrace") (type . "runtime")) ((name . "runtime.StopTrace()") (path . "runtime/index#StopTrace") (type . "runtime")) ((name . "runtime.ThreadCreateProfile()") (path . "runtime/index#ThreadCreateProfile") (type . "runtime")) ((name . "runtime.TypeAssertionError") (path . "runtime/index#TypeAssertionError") (type . "runtime")) ((name . "runtime.TypeAssertionError.Error()") (path . "runtime/index#TypeAssertionError.Error") (type . "runtime")) ((name . "runtime.TypeAssertionError.RuntimeError()") (path . "runtime/index#TypeAssertionError.RuntimeError") (type . "runtime")) ((name . "runtime.UnlockOSThread()") (path . "runtime/index#UnlockOSThread") (type . "runtime")) ((name . "runtime.Version()") (path . "runtime/index#Version") (type . "runtime")) ((name . "runtime/cgo") (path . "runtime/cgo/index") (type . "runtime")) ((name . "runtime/coverage") (path . "runtime/coverage/index") (type . "runtime")) ((name . "runtime/debug") (path . "runtime/debug/index") (type . "runtime")) ((name . "runtime/metrics") (path . "runtime/metrics/index") (type . "runtime")) ((name . "runtime/pprof") (path . "runtime/pprof/index") (type . "runtime")) ((name . "runtime/race") (path . "runtime/race/index") (type . "runtime")) ((name . "runtime/trace") (path . "runtime/trace/index") (type . "runtime")) ((name . "scanner.Error") (path . "go/scanner/index#Error") (type . "go")) ((name . "scanner.Error.Error()") (path . "go/scanner/index#Error.Error") (type . "go")) ((name . "scanner.ErrorHandler") (path . "go/scanner/index#ErrorHandler") (type . "go")) ((name . "scanner.ErrorList") (path . "go/scanner/index#ErrorList") (type . "go")) ((name . "scanner.ErrorList.Add()") (path . "go/scanner/index#ErrorList.Add") (type . "go")) ((name . "scanner.ErrorList.Err()") (path . "go/scanner/index#ErrorList.Err") (type . "go")) ((name . "scanner.ErrorList.Error()") (path . "go/scanner/index#ErrorList.Error") (type . "go")) ((name . "scanner.ErrorList.Len()") (path . "go/scanner/index#ErrorList.Len") (type . "go")) ((name . "scanner.ErrorList.Less()") (path . "go/scanner/index#ErrorList.Less") (type . "go")) ((name . "scanner.ErrorList.RemoveMultiples()") (path . "go/scanner/index#ErrorList.RemoveMultiples") (type . "go")) ((name . "scanner.ErrorList.Reset()") (path . "go/scanner/index#ErrorList.Reset") (type . "go")) ((name . "scanner.ErrorList.Sort()") (path . "go/scanner/index#ErrorList.Sort") (type . "go")) ((name . "scanner.ErrorList.Swap()") (path . "go/scanner/index#ErrorList.Swap") (type . "go")) ((name . "scanner.Mode") (path . "go/scanner/index#Mode") (type . "go")) ((name . "scanner.Position") (path . "text/scanner/index#Position") (type . "text")) ((name . "scanner.Position.IsValid()") (path . "text/scanner/index#Position.IsValid") (type . "text")) ((name . "scanner.Position.String()") (path . "text/scanner/index#Position.String") (type . "text")) ((name . "scanner.PrintError()") (path . "go/scanner/index#PrintError") (type . "go")) ((name . "scanner.Scanner") (path . "go/scanner/index#Scanner") (type . "go")) ((name . "scanner.Scanner") (path . "text/scanner/index#Scanner") (type . "text")) ((name . "scanner.Scanner.Init()") (path . "go/scanner/index#Scanner.Init") (type . "go")) ((name . "scanner.Scanner.Init()") (path . "text/scanner/index#Scanner.Init") (type . "text")) ((name . "scanner.Scanner.Next()") (path . "text/scanner/index#Scanner.Next") (type . "text")) ((name . "scanner.Scanner.Peek()") (path . "text/scanner/index#Scanner.Peek") (type . "text")) ((name . "scanner.Scanner.Pos()") (path . "text/scanner/index#Scanner.Pos") (type . "text")) ((name . "scanner.Scanner.Scan()") (path . "text/scanner/index#Scanner.Scan") (type . "text")) ((name . "scanner.Scanner.Scan()") (path . "go/scanner/index#Scanner.Scan") (type . "go")) ((name . "scanner.Scanner.TokenText()") (path . "text/scanner/index#Scanner.TokenText") (type . "text")) ((name . "scanner.TokenString()") (path . "text/scanner/index#TokenString") (type . "text")) ((name . "sha1.New()") (path . "crypto/sha1/index#New") (type . "crypto")) ((name . "sha1.Sum()") (path . "crypto/sha1/index#Sum") (type . "crypto")) ((name . "sha256.New()") (path . "crypto/sha256/index#New") (type . "crypto")) ((name . "sha256.New224()") (path . "crypto/sha256/index#New224") (type . "crypto")) ((name . "sha256.Sum224()") (path . "crypto/sha256/index#Sum224") (type . "crypto")) ((name . "sha256.Sum256()") (path . "crypto/sha256/index#Sum256") (type . "crypto")) ((name . "sha512.New()") (path . "crypto/sha512/index#New") (type . "crypto")) ((name . "sha512.New384()") (path . "crypto/sha512/index#New384") (type . "crypto")) ((name . "sha512.New512_224()") (path . "crypto/sha512/index#New512_224") (type . "crypto")) ((name . "sha512.New512_256()") (path . "crypto/sha512/index#New512_256") (type . "crypto")) ((name . "sha512.Sum384()") (path . "crypto/sha512/index#Sum384") (type . "crypto")) ((name . "sha512.Sum512()") (path . "crypto/sha512/index#Sum512") (type . "crypto")) ((name . "sha512.Sum512_224()") (path . "crypto/sha512/index#Sum512_224") (type . "crypto")) ((name . "sha512.Sum512_256()") (path . "crypto/sha512/index#Sum512_256") (type . "crypto")) ((name . "signal.Ignore()") (path . "os/signal/index#Ignore") (type . "os")) ((name . "signal.Ignored()") (path . "os/signal/index#Ignored") (type . "os")) ((name . "signal.Notify()") (path . "os/signal/index#Notify") (type . "os")) ((name . "signal.NotifyContext()") (path . "os/signal/index#NotifyContext") (type . "os")) ((name . "signal.Reset()") (path . "os/signal/index#Reset") (type . "os")) ((name . "signal.Stop()") (path . "os/signal/index#Stop") (type . "os")) ((name . "slices") (path . "slices/index") (type . "slices")) ((name . "slices.BinarySearch()") (path . "slices/index#BinarySearch") (type . "slices")) ((name . "slices.BinarySearchFunc()") (path . "slices/index#BinarySearchFunc") (type . "slices")) ((name . "slices.Clip()") (path . "slices/index#Clip") (type . "slices")) ((name . "slices.Clone()") (path . "slices/index#Clone") (type . "slices")) ((name . "slices.Compact()") (path . "slices/index#Compact") (type . "slices")) ((name . "slices.CompactFunc()") (path . "slices/index#CompactFunc") (type . "slices")) ((name . "slices.Compare()") (path . "slices/index#Compare") (type . "slices")) ((name . "slices.CompareFunc()") (path . "slices/index#CompareFunc") (type . "slices")) ((name . "slices.Concat()") (path . "slices/index#Concat") (type . "slices")) ((name . "slices.Contains()") (path . "slices/index#Contains") (type . "slices")) ((name . "slices.ContainsFunc()") (path . "slices/index#ContainsFunc") (type . "slices")) ((name . "slices.Delete()") (path . "slices/index#Delete") (type . "slices")) ((name . "slices.DeleteFunc()") (path . "slices/index#DeleteFunc") (type . "slices")) ((name . "slices.Equal()") (path . "slices/index#Equal") (type . "slices")) ((name . "slices.EqualFunc()") (path . "slices/index#EqualFunc") (type . "slices")) ((name . "slices.Grow()") (path . "slices/index#Grow") (type . "slices")) ((name . "slices.Index()") (path . "slices/index#Index") (type . "slices")) ((name . "slices.IndexFunc()") (path . "slices/index#IndexFunc") (type . "slices")) ((name . "slices.Insert()") (path . "slices/index#Insert") (type . "slices")) ((name . "slices.IsSorted()") (path . "slices/index#IsSorted") (type . "slices")) ((name . "slices.IsSortedFunc()") (path . "slices/index#IsSortedFunc") (type . "slices")) ((name . "slices.Max()") (path . "slices/index#Max") (type . "slices")) ((name . "slices.MaxFunc()") (path . "slices/index#MaxFunc") (type . "slices")) ((name . "slices.Min()") (path . "slices/index#Min") (type . "slices")) ((name . "slices.MinFunc()") (path . "slices/index#MinFunc") (type . "slices")) ((name . "slices.Replace()") (path . "slices/index#Replace") (type . "slices")) ((name . "slices.Reverse()") (path . "slices/index#Reverse") (type . "slices")) ((name . "slices.Sort()") (path . "slices/index#Sort") (type . "slices")) ((name . "slices.SortFunc()") (path . "slices/index#SortFunc") (type . "slices")) ((name . "slices.SortStableFunc()") (path . "slices/index#SortStableFunc") (type . "slices")) ((name . "slog.Any()") (path . "log/slog/index#Any") (type . "log")) ((name . "slog.AnyValue()") (path . "log/slog/index#AnyValue") (type . "log")) ((name . "slog.Attr") (path . "log/slog/index#Attr") (type . "log")) ((name . "slog.Attr.Equal()") (path . "log/slog/index#Attr.Equal") (type . "log")) ((name . "slog.Attr.String()") (path . "log/slog/index#Attr.String") (type . "log")) ((name . "slog.Bool()") (path . "log/slog/index#Bool") (type . "log")) ((name . "slog.BoolValue()") (path . "log/slog/index#BoolValue") (type . "log")) ((name . "slog.Debug()") (path . "log/slog/index#Debug") (type . "log")) ((name . "slog.DebugContext()") (path . "log/slog/index#DebugContext") (type . "log")) ((name . "slog.Default()") (path . "log/slog/index#Default") (type . "log")) ((name . "slog.Duration()") (path . "log/slog/index#Duration") (type . "log")) ((name . "slog.DurationValue()") (path . "log/slog/index#DurationValue") (type . "log")) ((name . "slog.Error()") (path . "log/slog/index#Error") (type . "log")) ((name . "slog.ErrorContext()") (path . "log/slog/index#ErrorContext") (type . "log")) ((name . "slog.Float64()") (path . "log/slog/index#Float64") (type . "log")) ((name . "slog.Float64Value()") (path . "log/slog/index#Float64Value") (type . "log")) ((name . "slog.Group()") (path . "log/slog/index#Group") (type . "log")) ((name . "slog.GroupValue()") (path . "log/slog/index#GroupValue") (type . "log")) ((name . "slog.Handler") (path . "log/slog/index#Handler") (type . "log")) ((name . "slog.HandlerOptions") (path . "log/slog/index#HandlerOptions") (type . "log")) ((name . "slog.Info()") (path . "log/slog/index#Info") (type . "log")) ((name . "slog.InfoContext()") (path . "log/slog/index#InfoContext") (type . "log")) ((name . "slog.Int()") (path . "log/slog/index#Int") (type . "log")) ((name . "slog.Int64()") (path . "log/slog/index#Int64") (type . "log")) ((name . "slog.Int64Value()") (path . "log/slog/index#Int64Value") (type . "log")) ((name . "slog.IntValue()") (path . "log/slog/index#IntValue") (type . "log")) ((name . "slog.JSONHandler") (path . "log/slog/index#JSONHandler") (type . "log")) ((name . "slog.JSONHandler.Enabled()") (path . "log/slog/index#JSONHandler.Enabled") (type . "log")) ((name . "slog.JSONHandler.Handle()") (path . "log/slog/index#JSONHandler.Handle") (type . "log")) ((name . "slog.JSONHandler.WithAttrs()") (path . "log/slog/index#JSONHandler.WithAttrs") (type . "log")) ((name . "slog.JSONHandler.WithGroup()") (path . "log/slog/index#JSONHandler.WithGroup") (type . "log")) ((name . "slog.Kind") (path . "log/slog/index#Kind") (type . "log")) ((name . "slog.Kind.String()") (path . "log/slog/index#Kind.String") (type . "log")) ((name . "slog.Level") (path . "log/slog/index#Level") (type . "log")) ((name . "slog.Level.Level()") (path . "log/slog/index#Level.Level") (type . "log")) ((name . "slog.Level.MarshalJSON()") (path . "log/slog/index#Level.MarshalJSON") (type . "log")) ((name . "slog.Level.MarshalText()") (path . "log/slog/index#Level.MarshalText") (type . "log")) ((name . "slog.Level.String()") (path . "log/slog/index#Level.String") (type . "log")) ((name . "slog.Level.UnmarshalJSON()") (path . "log/slog/index#Level.UnmarshalJSON") (type . "log")) ((name . "slog.Level.UnmarshalText()") (path . "log/slog/index#Level.UnmarshalText") (type . "log")) ((name . "slog.Leveler") (path . "log/slog/index#Leveler") (type . "log")) ((name . "slog.LevelVar") (path . "log/slog/index#LevelVar") (type . "log")) ((name . "slog.LevelVar.Level()") (path . "log/slog/index#LevelVar.Level") (type . "log")) ((name . "slog.LevelVar.MarshalText()") (path . "log/slog/index#LevelVar.MarshalText") (type . "log")) ((name . "slog.LevelVar.Set()") (path . "log/slog/index#LevelVar.Set") (type . "log")) ((name . "slog.LevelVar.String()") (path . "log/slog/index#LevelVar.String") (type . "log")) ((name . "slog.LevelVar.UnmarshalText()") (path . "log/slog/index#LevelVar.UnmarshalText") (type . "log")) ((name . "slog.Log()") (path . "log/slog/index#Log") (type . "log")) ((name . "slog.LogAttrs()") (path . "log/slog/index#LogAttrs") (type . "log")) ((name . "slog.Logger") (path . "log/slog/index#Logger") (type . "log")) ((name . "slog.Logger.Debug()") (path . "log/slog/index#Logger.Debug") (type . "log")) ((name . "slog.Logger.DebugContext()") (path . "log/slog/index#Logger.DebugContext") (type . "log")) ((name . "slog.Logger.Enabled()") (path . "log/slog/index#Logger.Enabled") (type . "log")) ((name . "slog.Logger.Error()") (path . "log/slog/index#Logger.Error") (type . "log")) ((name . "slog.Logger.ErrorContext()") (path . "log/slog/index#Logger.ErrorContext") (type . "log")) ((name . "slog.Logger.Handler()") (path . "log/slog/index#Logger.Handler") (type . "log")) ((name . "slog.Logger.Info()") (path . "log/slog/index#Logger.Info") (type . "log")) ((name . "slog.Logger.InfoContext()") (path . "log/slog/index#Logger.InfoContext") (type . "log")) ((name . "slog.Logger.Log()") (path . "log/slog/index#Logger.Log") (type . "log")) ((name . "slog.Logger.LogAttrs()") (path . "log/slog/index#Logger.LogAttrs") (type . "log")) ((name . "slog.Logger.Warn()") (path . "log/slog/index#Logger.Warn") (type . "log")) ((name . "slog.Logger.WarnContext()") (path . "log/slog/index#Logger.WarnContext") (type . "log")) ((name . "slog.Logger.With()") (path . "log/slog/index#Logger.With") (type . "log")) ((name . "slog.Logger.WithGroup()") (path . "log/slog/index#Logger.WithGroup") (type . "log")) ((name . "slog.LogValuer") (path . "log/slog/index#LogValuer") (type . "log")) ((name . "slog.New()") (path . "log/slog/index#New") (type . "log")) ((name . "slog.NewJSONHandler()") (path . "log/slog/index#NewJSONHandler") (type . "log")) ((name . "slog.NewLogLogger()") (path . "log/slog/index#NewLogLogger") (type . "log")) ((name . "slog.NewRecord()") (path . "log/slog/index#NewRecord") (type . "log")) ((name . "slog.NewTextHandler()") (path . "log/slog/index#NewTextHandler") (type . "log")) ((name . "slog.Record") (path . "log/slog/index#Record") (type . "log")) ((name . "slog.Record.Add()") (path . "log/slog/index#Record.Add") (type . "log")) ((name . "slog.Record.AddAttrs()") (path . "log/slog/index#Record.AddAttrs") (type . "log")) ((name . "slog.Record.Attrs()") (path . "log/slog/index#Record.Attrs") (type . "log")) ((name . "slog.Record.Clone()") (path . "log/slog/index#Record.Clone") (type . "log")) ((name . "slog.Record.NumAttrs()") (path . "log/slog/index#Record.NumAttrs") (type . "log")) ((name . "slog.SetDefault()") (path . "log/slog/index#SetDefault") (type . "log")) ((name . "slog.SetLogLoggerLevel()") (path . "log/slog/index#SetLogLoggerLevel") (type . "log")) ((name . "slog.Source") (path . "log/slog/index#Source") (type . "log")) ((name . "slog.String()") (path . "log/slog/index#String") (type . "log")) ((name . "slog.StringValue()") (path . "log/slog/index#StringValue") (type . "log")) ((name . "slog.TextHandler") (path . "log/slog/index#TextHandler") (type . "log")) ((name . "slog.TextHandler.Enabled()") (path . "log/slog/index#TextHandler.Enabled") (type . "log")) ((name . "slog.TextHandler.Handle()") (path . "log/slog/index#TextHandler.Handle") (type . "log")) ((name . "slog.TextHandler.WithAttrs()") (path . "log/slog/index#TextHandler.WithAttrs") (type . "log")) ((name . "slog.TextHandler.WithGroup()") (path . "log/slog/index#TextHandler.WithGroup") (type . "log")) ((name . "slog.Time()") (path . "log/slog/index#Time") (type . "log")) ((name . "slog.TimeValue()") (path . "log/slog/index#TimeValue") (type . "log")) ((name . "slog.Uint64()") (path . "log/slog/index#Uint64") (type . "log")) ((name . "slog.Uint64Value()") (path . "log/slog/index#Uint64Value") (type . "log")) ((name . "slog.Value") (path . "log/slog/index#Value") (type . "log")) ((name . "slog.Value.Any()") (path . "log/slog/index#Value.Any") (type . "log")) ((name . "slog.Value.Bool()") (path . "log/slog/index#Value.Bool") (type . "log")) ((name . "slog.Value.Duration()") (path . "log/slog/index#Value.Duration") (type . "log")) ((name . "slog.Value.Equal()") (path . "log/slog/index#Value.Equal") (type . "log")) ((name . "slog.Value.Float64()") (path . "log/slog/index#Value.Float64") (type . "log")) ((name . "slog.Value.Group()") (path . "log/slog/index#Value.Group") (type . "log")) ((name . "slog.Value.Int64()") (path . "log/slog/index#Value.Int64") (type . "log")) ((name . "slog.Value.Kind()") (path . "log/slog/index#Value.Kind") (type . "log")) ((name . "slog.Value.LogValuer()") (path . "log/slog/index#Value.LogValuer") (type . "log")) ((name . "slog.Value.Resolve()") (path . "log/slog/index#Value.Resolve") (type . "log")) ((name . "slog.Value.String()") (path . "log/slog/index#Value.String") (type . "log")) ((name . "slog.Value.Time()") (path . "log/slog/index#Value.Time") (type . "log")) ((name . "slog.Value.Uint64()") (path . "log/slog/index#Value.Uint64") (type . "log")) ((name . "slog.Warn()") (path . "log/slog/index#Warn") (type . "log")) ((name . "slog.WarnContext()") (path . "log/slog/index#WarnContext") (type . "log")) ((name . "slog.With()") (path . "log/slog/index#With") (type . "log")) ((name . "slogtest.Run()") (path . "testing/slogtest/index#Run") (type . "testing")) ((name . "slogtest.TestHandler()") (path . "testing/slogtest/index#TestHandler") (type . "testing")) ((name . "smtp.Auth") (path . "net/smtp/index#Auth") (type . "net/smtp")) ((name . "smtp.Client") (path . "net/smtp/index#Client") (type . "net/smtp")) ((name . "smtp.Client.Auth()") (path . "net/smtp/index#Client.Auth") (type . "net/smtp")) ((name . "smtp.Client.Close()") (path . "net/smtp/index#Client.Close") (type . "net/smtp")) ((name . "smtp.Client.Data()") (path . "net/smtp/index#Client.Data") (type . "net/smtp")) ((name . "smtp.Client.Extension()") (path . "net/smtp/index#Client.Extension") (type . "net/smtp")) ((name . "smtp.Client.Hello()") (path . "net/smtp/index#Client.Hello") (type . "net/smtp")) ((name . "smtp.Client.Mail()") (path . "net/smtp/index#Client.Mail") (type . "net/smtp")) ((name . "smtp.Client.Noop()") (path . "net/smtp/index#Client.Noop") (type . "net/smtp")) ((name . "smtp.Client.Quit()") (path . "net/smtp/index#Client.Quit") (type . "net/smtp")) ((name . "smtp.Client.Rcpt()") (path . "net/smtp/index#Client.Rcpt") (type . "net/smtp")) ((name . "smtp.Client.Reset()") (path . "net/smtp/index#Client.Reset") (type . "net/smtp")) ((name . "smtp.Client.StartTLS()") (path . "net/smtp/index#Client.StartTLS") (type . "net/smtp")) ((name . "smtp.Client.TLSConnectionState()") (path . "net/smtp/index#Client.TLSConnectionState") (type . "net/smtp")) ((name . "smtp.Client.Verify()") (path . "net/smtp/index#Client.Verify") (type . "net/smtp")) ((name . "smtp.CRAMMD5Auth()") (path . "net/smtp/index#CRAMMD5Auth") (type . "net/smtp")) ((name . "smtp.Dial()") (path . "net/smtp/index#Dial") (type . "net/smtp")) ((name . "smtp.NewClient()") (path . "net/smtp/index#NewClient") (type . "net/smtp")) ((name . "smtp.PlainAuth()") (path . "net/smtp/index#PlainAuth") (type . "net/smtp")) ((name . "smtp.SendMail()") (path . "net/smtp/index#SendMail") (type . "net/smtp")) ((name . "smtp.ServerInfo") (path . "net/smtp/index#ServerInfo") (type . "net/smtp")) ((name . "sort") (path . "sort/index") (type . "sort")) ((name . "sort.Find()") (path . "sort/index#Find") (type . "sort")) ((name . "sort.Float64s()") (path . "sort/index#Float64s") (type . "sort")) ((name . "sort.Float64sAreSorted()") (path . "sort/index#Float64sAreSorted") (type . "sort")) ((name . "sort.Float64Slice") (path . "sort/index#Float64Slice") (type . "sort")) ((name . "sort.Float64Slice.Len()") (path . "sort/index#Float64Slice.Len") (type . "sort")) ((name . "sort.Float64Slice.Less()") (path . "sort/index#Float64Slice.Less") (type . "sort")) ((name . "sort.Float64Slice.Search()") (path . "sort/index#Float64Slice.Search") (type . "sort")) ((name . "sort.Float64Slice.Sort()") (path . "sort/index#Float64Slice.Sort") (type . "sort")) ((name . "sort.Float64Slice.Swap()") (path . "sort/index#Float64Slice.Swap") (type . "sort")) ((name . "sort.Interface") (path . "sort/index#Interface") (type . "sort")) ((name . "sort.Ints()") (path . "sort/index#Ints") (type . "sort")) ((name . "sort.IntsAreSorted()") (path . "sort/index#IntsAreSorted") (type . "sort")) ((name . "sort.IntSlice") (path . "sort/index#IntSlice") (type . "sort")) ((name . "sort.IntSlice.Len()") (path . "sort/index#IntSlice.Len") (type . "sort")) ((name . "sort.IntSlice.Less()") (path . "sort/index#IntSlice.Less") (type . "sort")) ((name . "sort.IntSlice.Search()") (path . "sort/index#IntSlice.Search") (type . "sort")) ((name . "sort.IntSlice.Sort()") (path . "sort/index#IntSlice.Sort") (type . "sort")) ((name . "sort.IntSlice.Swap()") (path . "sort/index#IntSlice.Swap") (type . "sort")) ((name . "sort.IsSorted()") (path . "sort/index#IsSorted") (type . "sort")) ((name . "sort.Reverse()") (path . "sort/index#Reverse") (type . "sort")) ((name . "sort.Search()") (path . "sort/index#Search") (type . "sort")) ((name . "sort.SearchFloat64s()") (path . "sort/index#SearchFloat64s") (type . "sort")) ((name . "sort.SearchInts()") (path . "sort/index#SearchInts") (type . "sort")) ((name . "sort.SearchStrings()") (path . "sort/index#SearchStrings") (type . "sort")) ((name . "sort.Slice()") (path . "sort/index#Slice") (type . "sort")) ((name . "sort.SliceIsSorted()") (path . "sort/index#SliceIsSorted") (type . "sort")) ((name . "sort.SliceStable()") (path . "sort/index#SliceStable") (type . "sort")) ((name . "sort.Sort()") (path . "sort/index#Sort") (type . "sort")) ((name . "sort.Stable()") (path . "sort/index#Stable") (type . "sort")) ((name . "sort.Strings()") (path . "sort/index#Strings") (type . "sort")) ((name . "sort.StringsAreSorted()") (path . "sort/index#StringsAreSorted") (type . "sort")) ((name . "sort.StringSlice") (path . "sort/index#StringSlice") (type . "sort")) ((name . "sort.StringSlice.Len()") (path . "sort/index#StringSlice.Len") (type . "sort")) ((name . "sort.StringSlice.Less()") (path . "sort/index#StringSlice.Less") (type . "sort")) ((name . "sort.StringSlice.Search()") (path . "sort/index#StringSlice.Search") (type . "sort")) ((name . "sort.StringSlice.Sort()") (path . "sort/index#StringSlice.Sort") (type . "sort")) ((name . "sort.StringSlice.Swap()") (path . "sort/index#StringSlice.Swap") (type . "sort")) ((name . "sql.ColumnType") (path . "database/sql/index#ColumnType") (type . "database")) ((name . "sql.ColumnType.DatabaseTypeName()") (path . "database/sql/index#ColumnType.DatabaseTypeName") (type . "database")) ((name . "sql.ColumnType.DecimalSize()") (path . "database/sql/index#ColumnType.DecimalSize") (type . "database")) ((name . "sql.ColumnType.Length()") (path . "database/sql/index#ColumnType.Length") (type . "database")) ((name . "sql.ColumnType.Name()") (path . "database/sql/index#ColumnType.Name") (type . "database")) ((name . "sql.ColumnType.Nullable()") (path . "database/sql/index#ColumnType.Nullable") (type . "database")) ((name . "sql.ColumnType.ScanType()") (path . "database/sql/index#ColumnType.ScanType") (type . "database")) ((name . "sql.Conn") (path . "database/sql/index#Conn") (type . "database")) ((name . "sql.Conn.BeginTx()") (path . "database/sql/index#Conn.BeginTx") (type . "database")) ((name . "sql.Conn.Close()") (path . "database/sql/index#Conn.Close") (type . "database")) ((name . "sql.Conn.ExecContext()") (path . "database/sql/index#Conn.ExecContext") (type . "database")) ((name . "sql.Conn.PingContext()") (path . "database/sql/index#Conn.PingContext") (type . "database")) ((name . "sql.Conn.PrepareContext()") (path . "database/sql/index#Conn.PrepareContext") (type . "database")) ((name . "sql.Conn.QueryContext()") (path . "database/sql/index#Conn.QueryContext") (type . "database")) ((name . "sql.Conn.QueryRowContext()") (path . "database/sql/index#Conn.QueryRowContext") (type . "database")) ((name . "sql.Conn.Raw()") (path . "database/sql/index#Conn.Raw") (type . "database")) ((name . "sql.DB") (path . "database/sql/index#DB") (type . "database")) ((name . "sql.DB.Begin()") (path . "database/sql/index#DB.Begin") (type . "database")) ((name . "sql.DB.BeginTx()") (path . "database/sql/index#DB.BeginTx") (type . "database")) ((name . "sql.DB.Close()") (path . "database/sql/index#DB.Close") (type . "database")) ((name . "sql.DB.Conn()") (path . "database/sql/index#DB.Conn") (type . "database")) ((name . "sql.DB.Driver()") (path . "database/sql/index#DB.Driver") (type . "database")) ((name . "sql.DB.Exec()") (path . "database/sql/index#DB.Exec") (type . "database")) ((name . "sql.DB.ExecContext()") (path . "database/sql/index#DB.ExecContext") (type . "database")) ((name . "sql.DB.Ping()") (path . "database/sql/index#DB.Ping") (type . "database")) ((name . "sql.DB.PingContext()") (path . "database/sql/index#DB.PingContext") (type . "database")) ((name . "sql.DB.Prepare()") (path . "database/sql/index#DB.Prepare") (type . "database")) ((name . "sql.DB.PrepareContext()") (path . "database/sql/index#DB.PrepareContext") (type . "database")) ((name . "sql.DB.Query()") (path . "database/sql/index#DB.Query") (type . "database")) ((name . "sql.DB.QueryContext()") (path . "database/sql/index#DB.QueryContext") (type . "database")) ((name . "sql.DB.QueryRow()") (path . "database/sql/index#DB.QueryRow") (type . "database")) ((name . "sql.DB.QueryRowContext()") (path . "database/sql/index#DB.QueryRowContext") (type . "database")) ((name . "sql.DB.SetConnMaxIdleTime()") (path . "database/sql/index#DB.SetConnMaxIdleTime") (type . "database")) ((name . "sql.DB.SetConnMaxLifetime()") (path . "database/sql/index#DB.SetConnMaxLifetime") (type . "database")) ((name . "sql.DB.SetMaxIdleConns()") (path . "database/sql/index#DB.SetMaxIdleConns") (type . "database")) ((name . "sql.DB.SetMaxOpenConns()") (path . "database/sql/index#DB.SetMaxOpenConns") (type . "database")) ((name . "sql.DB.Stats()") (path . "database/sql/index#DB.Stats") (type . "database")) ((name . "sql.DBStats") (path . "database/sql/index#DBStats") (type . "database")) ((name . "sql.Drivers()") (path . "database/sql/index#Drivers") (type . "database")) ((name . "sql.IsolationLevel") (path . "database/sql/index#IsolationLevel") (type . "database")) ((name . "sql.IsolationLevel.String()") (path . "database/sql/index#IsolationLevel.String") (type . "database")) ((name . "sql.Named()") (path . "database/sql/index#Named") (type . "database")) ((name . "sql.NamedArg") (path . "database/sql/index#NamedArg") (type . "database")) ((name . "sql.Null") (path . "database/sql/index#Null") (type . "database")) ((name . "sql.Null.Scan()") (path . "database/sql/index#Null.Scan") (type . "database")) ((name . "sql.Null.Value()") (path . "database/sql/index#Null.Value") (type . "database")) ((name . "sql.NullBool") (path . "database/sql/index#NullBool") (type . "database")) ((name . "sql.NullBool.Scan()") (path . "database/sql/index#NullBool.Scan") (type . "database")) ((name . "sql.NullBool.Value()") (path . "database/sql/index#NullBool.Value") (type . "database")) ((name . "sql.NullByte") (path . "database/sql/index#NullByte") (type . "database")) ((name . "sql.NullByte.Scan()") (path . "database/sql/index#NullByte.Scan") (type . "database")) ((name . "sql.NullByte.Value()") (path . "database/sql/index#NullByte.Value") (type . "database")) ((name . "sql.NullFloat64") (path . "database/sql/index#NullFloat64") (type . "database")) ((name . "sql.NullFloat64.Scan()") (path . "database/sql/index#NullFloat64.Scan") (type . "database")) ((name . "sql.NullFloat64.Value()") (path . "database/sql/index#NullFloat64.Value") (type . "database")) ((name . "sql.NullInt16") (path . "database/sql/index#NullInt16") (type . "database")) ((name . "sql.NullInt16.Scan()") (path . "database/sql/index#NullInt16.Scan") (type . "database")) ((name . "sql.NullInt16.Value()") (path . "database/sql/index#NullInt16.Value") (type . "database")) ((name . "sql.NullInt32") (path . "database/sql/index#NullInt32") (type . "database")) ((name . "sql.NullInt32.Scan()") (path . "database/sql/index#NullInt32.Scan") (type . "database")) ((name . "sql.NullInt32.Value()") (path . "database/sql/index#NullInt32.Value") (type . "database")) ((name . "sql.NullInt64") (path . "database/sql/index#NullInt64") (type . "database")) ((name . "sql.NullInt64.Scan()") (path . "database/sql/index#NullInt64.Scan") (type . "database")) ((name . "sql.NullInt64.Value()") (path . "database/sql/index#NullInt64.Value") (type . "database")) ((name . "sql.NullString") (path . "database/sql/index#NullString") (type . "database")) ((name . "sql.NullString.Scan()") (path . "database/sql/index#NullString.Scan") (type . "database")) ((name . "sql.NullString.Value()") (path . "database/sql/index#NullString.Value") (type . "database")) ((name . "sql.NullTime") (path . "database/sql/index#NullTime") (type . "database")) ((name . "sql.NullTime.Scan()") (path . "database/sql/index#NullTime.Scan") (type . "database")) ((name . "sql.NullTime.Value()") (path . "database/sql/index#NullTime.Value") (type . "database")) ((name . "sql.Open()") (path . "database/sql/index#Open") (type . "database")) ((name . "sql.OpenDB()") (path . "database/sql/index#OpenDB") (type . "database")) ((name . "sql.Out") (path . "database/sql/index#Out") (type . "database")) ((name . "sql.RawBytes") (path . "database/sql/index#RawBytes") (type . "database")) ((name . "sql.Register()") (path . "database/sql/index#Register") (type . "database")) ((name . "sql.Result") (path . "database/sql/index#Result") (type . "database")) ((name . "sql.Row") (path . "database/sql/index#Row") (type . "database")) ((name . "sql.Row.Err()") (path . "database/sql/index#Row.Err") (type . "database")) ((name . "sql.Row.Scan()") (path . "database/sql/index#Row.Scan") (type . "database")) ((name . "sql.Rows") (path . "database/sql/index#Rows") (type . "database")) ((name . "sql.Rows.Close()") (path . "database/sql/index#Rows.Close") (type . "database")) ((name . "sql.Rows.Columns()") (path . "database/sql/index#Rows.Columns") (type . "database")) ((name . "sql.Rows.ColumnTypes()") (path . "database/sql/index#Rows.ColumnTypes") (type . "database")) ((name . "sql.Rows.Err()") (path . "database/sql/index#Rows.Err") (type . "database")) ((name . "sql.Rows.Next()") (path . "database/sql/index#Rows.Next") (type . "database")) ((name . "sql.Rows.NextResultSet()") (path . "database/sql/index#Rows.NextResultSet") (type . "database")) ((name . "sql.Rows.Scan()") (path . "database/sql/index#Rows.Scan") (type . "database")) ((name . "sql.Scanner") (path . "database/sql/index#Scanner") (type . "database")) ((name . "sql.Stmt") (path . "database/sql/index#Stmt") (type . "database")) ((name . "sql.Stmt.Close()") (path . "database/sql/index#Stmt.Close") (type . "database")) ((name . "sql.Stmt.Exec()") (path . "database/sql/index#Stmt.Exec") (type . "database")) ((name . "sql.Stmt.ExecContext()") (path . "database/sql/index#Stmt.ExecContext") (type . "database")) ((name . "sql.Stmt.Query()") (path . "database/sql/index#Stmt.Query") (type . "database")) ((name . "sql.Stmt.QueryContext()") (path . "database/sql/index#Stmt.QueryContext") (type . "database")) ((name . "sql.Stmt.QueryRow()") (path . "database/sql/index#Stmt.QueryRow") (type . "database")) ((name . "sql.Stmt.QueryRowContext()") (path . "database/sql/index#Stmt.QueryRowContext") (type . "database")) ((name . "sql.Tx") (path . "database/sql/index#Tx") (type . "database")) ((name . "sql.Tx.Commit()") (path . "database/sql/index#Tx.Commit") (type . "database")) ((name . "sql.Tx.Exec()") (path . "database/sql/index#Tx.Exec") (type . "database")) ((name . "sql.Tx.ExecContext()") (path . "database/sql/index#Tx.ExecContext") (type . "database")) ((name . "sql.Tx.Prepare()") (path . "database/sql/index#Tx.Prepare") (type . "database")) ((name . "sql.Tx.PrepareContext()") (path . "database/sql/index#Tx.PrepareContext") (type . "database")) ((name . "sql.Tx.Query()") (path . "database/sql/index#Tx.Query") (type . "database")) ((name . "sql.Tx.QueryContext()") (path . "database/sql/index#Tx.QueryContext") (type . "database")) ((name . "sql.Tx.QueryRow()") (path . "database/sql/index#Tx.QueryRow") (type . "database")) ((name . "sql.Tx.QueryRowContext()") (path . "database/sql/index#Tx.QueryRowContext") (type . "database")) ((name . "sql.Tx.Rollback()") (path . "database/sql/index#Tx.Rollback") (type . "database")) ((name . "sql.Tx.Stmt()") (path . "database/sql/index#Tx.Stmt") (type . "database")) ((name . "sql.Tx.StmtContext()") (path . "database/sql/index#Tx.StmtContext") (type . "database")) ((name . "sql.TxOptions") (path . "database/sql/index#TxOptions") (type . "database")) ((name . "strconv") (path . "strconv/index") (type . "strconv")) ((name . "strconv constants") (path . "strconv/index#pkg-constants") (type . "strconv")) ((name . "strconv variables") (path . "strconv/index#pkg-variables") (type . "strconv")) ((name . "strconv.AppendBool()") (path . "strconv/index#AppendBool") (type . "strconv")) ((name . "strconv.AppendFloat()") (path . "strconv/index#AppendFloat") (type . "strconv")) ((name . "strconv.AppendInt()") (path . "strconv/index#AppendInt") (type . "strconv")) ((name . "strconv.AppendQuote()") (path . "strconv/index#AppendQuote") (type . "strconv")) ((name . "strconv.AppendQuoteRune()") (path . "strconv/index#AppendQuoteRune") (type . "strconv")) ((name . "strconv.AppendQuoteRuneToASCII()") (path . "strconv/index#AppendQuoteRuneToASCII") (type . "strconv")) ((name . "strconv.AppendQuoteRuneToGraphic()") (path . "strconv/index#AppendQuoteRuneToGraphic") (type . "strconv")) ((name . "strconv.AppendQuoteToASCII()") (path . "strconv/index#AppendQuoteToASCII") (type . "strconv")) ((name . "strconv.AppendQuoteToGraphic()") (path . "strconv/index#AppendQuoteToGraphic") (type . "strconv")) ((name . "strconv.AppendUint()") (path . "strconv/index#AppendUint") (type . "strconv")) ((name . "strconv.Atoi()") (path . "strconv/index#Atoi") (type . "strconv")) ((name . "strconv.CanBackquote()") (path . "strconv/index#CanBackquote") (type . "strconv")) ((name . "strconv.FormatBool()") (path . "strconv/index#FormatBool") (type . "strconv")) ((name . "strconv.FormatComplex()") (path . "strconv/index#FormatComplex") (type . "strconv")) ((name . "strconv.FormatFloat()") (path . "strconv/index#FormatFloat") (type . "strconv")) ((name . "strconv.FormatInt()") (path . "strconv/index#FormatInt") (type . "strconv")) ((name . "strconv.FormatUint()") (path . "strconv/index#FormatUint") (type . "strconv")) ((name . "strconv.IsGraphic()") (path . "strconv/index#IsGraphic") (type . "strconv")) ((name . "strconv.IsPrint()") (path . "strconv/index#IsPrint") (type . "strconv")) ((name . "strconv.Itoa()") (path . "strconv/index#Itoa") (type . "strconv")) ((name . "strconv.NumError") (path . "strconv/index#NumError") (type . "strconv")) ((name . "strconv.NumError.Error()") (path . "strconv/index#NumError.Error") (type . "strconv")) ((name . "strconv.NumError.Unwrap()") (path . "strconv/index#NumError.Unwrap") (type . "strconv")) ((name . "strconv.ParseBool()") (path . "strconv/index#ParseBool") (type . "strconv")) ((name . "strconv.ParseComplex()") (path . "strconv/index#ParseComplex") (type . "strconv")) ((name . "strconv.ParseFloat()") (path . "strconv/index#ParseFloat") (type . "strconv")) ((name . "strconv.ParseInt()") (path . "strconv/index#ParseInt") (type . "strconv")) ((name . "strconv.ParseUint()") (path . "strconv/index#ParseUint") (type . "strconv")) ((name . "strconv.Quote()") (path . "strconv/index#Quote") (type . "strconv")) ((name . "strconv.QuotedPrefix()") (path . "strconv/index#QuotedPrefix") (type . "strconv")) ((name . "strconv.QuoteRune()") (path . "strconv/index#QuoteRune") (type . "strconv")) ((name . "strconv.QuoteRuneToASCII()") (path . "strconv/index#QuoteRuneToASCII") (type . "strconv")) ((name . "strconv.QuoteRuneToGraphic()") (path . "strconv/index#QuoteRuneToGraphic") (type . "strconv")) ((name . "strconv.QuoteToASCII()") (path . "strconv/index#QuoteToASCII") (type . "strconv")) ((name . "strconv.QuoteToGraphic()") (path . "strconv/index#QuoteToGraphic") (type . "strconv")) ((name . "strconv.Unquote()") (path . "strconv/index#Unquote") (type . "strconv")) ((name . "strconv.UnquoteChar()") (path . "strconv/index#UnquoteChar") (type . "strconv")) ((name . "strings") (path . "strings/index") (type . "strings")) ((name . "strings.Builder") (path . "strings/index#Builder") (type . "strings")) ((name . "strings.Builder.Cap()") (path . "strings/index#Builder.Cap") (type . "strings")) ((name . "strings.Builder.Grow()") (path . "strings/index#Builder.Grow") (type . "strings")) ((name . "strings.Builder.Len()") (path . "strings/index#Builder.Len") (type . "strings")) ((name . "strings.Builder.Reset()") (path . "strings/index#Builder.Reset") (type . "strings")) ((name . "strings.Builder.String()") (path . "strings/index#Builder.String") (type . "strings")) ((name . "strings.Builder.Write()") (path . "strings/index#Builder.Write") (type . "strings")) ((name . "strings.Builder.WriteByte()") (path . "strings/index#Builder.WriteByte") (type . "strings")) ((name . "strings.Builder.WriteRune()") (path . "strings/index#Builder.WriteRune") (type . "strings")) ((name . "strings.Builder.WriteString()") (path . "strings/index#Builder.WriteString") (type . "strings")) ((name . "strings.Clone()") (path . "strings/index#Clone") (type . "strings")) ((name . "strings.Compare()") (path . "strings/index#Compare") (type . "strings")) ((name . "strings.Contains()") (path . "strings/index#Contains") (type . "strings")) ((name . "strings.ContainsAny()") (path . "strings/index#ContainsAny") (type . "strings")) ((name . "strings.ContainsFunc()") (path . "strings/index#ContainsFunc") (type . "strings")) ((name . "strings.ContainsRune()") (path . "strings/index#ContainsRune") (type . "strings")) ((name . "strings.Count()") (path . "strings/index#Count") (type . "strings")) ((name . "strings.Cut()") (path . "strings/index#Cut") (type . "strings")) ((name . "strings.CutPrefix()") (path . "strings/index#CutPrefix") (type . "strings")) ((name . "strings.CutSuffix()") (path . "strings/index#CutSuffix") (type . "strings")) ((name . "strings.EqualFold()") (path . "strings/index#EqualFold") (type . "strings")) ((name . "strings.Fields()") (path . "strings/index#Fields") (type . "strings")) ((name . "strings.FieldsFunc()") (path . "strings/index#FieldsFunc") (type . "strings")) ((name . "strings.HasPrefix()") (path . "strings/index#HasPrefix") (type . "strings")) ((name . "strings.HasSuffix()") (path . "strings/index#HasSuffix") (type . "strings")) ((name . "strings.Index()") (path . "strings/index#Index") (type . "strings")) ((name . "strings.IndexAny()") (path . "strings/index#IndexAny") (type . "strings")) ((name . "strings.IndexByte()") (path . "strings/index#IndexByte") (type . "strings")) ((name . "strings.IndexFunc()") (path . "strings/index#IndexFunc") (type . "strings")) ((name . "strings.IndexRune()") (path . "strings/index#IndexRune") (type . "strings")) ((name . "strings.Join()") (path . "strings/index#Join") (type . "strings")) ((name . "strings.LastIndex()") (path . "strings/index#LastIndex") (type . "strings")) ((name . "strings.LastIndexAny()") (path . "strings/index#LastIndexAny") (type . "strings")) ((name . "strings.LastIndexByte()") (path . "strings/index#LastIndexByte") (type . "strings")) ((name . "strings.LastIndexFunc()") (path . "strings/index#LastIndexFunc") (type . "strings")) ((name . "strings.Map()") (path . "strings/index#Map") (type . "strings")) ((name . "strings.NewReader()") (path . "strings/index#NewReader") (type . "strings")) ((name . "strings.NewReplacer()") (path . "strings/index#NewReplacer") (type . "strings")) ((name . "strings.Reader") (path . "strings/index#Reader") (type . "strings")) ((name . "strings.Reader.Len()") (path . "strings/index#Reader.Len") (type . "strings")) ((name . "strings.Reader.Read()") (path . "strings/index#Reader.Read") (type . "strings")) ((name . "strings.Reader.ReadAt()") (path . "strings/index#Reader.ReadAt") (type . "strings")) ((name . "strings.Reader.ReadByte()") (path . "strings/index#Reader.ReadByte") (type . "strings")) ((name . "strings.Reader.ReadRune()") (path . "strings/index#Reader.ReadRune") (type . "strings")) ((name . "strings.Reader.Reset()") (path . "strings/index#Reader.Reset") (type . "strings")) ((name . "strings.Reader.Seek()") (path . "strings/index#Reader.Seek") (type . "strings")) ((name . "strings.Reader.Size()") (path . "strings/index#Reader.Size") (type . "strings")) ((name . "strings.Reader.UnreadByte()") (path . "strings/index#Reader.UnreadByte") (type . "strings")) ((name . "strings.Reader.UnreadRune()") (path . "strings/index#Reader.UnreadRune") (type . "strings")) ((name . "strings.Reader.WriteTo()") (path . "strings/index#Reader.WriteTo") (type . "strings")) ((name . "strings.Repeat()") (path . "strings/index#Repeat") (type . "strings")) ((name . "strings.Replace()") (path . "strings/index#Replace") (type . "strings")) ((name . "strings.ReplaceAll()") (path . "strings/index#ReplaceAll") (type . "strings")) ((name . "strings.Replacer") (path . "strings/index#Replacer") (type . "strings")) ((name . "strings.Replacer.Replace()") (path . "strings/index#Replacer.Replace") (type . "strings")) ((name . "strings.Replacer.WriteString()") (path . "strings/index#Replacer.WriteString") (type . "strings")) ((name . "strings.Split()") (path . "strings/index#Split") (type . "strings")) ((name . "strings.SplitAfter()") (path . "strings/index#SplitAfter") (type . "strings")) ((name . "strings.SplitAfterN()") (path . "strings/index#SplitAfterN") (type . "strings")) ((name . "strings.SplitN()") (path . "strings/index#SplitN") (type . "strings")) ((name . "strings.Title()") (path . "strings/index#Title") (type . "strings")) ((name . "strings.ToLower()") (path . "strings/index#ToLower") (type . "strings")) ((name . "strings.ToLowerSpecial()") (path . "strings/index#ToLowerSpecial") (type . "strings")) ((name . "strings.ToTitle()") (path . "strings/index#ToTitle") (type . "strings")) ((name . "strings.ToTitleSpecial()") (path . "strings/index#ToTitleSpecial") (type . "strings")) ((name . "strings.ToUpper()") (path . "strings/index#ToUpper") (type . "strings")) ((name . "strings.ToUpperSpecial()") (path . "strings/index#ToUpperSpecial") (type . "strings")) ((name . "strings.ToValidUTF8()") (path . "strings/index#ToValidUTF8") (type . "strings")) ((name . "strings.Trim()") (path . "strings/index#Trim") (type . "strings")) ((name . "strings.TrimFunc()") (path . "strings/index#TrimFunc") (type . "strings")) ((name . "strings.TrimLeft()") (path . "strings/index#TrimLeft") (type . "strings")) ((name . "strings.TrimLeftFunc()") (path . "strings/index#TrimLeftFunc") (type . "strings")) ((name . "strings.TrimPrefix()") (path . "strings/index#TrimPrefix") (type . "strings")) ((name . "strings.TrimRight()") (path . "strings/index#TrimRight") (type . "strings")) ((name . "strings.TrimRightFunc()") (path . "strings/index#TrimRightFunc") (type . "strings")) ((name . "strings.TrimSpace()") (path . "strings/index#TrimSpace") (type . "strings")) ((name . "strings.TrimSuffix()") (path . "strings/index#TrimSuffix") (type . "strings")) ((name . "subtle.ConstantTimeByteEq()") (path . "crypto/subtle/index#ConstantTimeByteEq") (type . "crypto")) ((name . "subtle.ConstantTimeCompare()") (path . "crypto/subtle/index#ConstantTimeCompare") (type . "crypto")) ((name . "subtle.ConstantTimeCopy()") (path . "crypto/subtle/index#ConstantTimeCopy") (type . "crypto")) ((name . "subtle.ConstantTimeEq()") (path . "crypto/subtle/index#ConstantTimeEq") (type . "crypto")) ((name . "subtle.ConstantTimeLessOrEq()") (path . "crypto/subtle/index#ConstantTimeLessOrEq") (type . "crypto")) ((name . "subtle.ConstantTimeSelect()") (path . "crypto/subtle/index#ConstantTimeSelect") (type . "crypto")) ((name . "subtle.XORBytes()") (path . "crypto/subtle/index#XORBytes") (type . "crypto")) ((name . "suffixarray.Index") (path . "index/suffixarray/index#Index") (type . "index")) ((name . "suffixarray.Index.Bytes()") (path . "index/suffixarray/index#Index.Bytes") (type . "index")) ((name . "suffixarray.Index.FindAllIndex()") (path . "index/suffixarray/index#Index.FindAllIndex") (type . "index")) ((name . "suffixarray.Index.Lookup()") (path . "index/suffixarray/index#Index.Lookup") (type . "index")) ((name . "suffixarray.Index.Read()") (path . "index/suffixarray/index#Index.Read") (type . "index")) ((name . "suffixarray.Index.Write()") (path . "index/suffixarray/index#Index.Write") (type . "index")) ((name . "suffixarray.New()") (path . "index/suffixarray/index#New") (type . "index")) ((name . "sync") (path . "sync/index") (type . "sync")) ((name . "sync.Cond") (path . "sync/index#Cond") (type . "sync")) ((name . "sync.Cond.Broadcast()") (path . "sync/index#Cond.Broadcast") (type . "sync")) ((name . "sync.Cond.Signal()") (path . "sync/index#Cond.Signal") (type . "sync")) ((name . "sync.Cond.Wait()") (path . "sync/index#Cond.Wait") (type . "sync")) ((name . "sync.Locker") (path . "sync/index#Locker") (type . "sync")) ((name . "sync.Map") (path . "sync/index#Map") (type . "sync")) ((name . "sync.Map.CompareAndDelete()") (path . "sync/index#Map.CompareAndDelete") (type . "sync")) ((name . "sync.Map.CompareAndSwap()") (path . "sync/index#Map.CompareAndSwap") (type . "sync")) ((name . "sync.Map.Delete()") (path . "sync/index#Map.Delete") (type . "sync")) ((name . "sync.Map.Load()") (path . "sync/index#Map.Load") (type . "sync")) ((name . "sync.Map.LoadAndDelete()") (path . "sync/index#Map.LoadAndDelete") (type . "sync")) ((name . "sync.Map.LoadOrStore()") (path . "sync/index#Map.LoadOrStore") (type . "sync")) ((name . "sync.Map.Range()") (path . "sync/index#Map.Range") (type . "sync")) ((name . "sync.Map.Store()") (path . "sync/index#Map.Store") (type . "sync")) ((name . "sync.Map.Swap()") (path . "sync/index#Map.Swap") (type . "sync")) ((name . "sync.Mutex") (path . "sync/index#Mutex") (type . "sync")) ((name . "sync.Mutex.Lock()") (path . "sync/index#Mutex.Lock") (type . "sync")) ((name . "sync.Mutex.TryLock()") (path . "sync/index#Mutex.TryLock") (type . "sync")) ((name . "sync.Mutex.Unlock()") (path . "sync/index#Mutex.Unlock") (type . "sync")) ((name . "sync.NewCond()") (path . "sync/index#NewCond") (type . "sync")) ((name . "sync.Once") (path . "sync/index#Once") (type . "sync")) ((name . "sync.Once.Do()") (path . "sync/index#Once.Do") (type . "sync")) ((name . "sync.OnceFunc()") (path . "sync/index#OnceFunc") (type . "sync")) ((name . "sync.OnceValue()") (path . "sync/index#OnceValue") (type . "sync")) ((name . "sync.OnceValues()") (path . "sync/index#OnceValues") (type . "sync")) ((name . "sync.Pool") (path . "sync/index#Pool") (type . "sync")) ((name . "sync.Pool.Get()") (path . "sync/index#Pool.Get") (type . "sync")) ((name . "sync.Pool.Put()") (path . "sync/index#Pool.Put") (type . "sync")) ((name . "sync.RWMutex") (path . "sync/index#RWMutex") (type . "sync")) ((name . "sync.RWMutex.Lock()") (path . "sync/index#RWMutex.Lock") (type . "sync")) ((name . "sync.RWMutex.RLock()") (path . "sync/index#RWMutex.RLock") (type . "sync")) ((name . "sync.RWMutex.RLocker()") (path . "sync/index#RWMutex.RLocker") (type . "sync")) ((name . "sync.RWMutex.RUnlock()") (path . "sync/index#RWMutex.RUnlock") (type . "sync")) ((name . "sync.RWMutex.TryLock()") (path . "sync/index#RWMutex.TryLock") (type . "sync")) ((name . "sync.RWMutex.TryRLock()") (path . "sync/index#RWMutex.TryRLock") (type . "sync")) ((name . "sync.RWMutex.Unlock()") (path . "sync/index#RWMutex.Unlock") (type . "sync")) ((name . "sync.WaitGroup") (path . "sync/index#WaitGroup") (type . "sync")) ((name . "sync.WaitGroup.Add()") (path . "sync/index#WaitGroup.Add") (type . "sync")) ((name . "sync.WaitGroup.Done()") (path . "sync/index#WaitGroup.Done") (type . "sync")) ((name . "sync.WaitGroup.Wait()") (path . "sync/index#WaitGroup.Wait") (type . "sync")) ((name . "sync/atomic") (path . "sync/atomic/index") (type . "sync")) ((name . "syntax.Compile()") (path . "regexp/syntax/index#Compile") (type . "regexp")) ((name . "syntax.EmptyOp") (path . "regexp/syntax/index#EmptyOp") (type . "regexp")) ((name . "syntax.EmptyOpContext()") (path . "regexp/syntax/index#EmptyOpContext") (type . "regexp")) ((name . "syntax.Error") (path . "regexp/syntax/index#Error") (type . "regexp")) ((name . "syntax.Error.Error()") (path . "regexp/syntax/index#Error.Error") (type . "regexp")) ((name . "syntax.ErrorCode") (path . "regexp/syntax/index#ErrorCode") (type . "regexp")) ((name . "syntax.ErrorCode.String()") (path . "regexp/syntax/index#ErrorCode.String") (type . "regexp")) ((name . "syntax.Flags") (path . "regexp/syntax/index#Flags") (type . "regexp")) ((name . "syntax.Inst") (path . "regexp/syntax/index#Inst") (type . "regexp")) ((name . "syntax.Inst.MatchEmptyWidth()") (path . "regexp/syntax/index#Inst.MatchEmptyWidth") (type . "regexp")) ((name . "syntax.Inst.MatchRune()") (path . "regexp/syntax/index#Inst.MatchRune") (type . "regexp")) ((name . "syntax.Inst.MatchRunePos()") (path . "regexp/syntax/index#Inst.MatchRunePos") (type . "regexp")) ((name . "syntax.Inst.String()") (path . "regexp/syntax/index#Inst.String") (type . "regexp")) ((name . "syntax.InstOp") (path . "regexp/syntax/index#InstOp") (type . "regexp")) ((name . "syntax.InstOp.String()") (path . "regexp/syntax/index#InstOp.String") (type . "regexp")) ((name . "syntax.IsWordChar()") (path . "regexp/syntax/index#IsWordChar") (type . "regexp")) ((name . "syntax.Op") (path . "regexp/syntax/index#Op") (type . "regexp")) ((name . "syntax.Op.String()") (path . "regexp/syntax/index#Op.String") (type . "regexp")) ((name . "syntax.Parse()") (path . "regexp/syntax/index#Parse") (type . "regexp")) ((name . "syntax.Prog") (path . "regexp/syntax/index#Prog") (type . "regexp")) ((name . "syntax.Prog.Prefix()") (path . "regexp/syntax/index#Prog.Prefix") (type . "regexp")) ((name . "syntax.Prog.StartCond()") (path . "regexp/syntax/index#Prog.StartCond") (type . "regexp")) ((name . "syntax.Prog.String()") (path . "regexp/syntax/index#Prog.String") (type . "regexp")) ((name . "syntax.Regexp") (path . "regexp/syntax/index#Regexp") (type . "regexp")) ((name . "syntax.Regexp.CapNames()") (path . "regexp/syntax/index#Regexp.CapNames") (type . "regexp")) ((name . "syntax.Regexp.Equal()") (path . "regexp/syntax/index#Regexp.Equal") (type . "regexp")) ((name . "syntax.Regexp.MaxCap()") (path . "regexp/syntax/index#Regexp.MaxCap") (type . "regexp")) ((name . "syntax.Regexp.Simplify()") (path . "regexp/syntax/index#Regexp.Simplify") (type . "regexp")) ((name . "syntax.Regexp.String()") (path . "regexp/syntax/index#Regexp.String") (type . "regexp")) ((name . "syscall") (path . "syscall/index") (type . "syscall")) ((name . "syscall constants") (path . "syscall/index#pkg-constants") (type . "syscall")) ((name . "syscall variables") (path . "syscall/index#pkg-variables") (type . "syscall")) ((name . "syscall.Accept()") (path . "syscall/index#Accept") (type . "syscall")) ((name . "syscall.Accept4()") (path . "syscall/index#Accept4") (type . "syscall")) ((name . "syscall.Access()") (path . "syscall/index#Access") (type . "syscall")) ((name . "syscall.Acct()") (path . "syscall/index#Acct") (type . "syscall")) ((name . "syscall.Adjtimex()") (path . "syscall/index#Adjtimex") (type . "syscall")) ((name . "syscall.AllThreadsSyscall()") (path . "syscall/index#AllThreadsSyscall") (type . "syscall")) ((name . "syscall.AllThreadsSyscall6()") (path . "syscall/index#AllThreadsSyscall6") (type . "syscall")) ((name . "syscall.AttachLsf()") (path . "syscall/index#AttachLsf") (type . "syscall")) ((name . "syscall.Bind()") (path . "syscall/index#Bind") (type . "syscall")) ((name . "syscall.BindToDevice()") (path . "syscall/index#BindToDevice") (type . "syscall")) ((name . "syscall.BytePtrFromString()") (path . "syscall/index#BytePtrFromString") (type . "syscall")) ((name . "syscall.ByteSliceFromString()") (path . "syscall/index#ByteSliceFromString") (type . "syscall")) ((name . "syscall.Chdir()") (path . "syscall/index#Chdir") (type . "syscall")) ((name . "syscall.Chmod()") (path . "syscall/index#Chmod") (type . "syscall")) ((name . "syscall.Chown()") (path . "syscall/index#Chown") (type . "syscall")) ((name . "syscall.Chroot()") (path . "syscall/index#Chroot") (type . "syscall")) ((name . "syscall.Clearenv()") (path . "syscall/index#Clearenv") (type . "syscall")) ((name . "syscall.Close()") (path . "syscall/index#Close") (type . "syscall")) ((name . "syscall.CloseOnExec()") (path . "syscall/index#CloseOnExec") (type . "syscall")) ((name . "syscall.Cmsghdr") (path . "syscall/index#Cmsghdr") (type . "syscall")) ((name . "syscall.Cmsghdr.SetLen()") (path . "syscall/index#Cmsghdr.SetLen") (type . "syscall")) ((name . "syscall.CmsgLen()") (path . "syscall/index#CmsgLen") (type . "syscall")) ((name . "syscall.CmsgSpace()") (path . "syscall/index#CmsgSpace") (type . "syscall")) ((name . "syscall.Conn") (path . "syscall/index#Conn") (type . "syscall")) ((name . "syscall.Connect()") (path . "syscall/index#Connect") (type . "syscall")) ((name . "syscall.Creat()") (path . "syscall/index#Creat") (type . "syscall")) ((name . "syscall.Credential") (path . "syscall/index#Credential") (type . "syscall")) ((name . "syscall.DetachLsf()") (path . "syscall/index#DetachLsf") (type . "syscall")) ((name . "syscall.Dirent") (path . "syscall/index#Dirent") (type . "syscall")) ((name . "syscall.Dup()") (path . "syscall/index#Dup") (type . "syscall")) ((name . "syscall.Dup2()") (path . "syscall/index#Dup2") (type . "syscall")) ((name . "syscall.Dup3()") (path . "syscall/index#Dup3") (type . "syscall")) ((name . "syscall.Environ()") (path . "syscall/index#Environ") (type . "syscall")) ((name . "syscall.EpollCreate()") (path . "syscall/index#EpollCreate") (type . "syscall")) ((name . "syscall.EpollCreate1()") (path . "syscall/index#EpollCreate1") (type . "syscall")) ((name . "syscall.EpollCtl()") (path . "syscall/index#EpollCtl") (type . "syscall")) ((name . "syscall.EpollEvent") (path . "syscall/index#EpollEvent") (type . "syscall")) ((name . "syscall.EpollWait()") (path . "syscall/index#EpollWait") (type . "syscall")) ((name . "syscall.Errno") (path . "syscall/index#Errno") (type . "syscall")) ((name . "syscall.Errno.Error()") (path . "syscall/index#Errno.Error") (type . "syscall")) ((name . "syscall.Errno.Is()") (path . "syscall/index#Errno.Is") (type . "syscall")) ((name . "syscall.Errno.Temporary()") (path . "syscall/index#Errno.Temporary") (type . "syscall")) ((name . "syscall.Errno.Timeout()") (path . "syscall/index#Errno.Timeout") (type . "syscall")) ((name . "syscall.Exec()") (path . "syscall/index#Exec") (type . "syscall")) ((name . "syscall.Exit()") (path . "syscall/index#Exit") (type . "syscall")) ((name . "syscall.Faccessat()") (path . "syscall/index#Faccessat") (type . "syscall")) ((name . "syscall.Fallocate()") (path . "syscall/index#Fallocate") (type . "syscall")) ((name . "syscall.Fchdir()") (path . "syscall/index#Fchdir") (type . "syscall")) ((name . "syscall.Fchmod()") (path . "syscall/index#Fchmod") (type . "syscall")) ((name . "syscall.Fchmodat()") (path . "syscall/index#Fchmodat") (type . "syscall")) ((name . "syscall.Fchown()") (path . "syscall/index#Fchown") (type . "syscall")) ((name . "syscall.Fchownat()") (path . "syscall/index#Fchownat") (type . "syscall")) ((name . "syscall.FcntlFlock()") (path . "syscall/index#FcntlFlock") (type . "syscall")) ((name . "syscall.Fdatasync()") (path . "syscall/index#Fdatasync") (type . "syscall")) ((name . "syscall.FdSet") (path . "syscall/index#FdSet") (type . "syscall")) ((name . "syscall.Flock()") (path . "syscall/index#Flock") (type . "syscall")) ((name . "syscall.Flock_t") (path . "syscall/index#Flock_t") (type . "syscall")) ((name . "syscall.ForkExec()") (path . "syscall/index#ForkExec") (type . "syscall")) ((name . "syscall.Fsid") (path . "syscall/index#Fsid") (type . "syscall")) ((name . "syscall.Fstat()") (path . "syscall/index#Fstat") (type . "syscall")) ((name . "syscall.Fstatfs()") (path . "syscall/index#Fstatfs") (type . "syscall")) ((name . "syscall.Fsync()") (path . "syscall/index#Fsync") (type . "syscall")) ((name . "syscall.Ftruncate()") (path . "syscall/index#Ftruncate") (type . "syscall")) ((name . "syscall.Futimes()") (path . "syscall/index#Futimes") (type . "syscall")) ((name . "syscall.Futimesat()") (path . "syscall/index#Futimesat") (type . "syscall")) ((name . "syscall.Getcwd()") (path . "syscall/index#Getcwd") (type . "syscall")) ((name . "syscall.Getdents()") (path . "syscall/index#Getdents") (type . "syscall")) ((name . "syscall.Getegid()") (path . "syscall/index#Getegid") (type . "syscall")) ((name . "syscall.Getenv()") (path . "syscall/index#Getenv") (type . "syscall")) ((name . "syscall.Geteuid()") (path . "syscall/index#Geteuid") (type . "syscall")) ((name . "syscall.Getgid()") (path . "syscall/index#Getgid") (type . "syscall")) ((name . "syscall.Getgroups()") (path . "syscall/index#Getgroups") (type . "syscall")) ((name . "syscall.Getpagesize()") (path . "syscall/index#Getpagesize") (type . "syscall")) ((name . "syscall.Getpeername()") (path . "syscall/index#Getpeername") (type . "syscall")) ((name . "syscall.Getpgid()") (path . "syscall/index#Getpgid") (type . "syscall")) ((name . "syscall.Getpgrp()") (path . "syscall/index#Getpgrp") (type . "syscall")) ((name . "syscall.Getpid()") (path . "syscall/index#Getpid") (type . "syscall")) ((name . "syscall.Getppid()") (path . "syscall/index#Getppid") (type . "syscall")) ((name . "syscall.Getpriority()") (path . "syscall/index#Getpriority") (type . "syscall")) ((name . "syscall.Getrlimit()") (path . "syscall/index#Getrlimit") (type . "syscall")) ((name . "syscall.Getrusage()") (path . "syscall/index#Getrusage") (type . "syscall")) ((name . "syscall.Getsockname()") (path . "syscall/index#Getsockname") (type . "syscall")) ((name . "syscall.GetsockoptICMPv6Filter()") (path . "syscall/index#GetsockoptICMPv6Filter") (type . "syscall")) ((name . "syscall.GetsockoptInet4Addr()") (path . "syscall/index#GetsockoptInet4Addr") (type . "syscall")) ((name . "syscall.GetsockoptInt()") (path . "syscall/index#GetsockoptInt") (type . "syscall")) ((name . "syscall.GetsockoptIPMreq()") (path . "syscall/index#GetsockoptIPMreq") (type . "syscall")) ((name . "syscall.GetsockoptIPMreqn()") (path . "syscall/index#GetsockoptIPMreqn") (type . "syscall")) ((name . "syscall.GetsockoptIPv6Mreq()") (path . "syscall/index#GetsockoptIPv6Mreq") (type . "syscall")) ((name . "syscall.GetsockoptIPv6MTUInfo()") (path . "syscall/index#GetsockoptIPv6MTUInfo") (type . "syscall")) ((name . "syscall.GetsockoptUcred()") (path . "syscall/index#GetsockoptUcred") (type . "syscall")) ((name . "syscall.Gettid()") (path . "syscall/index#Gettid") (type . "syscall")) ((name . "syscall.Gettimeofday()") (path . "syscall/index#Gettimeofday") (type . "syscall")) ((name . "syscall.Getuid()") (path . "syscall/index#Getuid") (type . "syscall")) ((name . "syscall.Getwd()") (path . "syscall/index#Getwd") (type . "syscall")) ((name . "syscall.Getxattr()") (path . "syscall/index#Getxattr") (type . "syscall")) ((name . "syscall.ICMPv6Filter") (path . "syscall/index#ICMPv6Filter") (type . "syscall")) ((name . "syscall.IfAddrmsg") (path . "syscall/index#IfAddrmsg") (type . "syscall")) ((name . "syscall.IfInfomsg") (path . "syscall/index#IfInfomsg") (type . "syscall")) ((name . "syscall.Inet4Pktinfo") (path . "syscall/index#Inet4Pktinfo") (type . "syscall")) ((name . "syscall.Inet6Pktinfo") (path . "syscall/index#Inet6Pktinfo") (type . "syscall")) ((name . "syscall.InotifyAddWatch()") (path . "syscall/index#InotifyAddWatch") (type . "syscall")) ((name . "syscall.InotifyEvent") (path . "syscall/index#InotifyEvent") (type . "syscall")) ((name . "syscall.InotifyInit()") (path . "syscall/index#InotifyInit") (type . "syscall")) ((name . "syscall.InotifyInit1()") (path . "syscall/index#InotifyInit1") (type . "syscall")) ((name . "syscall.InotifyRmWatch()") (path . "syscall/index#InotifyRmWatch") (type . "syscall")) ((name . "syscall.Ioperm()") (path . "syscall/index#Ioperm") (type . "syscall")) ((name . "syscall.Iopl()") (path . "syscall/index#Iopl") (type . "syscall")) ((name . "syscall.Iovec") (path . "syscall/index#Iovec") (type . "syscall")) ((name . "syscall.Iovec.SetLen()") (path . "syscall/index#Iovec.SetLen") (type . "syscall")) ((name . "syscall.IPMreq") (path . "syscall/index#IPMreq") (type . "syscall")) ((name . "syscall.IPMreqn") (path . "syscall/index#IPMreqn") (type . "syscall")) ((name . "syscall.IPv6Mreq") (path . "syscall/index#IPv6Mreq") (type . "syscall")) ((name . "syscall.IPv6MTUInfo") (path . "syscall/index#IPv6MTUInfo") (type . "syscall")) ((name . "syscall.Kill()") (path . "syscall/index#Kill") (type . "syscall")) ((name . "syscall.Klogctl()") (path . "syscall/index#Klogctl") (type . "syscall")) ((name . "syscall.Lchown()") (path . "syscall/index#Lchown") (type . "syscall")) ((name . "syscall.Linger") (path . "syscall/index#Linger") (type . "syscall")) ((name . "syscall.Link()") (path . "syscall/index#Link") (type . "syscall")) ((name . "syscall.Listen()") (path . "syscall/index#Listen") (type . "syscall")) ((name . "syscall.Listxattr()") (path . "syscall/index#Listxattr") (type . "syscall")) ((name . "syscall.LsfJump()") (path . "syscall/index#LsfJump") (type . "syscall")) ((name . "syscall.LsfSocket()") (path . "syscall/index#LsfSocket") (type . "syscall")) ((name . "syscall.LsfStmt()") (path . "syscall/index#LsfStmt") (type . "syscall")) ((name . "syscall.Lstat()") (path . "syscall/index#Lstat") (type . "syscall")) ((name . "syscall.Madvise()") (path . "syscall/index#Madvise") (type . "syscall")) ((name . "syscall.Mkdir()") (path . "syscall/index#Mkdir") (type . "syscall")) ((name . "syscall.Mkdirat()") (path . "syscall/index#Mkdirat") (type . "syscall")) ((name . "syscall.Mkfifo()") (path . "syscall/index#Mkfifo") (type . "syscall")) ((name . "syscall.Mknod()") (path . "syscall/index#Mknod") (type . "syscall")) ((name . "syscall.Mknodat()") (path . "syscall/index#Mknodat") (type . "syscall")) ((name . "syscall.Mlock()") (path . "syscall/index#Mlock") (type . "syscall")) ((name . "syscall.Mlockall()") (path . "syscall/index#Mlockall") (type . "syscall")) ((name . "syscall.Mmap()") (path . "syscall/index#Mmap") (type . "syscall")) ((name . "syscall.Mprotect()") (path . "syscall/index#Mprotect") (type . "syscall")) ((name . "syscall.Msghdr") (path . "syscall/index#Msghdr") (type . "syscall")) ((name . "syscall.Msghdr.SetControllen()") (path . "syscall/index#Msghdr.SetControllen") (type . "syscall")) ((name . "syscall.Munlock()") (path . "syscall/index#Munlock") (type . "syscall")) ((name . "syscall.Munlockall()") (path . "syscall/index#Munlockall") (type . "syscall")) ((name . "syscall.Munmap()") (path . "syscall/index#Munmap") (type . "syscall")) ((name . "syscall.Nanosleep()") (path . "syscall/index#Nanosleep") (type . "syscall")) ((name . "syscall.NetlinkMessage") (path . "syscall/index#NetlinkMessage") (type . "syscall")) ((name . "syscall.NetlinkRIB()") (path . "syscall/index#NetlinkRIB") (type . "syscall")) ((name . "syscall.NetlinkRouteAttr") (path . "syscall/index#NetlinkRouteAttr") (type . "syscall")) ((name . "syscall.NetlinkRouteRequest") (path . "syscall/index#NetlinkRouteRequest") (type . "syscall")) ((name . "syscall.NlAttr") (path . "syscall/index#NlAttr") (type . "syscall")) ((name . "syscall.NlMsgerr") (path . "syscall/index#NlMsgerr") (type . "syscall")) ((name . "syscall.NlMsghdr") (path . "syscall/index#NlMsghdr") (type . "syscall")) ((name . "syscall.NsecToTimespec()") (path . "syscall/index#NsecToTimespec") (type . "syscall")) ((name . "syscall.NsecToTimeval()") (path . "syscall/index#NsecToTimeval") (type . "syscall")) ((name . "syscall.Open()") (path . "syscall/index#Open") (type . "syscall")) ((name . "syscall.Openat()") (path . "syscall/index#Openat") (type . "syscall")) ((name . "syscall.ParseDirent()") (path . "syscall/index#ParseDirent") (type . "syscall")) ((name . "syscall.ParseNetlinkMessage()") (path . "syscall/index#ParseNetlinkMessage") (type . "syscall")) ((name . "syscall.ParseNetlinkRouteAttr()") (path . "syscall/index#ParseNetlinkRouteAttr") (type . "syscall")) ((name . "syscall.ParseSocketControlMessage()") (path . "syscall/index#ParseSocketControlMessage") (type . "syscall")) ((name . "syscall.ParseUnixCredentials()") (path . "syscall/index#ParseUnixCredentials") (type . "syscall")) ((name . "syscall.ParseUnixRights()") (path . "syscall/index#ParseUnixRights") (type . "syscall")) ((name . "syscall.Pause()") (path . "syscall/index#Pause") (type . "syscall")) ((name . "syscall.Pipe()") (path . "syscall/index#Pipe") (type . "syscall")) ((name . "syscall.Pipe2()") (path . "syscall/index#Pipe2") (type . "syscall")) ((name . "syscall.PivotRoot()") (path . "syscall/index#PivotRoot") (type . "syscall")) ((name . "syscall.Pread()") (path . "syscall/index#Pread") (type . "syscall")) ((name . "syscall.ProcAttr") (path . "syscall/index#ProcAttr") (type . "syscall")) ((name . "syscall.PtraceAttach()") (path . "syscall/index#PtraceAttach") (type . "syscall")) ((name . "syscall.PtraceCont()") (path . "syscall/index#PtraceCont") (type . "syscall")) ((name . "syscall.PtraceDetach()") (path . "syscall/index#PtraceDetach") (type . "syscall")) ((name . "syscall.PtraceGetEventMsg()") (path . "syscall/index#PtraceGetEventMsg") (type . "syscall")) ((name . "syscall.PtraceGetRegs()") (path . "syscall/index#PtraceGetRegs") (type . "syscall")) ((name . "syscall.PtracePeekData()") (path . "syscall/index#PtracePeekData") (type . "syscall")) ((name . "syscall.PtracePeekText()") (path . "syscall/index#PtracePeekText") (type . "syscall")) ((name . "syscall.PtracePokeData()") (path . "syscall/index#PtracePokeData") (type . "syscall")) ((name . "syscall.PtracePokeText()") (path . "syscall/index#PtracePokeText") (type . "syscall")) ((name . "syscall.PtraceRegs") (path . "syscall/index#PtraceRegs") (type . "syscall")) ((name . "syscall.PtraceRegs.PC()") (path . "syscall/index#PtraceRegs.PC") (type . "syscall")) ((name . "syscall.PtraceRegs.SetPC()") (path . "syscall/index#PtraceRegs.SetPC") (type . "syscall")) ((name . "syscall.PtraceSetOptions()") (path . "syscall/index#PtraceSetOptions") (type . "syscall")) ((name . "syscall.PtraceSetRegs()") (path . "syscall/index#PtraceSetRegs") (type . "syscall")) ((name . "syscall.PtraceSingleStep()") (path . "syscall/index#PtraceSingleStep") (type . "syscall")) ((name . "syscall.PtraceSyscall()") (path . "syscall/index#PtraceSyscall") (type . "syscall")) ((name . "syscall.Pwrite()") (path . "syscall/index#Pwrite") (type . "syscall")) ((name . "syscall.RawConn") (path . "syscall/index#RawConn") (type . "syscall")) ((name . "syscall.RawSockaddr") (path . "syscall/index#RawSockaddr") (type . "syscall")) ((name . "syscall.RawSockaddrAny") (path . "syscall/index#RawSockaddrAny") (type . "syscall")) ((name . "syscall.RawSockaddrInet4") (path . "syscall/index#RawSockaddrInet4") (type . "syscall")) ((name . "syscall.RawSockaddrInet6") (path . "syscall/index#RawSockaddrInet6") (type . "syscall")) ((name . "syscall.RawSockaddrLinklayer") (path . "syscall/index#RawSockaddrLinklayer") (type . "syscall")) ((name . "syscall.RawSockaddrNetlink") (path . "syscall/index#RawSockaddrNetlink") (type . "syscall")) ((name . "syscall.RawSockaddrUnix") (path . "syscall/index#RawSockaddrUnix") (type . "syscall")) ((name . "syscall.RawSyscall()") (path . "syscall/index#RawSyscall") (type . "syscall")) ((name . "syscall.RawSyscall6()") (path . "syscall/index#RawSyscall6") (type . "syscall")) ((name . "syscall.Read()") (path . "syscall/index#Read") (type . "syscall")) ((name . "syscall.ReadDirent()") (path . "syscall/index#ReadDirent") (type . "syscall")) ((name . "syscall.Readlink()") (path . "syscall/index#Readlink") (type . "syscall")) ((name . "syscall.Reboot()") (path . "syscall/index#Reboot") (type . "syscall")) ((name . "syscall.Recvfrom()") (path . "syscall/index#Recvfrom") (type . "syscall")) ((name . "syscall.Recvmsg()") (path . "syscall/index#Recvmsg") (type . "syscall")) ((name . "syscall.Removexattr()") (path . "syscall/index#Removexattr") (type . "syscall")) ((name . "syscall.Rename()") (path . "syscall/index#Rename") (type . "syscall")) ((name . "syscall.Renameat()") (path . "syscall/index#Renameat") (type . "syscall")) ((name . "syscall.Rlimit") (path . "syscall/index#Rlimit") (type . "syscall")) ((name . "syscall.Rmdir()") (path . "syscall/index#Rmdir") (type . "syscall")) ((name . "syscall.RtAttr") (path . "syscall/index#RtAttr") (type . "syscall")) ((name . "syscall.RtGenmsg") (path . "syscall/index#RtGenmsg") (type . "syscall")) ((name . "syscall.RtMsg") (path . "syscall/index#RtMsg") (type . "syscall")) ((name . "syscall.RtNexthop") (path . "syscall/index#RtNexthop") (type . "syscall")) ((name . "syscall.Rusage") (path . "syscall/index#Rusage") (type . "syscall")) ((name . "syscall.Seek()") (path . "syscall/index#Seek") (type . "syscall")) ((name . "syscall.Select()") (path . "syscall/index#Select") (type . "syscall")) ((name . "syscall.Sendfile()") (path . "syscall/index#Sendfile") (type . "syscall")) ((name . "syscall.Sendmsg()") (path . "syscall/index#Sendmsg") (type . "syscall")) ((name . "syscall.SendmsgN()") (path . "syscall/index#SendmsgN") (type . "syscall")) ((name . "syscall.Sendto()") (path . "syscall/index#Sendto") (type . "syscall")) ((name . "syscall.Setdomainname()") (path . "syscall/index#Setdomainname") (type . "syscall")) ((name . "syscall.Setegid()") (path . "syscall/index#Setegid") (type . "syscall")) ((name . "syscall.Setenv()") (path . "syscall/index#Setenv") (type . "syscall")) ((name . "syscall.Seteuid()") (path . "syscall/index#Seteuid") (type . "syscall")) ((name . "syscall.Setfsgid()") (path . "syscall/index#Setfsgid") (type . "syscall")) ((name . "syscall.Setfsuid()") (path . "syscall/index#Setfsuid") (type . "syscall")) ((name . "syscall.Setgid()") (path . "syscall/index#Setgid") (type . "syscall")) ((name . "syscall.Setgroups()") (path . "syscall/index#Setgroups") (type . "syscall")) ((name . "syscall.Sethostname()") (path . "syscall/index#Sethostname") (type . "syscall")) ((name . "syscall.SetLsfPromisc()") (path . "syscall/index#SetLsfPromisc") (type . "syscall")) ((name . "syscall.SetNonblock()") (path . "syscall/index#SetNonblock") (type . "syscall")) ((name . "syscall.Setpgid()") (path . "syscall/index#Setpgid") (type . "syscall")) ((name . "syscall.Setpriority()") (path . "syscall/index#Setpriority") (type . "syscall")) ((name . "syscall.Setregid()") (path . "syscall/index#Setregid") (type . "syscall")) ((name . "syscall.Setresgid()") (path . "syscall/index#Setresgid") (type . "syscall")) ((name . "syscall.Setresuid()") (path . "syscall/index#Setresuid") (type . "syscall")) ((name . "syscall.Setreuid()") (path . "syscall/index#Setreuid") (type . "syscall")) ((name . "syscall.Setrlimit()") (path . "syscall/index#Setrlimit") (type . "syscall")) ((name . "syscall.Setsid()") (path . "syscall/index#Setsid") (type . "syscall")) ((name . "syscall.SetsockoptByte()") (path . "syscall/index#SetsockoptByte") (type . "syscall")) ((name . "syscall.SetsockoptICMPv6Filter()") (path . "syscall/index#SetsockoptICMPv6Filter") (type . "syscall")) ((name . "syscall.SetsockoptInet4Addr()") (path . "syscall/index#SetsockoptInet4Addr") (type . "syscall")) ((name . "syscall.SetsockoptInt()") (path . "syscall/index#SetsockoptInt") (type . "syscall")) ((name . "syscall.SetsockoptIPMreq()") (path . "syscall/index#SetsockoptIPMreq") (type . "syscall")) ((name . "syscall.SetsockoptIPMreqn()") (path . "syscall/index#SetsockoptIPMreqn") (type . "syscall")) ((name . "syscall.SetsockoptIPv6Mreq()") (path . "syscall/index#SetsockoptIPv6Mreq") (type . "syscall")) ((name . "syscall.SetsockoptLinger()") (path . "syscall/index#SetsockoptLinger") (type . "syscall")) ((name . "syscall.SetsockoptString()") (path . "syscall/index#SetsockoptString") (type . "syscall")) ((name . "syscall.SetsockoptTimeval()") (path . "syscall/index#SetsockoptTimeval") (type . "syscall")) ((name . "syscall.Settimeofday()") (path . "syscall/index#Settimeofday") (type . "syscall")) ((name . "syscall.Setuid()") (path . "syscall/index#Setuid") (type . "syscall")) ((name . "syscall.Setxattr()") (path . "syscall/index#Setxattr") (type . "syscall")) ((name . "syscall.Shutdown()") (path . "syscall/index#Shutdown") (type . "syscall")) ((name . "syscall.Signal") (path . "syscall/index#Signal") (type . "syscall")) ((name . "syscall.Signal.Signal()") (path . "syscall/index#Signal.Signal") (type . "syscall")) ((name . "syscall.Signal.String()") (path . "syscall/index#Signal.String") (type . "syscall")) ((name . "syscall.SlicePtrFromStrings()") (path . "syscall/index#SlicePtrFromStrings") (type . "syscall")) ((name . "syscall.Sockaddr") (path . "syscall/index#Sockaddr") (type . "syscall")) ((name . "syscall.SockaddrInet4") (path . "syscall/index#SockaddrInet4") (type . "syscall")) ((name . "syscall.SockaddrInet6") (path . "syscall/index#SockaddrInet6") (type . "syscall")) ((name . "syscall.SockaddrLinklayer") (path . "syscall/index#SockaddrLinklayer") (type . "syscall")) ((name . "syscall.SockaddrNetlink") (path . "syscall/index#SockaddrNetlink") (type . "syscall")) ((name . "syscall.SockaddrUnix") (path . "syscall/index#SockaddrUnix") (type . "syscall")) ((name . "syscall.Socket()") (path . "syscall/index#Socket") (type . "syscall")) ((name . "syscall.SocketControlMessage") (path . "syscall/index#SocketControlMessage") (type . "syscall")) ((name . "syscall.Socketpair()") (path . "syscall/index#Socketpair") (type . "syscall")) ((name . "syscall.SockFilter") (path . "syscall/index#SockFilter") (type . "syscall")) ((name . "syscall.SockFprog") (path . "syscall/index#SockFprog") (type . "syscall")) ((name . "syscall.Splice()") (path . "syscall/index#Splice") (type . "syscall")) ((name . "syscall.StartProcess()") (path . "syscall/index#StartProcess") (type . "syscall")) ((name . "syscall.Stat()") (path . "syscall/index#Stat") (type . "syscall")) ((name . "syscall.Stat_t") (path . "syscall/index#Stat_t") (type . "syscall")) ((name . "syscall.Statfs()") (path . "syscall/index#Statfs") (type . "syscall")) ((name . "syscall.Statfs_t") (path . "syscall/index#Statfs_t") (type . "syscall")) ((name . "syscall.string") (path . "syscall/index#Mount") (type . "syscall")) ((name . "syscall.StringBytePtr()") (path . "syscall/index#StringBytePtr") (type . "syscall")) ((name . "syscall.StringByteSlice()") (path . "syscall/index#StringByteSlice") (type . "syscall")) ((name . "syscall.StringSlicePtr()") (path . "syscall/index#StringSlicePtr") (type . "syscall")) ((name . "syscall.Symlink()") (path . "syscall/index#Symlink") (type . "syscall")) ((name . "syscall.Sync()") (path . "syscall/index#Sync") (type . "syscall")) ((name . "syscall.SyncFileRange()") (path . "syscall/index#SyncFileRange") (type . "syscall")) ((name . "syscall.Syscall()") (path . "syscall/index#Syscall") (type . "syscall")) ((name . "syscall.Syscall6()") (path . "syscall/index#Syscall6") (type . "syscall")) ((name . "syscall.Sysinfo()") (path . "syscall/index#Sysinfo") (type . "syscall")) ((name . "syscall.Sysinfo_t") (path . "syscall/index#Sysinfo_t") (type . "syscall")) ((name . "syscall.SysProcAttr") (path . "syscall/index#SysProcAttr") (type . "syscall")) ((name . "syscall.SysProcIDMap") (path . "syscall/index#SysProcIDMap") (type . "syscall")) ((name . "syscall.TCPInfo") (path . "syscall/index#TCPInfo") (type . "syscall")) ((name . "syscall.Tee()") (path . "syscall/index#Tee") (type . "syscall")) ((name . "syscall.Termios") (path . "syscall/index#Termios") (type . "syscall")) ((name . "syscall.Tgkill()") (path . "syscall/index#Tgkill") (type . "syscall")) ((name . "syscall.Time()") (path . "syscall/index#Time") (type . "syscall")) ((name . "syscall.Time_t") (path . "syscall/index#Time_t") (type . "syscall")) ((name . "syscall.Times()") (path . "syscall/index#Times") (type . "syscall")) ((name . "syscall.Timespec") (path . "syscall/index#Timespec") (type . "syscall")) ((name . "syscall.Timespec.Nano()") (path . "syscall/index#Timespec.Nano") (type . "syscall")) ((name . "syscall.Timespec.Unix()") (path . "syscall/index#Timespec.Unix") (type . "syscall")) ((name . "syscall.TimespecToNsec()") (path . "syscall/index#TimespecToNsec") (type . "syscall")) ((name . "syscall.Timeval") (path . "syscall/index#Timeval") (type . "syscall")) ((name . "syscall.Timeval.Nano()") (path . "syscall/index#Timeval.Nano") (type . "syscall")) ((name . "syscall.Timeval.Unix()") (path . "syscall/index#Timeval.Unix") (type . "syscall")) ((name . "syscall.TimevalToNsec()") (path . "syscall/index#TimevalToNsec") (type . "syscall")) ((name . "syscall.Timex") (path . "syscall/index#Timex") (type . "syscall")) ((name . "syscall.Tms") (path . "syscall/index#Tms") (type . "syscall")) ((name . "syscall.Truncate()") (path . "syscall/index#Truncate") (type . "syscall")) ((name . "syscall.Ucred") (path . "syscall/index#Ucred") (type . "syscall")) ((name . "syscall.Umask()") (path . "syscall/index#Umask") (type . "syscall")) ((name . "syscall.Uname()") (path . "syscall/index#Uname") (type . "syscall")) ((name . "syscall.UnixCredentials()") (path . "syscall/index#UnixCredentials") (type . "syscall")) ((name . "syscall.UnixRights()") (path . "syscall/index#UnixRights") (type . "syscall")) ((name . "syscall.Unlink()") (path . "syscall/index#Unlink") (type . "syscall")) ((name . "syscall.Unlinkat()") (path . "syscall/index#Unlinkat") (type . "syscall")) ((name . "syscall.Unmount()") (path . "syscall/index#Unmount") (type . "syscall")) ((name . "syscall.Unsetenv()") (path . "syscall/index#Unsetenv") (type . "syscall")) ((name . "syscall.Unshare()") (path . "syscall/index#Unshare") (type . "syscall")) ((name . "syscall.Ustat()") (path . "syscall/index#Ustat") (type . "syscall")) ((name . "syscall.Ustat_t") (path . "syscall/index#Ustat_t") (type . "syscall")) ((name . "syscall.Utimbuf") (path . "syscall/index#Utimbuf") (type . "syscall")) ((name . "syscall.Utime()") (path . "syscall/index#Utime") (type . "syscall")) ((name . "syscall.Utimes()") (path . "syscall/index#Utimes") (type . "syscall")) ((name . "syscall.UtimesNano()") (path . "syscall/index#UtimesNano") (type . "syscall")) ((name . "syscall.Utsname") (path . "syscall/index#Utsname") (type . "syscall")) ((name . "syscall.Wait4()") (path . "syscall/index#Wait4") (type . "syscall")) ((name . "syscall.WaitStatus") (path . "syscall/index#WaitStatus") (type . "syscall")) ((name . "syscall.WaitStatus.Continued()") (path . "syscall/index#WaitStatus.Continued") (type . "syscall")) ((name . "syscall.WaitStatus.CoreDump()") (path . "syscall/index#WaitStatus.CoreDump") (type . "syscall")) ((name . "syscall.WaitStatus.Exited()") (path . "syscall/index#WaitStatus.Exited") (type . "syscall")) ((name . "syscall.WaitStatus.ExitStatus()") (path . "syscall/index#WaitStatus.ExitStatus") (type . "syscall")) ((name . "syscall.WaitStatus.Signal()") (path . "syscall/index#WaitStatus.Signal") (type . "syscall")) ((name . "syscall.WaitStatus.Signaled()") (path . "syscall/index#WaitStatus.Signaled") (type . "syscall")) ((name . "syscall.WaitStatus.Stopped()") (path . "syscall/index#WaitStatus.Stopped") (type . "syscall")) ((name . "syscall.WaitStatus.StopSignal()") (path . "syscall/index#WaitStatus.StopSignal") (type . "syscall")) ((name . "syscall.WaitStatus.TrapCause()") (path . "syscall/index#WaitStatus.TrapCause") (type . "syscall")) ((name . "syscall.Write()") (path . "syscall/index#Write") (type . "syscall")) ((name . "syscall/js") (path . "syscall/js/index") (type . "syscall")) ((name . "syslog.Dial()") (path . "log/syslog/index#Dial") (type . "log")) ((name . "syslog.New()") (path . "log/syslog/index#New") (type . "log")) ((name . "syslog.NewLogger()") (path . "log/syslog/index#NewLogger") (type . "log")) ((name . "syslog.Priority") (path . "log/syslog/index#Priority") (type . "log")) ((name . "syslog.Writer") (path . "log/syslog/index#Writer") (type . "log")) ((name . "syslog.Writer.Alert()") (path . "log/syslog/index#Writer.Alert") (type . "log")) ((name . "syslog.Writer.Close()") (path . "log/syslog/index#Writer.Close") (type . "log")) ((name . "syslog.Writer.Crit()") (path . "log/syslog/index#Writer.Crit") (type . "log")) ((name . "syslog.Writer.Debug()") (path . "log/syslog/index#Writer.Debug") (type . "log")) ((name . "syslog.Writer.Emerg()") (path . "log/syslog/index#Writer.Emerg") (type . "log")) ((name . "syslog.Writer.Err()") (path . "log/syslog/index#Writer.Err") (type . "log")) ((name . "syslog.Writer.Info()") (path . "log/syslog/index#Writer.Info") (type . "log")) ((name . "syslog.Writer.Notice()") (path . "log/syslog/index#Writer.Notice") (type . "log")) ((name . "syslog.Writer.Warning()") (path . "log/syslog/index#Writer.Warning") (type . "log")) ((name . "syslog.Writer.Write()") (path . "log/syslog/index#Writer.Write") (type . "log")) ((name . "tabwriter.NewWriter()") (path . "text/tabwriter/index#NewWriter") (type . "text")) ((name . "tabwriter.Writer") (path . "text/tabwriter/index#Writer") (type . "text")) ((name . "tabwriter.Writer.Flush()") (path . "text/tabwriter/index#Writer.Flush") (type . "text")) ((name . "tabwriter.Writer.Init()") (path . "text/tabwriter/index#Writer.Init") (type . "text")) ((name . "tabwriter.Writer.Write()") (path . "text/tabwriter/index#Writer.Write") (type . "text")) ((name . "tar.FileInfoHeader()") (path . "archive/tar/index#FileInfoHeader") (type . "archive")) ((name . "tar.Format") (path . "archive/tar/index#Format") (type . "archive")) ((name . "tar.Format.String()") (path . "archive/tar/index#Format.String") (type . "archive")) ((name . "tar.Header") (path . "archive/tar/index#Header") (type . "archive")) ((name . "tar.Header.FileInfo()") (path . "archive/tar/index#Header.FileInfo") (type . "archive")) ((name . "tar.NewReader()") (path . "archive/tar/index#NewReader") (type . "archive")) ((name . "tar.NewWriter()") (path . "archive/tar/index#NewWriter") (type . "archive")) ((name . "tar.Reader") (path . "archive/tar/index#Reader") (type . "archive")) ((name . "tar.Reader.Next()") (path . "archive/tar/index#Reader.Next") (type . "archive")) ((name . "tar.Reader.Read()") (path . "archive/tar/index#Reader.Read") (type . "archive")) ((name . "tar.Writer") (path . "archive/tar/index#Writer") (type . "archive")) ((name . "tar.Writer.AddFS()") (path . "archive/tar/index#Writer.AddFS") (type . "archive")) ((name . "tar.Writer.Close()") (path . "archive/tar/index#Writer.Close") (type . "archive")) ((name . "tar.Writer.Flush()") (path . "archive/tar/index#Writer.Flush") (type . "archive")) ((name . "tar.Writer.Write()") (path . "archive/tar/index#Writer.Write") (type . "archive")) ((name . "tar.Writer.WriteHeader()") (path . "archive/tar/index#Writer.WriteHeader") (type . "archive")) ((name . "template.CSS") (path . "html/template/index#CSS") (type . "html")) ((name . "template.Error") (path . "html/template/index#Error") (type . "html")) ((name . "template.Error.Error()") (path . "html/template/index#Error.Error") (type . "html")) ((name . "template.ErrorCode") (path . "html/template/index#ErrorCode") (type . "html")) ((name . "template.ExecError") (path . "text/template/index#ExecError") (type . "text")) ((name . "template.ExecError.Error()") (path . "text/template/index#ExecError.Error") (type . "text")) ((name . "template.ExecError.Unwrap()") (path . "text/template/index#ExecError.Unwrap") (type . "text")) ((name . "template.FuncMap") (path . "html/template/index#FuncMap") (type . "html")) ((name . "template.FuncMap") (path . "text/template/index#FuncMap") (type . "text")) ((name . "template.HTML") (path . "html/template/index#HTML") (type . "html")) ((name . "template.HTMLAttr") (path . "html/template/index#HTMLAttr") (type . "html")) ((name . "template.HTMLEscape()") (path . "html/template/index#HTMLEscape") (type . "html")) ((name . "template.HTMLEscape()") (path . "text/template/index#HTMLEscape") (type . "text")) ((name . "template.HTMLEscaper()") (path . "text/template/index#HTMLEscaper") (type . "text")) ((name . "template.HTMLEscaper()") (path . "html/template/index#HTMLEscaper") (type . "html")) ((name . "template.HTMLEscapeString()") (path . "text/template/index#HTMLEscapeString") (type . "text")) ((name . "template.HTMLEscapeString()") (path . "html/template/index#HTMLEscapeString") (type . "html")) ((name . "template.IsTrue()") (path . "html/template/index#IsTrue") (type . "html")) ((name . "template.IsTrue()") (path . "text/template/index#IsTrue") (type . "text")) ((name . "template.JS") (path . "html/template/index#JS") (type . "html")) ((name . "template.JSEscape()") (path . "text/template/index#JSEscape") (type . "text")) ((name . "template.JSEscape()") (path . "html/template/index#JSEscape") (type . "html")) ((name . "template.JSEscaper()") (path . "text/template/index#JSEscaper") (type . "text")) ((name . "template.JSEscaper()") (path . "html/template/index#JSEscaper") (type . "html")) ((name . "template.JSEscapeString()") (path . "text/template/index#JSEscapeString") (type . "text")) ((name . "template.JSEscapeString()") (path . "html/template/index#JSEscapeString") (type . "html")) ((name . "template.JSStr") (path . "html/template/index#JSStr") (type . "html")) ((name . "template.Must()") (path . "text/template/index#Must") (type . "text")) ((name . "template.Must()") (path . "html/template/index#Must") (type . "html")) ((name . "template.New()") (path . "html/template/index#New") (type . "html")) ((name . "template.New()") (path . "text/template/index#New") (type . "text")) ((name . "template.ParseFiles()") (path . "text/template/index#ParseFiles") (type . "text")) ((name . "template.ParseFiles()") (path . "html/template/index#ParseFiles") (type . "html")) ((name . "template.ParseFS()") (path . "html/template/index#ParseFS") (type . "html")) ((name . "template.ParseFS()") (path . "text/template/index#ParseFS") (type . "text")) ((name . "template.ParseGlob()") (path . "html/template/index#ParseGlob") (type . "html")) ((name . "template.ParseGlob()") (path . "text/template/index#ParseGlob") (type . "text")) ((name . "template.Srcset") (path . "html/template/index#Srcset") (type . "html")) ((name . "template.Template") (path . "html/template/index#Template") (type . "html")) ((name . "template.Template") (path . "text/template/index#Template") (type . "text")) ((name . "template.Template.AddParseTree()") (path . "html/template/index#Template.AddParseTree") (type . "html")) ((name . "template.Template.AddParseTree()") (path . "text/template/index#Template.AddParseTree") (type . "text")) ((name . "template.Template.Clone()") (path . "text/template/index#Template.Clone") (type . "text")) ((name . "template.Template.Clone()") (path . "html/template/index#Template.Clone") (type . "html")) ((name . "template.Template.DefinedTemplates()") (path . "text/template/index#Template.DefinedTemplates") (type . "text")) ((name . "template.Template.DefinedTemplates()") (path . "html/template/index#Template.DefinedTemplates") (type . "html")) ((name . "template.Template.Delims()") (path . "text/template/index#Template.Delims") (type . "text")) ((name . "template.Template.Delims()") (path . "html/template/index#Template.Delims") (type . "html")) ((name . "template.Template.Execute()") (path . "html/template/index#Template.Execute") (type . "html")) ((name . "template.Template.Execute()") (path . "text/template/index#Template.Execute") (type . "text")) ((name . "template.Template.ExecuteTemplate()") (path . "html/template/index#Template.ExecuteTemplate") (type . "html")) ((name . "template.Template.ExecuteTemplate()") (path . "text/template/index#Template.ExecuteTemplate") (type . "text")) ((name . "template.Template.Funcs()") (path . "html/template/index#Template.Funcs") (type . "html")) ((name . "template.Template.Funcs()") (path . "text/template/index#Template.Funcs") (type . "text")) ((name . "template.Template.Lookup()") (path . "text/template/index#Template.Lookup") (type . "text")) ((name . "template.Template.Lookup()") (path . "html/template/index#Template.Lookup") (type . "html")) ((name . "template.Template.Name()") (path . "text/template/index#Template.Name") (type . "text")) ((name . "template.Template.Name()") (path . "html/template/index#Template.Name") (type . "html")) ((name . "template.Template.New()") (path . "html/template/index#Template.New") (type . "html")) ((name . "template.Template.New()") (path . "text/template/index#Template.New") (type . "text")) ((name . "template.Template.Option()") (path . "text/template/index#Template.Option") (type . "text")) ((name . "template.Template.Option()") (path . "html/template/index#Template.Option") (type . "html")) ((name . "template.Template.Parse()") (path . "html/template/index#Template.Parse") (type . "html")) ((name . "template.Template.Parse()") (path . "text/template/index#Template.Parse") (type . "text")) ((name . "template.Template.ParseFiles()") (path . "html/template/index#Template.ParseFiles") (type . "html")) ((name . "template.Template.ParseFiles()") (path . "text/template/index#Template.ParseFiles") (type . "text")) ((name . "template.Template.ParseFS()") (path . "text/template/index#Template.ParseFS") (type . "text")) ((name . "template.Template.ParseFS()") (path . "html/template/index#Template.ParseFS") (type . "html")) ((name . "template.Template.ParseGlob()") (path . "html/template/index#Template.ParseGlob") (type . "html")) ((name . "template.Template.ParseGlob()") (path . "text/template/index#Template.ParseGlob") (type . "text")) ((name . "template.Template.Templates()") (path . "text/template/index#Template.Templates") (type . "text")) ((name . "template.Template.Templates()") (path . "html/template/index#Template.Templates") (type . "html")) ((name . "template.URL") (path . "html/template/index#URL") (type . "html")) ((name . "template.URLQueryEscaper()") (path . "html/template/index#URLQueryEscaper") (type . "html")) ((name . "template.URLQueryEscaper()") (path . "text/template/index#URLQueryEscaper") (type . "text")) ((name . "testing") (path . "testing/index") (type . "testing")) ((name . "testing.AllocsPerRun()") (path . "testing/index#AllocsPerRun") (type . "testing")) ((name . "testing.B") (path . "testing/index#B") (type . "testing")) ((name . "testing.B.Cleanup()") (path . "testing/index#B.Cleanup") (type . "testing")) ((name . "testing.B.Elapsed()") (path . "testing/index#B.Elapsed") (type . "testing")) ((name . "testing.B.Error()") (path . "testing/index#B.Error") (type . "testing")) ((name . "testing.B.Errorf()") (path . "testing/index#B.Errorf") (type . "testing")) ((name . "testing.B.Fail()") (path . "testing/index#B.Fail") (type . "testing")) ((name . "testing.B.Failed()") (path . "testing/index#B.Failed") (type . "testing")) ((name . "testing.B.FailNow()") (path . "testing/index#B.FailNow") (type . "testing")) ((name . "testing.B.Fatal()") (path . "testing/index#B.Fatal") (type . "testing")) ((name . "testing.B.Fatalf()") (path . "testing/index#B.Fatalf") (type . "testing")) ((name . "testing.B.Helper()") (path . "testing/index#B.Helper") (type . "testing")) ((name . "testing.B.Log()") (path . "testing/index#B.Log") (type . "testing")) ((name . "testing.B.Logf()") (path . "testing/index#B.Logf") (type . "testing")) ((name . "testing.B.Name()") (path . "testing/index#B.Name") (type . "testing")) ((name . "testing.B.ReportAllocs()") (path . "testing/index#B.ReportAllocs") (type . "testing")) ((name . "testing.B.ReportMetric()") (path . "testing/index#B.ReportMetric") (type . "testing")) ((name . "testing.B.ResetTimer()") (path . "testing/index#B.ResetTimer") (type . "testing")) ((name . "testing.B.Run()") (path . "testing/index#B.Run") (type . "testing")) ((name . "testing.B.RunParallel()") (path . "testing/index#B.RunParallel") (type . "testing")) ((name . "testing.B.SetBytes()") (path . "testing/index#B.SetBytes") (type . "testing")) ((name . "testing.B.Setenv()") (path . "testing/index#B.Setenv") (type . "testing")) ((name . "testing.B.SetParallelism()") (path . "testing/index#B.SetParallelism") (type . "testing")) ((name . "testing.B.Skip()") (path . "testing/index#B.Skip") (type . "testing")) ((name . "testing.B.Skipf()") (path . "testing/index#B.Skipf") (type . "testing")) ((name . "testing.B.SkipNow()") (path . "testing/index#B.SkipNow") (type . "testing")) ((name . "testing.B.Skipped()") (path . "testing/index#B.Skipped") (type . "testing")) ((name . "testing.B.StartTimer()") (path . "testing/index#B.StartTimer") (type . "testing")) ((name . "testing.B.StopTimer()") (path . "testing/index#B.StopTimer") (type . "testing")) ((name . "testing.B.TempDir()") (path . "testing/index#B.TempDir") (type . "testing")) ((name . "testing.Benchmark()") (path . "testing/index#Benchmark") (type . "testing")) ((name . "testing.BenchmarkResult") (path . "testing/index#BenchmarkResult") (type . "testing")) ((name . "testing.BenchmarkResult.AllocedBytesPerOp()") (path . "testing/index#BenchmarkResult.AllocedBytesPerOp") (type . "testing")) ((name . "testing.BenchmarkResult.AllocsPerOp()") (path . "testing/index#BenchmarkResult.AllocsPerOp") (type . "testing")) ((name . "testing.BenchmarkResult.MemString()") (path . "testing/index#BenchmarkResult.MemString") (type . "testing")) ((name . "testing.BenchmarkResult.NsPerOp()") (path . "testing/index#BenchmarkResult.NsPerOp") (type . "testing")) ((name . "testing.BenchmarkResult.String()") (path . "testing/index#BenchmarkResult.String") (type . "testing")) ((name . "testing.Cover") (path . "testing/index#Cover") (type . "testing")) ((name . "testing.Coverage()") (path . "testing/index#Coverage") (type . "testing")) ((name . "testing.CoverBlock") (path . "testing/index#CoverBlock") (type . "testing")) ((name . "testing.CoverMode()") (path . "testing/index#CoverMode") (type . "testing")) ((name . "testing.F") (path . "testing/index#F") (type . "testing")) ((name . "testing.F.Add()") (path . "testing/index#F.Add") (type . "testing")) ((name . "testing.F.Cleanup()") (path . "testing/index#F.Cleanup") (type . "testing")) ((name . "testing.F.Error()") (path . "testing/index#F.Error") (type . "testing")) ((name . "testing.F.Errorf()") (path . "testing/index#F.Errorf") (type . "testing")) ((name . "testing.F.Fail()") (path . "testing/index#F.Fail") (type . "testing")) ((name . "testing.F.Failed()") (path . "testing/index#F.Failed") (type . "testing")) ((name . "testing.F.FailNow()") (path . "testing/index#F.FailNow") (type . "testing")) ((name . "testing.F.Fatal()") (path . "testing/index#F.Fatal") (type . "testing")) ((name . "testing.F.Fatalf()") (path . "testing/index#F.Fatalf") (type . "testing")) ((name . "testing.F.Fuzz()") (path . "testing/index#F.Fuzz") (type . "testing")) ((name . "testing.F.Helper()") (path . "testing/index#F.Helper") (type . "testing")) ((name . "testing.F.Log()") (path . "testing/index#F.Log") (type . "testing")) ((name . "testing.F.Logf()") (path . "testing/index#F.Logf") (type . "testing")) ((name . "testing.F.Name()") (path . "testing/index#F.Name") (type . "testing")) ((name . "testing.F.Setenv()") (path . "testing/index#F.Setenv") (type . "testing")) ((name . "testing.F.Skip()") (path . "testing/index#F.Skip") (type . "testing")) ((name . "testing.F.Skipf()") (path . "testing/index#F.Skipf") (type . "testing")) ((name . "testing.F.SkipNow()") (path . "testing/index#F.SkipNow") (type . "testing")) ((name . "testing.F.Skipped()") (path . "testing/index#F.Skipped") (type . "testing")) ((name . "testing.F.TempDir()") (path . "testing/index#F.TempDir") (type . "testing")) ((name . "testing.Init()") (path . "testing/index#Init") (type . "testing")) ((name . "testing.InternalBenchmark") (path . "testing/index#InternalBenchmark") (type . "testing")) ((name . "testing.InternalExample") (path . "testing/index#InternalExample") (type . "testing")) ((name . "testing.InternalFuzzTarget") (path . "testing/index#InternalFuzzTarget") (type . "testing")) ((name . "testing.InternalTest") (path . "testing/index#InternalTest") (type . "testing")) ((name . "testing.M") (path . "testing/index#M") (type . "testing")) ((name . "testing.M.Run()") (path . "testing/index#M.Run") (type . "testing")) ((name . "testing.Main()") (path . "testing/index#Main") (type . "testing")) ((name . "testing.MainStart()") (path . "testing/index#MainStart") (type . "testing")) ((name . "testing.PB") (path . "testing/index#PB") (type . "testing")) ((name . "testing.PB.Next()") (path . "testing/index#PB.Next") (type . "testing")) ((name . "testing.RegisterCover()") (path . "testing/index#RegisterCover") (type . "testing")) ((name . "testing.RunBenchmarks()") (path . "testing/index#RunBenchmarks") (type . "testing")) ((name . "testing.RunExamples()") (path . "testing/index#RunExamples") (type . "testing")) ((name . "testing.RunTests()") (path . "testing/index#RunTests") (type . "testing")) ((name . "testing.Short()") (path . "testing/index#Short") (type . "testing")) ((name . "testing.T") (path . "testing/index#T") (type . "testing")) ((name . "testing.T.Cleanup()") (path . "testing/index#T.Cleanup") (type . "testing")) ((name . "testing.T.Deadline()") (path . "testing/index#T.Deadline") (type . "testing")) ((name . "testing.T.Error()") (path . "testing/index#T.Error") (type . "testing")) ((name . "testing.T.Errorf()") (path . "testing/index#T.Errorf") (type . "testing")) ((name . "testing.T.Fail()") (path . "testing/index#T.Fail") (type . "testing")) ((name . "testing.T.Failed()") (path . "testing/index#T.Failed") (type . "testing")) ((name . "testing.T.FailNow()") (path . "testing/index#T.FailNow") (type . "testing")) ((name . "testing.T.Fatal()") (path . "testing/index#T.Fatal") (type . "testing")) ((name . "testing.T.Fatalf()") (path . "testing/index#T.Fatalf") (type . "testing")) ((name . "testing.T.Helper()") (path . "testing/index#T.Helper") (type . "testing")) ((name . "testing.T.Log()") (path . "testing/index#T.Log") (type . "testing")) ((name . "testing.T.Logf()") (path . "testing/index#T.Logf") (type . "testing")) ((name . "testing.T.Name()") (path . "testing/index#T.Name") (type . "testing")) ((name . "testing.T.Parallel()") (path . "testing/index#T.Parallel") (type . "testing")) ((name . "testing.T.Run()") (path . "testing/index#T.Run") (type . "testing")) ((name . "testing.T.Setenv()") (path . "testing/index#T.Setenv") (type . "testing")) ((name . "testing.T.Skip()") (path . "testing/index#T.Skip") (type . "testing")) ((name . "testing.T.Skipf()") (path . "testing/index#T.Skipf") (type . "testing")) ((name . "testing.T.SkipNow()") (path . "testing/index#T.SkipNow") (type . "testing")) ((name . "testing.T.Skipped()") (path . "testing/index#T.Skipped") (type . "testing")) ((name . "testing.T.TempDir()") (path . "testing/index#T.TempDir") (type . "testing")) ((name . "testing.TB") (path . "testing/index#TB") (type . "testing")) ((name . "testing.Testing()") (path . "testing/index#Testing") (type . "testing")) ((name . "testing.Verbose()") (path . "testing/index#Verbose") (type . "testing")) ((name . "testing/fstest") (path . "testing/fstest/index") (type . "testing")) ((name . "testing/iotest") (path . "testing/iotest/index") (type . "testing")) ((name . "testing/iotest variables") (path . "testing/iotest/index#pkg-variables") (type . "testing")) ((name . "testing/quick") (path . "testing/quick/index") (type . "testing")) ((name . "testing/slogtest") (path . "testing/slogtest/index") (type . "testing")) ((name . "text/scanner") (path . "text/scanner/index") (type . "text")) ((name . "text/scanner constants") (path . "text/scanner/index#pkg-constants") (type . "text")) ((name . "text/tabwriter") (path . "text/tabwriter/index") (type . "text")) ((name . "text/tabwriter constants") (path . "text/tabwriter/index#pkg-constants") (type . "text")) ((name . "text/template") (path . "text/template/index") (type . "text")) ((name . "text/template/parse") (path . "text/template/parse/index") (type . "text")) ((name . "textproto.CanonicalMIMEHeaderKey()") (path . "net/textproto/index#CanonicalMIMEHeaderKey") (type . "net/textproto")) ((name . "textproto.Conn") (path . "net/textproto/index#Conn") (type . "net/textproto")) ((name . "textproto.Conn.Close()") (path . "net/textproto/index#Conn.Close") (type . "net/textproto")) ((name . "textproto.Conn.Cmd()") (path . "net/textproto/index#Conn.Cmd") (type . "net/textproto")) ((name . "textproto.Dial()") (path . "net/textproto/index#Dial") (type . "net/textproto")) ((name . "textproto.Error") (path . "net/textproto/index#Error") (type . "net/textproto")) ((name . "textproto.Error.Error()") (path . "net/textproto/index#Error.Error") (type . "net/textproto")) ((name . "textproto.MIMEHeader") (path . "net/textproto/index#MIMEHeader") (type . "net/textproto")) ((name . "textproto.MIMEHeader.Add()") (path . "net/textproto/index#MIMEHeader.Add") (type . "net/textproto")) ((name . "textproto.MIMEHeader.Del()") (path . "net/textproto/index#MIMEHeader.Del") (type . "net/textproto")) ((name . "textproto.MIMEHeader.Get()") (path . "net/textproto/index#MIMEHeader.Get") (type . "net/textproto")) ((name . "textproto.MIMEHeader.Set()") (path . "net/textproto/index#MIMEHeader.Set") (type . "net/textproto")) ((name . "textproto.MIMEHeader.Values()") (path . "net/textproto/index#MIMEHeader.Values") (type . "net/textproto")) ((name . "textproto.NewConn()") (path . "net/textproto/index#NewConn") (type . "net/textproto")) ((name . "textproto.NewReader()") (path . "net/textproto/index#NewReader") (type . "net/textproto")) ((name . "textproto.NewWriter()") (path . "net/textproto/index#NewWriter") (type . "net/textproto")) ((name . "textproto.Pipeline") (path . "net/textproto/index#Pipeline") (type . "net/textproto")) ((name . "textproto.Pipeline.EndRequest()") (path . "net/textproto/index#Pipeline.EndRequest") (type . "net/textproto")) ((name . "textproto.Pipeline.EndResponse()") (path . "net/textproto/index#Pipeline.EndResponse") (type . "net/textproto")) ((name . "textproto.Pipeline.Next()") (path . "net/textproto/index#Pipeline.Next") (type . "net/textproto")) ((name . "textproto.Pipeline.StartRequest()") (path . "net/textproto/index#Pipeline.StartRequest") (type . "net/textproto")) ((name . "textproto.Pipeline.StartResponse()") (path . "net/textproto/index#Pipeline.StartResponse") (type . "net/textproto")) ((name . "textproto.ProtocolError") (path . "net/textproto/index#ProtocolError") (type . "net/textproto")) ((name . "textproto.ProtocolError.Error()") (path . "net/textproto/index#ProtocolError.Error") (type . "net/textproto")) ((name . "textproto.Reader") (path . "net/textproto/index#Reader") (type . "net/textproto")) ((name . "textproto.Reader.DotReader()") (path . "net/textproto/index#Reader.DotReader") (type . "net/textproto")) ((name . "textproto.Reader.ReadCodeLine()") (path . "net/textproto/index#Reader.ReadCodeLine") (type . "net/textproto")) ((name . "textproto.Reader.ReadContinuedLine()") (path . "net/textproto/index#Reader.ReadContinuedLine") (type . "net/textproto")) ((name . "textproto.Reader.ReadContinuedLineBytes()") (path . "net/textproto/index#Reader.ReadContinuedLineBytes") (type . "net/textproto")) ((name . "textproto.Reader.ReadDotBytes()") (path . "net/textproto/index#Reader.ReadDotBytes") (type . "net/textproto")) ((name . "textproto.Reader.ReadDotLines()") (path . "net/textproto/index#Reader.ReadDotLines") (type . "net/textproto")) ((name . "textproto.Reader.ReadLine()") (path . "net/textproto/index#Reader.ReadLine") (type . "net/textproto")) ((name . "textproto.Reader.ReadLineBytes()") (path . "net/textproto/index#Reader.ReadLineBytes") (type . "net/textproto")) ((name . "textproto.Reader.ReadMIMEHeader()") (path . "net/textproto/index#Reader.ReadMIMEHeader") (type . "net/textproto")) ((name . "textproto.Reader.ReadResponse()") (path . "net/textproto/index#Reader.ReadResponse") (type . "net/textproto")) ((name . "textproto.TrimBytes()") (path . "net/textproto/index#TrimBytes") (type . "net/textproto")) ((name . "textproto.TrimString()") (path . "net/textproto/index#TrimString") (type . "net/textproto")) ((name . "textproto.Writer") (path . "net/textproto/index#Writer") (type . "net/textproto")) ((name . "textproto.Writer.DotWriter()") (path . "net/textproto/index#Writer.DotWriter") (type . "net/textproto")) ((name . "textproto.Writer.PrintfLine()") (path . "net/textproto/index#Writer.PrintfLine") (type . "net/textproto")) ((name . "time") (path . "time/index") (type . "time")) ((name . "time constants") (path . "time/index#pkg-constants") (type . "time")) ((name . "time.After()") (path . "time/index#After") (type . "time")) ((name . "time.AfterFunc()") (path . "time/index#AfterFunc") (type . "time")) ((name . "time.Date()") (path . "time/index#Date") (type . "time")) ((name . "time.Duration") (path . "time/index#Duration") (type . "time")) ((name . "time.Duration.Abs()") (path . "time/index#Duration.Abs") (type . "time")) ((name . "time.Duration.Hours()") (path . "time/index#Duration.Hours") (type . "time")) ((name . "time.Duration.Microseconds()") (path . "time/index#Duration.Microseconds") (type . "time")) ((name . "time.Duration.Milliseconds()") (path . "time/index#Duration.Milliseconds") (type . "time")) ((name . "time.Duration.Minutes()") (path . "time/index#Duration.Minutes") (type . "time")) ((name . "time.Duration.Nanoseconds()") (path . "time/index#Duration.Nanoseconds") (type . "time")) ((name . "time.Duration.Round()") (path . "time/index#Duration.Round") (type . "time")) ((name . "time.Duration.Seconds()") (path . "time/index#Duration.Seconds") (type . "time")) ((name . "time.Duration.String()") (path . "time/index#Duration.String") (type . "time")) ((name . "time.Duration.Truncate()") (path . "time/index#Duration.Truncate") (type . "time")) ((name . "time.FixedZone()") (path . "time/index#FixedZone") (type . "time")) ((name . "time.LoadLocation()") (path . "time/index#LoadLocation") (type . "time")) ((name . "time.LoadLocationFromTZData()") (path . "time/index#LoadLocationFromTZData") (type . "time")) ((name . "time.Location") (path . "time/index#Location") (type . "time")) ((name . "time.Location.String()") (path . "time/index#Location.String") (type . "time")) ((name . "time.Month") (path . "time/index#Month") (type . "time")) ((name . "time.Month.String()") (path . "time/index#Month.String") (type . "time")) ((name . "time.NewTicker()") (path . "time/index#NewTicker") (type . "time")) ((name . "time.NewTimer()") (path . "time/index#NewTimer") (type . "time")) ((name . "time.Now()") (path . "time/index#Now") (type . "time")) ((name . "time.Parse()") (path . "time/index#Parse") (type . "time")) ((name . "time.ParseDuration()") (path . "time/index#ParseDuration") (type . "time")) ((name . "time.ParseError") (path . "time/index#ParseError") (type . "time")) ((name . "time.ParseError.Error()") (path . "time/index#ParseError.Error") (type . "time")) ((name . "time.ParseInLocation()") (path . "time/index#ParseInLocation") (type . "time")) ((name . "time.Since()") (path . "time/index#Since") (type . "time")) ((name . "time.Sleep()") (path . "time/index#Sleep") (type . "time")) ((name . "time.Tick()") (path . "time/index#Tick") (type . "time")) ((name . "time.Ticker") (path . "time/index#Ticker") (type . "time")) ((name . "time.Ticker.Reset()") (path . "time/index#Ticker.Reset") (type . "time")) ((name . "time.Ticker.Stop()") (path . "time/index#Ticker.Stop") (type . "time")) ((name . "time.Time") (path . "time/index#Time") (type . "time")) ((name . "time.Time.Add()") (path . "time/index#Time.Add") (type . "time")) ((name . "time.Time.AddDate()") (path . "time/index#Time.AddDate") (type . "time")) ((name . "time.Time.After()") (path . "time/index#Time.After") (type . "time")) ((name . "time.Time.AppendFormat()") (path . "time/index#Time.AppendFormat") (type . "time")) ((name . "time.Time.Before()") (path . "time/index#Time.Before") (type . "time")) ((name . "time.Time.Clock()") (path . "time/index#Time.Clock") (type . "time")) ((name . "time.Time.Compare()") (path . "time/index#Time.Compare") (type . "time")) ((name . "time.Time.Date()") (path . "time/index#Time.Date") (type . "time")) ((name . "time.Time.Day()") (path . "time/index#Time.Day") (type . "time")) ((name . "time.Time.Equal()") (path . "time/index#Time.Equal") (type . "time")) ((name . "time.Time.Format()") (path . "time/index#Time.Format") (type . "time")) ((name . "time.Time.GobDecode()") (path . "time/index#Time.GobDecode") (type . "time")) ((name . "time.Time.GobEncode()") (path . "time/index#Time.GobEncode") (type . "time")) ((name . "time.Time.GoString()") (path . "time/index#Time.GoString") (type . "time")) ((name . "time.Time.Hour()") (path . "time/index#Time.Hour") (type . "time")) ((name . "time.Time.In()") (path . "time/index#Time.In") (type . "time")) ((name . "time.Time.IsDST()") (path . "time/index#Time.IsDST") (type . "time")) ((name . "time.Time.ISOWeek()") (path . "time/index#Time.ISOWeek") (type . "time")) ((name . "time.Time.IsZero()") (path . "time/index#Time.IsZero") (type . "time")) ((name . "time.Time.Local()") (path . "time/index#Time.Local") (type . "time")) ((name . "time.Time.Location()") (path . "time/index#Time.Location") (type . "time")) ((name . "time.Time.MarshalBinary()") (path . "time/index#Time.MarshalBinary") (type . "time")) ((name . "time.Time.MarshalJSON()") (path . "time/index#Time.MarshalJSON") (type . "time")) ((name . "time.Time.MarshalText()") (path . "time/index#Time.MarshalText") (type . "time")) ((name . "time.Time.Minute()") (path . "time/index#Time.Minute") (type . "time")) ((name . "time.Time.Month()") (path . "time/index#Time.Month") (type . "time")) ((name . "time.Time.Nanosecond()") (path . "time/index#Time.Nanosecond") (type . "time")) ((name . "time.Time.Round()") (path . "time/index#Time.Round") (type . "time")) ((name . "time.Time.Second()") (path . "time/index#Time.Second") (type . "time")) ((name . "time.Time.String()") (path . "time/index#Time.String") (type . "time")) ((name . "time.Time.Sub()") (path . "time/index#Time.Sub") (type . "time")) ((name . "time.Time.Truncate()") (path . "time/index#Time.Truncate") (type . "time")) ((name . "time.Time.Unix()") (path . "time/index#Time.Unix") (type . "time")) ((name . "time.Time.UnixMicro()") (path . "time/index#Time.UnixMicro") (type . "time")) ((name . "time.Time.UnixMilli()") (path . "time/index#Time.UnixMilli") (type . "time")) ((name . "time.Time.UnixNano()") (path . "time/index#Time.UnixNano") (type . "time")) ((name . "time.Time.UnmarshalBinary()") (path . "time/index#Time.UnmarshalBinary") (type . "time")) ((name . "time.Time.UnmarshalJSON()") (path . "time/index#Time.UnmarshalJSON") (type . "time")) ((name . "time.Time.UnmarshalText()") (path . "time/index#Time.UnmarshalText") (type . "time")) ((name . "time.Time.UTC()") (path . "time/index#Time.UTC") (type . "time")) ((name . "time.Time.Weekday()") (path . "time/index#Time.Weekday") (type . "time")) ((name . "time.Time.Year()") (path . "time/index#Time.Year") (type . "time")) ((name . "time.Time.YearDay()") (path . "time/index#Time.YearDay") (type . "time")) ((name . "time.Time.Zone()") (path . "time/index#Time.Zone") (type . "time")) ((name . "time.Time.ZoneBounds()") (path . "time/index#Time.ZoneBounds") (type . "time")) ((name . "time.Timer") (path . "time/index#Timer") (type . "time")) ((name . "time.Timer.Reset()") (path . "time/index#Timer.Reset") (type . "time")) ((name . "time.Timer.Stop()") (path . "time/index#Timer.Stop") (type . "time")) ((name . "time.Unix()") (path . "time/index#Unix") (type . "time")) ((name . "time.UnixMicro()") (path . "time/index#UnixMicro") (type . "time")) ((name . "time.UnixMilli()") (path . "time/index#UnixMilli") (type . "time")) ((name . "time.Until()") (path . "time/index#Until") (type . "time")) ((name . "time.Weekday") (path . "time/index#Weekday") (type . "time")) ((name . "time.Weekday.String()") (path . "time/index#Weekday.String") (type . "time")) ((name . "time/tzdata") (path . "time/tzdata/index") (type . "time")) ((name . "tls.AlertError") (path . "crypto/tls/index#AlertError") (type . "crypto")) ((name . "tls.AlertError.Error()") (path . "crypto/tls/index#AlertError.Error") (type . "crypto")) ((name . "tls.Certificate") (path . "crypto/tls/index#Certificate") (type . "crypto")) ((name . "tls.CertificateRequestInfo") (path . "crypto/tls/index#CertificateRequestInfo") (type . "crypto")) ((name . "tls.CertificateRequestInfo.Context()") (path . "crypto/tls/index#CertificateRequestInfo.Context") (type . "crypto")) ((name . "tls.CertificateRequestInfo.SupportsCertificate()") (path . "crypto/tls/index#CertificateRequestInfo.SupportsCertificate") (type . "crypto")) ((name . "tls.CertificateVerificationError") (path . "crypto/tls/index#CertificateVerificationError") (type . "crypto")) ((name . "tls.CertificateVerificationError.Error()") (path . "crypto/tls/index#CertificateVerificationError.Error") (type . "crypto")) ((name . "tls.CertificateVerificationError.Unwrap()") (path . "crypto/tls/index#CertificateVerificationError.Unwrap") (type . "crypto")) ((name . "tls.CipherSuite") (path . "crypto/tls/index#CipherSuite") (type . "crypto")) ((name . "tls.CipherSuiteName()") (path . "crypto/tls/index#CipherSuiteName") (type . "crypto")) ((name . "tls.CipherSuites()") (path . "crypto/tls/index#CipherSuites") (type . "crypto")) ((name . "tls.Client()") (path . "crypto/tls/index#Client") (type . "crypto")) ((name . "tls.ClientAuthType") (path . "crypto/tls/index#ClientAuthType") (type . "crypto")) ((name . "tls.ClientAuthType.String()") (path . "crypto/tls/index#ClientAuthType.String") (type . "crypto")) ((name . "tls.ClientHelloInfo") (path . "crypto/tls/index#ClientHelloInfo") (type . "crypto")) ((name . "tls.ClientHelloInfo.Context()") (path . "crypto/tls/index#ClientHelloInfo.Context") (type . "crypto")) ((name . "tls.ClientHelloInfo.SupportsCertificate()") (path . "crypto/tls/index#ClientHelloInfo.SupportsCertificate") (type . "crypto")) ((name . "tls.ClientSessionCache") (path . "crypto/tls/index#ClientSessionCache") (type . "crypto")) ((name . "tls.ClientSessionState") (path . "crypto/tls/index#ClientSessionState") (type . "crypto")) ((name . "tls.ClientSessionState.ResumptionState()") (path . "crypto/tls/index#ClientSessionState.ResumptionState") (type . "crypto")) ((name . "tls.Config") (path . "crypto/tls/index#Config") (type . "crypto")) ((name . "tls.Config.BuildNameToCertificate()") (path . "crypto/tls/index#Config.BuildNameToCertificate") (type . "crypto")) ((name . "tls.Config.Clone()") (path . "crypto/tls/index#Config.Clone") (type . "crypto")) ((name . "tls.Config.DecryptTicket()") (path . "crypto/tls/index#Config.DecryptTicket") (type . "crypto")) ((name . "tls.Config.EncryptTicket()") (path . "crypto/tls/index#Config.EncryptTicket") (type . "crypto")) ((name . "tls.Config.SetSessionTicketKeys()") (path . "crypto/tls/index#Config.SetSessionTicketKeys") (type . "crypto")) ((name . "tls.Conn") (path . "crypto/tls/index#Conn") (type . "crypto")) ((name . "tls.Conn.Close()") (path . "crypto/tls/index#Conn.Close") (type . "crypto")) ((name . "tls.Conn.CloseWrite()") (path . "crypto/tls/index#Conn.CloseWrite") (type . "crypto")) ((name . "tls.Conn.ConnectionState()") (path . "crypto/tls/index#Conn.ConnectionState") (type . "crypto")) ((name . "tls.Conn.Handshake()") (path . "crypto/tls/index#Conn.Handshake") (type . "crypto")) ((name . "tls.Conn.HandshakeContext()") (path . "crypto/tls/index#Conn.HandshakeContext") (type . "crypto")) ((name . "tls.Conn.LocalAddr()") (path . "crypto/tls/index#Conn.LocalAddr") (type . "crypto")) ((name . "tls.Conn.NetConn()") (path . "crypto/tls/index#Conn.NetConn") (type . "crypto")) ((name . "tls.Conn.OCSPResponse()") (path . "crypto/tls/index#Conn.OCSPResponse") (type . "crypto")) ((name . "tls.Conn.Read()") (path . "crypto/tls/index#Conn.Read") (type . "crypto")) ((name . "tls.Conn.RemoteAddr()") (path . "crypto/tls/index#Conn.RemoteAddr") (type . "crypto")) ((name . "tls.Conn.SetDeadline()") (path . "crypto/tls/index#Conn.SetDeadline") (type . "crypto")) ((name . "tls.Conn.SetReadDeadline()") (path . "crypto/tls/index#Conn.SetReadDeadline") (type . "crypto")) ((name . "tls.Conn.SetWriteDeadline()") (path . "crypto/tls/index#Conn.SetWriteDeadline") (type . "crypto")) ((name . "tls.Conn.VerifyHostname()") (path . "crypto/tls/index#Conn.VerifyHostname") (type . "crypto")) ((name . "tls.Conn.Write()") (path . "crypto/tls/index#Conn.Write") (type . "crypto")) ((name . "tls.ConnectionState") (path . "crypto/tls/index#ConnectionState") (type . "crypto")) ((name . "tls.ConnectionState.ExportKeyingMaterial()") (path . "crypto/tls/index#ConnectionState.ExportKeyingMaterial") (type . "crypto")) ((name . "tls.CurveID") (path . "crypto/tls/index#CurveID") (type . "crypto")) ((name . "tls.CurveID.String()") (path . "crypto/tls/index#CurveID.String") (type . "crypto")) ((name . "tls.Dial()") (path . "crypto/tls/index#Dial") (type . "crypto")) ((name . "tls.Dialer") (path . "crypto/tls/index#Dialer") (type . "crypto")) ((name . "tls.Dialer.Dial()") (path . "crypto/tls/index#Dialer.Dial") (type . "crypto")) ((name . "tls.Dialer.DialContext()") (path . "crypto/tls/index#Dialer.DialContext") (type . "crypto")) ((name . "tls.DialWithDialer()") (path . "crypto/tls/index#DialWithDialer") (type . "crypto")) ((name . "tls.InsecureCipherSuites()") (path . "crypto/tls/index#InsecureCipherSuites") (type . "crypto")) ((name . "tls.Listen()") (path . "crypto/tls/index#Listen") (type . "crypto")) ((name . "tls.LoadX509KeyPair()") (path . "crypto/tls/index#LoadX509KeyPair") (type . "crypto")) ((name . "tls.NewListener()") (path . "crypto/tls/index#NewListener") (type . "crypto")) ((name . "tls.NewLRUClientSessionCache()") (path . "crypto/tls/index#NewLRUClientSessionCache") (type . "crypto")) ((name . "tls.NewResumptionState()") (path . "crypto/tls/index#NewResumptionState") (type . "crypto")) ((name . "tls.ParseSessionState()") (path . "crypto/tls/index#ParseSessionState") (type . "crypto")) ((name . "tls.QUICClient()") (path . "crypto/tls/index#QUICClient") (type . "crypto")) ((name . "tls.QUICConfig") (path . "crypto/tls/index#QUICConfig") (type . "crypto")) ((name . "tls.QUICConn") (path . "crypto/tls/index#QUICConn") (type . "crypto")) ((name . "tls.QUICConn.Close()") (path . "crypto/tls/index#QUICConn.Close") (type . "crypto")) ((name . "tls.QUICConn.ConnectionState()") (path . "crypto/tls/index#QUICConn.ConnectionState") (type . "crypto")) ((name . "tls.QUICConn.HandleData()") (path . "crypto/tls/index#QUICConn.HandleData") (type . "crypto")) ((name . "tls.QUICConn.NextEvent()") (path . "crypto/tls/index#QUICConn.NextEvent") (type . "crypto")) ((name . "tls.QUICConn.SendSessionTicket()") (path . "crypto/tls/index#QUICConn.SendSessionTicket") (type . "crypto")) ((name . "tls.QUICConn.SetTransportParameters()") (path . "crypto/tls/index#QUICConn.SetTransportParameters") (type . "crypto")) ((name . "tls.QUICConn.Start()") (path . "crypto/tls/index#QUICConn.Start") (type . "crypto")) ((name . "tls.QUICEncryptionLevel") (path . "crypto/tls/index#QUICEncryptionLevel") (type . "crypto")) ((name . "tls.QUICEncryptionLevel.String()") (path . "crypto/tls/index#QUICEncryptionLevel.String") (type . "crypto")) ((name . "tls.QUICEvent") (path . "crypto/tls/index#QUICEvent") (type . "crypto")) ((name . "tls.QUICEventKind") (path . "crypto/tls/index#QUICEventKind") (type . "crypto")) ((name . "tls.QUICServer()") (path . "crypto/tls/index#QUICServer") (type . "crypto")) ((name . "tls.QUICSessionTicketOptions") (path . "crypto/tls/index#QUICSessionTicketOptions") (type . "crypto")) ((name . "tls.RecordHeaderError") (path . "crypto/tls/index#RecordHeaderError") (type . "crypto")) ((name . "tls.RecordHeaderError.Error()") (path . "crypto/tls/index#RecordHeaderError.Error") (type . "crypto")) ((name . "tls.RenegotiationSupport") (path . "crypto/tls/index#RenegotiationSupport") (type . "crypto")) ((name . "tls.Server()") (path . "crypto/tls/index#Server") (type . "crypto")) ((name . "tls.SessionState") (path . "crypto/tls/index#SessionState") (type . "crypto")) ((name . "tls.SessionState.Bytes()") (path . "crypto/tls/index#SessionState.Bytes") (type . "crypto")) ((name . "tls.SignatureScheme") (path . "crypto/tls/index#SignatureScheme") (type . "crypto")) ((name . "tls.SignatureScheme.String()") (path . "crypto/tls/index#SignatureScheme.String") (type . "crypto")) ((name . "tls.VersionName()") (path . "crypto/tls/index#VersionName") (type . "crypto")) ((name . "tls.X509KeyPair()") (path . "crypto/tls/index#X509KeyPair") (type . "crypto")) ((name . "token.File") (path . "go/token/index#File") (type . "go")) ((name . "token.File.AddLine()") (path . "go/token/index#File.AddLine") (type . "go")) ((name . "token.File.AddLineColumnInfo()") (path . "go/token/index#File.AddLineColumnInfo") (type . "go")) ((name . "token.File.AddLineInfo()") (path . "go/token/index#File.AddLineInfo") (type . "go")) ((name . "token.File.Base()") (path . "go/token/index#File.Base") (type . "go")) ((name . "token.File.Line()") (path . "go/token/index#File.Line") (type . "go")) ((name . "token.File.LineCount()") (path . "go/token/index#File.LineCount") (type . "go")) ((name . "token.File.Lines()") (path . "go/token/index#File.Lines") (type . "go")) ((name . "token.File.LineStart()") (path . "go/token/index#File.LineStart") (type . "go")) ((name . "token.File.MergeLine()") (path . "go/token/index#File.MergeLine") (type . "go")) ((name . "token.File.Name()") (path . "go/token/index#File.Name") (type . "go")) ((name . "token.File.Offset()") (path . "go/token/index#File.Offset") (type . "go")) ((name . "token.File.Pos()") (path . "go/token/index#File.Pos") (type . "go")) ((name . "token.File.Position()") (path . "go/token/index#File.Position") (type . "go")) ((name . "token.File.PositionFor()") (path . "go/token/index#File.PositionFor") (type . "go")) ((name . "token.File.SetLines()") (path . "go/token/index#File.SetLines") (type . "go")) ((name . "token.File.SetLinesForContent()") (path . "go/token/index#File.SetLinesForContent") (type . "go")) ((name . "token.File.Size()") (path . "go/token/index#File.Size") (type . "go")) ((name . "token.FileSet") (path . "go/token/index#FileSet") (type . "go")) ((name . "token.FileSet.AddFile()") (path . "go/token/index#FileSet.AddFile") (type . "go")) ((name . "token.FileSet.Base()") (path . "go/token/index#FileSet.Base") (type . "go")) ((name . "token.FileSet.File()") (path . "go/token/index#FileSet.File") (type . "go")) ((name . "token.FileSet.Iterate()") (path . "go/token/index#FileSet.Iterate") (type . "go")) ((name . "token.FileSet.Position()") (path . "go/token/index#FileSet.Position") (type . "go")) ((name . "token.FileSet.PositionFor()") (path . "go/token/index#FileSet.PositionFor") (type . "go")) ((name . "token.FileSet.Read()") (path . "go/token/index#FileSet.Read") (type . "go")) ((name . "token.FileSet.RemoveFile()") (path . "go/token/index#FileSet.RemoveFile") (type . "go")) ((name . "token.FileSet.Write()") (path . "go/token/index#FileSet.Write") (type . "go")) ((name . "token.IsExported()") (path . "go/token/index#IsExported") (type . "go")) ((name . "token.IsIdentifier()") (path . "go/token/index#IsIdentifier") (type . "go")) ((name . "token.IsKeyword()") (path . "go/token/index#IsKeyword") (type . "go")) ((name . "token.Lookup()") (path . "go/token/index#Lookup") (type . "go")) ((name . "token.NewFileSet()") (path . "go/token/index#NewFileSet") (type . "go")) ((name . "token.Pos") (path . "go/token/index#Pos") (type . "go")) ((name . "token.Pos.IsValid()") (path . "go/token/index#Pos.IsValid") (type . "go")) ((name . "token.Position") (path . "go/token/index#Position") (type . "go")) ((name . "token.Position.IsValid()") (path . "go/token/index#Position.IsValid") (type . "go")) ((name . "token.Position.String()") (path . "go/token/index#Position.String") (type . "go")) ((name . "token.Token") (path . "go/token/index#Token") (type . "go")) ((name . "token.Token.IsKeyword()") (path . "go/token/index#Token.IsKeyword") (type . "go")) ((name . "token.Token.IsLiteral()") (path . "go/token/index#Token.IsLiteral") (type . "go")) ((name . "token.Token.IsOperator()") (path . "go/token/index#Token.IsOperator") (type . "go")) ((name . "token.Token.Precedence()") (path . "go/token/index#Token.Precedence") (type . "go")) ((name . "token.Token.String()") (path . "go/token/index#Token.String") (type . "go")) ((name . "trace.IsEnabled()") (path . "runtime/trace/index#IsEnabled") (type . "runtime")) ((name . "trace.Log()") (path . "runtime/trace/index#Log") (type . "runtime")) ((name . "trace.Logf()") (path . "runtime/trace/index#Logf") (type . "runtime")) ((name . "trace.NewTask()") (path . "runtime/trace/index#NewTask") (type . "runtime")) ((name . "trace.Region") (path . "runtime/trace/index#Region") (type . "runtime")) ((name . "trace.Region.End()") (path . "runtime/trace/index#Region.End") (type . "runtime")) ((name . "trace.Start()") (path . "runtime/trace/index#Start") (type . "runtime")) ((name . "trace.StartRegion()") (path . "runtime/trace/index#StartRegion") (type . "runtime")) ((name . "trace.Stop()") (path . "runtime/trace/index#Stop") (type . "runtime")) ((name . "trace.Task") (path . "runtime/trace/index#Task") (type . "runtime")) ((name . "trace.Task.End()") (path . "runtime/trace/index#Task.End") (type . "runtime")) ((name . "trace.WithRegion()") (path . "runtime/trace/index#WithRegion") (type . "runtime")) ((name . "types.Alias") (path . "go/types/index#Alias") (type . "go")) ((name . "types.Alias.Obj()") (path . "go/types/index#Alias.Obj") (type . "go")) ((name . "types.Alias.String()") (path . "go/types/index#Alias.String") (type . "go")) ((name . "types.Alias.Underlying()") (path . "go/types/index#Alias.Underlying") (type . "go")) ((name . "types.ArgumentError") (path . "go/types/index#ArgumentError") (type . "go")) ((name . "types.ArgumentError.Error()") (path . "go/types/index#ArgumentError.Error") (type . "go")) ((name . "types.ArgumentError.Unwrap()") (path . "go/types/index#ArgumentError.Unwrap") (type . "go")) ((name . "types.Array") (path . "go/types/index#Array") (type . "go")) ((name . "types.Array.Elem()") (path . "go/types/index#Array.Elem") (type . "go")) ((name . "types.Array.Len()") (path . "go/types/index#Array.Len") (type . "go")) ((name . "types.Array.String()") (path . "go/types/index#Array.String") (type . "go")) ((name . "types.Array.Underlying()") (path . "go/types/index#Array.Underlying") (type . "go")) ((name . "types.AssertableTo()") (path . "go/types/index#AssertableTo") (type . "go")) ((name . "types.AssignableTo()") (path . "go/types/index#AssignableTo") (type . "go")) ((name . "types.Basic") (path . "go/types/index#Basic") (type . "go")) ((name . "types.Basic.Info()") (path . "go/types/index#Basic.Info") (type . "go")) ((name . "types.Basic.Kind()") (path . "go/types/index#Basic.Kind") (type . "go")) ((name . "types.Basic.Name()") (path . "go/types/index#Basic.Name") (type . "go")) ((name . "types.Basic.String()") (path . "go/types/index#Basic.String") (type . "go")) ((name . "types.Basic.Underlying()") (path . "go/types/index#Basic.Underlying") (type . "go")) ((name . "types.BasicInfo") (path . "go/types/index#BasicInfo") (type . "go")) ((name . "types.BasicKind") (path . "go/types/index#BasicKind") (type . "go")) ((name . "types.Builtin") (path . "go/types/index#Builtin") (type . "go")) ((name . "types.Builtin.Exported()") (path . "go/types/index#Builtin.Exported") (type . "go")) ((name . "types.Builtin.Id()") (path . "go/types/index#Builtin.Id") (type . "go")) ((name . "types.Builtin.Name()") (path . "go/types/index#Builtin.Name") (type . "go")) ((name . "types.Builtin.Parent()") (path . "go/types/index#Builtin.Parent") (type . "go")) ((name . "types.Builtin.Pkg()") (path . "go/types/index#Builtin.Pkg") (type . "go")) ((name . "types.Builtin.Pos()") (path . "go/types/index#Builtin.Pos") (type . "go")) ((name . "types.Builtin.String()") (path . "go/types/index#Builtin.String") (type . "go")) ((name . "types.Builtin.Type()") (path . "go/types/index#Builtin.Type") (type . "go")) ((name . "types.Chan") (path . "go/types/index#Chan") (type . "go")) ((name . "types.Chan.Dir()") (path . "go/types/index#Chan.Dir") (type . "go")) ((name . "types.Chan.Elem()") (path . "go/types/index#Chan.Elem") (type . "go")) ((name . "types.Chan.String()") (path . "go/types/index#Chan.String") (type . "go")) ((name . "types.Chan.Underlying()") (path . "go/types/index#Chan.Underlying") (type . "go")) ((name . "types.ChanDir") (path . "go/types/index#ChanDir") (type . "go")) ((name . "types.Checker") (path . "go/types/index#Checker") (type . "go")) ((name . "types.Checker.Files()") (path . "go/types/index#Checker.Files") (type . "go")) ((name . "types.CheckExpr()") (path . "go/types/index#CheckExpr") (type . "go")) ((name . "types.Comparable()") (path . "go/types/index#Comparable") (type . "go")) ((name . "types.Config") (path . "go/types/index#Config") (type . "go")) ((name . "types.Config.Check()") (path . "go/types/index#Config.Check") (type . "go")) ((name . "types.Const") (path . "go/types/index#Const") (type . "go")) ((name . "types.Const.Exported()") (path . "go/types/index#Const.Exported") (type . "go")) ((name . "types.Const.Id()") (path . "go/types/index#Const.Id") (type . "go")) ((name . "types.Const.Name()") (path . "go/types/index#Const.Name") (type . "go")) ((name . "types.Const.Parent()") (path . "go/types/index#Const.Parent") (type . "go")) ((name . "types.Const.Pkg()") (path . "go/types/index#Const.Pkg") (type . "go")) ((name . "types.Const.Pos()") (path . "go/types/index#Const.Pos") (type . "go")) ((name . "types.Const.String()") (path . "go/types/index#Const.String") (type . "go")) ((name . "types.Const.Type()") (path . "go/types/index#Const.Type") (type . "go")) ((name . "types.Const.Val()") (path . "go/types/index#Const.Val") (type . "go")) ((name . "types.Context") (path . "go/types/index#Context") (type . "go")) ((name . "types.ConvertibleTo()") (path . "go/types/index#ConvertibleTo") (type . "go")) ((name . "types.Default()") (path . "go/types/index#Default") (type . "go")) ((name . "types.DefPredeclaredTestFuncs()") (path . "go/types/index#DefPredeclaredTestFuncs") (type . "go")) ((name . "types.Error") (path . "go/types/index#Error") (type . "go")) ((name . "types.Error.Error()") (path . "go/types/index#Error.Error") (type . "go")) ((name . "types.Eval()") (path . "go/types/index#Eval") (type . "go")) ((name . "types.ExprString()") (path . "go/types/index#ExprString") (type . "go")) ((name . "types.Func") (path . "go/types/index#Func") (type . "go")) ((name . "types.Func.Exported()") (path . "go/types/index#Func.Exported") (type . "go")) ((name . "types.Func.FullName()") (path . "go/types/index#Func.FullName") (type . "go")) ((name . "types.Func.Id()") (path . "go/types/index#Func.Id") (type . "go")) ((name . "types.Func.Name()") (path . "go/types/index#Func.Name") (type . "go")) ((name . "types.Func.Origin()") (path . "go/types/index#Func.Origin") (type . "go")) ((name . "types.Func.Parent()") (path . "go/types/index#Func.Parent") (type . "go")) ((name . "types.Func.Pkg()") (path . "go/types/index#Func.Pkg") (type . "go")) ((name . "types.Func.Pos()") (path . "go/types/index#Func.Pos") (type . "go")) ((name . "types.Func.Scope()") (path . "go/types/index#Func.Scope") (type . "go")) ((name . "types.Func.String()") (path . "go/types/index#Func.String") (type . "go")) ((name . "types.Func.Type()") (path . "go/types/index#Func.Type") (type . "go")) ((name . "types.Id()") (path . "go/types/index#Id") (type . "go")) ((name . "types.Identical()") (path . "go/types/index#Identical") (type . "go")) ((name . "types.IdenticalIgnoreTags()") (path . "go/types/index#IdenticalIgnoreTags") (type . "go")) ((name . "types.Implements()") (path . "go/types/index#Implements") (type . "go")) ((name . "types.Importer") (path . "go/types/index#Importer") (type . "go")) ((name . "types.ImporterFrom") (path . "go/types/index#ImporterFrom") (type . "go")) ((name . "types.ImportMode") (path . "go/types/index#ImportMode") (type . "go")) ((name . "types.Info") (path . "go/types/index#Info") (type . "go")) ((name . "types.Info.ObjectOf()") (path . "go/types/index#Info.ObjectOf") (type . "go")) ((name . "types.Info.PkgNameOf()") (path . "go/types/index#Info.PkgNameOf") (type . "go")) ((name . "types.Info.TypeOf()") (path . "go/types/index#Info.TypeOf") (type . "go")) ((name . "types.Initializer") (path . "go/types/index#Initializer") (type . "go")) ((name . "types.Initializer.String()") (path . "go/types/index#Initializer.String") (type . "go")) ((name . "types.Instance") (path . "go/types/index#Instance") (type . "go")) ((name . "types.Instantiate()") (path . "go/types/index#Instantiate") (type . "go")) ((name . "types.Interface") (path . "go/types/index#Interface") (type . "go")) ((name . "types.Interface.Complete()") (path . "go/types/index#Interface.Complete") (type . "go")) ((name . "types.Interface.Embedded()") (path . "go/types/index#Interface.Embedded") (type . "go")) ((name . "types.Interface.EmbeddedType()") (path . "go/types/index#Interface.EmbeddedType") (type . "go")) ((name . "types.Interface.Empty()") (path . "go/types/index#Interface.Empty") (type . "go")) ((name . "types.Interface.ExplicitMethod()") (path . "go/types/index#Interface.ExplicitMethod") (type . "go")) ((name . "types.Interface.IsComparable()") (path . "go/types/index#Interface.IsComparable") (type . "go")) ((name . "types.Interface.IsImplicit()") (path . "go/types/index#Interface.IsImplicit") (type . "go")) ((name . "types.Interface.IsMethodSet()") (path . "go/types/index#Interface.IsMethodSet") (type . "go")) ((name . "types.Interface.MarkImplicit()") (path . "go/types/index#Interface.MarkImplicit") (type . "go")) ((name . "types.Interface.Method()") (path . "go/types/index#Interface.Method") (type . "go")) ((name . "types.Interface.NumEmbeddeds()") (path . "go/types/index#Interface.NumEmbeddeds") (type . "go")) ((name . "types.Interface.NumExplicitMethods()") (path . "go/types/index#Interface.NumExplicitMethods") (type . "go")) ((name . "types.Interface.NumMethods()") (path . "go/types/index#Interface.NumMethods") (type . "go")) ((name . "types.Interface.String()") (path . "go/types/index#Interface.String") (type . "go")) ((name . "types.Interface.Underlying()") (path . "go/types/index#Interface.Underlying") (type . "go")) ((name . "types.IsInterface()") (path . "go/types/index#IsInterface") (type . "go")) ((name . "types.Label") (path . "go/types/index#Label") (type . "go")) ((name . "types.Label.Exported()") (path . "go/types/index#Label.Exported") (type . "go")) ((name . "types.Label.Id()") (path . "go/types/index#Label.Id") (type . "go")) ((name . "types.Label.Name()") (path . "go/types/index#Label.Name") (type . "go")) ((name . "types.Label.Parent()") (path . "go/types/index#Label.Parent") (type . "go")) ((name . "types.Label.Pkg()") (path . "go/types/index#Label.Pkg") (type . "go")) ((name . "types.Label.Pos()") (path . "go/types/index#Label.Pos") (type . "go")) ((name . "types.Label.String()") (path . "go/types/index#Label.String") (type . "go")) ((name . "types.Label.Type()") (path . "go/types/index#Label.Type") (type . "go")) ((name . "types.LookupFieldOrMethod()") (path . "go/types/index#LookupFieldOrMethod") (type . "go")) ((name . "types.Map") (path . "go/types/index#Map") (type . "go")) ((name . "types.Map.Elem()") (path . "go/types/index#Map.Elem") (type . "go")) ((name . "types.Map.Key()") (path . "go/types/index#Map.Key") (type . "go")) ((name . "types.Map.String()") (path . "go/types/index#Map.String") (type . "go")) ((name . "types.Map.Underlying()") (path . "go/types/index#Map.Underlying") (type . "go")) ((name . "types.MethodSet") (path . "go/types/index#MethodSet") (type . "go")) ((name . "types.MethodSet.At()") (path . "go/types/index#MethodSet.At") (type . "go")) ((name . "types.MethodSet.Len()") (path . "go/types/index#MethodSet.Len") (type . "go")) ((name . "types.MethodSet.Lookup()") (path . "go/types/index#MethodSet.Lookup") (type . "go")) ((name . "types.MethodSet.String()") (path . "go/types/index#MethodSet.String") (type . "go")) ((name . "types.MissingMethod()") (path . "go/types/index#MissingMethod") (type . "go")) ((name . "types.Named") (path . "go/types/index#Named") (type . "go")) ((name . "types.Named.AddMethod()") (path . "go/types/index#Named.AddMethod") (type . "go")) ((name . "types.Named.Method()") (path . "go/types/index#Named.Method") (type . "go")) ((name . "types.Named.NumMethods()") (path . "go/types/index#Named.NumMethods") (type . "go")) ((name . "types.Named.Obj()") (path . "go/types/index#Named.Obj") (type . "go")) ((name . "types.Named.Origin()") (path . "go/types/index#Named.Origin") (type . "go")) ((name . "types.Named.SetTypeParams()") (path . "go/types/index#Named.SetTypeParams") (type . "go")) ((name . "types.Named.SetUnderlying()") (path . "go/types/index#Named.SetUnderlying") (type . "go")) ((name . "types.Named.String()") (path . "go/types/index#Named.String") (type . "go")) ((name . "types.Named.TypeArgs()") (path . "go/types/index#Named.TypeArgs") (type . "go")) ((name . "types.Named.TypeParams()") (path . "go/types/index#Named.TypeParams") (type . "go")) ((name . "types.Named.Underlying()") (path . "go/types/index#Named.Underlying") (type . "go")) ((name . "types.NewAlias()") (path . "go/types/index#NewAlias") (type . "go")) ((name . "types.NewArray()") (path . "go/types/index#NewArray") (type . "go")) ((name . "types.NewChan()") (path . "go/types/index#NewChan") (type . "go")) ((name . "types.NewChecker()") (path . "go/types/index#NewChecker") (type . "go")) ((name . "types.NewConst()") (path . "go/types/index#NewConst") (type . "go")) ((name . "types.NewContext()") (path . "go/types/index#NewContext") (type . "go")) ((name . "types.NewField()") (path . "go/types/index#NewField") (type . "go")) ((name . "types.NewFunc()") (path . "go/types/index#NewFunc") (type . "go")) ((name . "types.NewInterface()") (path . "go/types/index#NewInterface") (type . "go")) ((name . "types.NewInterfaceType()") (path . "go/types/index#NewInterfaceType") (type . "go")) ((name . "types.NewLabel()") (path . "go/types/index#NewLabel") (type . "go")) ((name . "types.NewMap()") (path . "go/types/index#NewMap") (type . "go")) ((name . "types.NewMethodSet()") (path . "go/types/index#NewMethodSet") (type . "go")) ((name . "types.NewNamed()") (path . "go/types/index#NewNamed") (type . "go")) ((name . "types.NewPackage()") (path . "go/types/index#NewPackage") (type . "go")) ((name . "types.NewParam()") (path . "go/types/index#NewParam") (type . "go")) ((name . "types.NewPkgName()") (path . "go/types/index#NewPkgName") (type . "go")) ((name . "types.NewPointer()") (path . "go/types/index#NewPointer") (type . "go")) ((name . "types.NewScope()") (path . "go/types/index#NewScope") (type . "go")) ((name . "types.NewSignature()") (path . "go/types/index#NewSignature") (type . "go")) ((name . "types.NewSignatureType()") (path . "go/types/index#NewSignatureType") (type . "go")) ((name . "types.NewSlice()") (path . "go/types/index#NewSlice") (type . "go")) ((name . "types.NewStruct()") (path . "go/types/index#NewStruct") (type . "go")) ((name . "types.NewTerm()") (path . "go/types/index#NewTerm") (type . "go")) ((name . "types.NewTuple()") (path . "go/types/index#NewTuple") (type . "go")) ((name . "types.NewTypeName()") (path . "go/types/index#NewTypeName") (type . "go")) ((name . "types.NewTypeParam()") (path . "go/types/index#NewTypeParam") (type . "go")) ((name . "types.NewUnion()") (path . "go/types/index#NewUnion") (type . "go")) ((name . "types.NewVar()") (path . "go/types/index#NewVar") (type . "go")) ((name . "types.Nil") (path . "go/types/index#Nil") (type . "go")) ((name . "types.Nil.Exported()") (path . "go/types/index#Nil.Exported") (type . "go")) ((name . "types.Nil.Id()") (path . "go/types/index#Nil.Id") (type . "go")) ((name . "types.Nil.Name()") (path . "go/types/index#Nil.Name") (type . "go")) ((name . "types.Nil.Parent()") (path . "go/types/index#Nil.Parent") (type . "go")) ((name . "types.Nil.Pkg()") (path . "go/types/index#Nil.Pkg") (type . "go")) ((name . "types.Nil.Pos()") (path . "go/types/index#Nil.Pos") (type . "go")) ((name . "types.Nil.String()") (path . "go/types/index#Nil.String") (type . "go")) ((name . "types.Nil.Type()") (path . "go/types/index#Nil.Type") (type . "go")) ((name . "types.Object") (path . "go/types/index#Object") (type . "go")) ((name . "types.ObjectString()") (path . "go/types/index#ObjectString") (type . "go")) ((name . "types.Package") (path . "go/types/index#Package") (type . "go")) ((name . "types.Package.Complete()") (path . "go/types/index#Package.Complete") (type . "go")) ((name . "types.Package.GoVersion()") (path . "go/types/index#Package.GoVersion") (type . "go")) ((name . "types.Package.Imports()") (path . "go/types/index#Package.Imports") (type . "go")) ((name . "types.Package.MarkComplete()") (path . "go/types/index#Package.MarkComplete") (type . "go")) ((name . "types.Package.Name()") (path . "go/types/index#Package.Name") (type . "go")) ((name . "types.Package.Path()") (path . "go/types/index#Package.Path") (type . "go")) ((name . "types.Package.Scope()") (path . "go/types/index#Package.Scope") (type . "go")) ((name . "types.Package.SetImports()") (path . "go/types/index#Package.SetImports") (type . "go")) ((name . "types.Package.SetName()") (path . "go/types/index#Package.SetName") (type . "go")) ((name . "types.Package.String()") (path . "go/types/index#Package.String") (type . "go")) ((name . "types.PkgName") (path . "go/types/index#PkgName") (type . "go")) ((name . "types.PkgName.Exported()") (path . "go/types/index#PkgName.Exported") (type . "go")) ((name . "types.PkgName.Id()") (path . "go/types/index#PkgName.Id") (type . "go")) ((name . "types.PkgName.Imported()") (path . "go/types/index#PkgName.Imported") (type . "go")) ((name . "types.PkgName.Name()") (path . "go/types/index#PkgName.Name") (type . "go")) ((name . "types.PkgName.Parent()") (path . "go/types/index#PkgName.Parent") (type . "go")) ((name . "types.PkgName.Pkg()") (path . "go/types/index#PkgName.Pkg") (type . "go")) ((name . "types.PkgName.Pos()") (path . "go/types/index#PkgName.Pos") (type . "go")) ((name . "types.PkgName.String()") (path . "go/types/index#PkgName.String") (type . "go")) ((name . "types.PkgName.Type()") (path . "go/types/index#PkgName.Type") (type . "go")) ((name . "types.Pointer") (path . "go/types/index#Pointer") (type . "go")) ((name . "types.Pointer.Elem()") (path . "go/types/index#Pointer.Elem") (type . "go")) ((name . "types.Pointer.String()") (path . "go/types/index#Pointer.String") (type . "go")) ((name . "types.Pointer.Underlying()") (path . "go/types/index#Pointer.Underlying") (type . "go")) ((name . "types.Qualifier") (path . "go/types/index#Qualifier") (type . "go")) ((name . "types.RelativeTo()") (path . "go/types/index#RelativeTo") (type . "go")) ((name . "types.Satisfies()") (path . "go/types/index#Satisfies") (type . "go")) ((name . "types.Scope") (path . "go/types/index#Scope") (type . "go")) ((name . "types.Scope.Child()") (path . "go/types/index#Scope.Child") (type . "go")) ((name . "types.Scope.Contains()") (path . "go/types/index#Scope.Contains") (type . "go")) ((name . "types.Scope.End()") (path . "go/types/index#Scope.End") (type . "go")) ((name . "types.Scope.Innermost()") (path . "go/types/index#Scope.Innermost") (type . "go")) ((name . "types.Scope.Insert()") (path . "go/types/index#Scope.Insert") (type . "go")) ((name . "types.Scope.Len()") (path . "go/types/index#Scope.Len") (type . "go")) ((name . "types.Scope.Lookup()") (path . "go/types/index#Scope.Lookup") (type . "go")) ((name . "types.Scope.LookupParent()") (path . "go/types/index#Scope.LookupParent") (type . "go")) ((name . "types.Scope.Names()") (path . "go/types/index#Scope.Names") (type . "go")) ((name . "types.Scope.NumChildren()") (path . "go/types/index#Scope.NumChildren") (type . "go")) ((name . "types.Scope.Parent()") (path . "go/types/index#Scope.Parent") (type . "go")) ((name . "types.Scope.Pos()") (path . "go/types/index#Scope.Pos") (type . "go")) ((name . "types.Scope.String()") (path . "go/types/index#Scope.String") (type . "go")) ((name . "types.Scope.WriteTo()") (path . "go/types/index#Scope.WriteTo") (type . "go")) ((name . "types.Selection") (path . "go/types/index#Selection") (type . "go")) ((name . "types.Selection.Index()") (path . "go/types/index#Selection.Index") (type . "go")) ((name . "types.Selection.Indirect()") (path . "go/types/index#Selection.Indirect") (type . "go")) ((name . "types.Selection.Kind()") (path . "go/types/index#Selection.Kind") (type . "go")) ((name . "types.Selection.Obj()") (path . "go/types/index#Selection.Obj") (type . "go")) ((name . "types.Selection.Recv()") (path . "go/types/index#Selection.Recv") (type . "go")) ((name . "types.Selection.String()") (path . "go/types/index#Selection.String") (type . "go")) ((name . "types.Selection.Type()") (path . "go/types/index#Selection.Type") (type . "go")) ((name . "types.SelectionKind") (path . "go/types/index#SelectionKind") (type . "go")) ((name . "types.SelectionString()") (path . "go/types/index#SelectionString") (type . "go")) ((name . "types.Signature") (path . "go/types/index#Signature") (type . "go")) ((name . "types.Signature.Params()") (path . "go/types/index#Signature.Params") (type . "go")) ((name . "types.Signature.Recv()") (path . "go/types/index#Signature.Recv") (type . "go")) ((name . "types.Signature.RecvTypeParams()") (path . "go/types/index#Signature.RecvTypeParams") (type . "go")) ((name . "types.Signature.Results()") (path . "go/types/index#Signature.Results") (type . "go")) ((name . "types.Signature.String()") (path . "go/types/index#Signature.String") (type . "go")) ((name . "types.Signature.TypeParams()") (path . "go/types/index#Signature.TypeParams") (type . "go")) ((name . "types.Signature.Underlying()") (path . "go/types/index#Signature.Underlying") (type . "go")) ((name . "types.Signature.Variadic()") (path . "go/types/index#Signature.Variadic") (type . "go")) ((name . "types.Sizes") (path . "go/types/index#Sizes") (type . "go")) ((name . "types.SizesFor()") (path . "go/types/index#SizesFor") (type . "go")) ((name . "types.Slice") (path . "go/types/index#Slice") (type . "go")) ((name . "types.Slice.Elem()") (path . "go/types/index#Slice.Elem") (type . "go")) ((name . "types.Slice.String()") (path . "go/types/index#Slice.String") (type . "go")) ((name . "types.Slice.Underlying()") (path . "go/types/index#Slice.Underlying") (type . "go")) ((name . "types.StdSizes") (path . "go/types/index#StdSizes") (type . "go")) ((name . "types.StdSizes.Alignof()") (path . "go/types/index#StdSizes.Alignof") (type . "go")) ((name . "types.StdSizes.Offsetsof()") (path . "go/types/index#StdSizes.Offsetsof") (type . "go")) ((name . "types.StdSizes.Sizeof()") (path . "go/types/index#StdSizes.Sizeof") (type . "go")) ((name . "types.Struct") (path . "go/types/index#Struct") (type . "go")) ((name . "types.Struct.Field()") (path . "go/types/index#Struct.Field") (type . "go")) ((name . "types.Struct.NumFields()") (path . "go/types/index#Struct.NumFields") (type . "go")) ((name . "types.Struct.String()") (path . "go/types/index#Struct.String") (type . "go")) ((name . "types.Struct.Tag()") (path . "go/types/index#Struct.Tag") (type . "go")) ((name . "types.Struct.Underlying()") (path . "go/types/index#Struct.Underlying") (type . "go")) ((name . "types.Term") (path . "go/types/index#Term") (type . "go")) ((name . "types.Term.String()") (path . "go/types/index#Term.String") (type . "go")) ((name . "types.Term.Tilde()") (path . "go/types/index#Term.Tilde") (type . "go")) ((name . "types.Term.Type()") (path . "go/types/index#Term.Type") (type . "go")) ((name . "types.Tuple") (path . "go/types/index#Tuple") (type . "go")) ((name . "types.Tuple.At()") (path . "go/types/index#Tuple.At") (type . "go")) ((name . "types.Tuple.Len()") (path . "go/types/index#Tuple.Len") (type . "go")) ((name . "types.Tuple.String()") (path . "go/types/index#Tuple.String") (type . "go")) ((name . "types.Tuple.Underlying()") (path . "go/types/index#Tuple.Underlying") (type . "go")) ((name . "types.Type") (path . "go/types/index#Type") (type . "go")) ((name . "types.TypeAndValue") (path . "go/types/index#TypeAndValue") (type . "go")) ((name . "types.TypeAndValue.Addressable()") (path . "go/types/index#TypeAndValue.Addressable") (type . "go")) ((name . "types.TypeAndValue.Assignable()") (path . "go/types/index#TypeAndValue.Assignable") (type . "go")) ((name . "types.TypeAndValue.HasOk()") (path . "go/types/index#TypeAndValue.HasOk") (type . "go")) ((name . "types.TypeAndValue.IsBuiltin()") (path . "go/types/index#TypeAndValue.IsBuiltin") (type . "go")) ((name . "types.TypeAndValue.IsNil()") (path . "go/types/index#TypeAndValue.IsNil") (type . "go")) ((name . "types.TypeAndValue.IsType()") (path . "go/types/index#TypeAndValue.IsType") (type . "go")) ((name . "types.TypeAndValue.IsValue()") (path . "go/types/index#TypeAndValue.IsValue") (type . "go")) ((name . "types.TypeAndValue.IsVoid()") (path . "go/types/index#TypeAndValue.IsVoid") (type . "go")) ((name . "types.TypeList") (path . "go/types/index#TypeList") (type . "go")) ((name . "types.TypeList.At()") (path . "go/types/index#TypeList.At") (type . "go")) ((name . "types.TypeList.Len()") (path . "go/types/index#TypeList.Len") (type . "go")) ((name . "types.TypeName") (path . "go/types/index#TypeName") (type . "go")) ((name . "types.TypeName.Exported()") (path . "go/types/index#TypeName.Exported") (type . "go")) ((name . "types.TypeName.Id()") (path . "go/types/index#TypeName.Id") (type . "go")) ((name . "types.TypeName.IsAlias()") (path . "go/types/index#TypeName.IsAlias") (type . "go")) ((name . "types.TypeName.Name()") (path . "go/types/index#TypeName.Name") (type . "go")) ((name . "types.TypeName.Parent()") (path . "go/types/index#TypeName.Parent") (type . "go")) ((name . "types.TypeName.Pkg()") (path . "go/types/index#TypeName.Pkg") (type . "go")) ((name . "types.TypeName.Pos()") (path . "go/types/index#TypeName.Pos") (type . "go")) ((name . "types.TypeName.String()") (path . "go/types/index#TypeName.String") (type . "go")) ((name . "types.TypeName.Type()") (path . "go/types/index#TypeName.Type") (type . "go")) ((name . "types.TypeParam") (path . "go/types/index#TypeParam") (type . "go")) ((name . "types.TypeParam.Constraint()") (path . "go/types/index#TypeParam.Constraint") (type . "go")) ((name . "types.TypeParam.Index()") (path . "go/types/index#TypeParam.Index") (type . "go")) ((name . "types.TypeParam.Obj()") (path . "go/types/index#TypeParam.Obj") (type . "go")) ((name . "types.TypeParam.SetConstraint()") (path . "go/types/index#TypeParam.SetConstraint") (type . "go")) ((name . "types.TypeParam.String()") (path . "go/types/index#TypeParam.String") (type . "go")) ((name . "types.TypeParam.Underlying()") (path . "go/types/index#TypeParam.Underlying") (type . "go")) ((name . "types.TypeParamList") (path . "go/types/index#TypeParamList") (type . "go")) ((name . "types.TypeParamList.At()") (path . "go/types/index#TypeParamList.At") (type . "go")) ((name . "types.TypeParamList.Len()") (path . "go/types/index#TypeParamList.Len") (type . "go")) ((name . "types.TypeString()") (path . "go/types/index#TypeString") (type . "go")) ((name . "types.Unalias()") (path . "go/types/index#Unalias") (type . "go")) ((name . "types.Union") (path . "go/types/index#Union") (type . "go")) ((name . "types.Union.Len()") (path . "go/types/index#Union.Len") (type . "go")) ((name . "types.Union.String()") (path . "go/types/index#Union.String") (type . "go")) ((name . "types.Union.Term()") (path . "go/types/index#Union.Term") (type . "go")) ((name . "types.Union.Underlying()") (path . "go/types/index#Union.Underlying") (type . "go")) ((name . "types.Var") (path . "go/types/index#Var") (type . "go")) ((name . "types.Var.Anonymous()") (path . "go/types/index#Var.Anonymous") (type . "go")) ((name . "types.Var.Embedded()") (path . "go/types/index#Var.Embedded") (type . "go")) ((name . "types.Var.Exported()") (path . "go/types/index#Var.Exported") (type . "go")) ((name . "types.Var.Id()") (path . "go/types/index#Var.Id") (type . "go")) ((name . "types.Var.IsField()") (path . "go/types/index#Var.IsField") (type . "go")) ((name . "types.Var.Name()") (path . "go/types/index#Var.Name") (type . "go")) ((name . "types.Var.Origin()") (path . "go/types/index#Var.Origin") (type . "go")) ((name . "types.Var.Parent()") (path . "go/types/index#Var.Parent") (type . "go")) ((name . "types.Var.Pkg()") (path . "go/types/index#Var.Pkg") (type . "go")) ((name . "types.Var.Pos()") (path . "go/types/index#Var.Pos") (type . "go")) ((name . "types.Var.String()") (path . "go/types/index#Var.String") (type . "go")) ((name . "types.Var.Type()") (path . "go/types/index#Var.Type") (type . "go")) ((name . "types.WriteExpr()") (path . "go/types/index#WriteExpr") (type . "go")) ((name . "types.WriteSignature()") (path . "go/types/index#WriteSignature") (type . "go")) ((name . "types.WriteType()") (path . "go/types/index#WriteType") (type . "go")) ((name . "unicode") (path . "unicode/index") (type . "unicode")) ((name . "unicode constants") (path . "unicode/index#pkg-constants") (type . "unicode")) ((name . "unicode variables") (path . "unicode/index#pkg-variables") (type . "unicode")) ((name . "unicode.CaseRange") (path . "unicode/index#CaseRange") (type . "unicode")) ((name . "unicode.In()") (path . "unicode/index#In") (type . "unicode")) ((name . "unicode.Is()") (path . "unicode/index#Is") (type . "unicode")) ((name . "unicode.IsControl()") (path . "unicode/index#IsControl") (type . "unicode")) ((name . "unicode.IsDigit()") (path . "unicode/index#IsDigit") (type . "unicode")) ((name . "unicode.IsGraphic()") (path . "unicode/index#IsGraphic") (type . "unicode")) ((name . "unicode.IsLetter()") (path . "unicode/index#IsLetter") (type . "unicode")) ((name . "unicode.IsLower()") (path . "unicode/index#IsLower") (type . "unicode")) ((name . "unicode.IsMark()") (path . "unicode/index#IsMark") (type . "unicode")) ((name . "unicode.IsNumber()") (path . "unicode/index#IsNumber") (type . "unicode")) ((name . "unicode.IsOneOf()") (path . "unicode/index#IsOneOf") (type . "unicode")) ((name . "unicode.IsPrint()") (path . "unicode/index#IsPrint") (type . "unicode")) ((name . "unicode.IsPunct()") (path . "unicode/index#IsPunct") (type . "unicode")) ((name . "unicode.IsSpace()") (path . "unicode/index#IsSpace") (type . "unicode")) ((name . "unicode.IsSymbol()") (path . "unicode/index#IsSymbol") (type . "unicode")) ((name . "unicode.IsTitle()") (path . "unicode/index#IsTitle") (type . "unicode")) ((name . "unicode.IsUpper()") (path . "unicode/index#IsUpper") (type . "unicode")) ((name . "unicode.Range16") (path . "unicode/index#Range16") (type . "unicode")) ((name . "unicode.Range32") (path . "unicode/index#Range32") (type . "unicode")) ((name . "unicode.RangeTable") (path . "unicode/index#RangeTable") (type . "unicode")) ((name . "unicode.SimpleFold()") (path . "unicode/index#SimpleFold") (type . "unicode")) ((name . "unicode.SpecialCase") (path . "unicode/index#SpecialCase") (type . "unicode")) ((name . "unicode.SpecialCase.ToLower()") (path . "unicode/index#SpecialCase.ToLower") (type . "unicode")) ((name . "unicode.SpecialCase.ToTitle()") (path . "unicode/index#SpecialCase.ToTitle") (type . "unicode")) ((name . "unicode.SpecialCase.ToUpper()") (path . "unicode/index#SpecialCase.ToUpper") (type . "unicode")) ((name . "unicode.To()") (path . "unicode/index#To") (type . "unicode")) ((name . "unicode.ToLower()") (path . "unicode/index#ToLower") (type . "unicode")) ((name . "unicode.ToTitle()") (path . "unicode/index#ToTitle") (type . "unicode")) ((name . "unicode.ToUpper()") (path . "unicode/index#ToUpper") (type . "unicode")) ((name . "unicode/utf16") (path . "unicode/utf16/index") (type . "unicode")) ((name . "unicode/utf8") (path . "unicode/utf8/index") (type . "unicode")) ((name . "unicode/utf8 constants") (path . "unicode/utf8/index#pkg-constants") (type . "unicode")) ((name . "unsafe") (path . "unsafe/index") (type . "unsafe")) ((name . "unsafe.Add()") (path . "unsafe/index#Add") (type . "unsafe")) ((name . "unsafe.Alignof()") (path . "unsafe/index#Alignof") (type . "unsafe")) ((name . "unsafe.ArbitraryType") (path . "unsafe/index#ArbitraryType") (type . "unsafe")) ((name . "unsafe.IntegerType") (path . "unsafe/index#IntegerType") (type . "unsafe")) ((name . "unsafe.Offsetof()") (path . "unsafe/index#Offsetof") (type . "unsafe")) ((name . "unsafe.Pointer") (path . "unsafe/index#Pointer") (type . "unsafe")) ((name . "unsafe.Sizeof()") (path . "unsafe/index#Sizeof") (type . "unsafe")) ((name . "unsafe.Slice()") (path . "unsafe/index#Slice") (type . "unsafe")) ((name . "unsafe.SliceData()") (path . "unsafe/index#SliceData") (type . "unsafe")) ((name . "unsafe.String()") (path . "unsafe/index#String") (type . "unsafe")) ((name . "unsafe.StringData()") (path . "unsafe/index#StringData") (type . "unsafe")) ((name . "url.Error") (path . "net/url/index#Error") (type . "net/url")) ((name . "url.Error.Error()") (path . "net/url/index#Error.Error") (type . "net/url")) ((name . "url.Error.Temporary()") (path . "net/url/index#Error.Temporary") (type . "net/url")) ((name . "url.Error.Timeout()") (path . "net/url/index#Error.Timeout") (type . "net/url")) ((name . "url.Error.Unwrap()") (path . "net/url/index#Error.Unwrap") (type . "net/url")) ((name . "url.EscapeError") (path . "net/url/index#EscapeError") (type . "net/url")) ((name . "url.EscapeError.Error()") (path . "net/url/index#EscapeError.Error") (type . "net/url")) ((name . "url.InvalidHostError") (path . "net/url/index#InvalidHostError") (type . "net/url")) ((name . "url.InvalidHostError.Error()") (path . "net/url/index#InvalidHostError.Error") (type . "net/url")) ((name . "url.JoinPath()") (path . "net/url/index#JoinPath") (type . "net/url")) ((name . "url.Parse()") (path . "net/url/index#Parse") (type . "net/url")) ((name . "url.ParseQuery()") (path . "net/url/index#ParseQuery") (type . "net/url")) ((name . "url.ParseRequestURI()") (path . "net/url/index#ParseRequestURI") (type . "net/url")) ((name . "url.PathEscape()") (path . "net/url/index#PathEscape") (type . "net/url")) ((name . "url.PathUnescape()") (path . "net/url/index#PathUnescape") (type . "net/url")) ((name . "url.QueryEscape()") (path . "net/url/index#QueryEscape") (type . "net/url")) ((name . "url.QueryUnescape()") (path . "net/url/index#QueryUnescape") (type . "net/url")) ((name . "url.URL") (path . "net/url/index#URL") (type . "net/url")) ((name . "url.URL.EscapedFragment()") (path . "net/url/index#URL.EscapedFragment") (type . "net/url")) ((name . "url.URL.EscapedPath()") (path . "net/url/index#URL.EscapedPath") (type . "net/url")) ((name . "url.URL.Hostname()") (path . "net/url/index#URL.Hostname") (type . "net/url")) ((name . "url.URL.IsAbs()") (path . "net/url/index#URL.IsAbs") (type . "net/url")) ((name . "url.URL.JoinPath()") (path . "net/url/index#URL.JoinPath") (type . "net/url")) ((name . "url.URL.MarshalBinary()") (path . "net/url/index#URL.MarshalBinary") (type . "net/url")) ((name . "url.URL.Parse()") (path . "net/url/index#URL.Parse") (type . "net/url")) ((name . "url.URL.Port()") (path . "net/url/index#URL.Port") (type . "net/url")) ((name . "url.URL.Query()") (path . "net/url/index#URL.Query") (type . "net/url")) ((name . "url.URL.Redacted()") (path . "net/url/index#URL.Redacted") (type . "net/url")) ((name . "url.URL.RequestURI()") (path . "net/url/index#URL.RequestURI") (type . "net/url")) ((name . "url.URL.ResolveReference()") (path . "net/url/index#URL.ResolveReference") (type . "net/url")) ((name . "url.URL.String()") (path . "net/url/index#URL.String") (type . "net/url")) ((name . "url.URL.UnmarshalBinary()") (path . "net/url/index#URL.UnmarshalBinary") (type . "net/url")) ((name . "url.User()") (path . "net/url/index#User") (type . "net/url")) ((name . "url.Userinfo") (path . "net/url/index#Userinfo") (type . "net/url")) ((name . "url.Userinfo.Password()") (path . "net/url/index#Userinfo.Password") (type . "net/url")) ((name . "url.Userinfo.String()") (path . "net/url/index#Userinfo.String") (type . "net/url")) ((name . "url.Userinfo.Username()") (path . "net/url/index#Userinfo.Username") (type . "net/url")) ((name . "url.UserPassword()") (path . "net/url/index#UserPassword") (type . "net/url")) ((name . "url.Values") (path . "net/url/index#Values") (type . "net/url")) ((name . "url.Values.Add()") (path . "net/url/index#Values.Add") (type . "net/url")) ((name . "url.Values.Del()") (path . "net/url/index#Values.Del") (type . "net/url")) ((name . "url.Values.Encode()") (path . "net/url/index#Values.Encode") (type . "net/url")) ((name . "url.Values.Get()") (path . "net/url/index#Values.Get") (type . "net/url")) ((name . "url.Values.Has()") (path . "net/url/index#Values.Has") (type . "net/url")) ((name . "url.Values.Set()") (path . "net/url/index#Values.Set") (type . "net/url")) ((name . "user.Current()") (path . "os/user/index#Current") (type . "os")) ((name . "user.Group") (path . "os/user/index#Group") (type . "os")) ((name . "user.Lookup()") (path . "os/user/index#Lookup") (type . "os")) ((name . "user.LookupGroup()") (path . "os/user/index#LookupGroup") (type . "os")) ((name . "user.LookupGroupId()") (path . "os/user/index#LookupGroupId") (type . "os")) ((name . "user.LookupId()") (path . "os/user/index#LookupId") (type . "os")) ((name . "user.UnknownGroupError") (path . "os/user/index#UnknownGroupError") (type . "os")) ((name . "user.UnknownGroupError.Error()") (path . "os/user/index#UnknownGroupError.Error") (type . "os")) ((name . "user.UnknownGroupIdError") (path . "os/user/index#UnknownGroupIdError") (type . "os")) ((name . "user.UnknownGroupIdError.Error()") (path . "os/user/index#UnknownGroupIdError.Error") (type . "os")) ((name . "user.UnknownUserError") (path . "os/user/index#UnknownUserError") (type . "os")) ((name . "user.UnknownUserError.Error()") (path . "os/user/index#UnknownUserError.Error") (type . "os")) ((name . "user.UnknownUserIdError") (path . "os/user/index#UnknownUserIdError") (type . "os")) ((name . "user.UnknownUserIdError.Error()") (path . "os/user/index#UnknownUserIdError.Error") (type . "os")) ((name . "user.User") (path . "os/user/index#User") (type . "os")) ((name . "user.User.GroupIds()") (path . "os/user/index#User.GroupIds") (type . "os")) ((name . "utf16.AppendRune()") (path . "unicode/utf16/index#AppendRune") (type . "unicode")) ((name . "utf16.Decode()") (path . "unicode/utf16/index#Decode") (type . "unicode")) ((name . "utf16.DecodeRune()") (path . "unicode/utf16/index#DecodeRune") (type . "unicode")) ((name . "utf16.Encode()") (path . "unicode/utf16/index#Encode") (type . "unicode")) ((name . "utf16.EncodeRune()") (path . "unicode/utf16/index#EncodeRune") (type . "unicode")) ((name . "utf16.IsSurrogate()") (path . "unicode/utf16/index#IsSurrogate") (type . "unicode")) ((name . "utf8.AppendRune()") (path . "unicode/utf8/index#AppendRune") (type . "unicode")) ((name . "utf8.DecodeLastRune()") (path . "unicode/utf8/index#DecodeLastRune") (type . "unicode")) ((name . "utf8.DecodeLastRuneInString()") (path . "unicode/utf8/index#DecodeLastRuneInString") (type . "unicode")) ((name . "utf8.DecodeRune()") (path . "unicode/utf8/index#DecodeRune") (type . "unicode")) ((name . "utf8.DecodeRuneInString()") (path . "unicode/utf8/index#DecodeRuneInString") (type . "unicode")) ((name . "utf8.EncodeRune()") (path . "unicode/utf8/index#EncodeRune") (type . "unicode")) ((name . "utf8.FullRune()") (path . "unicode/utf8/index#FullRune") (type . "unicode")) ((name . "utf8.FullRuneInString()") (path . "unicode/utf8/index#FullRuneInString") (type . "unicode")) ((name . "utf8.RuneCount()") (path . "unicode/utf8/index#RuneCount") (type . "unicode")) ((name . "utf8.RuneCountInString()") (path . "unicode/utf8/index#RuneCountInString") (type . "unicode")) ((name . "utf8.RuneLen()") (path . "unicode/utf8/index#RuneLen") (type . "unicode")) ((name . "utf8.RuneStart()") (path . "unicode/utf8/index#RuneStart") (type . "unicode")) ((name . "utf8.Valid()") (path . "unicode/utf8/index#Valid") (type . "unicode")) ((name . "utf8.ValidRune()") (path . "unicode/utf8/index#ValidRune") (type . "unicode")) ((name . "utf8.ValidString()") (path . "unicode/utf8/index#ValidString") (type . "unicode")) ((name . "v2.ChaCha8") (path . "math/rand/v2/index#ChaCha8") (type . "math/rand")) ((name . "v2.ChaCha8.MarshalBinary()") (path . "math/rand/v2/index#ChaCha8.MarshalBinary") (type . "math/rand")) ((name . "v2.ChaCha8.Seed()") (path . "math/rand/v2/index#ChaCha8.Seed") (type . "math/rand")) ((name . "v2.ChaCha8.Uint64()") (path . "math/rand/v2/index#ChaCha8.Uint64") (type . "math/rand")) ((name . "v2.ChaCha8.UnmarshalBinary()") (path . "math/rand/v2/index#ChaCha8.UnmarshalBinary") (type . "math/rand")) ((name . "v2.ExpFloat64()") (path . "math/rand/v2/index#ExpFloat64") (type . "math/rand")) ((name . "v2.Float32()") (path . "math/rand/v2/index#Float32") (type . "math/rand")) ((name . "v2.Float64()") (path . "math/rand/v2/index#Float64") (type . "math/rand")) ((name . "v2.Int()") (path . "math/rand/v2/index#Int") (type . "math/rand")) ((name . "v2.Int32()") (path . "math/rand/v2/index#Int32") (type . "math/rand")) ((name . "v2.Int32N()") (path . "math/rand/v2/index#Int32N") (type . "math/rand")) ((name . "v2.Int64()") (path . "math/rand/v2/index#Int64") (type . "math/rand")) ((name . "v2.Int64N()") (path . "math/rand/v2/index#Int64N") (type . "math/rand")) ((name . "v2.IntN()") (path . "math/rand/v2/index#IntN") (type . "math/rand")) ((name . "v2.N()") (path . "math/rand/v2/index#N") (type . "math/rand")) ((name . "v2.New()") (path . "math/rand/v2/index#New") (type . "math/rand")) ((name . "v2.NewChaCha8()") (path . "math/rand/v2/index#NewChaCha8") (type . "math/rand")) ((name . "v2.NewPCG()") (path . "math/rand/v2/index#NewPCG") (type . "math/rand")) ((name . "v2.NewZipf()") (path . "math/rand/v2/index#NewZipf") (type . "math/rand")) ((name . "v2.NormFloat64()") (path . "math/rand/v2/index#NormFloat64") (type . "math/rand")) ((name . "v2.PCG") (path . "math/rand/v2/index#PCG") (type . "math/rand")) ((name . "v2.PCG.MarshalBinary()") (path . "math/rand/v2/index#PCG.MarshalBinary") (type . "math/rand")) ((name . "v2.PCG.Seed()") (path . "math/rand/v2/index#PCG.Seed") (type . "math/rand")) ((name . "v2.PCG.Uint64()") (path . "math/rand/v2/index#PCG.Uint64") (type . "math/rand")) ((name . "v2.PCG.UnmarshalBinary()") (path . "math/rand/v2/index#PCG.UnmarshalBinary") (type . "math/rand")) ((name . "v2.Perm()") (path . "math/rand/v2/index#Perm") (type . "math/rand")) ((name . "v2.Rand") (path . "math/rand/v2/index#Rand") (type . "math/rand")) ((name . "v2.Rand.ExpFloat64()") (path . "math/rand/v2/index#Rand.ExpFloat64") (type . "math/rand")) ((name . "v2.Rand.Float32()") (path . "math/rand/v2/index#Rand.Float32") (type . "math/rand")) ((name . "v2.Rand.Float64()") (path . "math/rand/v2/index#Rand.Float64") (type . "math/rand")) ((name . "v2.Rand.Int()") (path . "math/rand/v2/index#Rand.Int") (type . "math/rand")) ((name . "v2.Rand.Int32()") (path . "math/rand/v2/index#Rand.Int32") (type . "math/rand")) ((name . "v2.Rand.Int32N()") (path . "math/rand/v2/index#Rand.Int32N") (type . "math/rand")) ((name . "v2.Rand.Int64()") (path . "math/rand/v2/index#Rand.Int64") (type . "math/rand")) ((name . "v2.Rand.Int64N()") (path . "math/rand/v2/index#Rand.Int64N") (type . "math/rand")) ((name . "v2.Rand.IntN()") (path . "math/rand/v2/index#Rand.IntN") (type . "math/rand")) ((name . "v2.Rand.NormFloat64()") (path . "math/rand/v2/index#Rand.NormFloat64") (type . "math/rand")) ((name . "v2.Rand.Perm()") (path . "math/rand/v2/index#Rand.Perm") (type . "math/rand")) ((name . "v2.Rand.Shuffle()") (path . "math/rand/v2/index#Rand.Shuffle") (type . "math/rand")) ((name . "v2.Rand.Uint32()") (path . "math/rand/v2/index#Rand.Uint32") (type . "math/rand")) ((name . "v2.Rand.Uint32N()") (path . "math/rand/v2/index#Rand.Uint32N") (type . "math/rand")) ((name . "v2.Rand.Uint64()") (path . "math/rand/v2/index#Rand.Uint64") (type . "math/rand")) ((name . "v2.Rand.Uint64N()") (path . "math/rand/v2/index#Rand.Uint64N") (type . "math/rand")) ((name . "v2.Rand.UintN()") (path . "math/rand/v2/index#Rand.UintN") (type . "math/rand")) ((name . "v2.Shuffle()") (path . "math/rand/v2/index#Shuffle") (type . "math/rand")) ((name . "v2.Source") (path . "math/rand/v2/index#Source") (type . "math/rand")) ((name . "v2.Uint32()") (path . "math/rand/v2/index#Uint32") (type . "math/rand")) ((name . "v2.Uint32N()") (path . "math/rand/v2/index#Uint32N") (type . "math/rand")) ((name . "v2.Uint64()") (path . "math/rand/v2/index#Uint64") (type . "math/rand")) ((name . "v2.Uint64N()") (path . "math/rand/v2/index#Uint64N") (type . "math/rand")) ((name . "v2.UintN()") (path . "math/rand/v2/index#UintN") (type . "math/rand")) ((name . "v2.Zipf") (path . "math/rand/v2/index#Zipf") (type . "math/rand")) ((name . "v2.Zipf.Uint64()") (path . "math/rand/v2/index#Zipf.Uint64") (type . "math/rand")) ((name . "version.Compare()") (path . "go/version/index#Compare") (type . "go")) ((name . "version.IsValid()") (path . "go/version/index#IsValid") (type . "go")) ((name . "version.Lang()") (path . "go/version/index#Lang") (type . "go")) ((name . "x509.Certificate") (path . "crypto/x509/index#Certificate") (type . "crypto")) ((name . "x509.Certificate.CheckCRLSignature()") (path . "crypto/x509/index#Certificate.CheckCRLSignature") (type . "crypto")) ((name . "x509.Certificate.CheckSignature()") (path . "crypto/x509/index#Certificate.CheckSignature") (type . "crypto")) ((name . "x509.Certificate.CheckSignatureFrom()") (path . "crypto/x509/index#Certificate.CheckSignatureFrom") (type . "crypto")) ((name . "x509.Certificate.CreateCRL()") (path . "crypto/x509/index#Certificate.CreateCRL") (type . "crypto")) ((name . "x509.Certificate.Equal()") (path . "crypto/x509/index#Certificate.Equal") (type . "crypto")) ((name . "x509.Certificate.Verify()") (path . "crypto/x509/index#Certificate.Verify") (type . "crypto")) ((name . "x509.Certificate.VerifyHostname()") (path . "crypto/x509/index#Certificate.VerifyHostname") (type . "crypto")) ((name . "x509.CertificateInvalidError") (path . "crypto/x509/index#CertificateInvalidError") (type . "crypto")) ((name . "x509.CertificateInvalidError.Error()") (path . "crypto/x509/index#CertificateInvalidError.Error") (type . "crypto")) ((name . "x509.CertificateRequest") (path . "crypto/x509/index#CertificateRequest") (type . "crypto")) ((name . "x509.CertificateRequest.CheckSignature()") (path . "crypto/x509/index#CertificateRequest.CheckSignature") (type . "crypto")) ((name . "x509.CertPool") (path . "crypto/x509/index#CertPool") (type . "crypto")) ((name . "x509.CertPool.AddCert()") (path . "crypto/x509/index#CertPool.AddCert") (type . "crypto")) ((name . "x509.CertPool.AddCertWithConstraint()") (path . "crypto/x509/index#CertPool.AddCertWithConstraint") (type . "crypto")) ((name . "x509.CertPool.AppendCertsFromPEM()") (path . "crypto/x509/index#CertPool.AppendCertsFromPEM") (type . "crypto")) ((name . "x509.CertPool.Clone()") (path . "crypto/x509/index#CertPool.Clone") (type . "crypto")) ((name . "x509.CertPool.Equal()") (path . "crypto/x509/index#CertPool.Equal") (type . "crypto")) ((name . "x509.CertPool.Subjects()") (path . "crypto/x509/index#CertPool.Subjects") (type . "crypto")) ((name . "x509.ConstraintViolationError") (path . "crypto/x509/index#ConstraintViolationError") (type . "crypto")) ((name . "x509.ConstraintViolationError.Error()") (path . "crypto/x509/index#ConstraintViolationError.Error") (type . "crypto")) ((name . "x509.CreateCertificate()") (path . "crypto/x509/index#CreateCertificate") (type . "crypto")) ((name . "x509.CreateCertificateRequest()") (path . "crypto/x509/index#CreateCertificateRequest") (type . "crypto")) ((name . "x509.CreateRevocationList()") (path . "crypto/x509/index#CreateRevocationList") (type . "crypto")) ((name . "x509.DecryptPEMBlock()") (path . "crypto/x509/index#DecryptPEMBlock") (type . "crypto")) ((name . "x509.EncryptPEMBlock()") (path . "crypto/x509/index#EncryptPEMBlock") (type . "crypto")) ((name . "x509.ExtKeyUsage") (path . "crypto/x509/index#ExtKeyUsage") (type . "crypto")) ((name . "x509.HostnameError") (path . "crypto/x509/index#HostnameError") (type . "crypto")) ((name . "x509.HostnameError.Error()") (path . "crypto/x509/index#HostnameError.Error") (type . "crypto")) ((name . "x509.InsecureAlgorithmError") (path . "crypto/x509/index#InsecureAlgorithmError") (type . "crypto")) ((name . "x509.InsecureAlgorithmError.Error()") (path . "crypto/x509/index#InsecureAlgorithmError.Error") (type . "crypto")) ((name . "x509.InvalidReason") (path . "crypto/x509/index#InvalidReason") (type . "crypto")) ((name . "x509.IsEncryptedPEMBlock()") (path . "crypto/x509/index#IsEncryptedPEMBlock") (type . "crypto")) ((name . "x509.KeyUsage") (path . "crypto/x509/index#KeyUsage") (type . "crypto")) ((name . "x509.MarshalECPrivateKey()") (path . "crypto/x509/index#MarshalECPrivateKey") (type . "crypto")) ((name . "x509.MarshalPKCS1PrivateKey()") (path . "crypto/x509/index#MarshalPKCS1PrivateKey") (type . "crypto")) ((name . "x509.MarshalPKCS1PublicKey()") (path . "crypto/x509/index#MarshalPKCS1PublicKey") (type . "crypto")) ((name . "x509.MarshalPKCS8PrivateKey()") (path . "crypto/x509/index#MarshalPKCS8PrivateKey") (type . "crypto")) ((name . "x509.MarshalPKIXPublicKey()") (path . "crypto/x509/index#MarshalPKIXPublicKey") (type . "crypto")) ((name . "x509.NewCertPool()") (path . "crypto/x509/index#NewCertPool") (type . "crypto")) ((name . "x509.OID") (path . "crypto/x509/index#OID") (type . "crypto")) ((name . "x509.OID.Equal()") (path . "crypto/x509/index#OID.Equal") (type . "crypto")) ((name . "x509.OID.EqualASN1OID()") (path . "crypto/x509/index#OID.EqualASN1OID") (type . "crypto")) ((name . "x509.OID.String()") (path . "crypto/x509/index#OID.String") (type . "crypto")) ((name . "x509.OIDFromInts()") (path . "crypto/x509/index#OIDFromInts") (type . "crypto")) ((name . "x509.ParseCertificate()") (path . "crypto/x509/index#ParseCertificate") (type . "crypto")) ((name . "x509.ParseCertificateRequest()") (path . "crypto/x509/index#ParseCertificateRequest") (type . "crypto")) ((name . "x509.ParseCertificates()") (path . "crypto/x509/index#ParseCertificates") (type . "crypto")) ((name . "x509.ParseCRL()") (path . "crypto/x509/index#ParseCRL") (type . "crypto")) ((name . "x509.ParseDERCRL()") (path . "crypto/x509/index#ParseDERCRL") (type . "crypto")) ((name . "x509.ParseECPrivateKey()") (path . "crypto/x509/index#ParseECPrivateKey") (type . "crypto")) ((name . "x509.ParsePKCS1PrivateKey()") (path . "crypto/x509/index#ParsePKCS1PrivateKey") (type . "crypto")) ((name . "x509.ParsePKCS1PublicKey()") (path . "crypto/x509/index#ParsePKCS1PublicKey") (type . "crypto")) ((name . "x509.ParsePKCS8PrivateKey()") (path . "crypto/x509/index#ParsePKCS8PrivateKey") (type . "crypto")) ((name . "x509.ParsePKIXPublicKey()") (path . "crypto/x509/index#ParsePKIXPublicKey") (type . "crypto")) ((name . "x509.ParseRevocationList()") (path . "crypto/x509/index#ParseRevocationList") (type . "crypto")) ((name . "x509.PEMCipher") (path . "crypto/x509/index#PEMCipher") (type . "crypto")) ((name . "x509.PublicKeyAlgorithm") (path . "crypto/x509/index#PublicKeyAlgorithm") (type . "crypto")) ((name . "x509.PublicKeyAlgorithm.String()") (path . "crypto/x509/index#PublicKeyAlgorithm.String") (type . "crypto")) ((name . "x509.RevocationList") (path . "crypto/x509/index#RevocationList") (type . "crypto")) ((name . "x509.RevocationList.CheckSignatureFrom()") (path . "crypto/x509/index#RevocationList.CheckSignatureFrom") (type . "crypto")) ((name . "x509.RevocationListEntry") (path . "crypto/x509/index#RevocationListEntry") (type . "crypto")) ((name . "x509.SetFallbackRoots()") (path . "crypto/x509/index#SetFallbackRoots") (type . "crypto")) ((name . "x509.SignatureAlgorithm") (path . "crypto/x509/index#SignatureAlgorithm") (type . "crypto")) ((name . "x509.SignatureAlgorithm.String()") (path . "crypto/x509/index#SignatureAlgorithm.String") (type . "crypto")) ((name . "x509.SystemCertPool()") (path . "crypto/x509/index#SystemCertPool") (type . "crypto")) ((name . "x509.SystemRootsError") (path . "crypto/x509/index#SystemRootsError") (type . "crypto")) ((name . "x509.SystemRootsError.Error()") (path . "crypto/x509/index#SystemRootsError.Error") (type . "crypto")) ((name . "x509.SystemRootsError.Unwrap()") (path . "crypto/x509/index#SystemRootsError.Unwrap") (type . "crypto")) ((name . "x509.UnhandledCriticalExtension") (path . "crypto/x509/index#UnhandledCriticalExtension") (type . "crypto")) ((name . "x509.UnhandledCriticalExtension.Error()") (path . "crypto/x509/index#UnhandledCriticalExtension.Error") (type . "crypto")) ((name . "x509.UnknownAuthorityError") (path . "crypto/x509/index#UnknownAuthorityError") (type . "crypto")) ((name . "x509.UnknownAuthorityError.Error()") (path . "crypto/x509/index#UnknownAuthorityError.Error") (type . "crypto")) ((name . "x509.VerifyOptions") (path . "crypto/x509/index#VerifyOptions") (type . "crypto")) ((name . "xml.Attr") (path . "encoding/xml/index#Attr") (type . "encoding")) ((name . "xml.CharData") (path . "encoding/xml/index#CharData") (type . "encoding")) ((name . "xml.CharData.Copy()") (path . "encoding/xml/index#CharData.Copy") (type . "encoding")) ((name . "xml.Comment") (path . "encoding/xml/index#Comment") (type . "encoding")) ((name . "xml.Comment.Copy()") (path . "encoding/xml/index#Comment.Copy") (type . "encoding")) ((name . "xml.CopyToken()") (path . "encoding/xml/index#CopyToken") (type . "encoding")) ((name . "xml.Decoder") (path . "encoding/xml/index#Decoder") (type . "encoding")) ((name . "xml.Decoder.Decode()") (path . "encoding/xml/index#Decoder.Decode") (type . "encoding")) ((name . "xml.Decoder.DecodeElement()") (path . "encoding/xml/index#Decoder.DecodeElement") (type . "encoding")) ((name . "xml.Decoder.InputOffset()") (path . "encoding/xml/index#Decoder.InputOffset") (type . "encoding")) ((name . "xml.Decoder.InputPos()") (path . "encoding/xml/index#Decoder.InputPos") (type . "encoding")) ((name . "xml.Decoder.RawToken()") (path . "encoding/xml/index#Decoder.RawToken") (type . "encoding")) ((name . "xml.Decoder.Skip()") (path . "encoding/xml/index#Decoder.Skip") (type . "encoding")) ((name . "xml.Decoder.Token()") (path . "encoding/xml/index#Decoder.Token") (type . "encoding")) ((name . "xml.Directive") (path . "encoding/xml/index#Directive") (type . "encoding")) ((name . "xml.Directive.Copy()") (path . "encoding/xml/index#Directive.Copy") (type . "encoding")) ((name . "xml.Encoder") (path . "encoding/xml/index#Encoder") (type . "encoding")) ((name . "xml.Encoder.Close()") (path . "encoding/xml/index#Encoder.Close") (type . "encoding")) ((name . "xml.Encoder.Encode()") (path . "encoding/xml/index#Encoder.Encode") (type . "encoding")) ((name . "xml.Encoder.EncodeElement()") (path . "encoding/xml/index#Encoder.EncodeElement") (type . "encoding")) ((name . "xml.Encoder.EncodeToken()") (path . "encoding/xml/index#Encoder.EncodeToken") (type . "encoding")) ((name . "xml.Encoder.Flush()") (path . "encoding/xml/index#Encoder.Flush") (type . "encoding")) ((name . "xml.Encoder.Indent()") (path . "encoding/xml/index#Encoder.Indent") (type . "encoding")) ((name . "xml.EndElement") (path . "encoding/xml/index#EndElement") (type . "encoding")) ((name . "xml.Escape()") (path . "encoding/xml/index#Escape") (type . "encoding")) ((name . "xml.EscapeText()") (path . "encoding/xml/index#EscapeText") (type . "encoding")) ((name . "xml.Marshal()") (path . "encoding/xml/index#Marshal") (type . "encoding")) ((name . "xml.Marshaler") (path . "encoding/xml/index#Marshaler") (type . "encoding")) ((name . "xml.MarshalerAttr") (path . "encoding/xml/index#MarshalerAttr") (type . "encoding")) ((name . "xml.MarshalIndent()") (path . "encoding/xml/index#MarshalIndent") (type . "encoding")) ((name . "xml.Name") (path . "encoding/xml/index#Name") (type . "encoding")) ((name . "xml.NewDecoder()") (path . "encoding/xml/index#NewDecoder") (type . "encoding")) ((name . "xml.NewEncoder()") (path . "encoding/xml/index#NewEncoder") (type . "encoding")) ((name . "xml.NewTokenDecoder()") (path . "encoding/xml/index#NewTokenDecoder") (type . "encoding")) ((name . "xml.ProcInst") (path . "encoding/xml/index#ProcInst") (type . "encoding")) ((name . "xml.ProcInst.Copy()") (path . "encoding/xml/index#ProcInst.Copy") (type . "encoding")) ((name . "xml.StartElement") (path . "encoding/xml/index#StartElement") (type . "encoding")) ((name . "xml.StartElement.Copy()") (path . "encoding/xml/index#StartElement.Copy") (type . "encoding")) ((name . "xml.StartElement.End()") (path . "encoding/xml/index#StartElement.End") (type . "encoding")) ((name . "xml.SyntaxError") (path . "encoding/xml/index#SyntaxError") (type . "encoding")) ((name . "xml.SyntaxError.Error()") (path . "encoding/xml/index#SyntaxError.Error") (type . "encoding")) ((name . "xml.TagPathError") (path . "encoding/xml/index#TagPathError") (type . "encoding")) ((name . "xml.TagPathError.Error()") (path . "encoding/xml/index#TagPathError.Error") (type . "encoding")) ((name . "xml.Token") (path . "encoding/xml/index#Token") (type . "encoding")) ((name . "xml.TokenReader") (path . "encoding/xml/index#TokenReader") (type . "encoding")) ((name . "xml.Unmarshal()") (path . "encoding/xml/index#Unmarshal") (type . "encoding")) ((name . "xml.Unmarshaler") (path . "encoding/xml/index#Unmarshaler") (type . "encoding")) ((name . "xml.UnmarshalerAttr") (path . "encoding/xml/index#UnmarshalerAttr") (type . "encoding")) ((name . "xml.UnmarshalError") (path . "encoding/xml/index#UnmarshalError") (type . "encoding")) ((name . "xml.UnmarshalError.Error()") (path . "encoding/xml/index#UnmarshalError.Error") (type . "encoding")) ((name . "xml.UnsupportedTypeError") (path . "encoding/xml/index#UnsupportedTypeError") (type . "encoding")) ((name . "xml.UnsupportedTypeError.Error()") (path . "encoding/xml/index#UnsupportedTypeError.Error") (type . "encoding")) ((name . "zip.Compressor") (path . "archive/zip/index#Compressor") (type . "archive")) ((name . "zip.Decompressor") (path . "archive/zip/index#Decompressor") (type . "archive")) ((name . "zip.File") (path . "archive/zip/index#File") (type . "archive")) ((name . "zip.File.DataOffset()") (path . "archive/zip/index#File.DataOffset") (type . "archive")) ((name . "zip.File.Open()") (path . "archive/zip/index#File.Open") (type . "archive")) ((name . "zip.File.OpenRaw()") (path . "archive/zip/index#File.OpenRaw") (type . "archive")) ((name . "zip.FileHeader") (path . "archive/zip/index#FileHeader") (type . "archive")) ((name . "zip.FileHeader.FileInfo()") (path . "archive/zip/index#FileHeader.FileInfo") (type . "archive")) ((name . "zip.FileHeader.Mode()") (path . "archive/zip/index#FileHeader.Mode") (type . "archive")) ((name . "zip.FileHeader.ModTime()") (path . "archive/zip/index#FileHeader.ModTime") (type . "archive")) ((name . "zip.FileHeader.SetMode()") (path . "archive/zip/index#FileHeader.SetMode") (type . "archive")) ((name . "zip.FileHeader.SetModTime()") (path . "archive/zip/index#FileHeader.SetModTime") (type . "archive")) ((name . "zip.FileInfoHeader()") (path . "archive/zip/index#FileInfoHeader") (type . "archive")) ((name . "zip.NewReader()") (path . "archive/zip/index#NewReader") (type . "archive")) ((name . "zip.NewWriter()") (path . "archive/zip/index#NewWriter") (type . "archive")) ((name . "zip.OpenReader()") (path . "archive/zip/index#OpenReader") (type . "archive")) ((name . "zip.ReadCloser") (path . "archive/zip/index#ReadCloser") (type . "archive")) ((name . "zip.ReadCloser.Close()") (path . "archive/zip/index#ReadCloser.Close") (type . "archive")) ((name . "zip.Reader") (path . "archive/zip/index#Reader") (type . "archive")) ((name . "zip.Reader.Open()") (path . "archive/zip/index#Reader.Open") (type . "archive")) ((name . "zip.Reader.RegisterDecompressor()") (path . "archive/zip/index#Reader.RegisterDecompressor") (type . "archive")) ((name . "zip.RegisterCompressor()") (path . "archive/zip/index#RegisterCompressor") (type . "archive")) ((name . "zip.RegisterDecompressor()") (path . "archive/zip/index#RegisterDecompressor") (type . "archive")) ((name . "zip.Writer") (path . "archive/zip/index#Writer") (type . "archive")) ((name . "zip.Writer.AddFS()") (path . "archive/zip/index#Writer.AddFS") (type . "archive")) ((name . "zip.Writer.Close()") (path . "archive/zip/index#Writer.Close") (type . "archive")) ((name . "zip.Writer.Copy()") (path . "archive/zip/index#Writer.Copy") (type . "archive")) ((name . "zip.Writer.Create()") (path . "archive/zip/index#Writer.Create") (type . "archive")) ((name . "zip.Writer.CreateHeader()") (path . "archive/zip/index#Writer.CreateHeader") (type . "archive")) ((name . "zip.Writer.CreateRaw()") (path . "archive/zip/index#Writer.CreateRaw") (type . "archive")) ((name . "zip.Writer.Flush()") (path . "archive/zip/index#Writer.Flush") (type . "archive")) ((name . "zip.Writer.RegisterCompressor()") (path . "archive/zip/index#Writer.RegisterCompressor") (type . "archive")) ((name . "zip.Writer.SetComment()") (path . "archive/zip/index#Writer.SetComment") (type . "archive")) ((name . "zip.Writer.SetOffset()") (path . "archive/zip/index#Writer.SetOffset") (type . "archive")) ((name . "zlib.NewReader()") (path . "compress/zlib/index#NewReader") (type . "compress")) ((name . "zlib.NewReaderDict()") (path . "compress/zlib/index#NewReaderDict") (type . "compress")) ((name . "zlib.NewWriter()") (path . "compress/zlib/index#NewWriter") (type . "compress")) ((name . "zlib.NewWriterLevel()") (path . "compress/zlib/index#NewWriterLevel") (type . "compress")) ((name . "zlib.NewWriterLevelDict()") (path . "compress/zlib/index#NewWriterLevelDict") (type . "compress")) ((name . "zlib.Resetter") (path . "compress/zlib/index#Resetter") (type . "compress")) ((name . "zlib.Writer") (path . "compress/zlib/index#Writer") (type . "compress")) ((name . "zlib.Writer.Close()") (path . "compress/zlib/index#Writer.Close") (type . "compress")) ((name . "zlib.Writer.Flush()") (path . "compress/zlib/index#Writer.Flush") (type . "compress")) ((name . "zlib.Writer.Reset()") (path . "compress/zlib/index#Writer.Reset") (type . "compress")) ((name . "zlib.Writer.Write()") (path . "compress/zlib/index#Writer.Write") (type . "compress"))]) (types . [((name . "archive") (count . 56) (slug . "archive")) ((name . "arena") (count . 1) (slug . "arena")) ((name . "bufio") (count . 50) (slug . "bufio")) ((name . "builtin") (count . 48) (slug . "builtin")) ((name . "bytes") (count . 94) (slug . "bytes")) ((name . "cmp") (count . 5) (slug . "cmp")) ((name . "compress") (count . 68) (slug . "compress")) ((name . "container") (count . 38) (slug . "container")) ((name . "context") (count . 17) (slug . "context")) ((name . "crypto") (count . 377) (slug . "crypto")) ((name . "database") (count . 156) (slug . "database")) ((name . "debug") (count . 379) (slug . "debug")) ((name . "embed") (count . 5) (slug . "embed")) ((name . "encoding") (count . 245) (slug . "encoding")) ((name . "errors") (count . 7) (slug . "errors")) ((name . "expvar") (count . 37) (slug . "expvar")) ((name . "flag") (count . 76) (slug . "flag")) ((name . "fmt") (count . 30) (slug . "fmt")) ((name . "go") (count . 754) (slug . "go")) ((name . "hash") (count . 48) (slug . "hash")) ((name . "html") (count . 45) (slug . "html")) ((name . "image") (count . 276) (slug . "image")) ((name . "index") (count . 8) (slug . "index")) ((name . "internal") (count . 5) (slug . "internal")) ((name . "io") (count . 102) (slug . "io")) ((name . "iter") (count . 1) (slug . "iter")) ((name . "log") (count . 162) (slug . "log")) ((name . "maps") (count . 6) (slug . "maps")) ((name . "math") (count . 69) (slug . "math")) ((name . "math/big") (count . 152) (slug . "math-big")) ((name . "math/bits") (count . 51) (slug . "math-bits")) ((name . "math/cmplx") (count . 28) (slug . "math-cmplx")) ((name . "math/rand") (count . 95) (slug . "math-rand")) ((name . "mime") (count . 48) (slug . "mime")) ((name . "net") (count . 258) (slug . "net")) ((name . "net/http") (count . 228) (slug . "net-http")) ((name . "net/mail") (count . 16) (slug . "net-mail")) ((name . "net/netip") (count . 74) (slug . "net-netip")) ((name . "net/rpc") (count . 42) (slug . "net-rpc")) ((name . "net/smtp") (count . 22) (slug . "net-smtp")) ((name . "net/textproto") (count . 41) (slug . "net-textproto")) ((name . "net/url") (count . 46) (slug . "net-url")) ((name . "os") (count . 161) (slug . "os")) ((name . "path") (count . 34) (slug . "path")) ((name . "plugin") (count . 5) (slug . "plugin")) ((name . "reflect") (count . 128) (slug . "reflect")) ((name . "regexp") (count . 79) (slug . "regexp")) ((name . "runtime") (count . 139) (slug . "runtime")) ((name . "slices") (count . 31) (slug . "slices")) ((name . "sort") (count . 38) (slug . "sort")) ((name . "strconv") (count . 40) (slug . "strconv")) ((name . "strings") (count . 78) (slug . "strings")) ((name . "sync") (count . 116) (slug . "sync")) ((name . "syscall") (count . 366) (slug . "syscall")) ((name . "testing") (count . 140) (slug . "testing")) ((name . "text") (count . 140) (slug . "text")) ((name . "time") (count . 93) (slug . "time")) ((name . "unicode") (count . 56) (slug . "unicode")) ((name . "unsafe") (count . 12) (slug . "unsafe"))])) \ No newline at end of file
diff --git a/devdocs/go/index%2Fsuffixarray%2Findex.html b/devdocs/go/index%2Fsuffixarray%2Findex.html
new file mode 100644
index 00000000..39fab1b8
--- /dev/null
+++ b/devdocs/go/index%2Fsuffixarray%2Findex.html
@@ -0,0 +1,50 @@
+<h1> Package suffixarray </h1> <ul id="short-nav">
+<li><code>import "index/suffixarray"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package suffixarray implements substring search in logarithmic time using an in-memory suffix array. </p>
+<p>Example use: </p>
+<pre data-language="go">// create index for some data
+index := suffixarray.New(data)
+
+// lookup byte slice s
+offsets1 := index.Lookup(s, -1) // the list of all indices where s occurs in data
+offsets2 := index.Lookup(s, 3) // the list of at most 3 indices where s occurs in data
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Index">type Index</a></li>
+<li> <a href="#New">func New(data []byte) *Index</a>
+</li>
+<li> <a href="#Index.Bytes">func (x *Index) Bytes() []byte</a>
+</li>
+<li> <a href="#Index.FindAllIndex">func (x *Index) FindAllIndex(r *regexp.Regexp, n int) (result [][]int)</a>
+</li>
+<li> <a href="#Index.Lookup">func (x *Index) Lookup(s []byte, n int) (result []int)</a>
+</li>
+<li> <a href="#Index.Read">func (x *Index) Read(r io.Reader) error</a>
+</li>
+<li> <a href="#Index.Write">func (x *Index) Write(w io.Writer) error</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Index_Lookup">Index.Lookup</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>sais.go</span> <span>sais2.go</span> <span>suffixarray.go</span> </p> <h2 id="Index">type <span>Index</span> </h2> <p>Index implements a suffix array for fast substring search. </p>
+<pre data-language="go">type Index struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(data []byte) *Index</pre> <p>New creates a new <a href="#Index">Index</a> for data. <a href="#Index">Index</a> creation time is O(N) for N = len(data). </p>
+<h3 id="Index.Bytes">func (*Index) <span>Bytes</span> </h3> <pre data-language="go">func (x *Index) Bytes() []byte</pre> <p>Bytes returns the data over which the index was created. It must not be modified. </p>
+<h3 id="Index.FindAllIndex">func (*Index) <span>FindAllIndex</span> </h3> <pre data-language="go">func (x *Index) FindAllIndex(r *regexp.Regexp, n int) (result [][]int)</pre> <p>FindAllIndex returns a sorted list of non-overlapping matches of the regular expression r, where a match is a pair of indices specifying the matched slice of x.Bytes(). If n &lt; 0, all matches are returned in successive order. Otherwise, at most n matches are returned and they may not be successive. The result is nil if there are no matches, or if n == 0. </p>
+<h3 id="Index.Lookup">func (*Index) <span>Lookup</span> </h3> <pre data-language="go">func (x *Index) Lookup(s []byte, n int) (result []int)</pre> <p>Lookup returns an unsorted list of at most n indices where the byte string s occurs in the indexed data. If n &lt; 0, all occurrences are returned. The result is nil if s is empty, s is not found, or n == 0. Lookup time is O(log(N)*len(s) + len(result)) where N is the size of the indexed data. </p> <h4 id="example_Index_Lookup"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">index := suffixarray.New([]byte("banana"))
+offsets := index.Lookup([]byte("ana"), -1)
+for _, off := range offsets {
+ fmt.Println(off)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1
+3
+</pre> <h3 id="Index.Read">func (*Index) <span>Read</span> </h3> <pre data-language="go">func (x *Index) Read(r io.Reader) error</pre> <p>Read reads the index from r into x; x must not be nil. </p>
+<h3 id="Index.Write">func (*Index) <span>Write</span> </h3> <pre data-language="go">func (x *Index) Write(w io.Writer) error</pre> <p>Write writes the index x to w. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/index/suffixarray/" class="_attribution-link">http://golang.org/pkg/index/suffixarray/</a>
+ </p>
+</div>
diff --git a/devdocs/go/index.html b/devdocs/go/index.html
new file mode 100644
index 00000000..74e0c2ee
--- /dev/null
+++ b/devdocs/go/index.html
@@ -0,0 +1,29 @@
+<h1>Go Programming Language</h1> <ul id="manual-nav">
+<li><a href="#subrepo">Sub-repositories</a></li>
+<li><a href="#community">Community</a></li>
+</ul> <h2 id="stdlib">Standard library </h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> </tr> <tr> <td class="pkg-name"> <a href="archive/tar/index">tar</a> </td> </tr> <tr> <td class="pkg-name"> <a href="archive/zip/index">zip</a> </td> </tr> <tr> <td class="pkg-name"> <a href="arena/index">arena</a> </td> </tr> <tr> <td class="pkg-name"> <a href="bufio/index">bufio</a> </td> </tr> <tr> <td class="pkg-name"> <a href="builtin/index">builtin</a> </td> </tr> <tr> <td class="pkg-name"> <a href="bytes/index">bytes</a> </td> </tr> <tr> <td class="pkg-name"> <a href="cmp/index">cmp</a> </td> </tr> <tr> <td class="pkg-name"> <a href="compress/index">compress</a> </td> </tr> <tr> <td class="pkg-name"> <a href="compress/bzip2/index">bzip2</a> </td> </tr> <tr> <td class="pkg-name"> <a href="compress/flate/index">flate</a> </td> </tr> <tr> <td class="pkg-name"> <a href="compress/gzip/index">gzip</a> </td> </tr> <tr> <td class="pkg-name"> <a href="compress/lzw/index">lzw</a> </td> </tr> <tr> <td class="pkg-name"> <a href="compress/zlib/index">zlib</a> </td> </tr> <tr> <td class="pkg-name"> <a href="container/index">container</a> </td> </tr> <tr> <td class="pkg-name"> <a href="container/heap/index">heap</a> </td> </tr> <tr> <td class="pkg-name"> <a href="container/list/index">list</a> </td> </tr> <tr> <td class="pkg-name"> <a href="container/ring/index">ring</a> </td> </tr> <tr> <td class="pkg-name"> <a href="context/index">context</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/index">crypto</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/aes/index">aes</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/boring/index">boring</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/cipher/index">cipher</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/des/index">des</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/dsa/index">dsa</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/ecdh/index">ecdh</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/ecdsa/index">ecdsa</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/ed25519/index">ed25519</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/elliptic/index">elliptic</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/hmac/index">hmac</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/md5/index">md5</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/rand/index">rand</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/rc4/index">rc4</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/rsa/index">rsa</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/sha1/index">sha1</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/sha256/index">sha256</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/sha512/index">sha512</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/subtle/index">subtle</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/tls/index">tls</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/tls/fipsonly/index">fipsonly</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/x509/index">x509</a> </td> </tr> <tr> <td class="pkg-name"> <a href="crypto/x509/pkix/index">pkix</a> </td> </tr> <tr> <td class="pkg-name"> <a href="database/index">database</a> </td> </tr> <tr> <td class="pkg-name"> <a href="database/sql/index">sql</a> </td> </tr> <tr> <td class="pkg-name"> <a href="database/sql/driver/index">driver</a> </td> </tr> <tr> <td class="pkg-name"> <a href="debug/index">debug</a> </td> </tr> <tr> <td class="pkg-name"> <a href="debug/buildinfo/index">buildinfo</a> </td> </tr> <tr> <td class="pkg-name"> <a href="debug/dwarf/index">dwarf</a> </td> </tr> <tr> <td class="pkg-name"> <a href="debug/elf/index">elf</a> </td> </tr> <tr> <td class="pkg-name"> <a href="debug/gosym/index">gosym</a> </td> </tr> <tr> <td class="pkg-name"> <a href="debug/macho/index">macho</a> </td> </tr> <tr> <td class="pkg-name"> <a href="debug/pe/index">pe</a> </td> </tr> <tr> <td class="pkg-name"> <a href="debug/plan9obj/index">plan9obj</a> </td> </tr> <tr> <td class="pkg-name"> <a href="embed/index">embed</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/index">encoding</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/ascii85/index">ascii85</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/asn1/index">asn1</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/base32/index">base32</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/base64/index">base64</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/binary/index">binary</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/csv/index">csv</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/gob/index">gob</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/hex/index">hex</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/json/index">json</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/pem/index">pem</a> </td> </tr> <tr> <td class="pkg-name"> <a href="encoding/xml/index">xml</a> </td> </tr> <tr> <td class="pkg-name"> <a href="errors/index">errors</a> </td> </tr> <tr> <td class="pkg-name"> <a href="expvar/index">expvar</a> </td> </tr> <tr> <td class="pkg-name"> <a href="flag/index">flag</a> </td> </tr> <tr> <td class="pkg-name"> <a href="fmt/index">fmt</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/index">go</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/ast/index">ast</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/build/index">build</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/build/constraint/index">constraint</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/constant/index">constant</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/doc/index">doc</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/doc/comment/index">comment</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/format/index">format</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/importer/index">importer</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/parser/index">parser</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/printer/index">printer</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/scanner/index">scanner</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/token/index">token</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/types/index">types</a> </td> </tr> <tr> <td class="pkg-name"> <a href="go/version/index">version</a> </td> </tr> <tr> <td class="pkg-name"> <a href="hash/index">hash</a> </td> </tr> <tr> <td class="pkg-name"> <a href="hash/adler32/index">adler32</a> </td> </tr> <tr> <td class="pkg-name"> <a href="hash/crc32/index">crc32</a> </td> </tr> <tr> <td class="pkg-name"> <a href="hash/crc64/index">crc64</a> </td> </tr> <tr> <td class="pkg-name"> <a href="hash/fnv/index">fnv</a> </td> </tr> <tr> <td class="pkg-name"> <a href="hash/maphash/index">maphash</a> </td> </tr> <tr> <td class="pkg-name"> <a href="html/index">html</a> </td> </tr> <tr> <td class="pkg-name"> <a href="html/template/index">template</a> </td> </tr> <tr> <td class="pkg-name"> <a href="image/index">image</a> </td> </tr> <tr> <td class="pkg-name"> <a href="image/color/index">color</a> </td> </tr> <tr> <td class="pkg-name"> <a href="image/color/palette/index">palette</a> </td> </tr> <tr> <td class="pkg-name"> <a href="image/draw/index">draw</a> </td> </tr> <tr> <td class="pkg-name"> <a href="image/gif/index">gif</a> </td> </tr> <tr> <td class="pkg-name"> <a href="image/jpeg/index">jpeg</a> </td> </tr> <tr> <td class="pkg-name"> <a href="image/png/index">png</a> </td> </tr> <tr> <td class="pkg-name"> <a href="index/index">index</a> </td> </tr> <tr> <td class="pkg-name"> <a href="index/suffixarray/index">suffixarray</a> </td> </tr> <tr> <td class="pkg-name"> <a href="io/index">io</a> </td> </tr> <tr> <td class="pkg-name"> <a href="io/fs/index">fs</a> </td> </tr> <tr> <td class="pkg-name"> <a href="io/ioutil/index">ioutil</a> </td> </tr> <tr> <td class="pkg-name"> <a href="iter/index">iter</a> </td> </tr> <tr> <td class="pkg-name"> <a href="log/index">log</a> </td> </tr> <tr> <td class="pkg-name"> <a href="log/slog/index">slog</a> </td> </tr> <tr> <td class="pkg-name"> <a href="log/syslog/index">syslog</a> </td> </tr> <tr> <td class="pkg-name"> <a href="maps/index">maps</a> </td> </tr> <tr> <td class="pkg-name"> <a href="math/index">math</a> </td> </tr> <tr> <td class="pkg-name"> <a href="math/big/index">big</a> </td> </tr> <tr> <td class="pkg-name"> <a href="math/bits/index">bits</a> </td> </tr> <tr> <td class="pkg-name"> <a href="math/cmplx/index">cmplx</a> </td> </tr> <tr> <td class="pkg-name"> <a href="math/rand/index">rand</a> </td> </tr> <tr> <td class="pkg-name"> <a href="math/rand/v2/index">v2</a> </td> </tr> <tr> <td class="pkg-name"> <a href="mime/index">mime</a> </td> </tr> <tr> <td class="pkg-name"> <a href="mime/multipart/index">multipart</a> </td> </tr> <tr> <td class="pkg-name"> <a href="mime/quotedprintable/index">quotedprintable</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/index">net</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/http/index">http</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/http/cgi/index">cgi</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/http/cookiejar/index">cookiejar</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/http/fcgi/index">fcgi</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/http/httptest/index">httptest</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/http/httptrace/index">httptrace</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/http/httputil/index">httputil</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/http/pprof/index">pprof</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/mail/index">mail</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/netip/index">netip</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/rpc/index">rpc</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/rpc/jsonrpc/index">jsonrpc</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/smtp/index">smtp</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/textproto/index">textproto</a> </td> </tr> <tr> <td class="pkg-name"> <a href="net/url/index">url</a> </td> </tr> <tr> <td class="pkg-name"> <a href="os/index">os</a> </td> </tr> <tr> <td class="pkg-name"> <a href="os/exec/index">exec</a> </td> </tr> <tr> <td class="pkg-name"> <a href="os/signal/index">signal</a> </td> </tr> <tr> <td class="pkg-name"> <a href="os/user/index">user</a> </td> </tr> <tr> <td class="pkg-name"> <a href="path/index">path</a> </td> </tr> <tr> <td class="pkg-name"> <a href="path/filepath/index">filepath</a> </td> </tr> <tr> <td class="pkg-name"> <a href="plugin/index">plugin</a> </td> </tr> <tr> <td class="pkg-name"> <a href="reflect/index">reflect</a> </td> </tr> <tr> <td class="pkg-name"> <a href="regexp/index">regexp</a> </td> </tr> <tr> <td class="pkg-name"> <a href="regexp/syntax/index">syntax</a> </td> </tr> <tr> <td class="pkg-name"> <a href="runtime/index">runtime</a> </td> </tr> <tr> <td class="pkg-name"> <a href="runtime/asan/index">asan</a> </td> </tr> <tr> <td class="pkg-name"> <a href="runtime/cgo/index">cgo</a> </td> </tr> <tr> <td class="pkg-name"> <a href="runtime/coverage/index">coverage</a> </td> </tr> <tr> <td class="pkg-name"> <a href="runtime/debug/index">debug</a> </td> </tr> <tr> <td class="pkg-name"> <a href="runtime/metrics/index">metrics</a> </td> </tr> <tr> <td class="pkg-name"> <span>msan</span> </td> </tr> <tr> <td class="pkg-name"> <a href="runtime/pprof/index">pprof</a> </td> </tr> <tr> <td class="pkg-name"> <a href="runtime/race/index">race</a> </td> </tr> <tr> <td class="pkg-name"> <a href="runtime/trace/index">trace</a> </td> </tr> <tr> <td class="pkg-name"> <a href="slices/index">slices</a> </td> </tr> <tr> <td class="pkg-name"> <a href="sort/index">sort</a> </td> </tr> <tr> <td class="pkg-name"> <a href="strconv/index">strconv</a> </td> </tr> <tr> <td class="pkg-name"> <a href="strings/index">strings</a> </td> </tr> <tr> <td class="pkg-name"> <a href="sync/index">sync</a> </td> </tr> <tr> <td class="pkg-name"> <a href="sync/atomic/index">atomic</a> </td> </tr> <tr> <td class="pkg-name"> <a href="syscall/index">syscall</a> </td> </tr> <tr> <td class="pkg-name"> <a href="syscall/js/index">js</a> </td> </tr> <tr> <td class="pkg-name"> <a href="testing/index">testing</a> </td> </tr> <tr> <td class="pkg-name"> <a href="testing/fstest/index">fstest</a> </td> </tr> <tr> <td class="pkg-name"> <a href="testing/iotest/index">iotest</a> </td> </tr> <tr> <td class="pkg-name"> <a href="testing/quick/index">quick</a> </td> </tr> <tr> <td class="pkg-name"> <a href="testing/slogtest/index">slogtest</a> </td> </tr> <tr> <td class="pkg-name"> <a href="text/index">text</a> </td> </tr> <tr> <td class="pkg-name"> <a href="text/scanner/index">scanner</a> </td> </tr> <tr> <td class="pkg-name"> <a href="text/tabwriter/index">tabwriter</a> </td> </tr> <tr> <td class="pkg-name"> <a href="text/template/index">template</a> </td> </tr> <tr> <td class="pkg-name"> <a href="text/template/parse/index">parse</a> </td> </tr> <tr> <td class="pkg-name"> <a href="time/index">time</a> </td> </tr> <tr> <td class="pkg-name"> <a href="time/tzdata/index">tzdata</a> </td> </tr> <tr> <td class="pkg-name"> <a href="unicode/index">unicode</a> </td> </tr> <tr> <td class="pkg-name"> <a href="unicode/utf16/index">utf16</a> </td> </tr> <tr> <td class="pkg-name"> <a href="unicode/utf8/index">utf8</a> </td> </tr> <tr> <td class="pkg-name"> <a href="unsafe/index">unsafe</a> </td> </tr> </table> </div> <h2 id="other">Other packages</h2> <h3 id="subrepo">Sub-repositories</h3> <p> These packages are part of the Go Project but outside the main Go tree. They are developed under looser <a href="https://golang.org/doc/go1compat">compatibility requirements</a> than the Go core. Install them with "<span>go get</span>". </p> <ul> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/benchmarks">benchmarks</a> — benchmarks to measure Go as it is developed.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/blog">blog</a> — <a href="http://blog.golang.org:6060">blog.golang.org</a>'s implementation.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/build">build</a> — <a href="http://build.golang.org:6060">build.golang.org</a>'s implementation.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/crypto">crypto</a> — additional cryptography packages.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/debug">debug</a> — an experimental debugger for Go.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/image">image</a> — additional imaging packages.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/mobile">mobile</a> — experimental support for Go on mobile platforms.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/net">net</a> — additional networking packages.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/perf">perf</a> — packages and tools for performance measurement, storage, and analysis.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/pkgsite">pkgsite</a> — home of the pkg.go.dev website.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/review">review</a> — a tool for working with Gerrit code reviews.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/sync">sync</a> — additional concurrency primitives.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/sys">sys</a> — packages for making system calls.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/text">text</a> — packages for working with text.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/time">time</a> — additional time packages.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/tools">tools</a> — godoc, goimports, gorename, and other tools.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/tour">tour</a> — <a href="http://tour.golang.org:6060">tour.golang.org</a>'s implementation.</li> <li>
+<a href="http://pkg.go.dev:6060/golang.org/x/exp">exp</a> — experimental and deprecated packages (handle with care; may change without warning).</li> </ul> <h3 id="community">Community</h3> <p> These services can help you find Open Source packages provided by the community. </p> <ul> <li>
+<a href="http://pkg.go.dev:6060">Pkg.go.dev</a> - the Go package discovery site.</li> <li>
+<span>Projects at the Go Wiki</span> - a curated list of Go projects.</li> </ul><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg//" class="_attribution-link">http://golang.org/pkg//</a>
+ </p>
+</div>
diff --git a/devdocs/go/internal%2Fgoarch%2Findex.html b/devdocs/go/internal%2Fgoarch%2Findex.html
new file mode 100644
index 00000000..e7fa752f
--- /dev/null
+++ b/devdocs/go/internal%2Fgoarch%2Findex.html
@@ -0,0 +1,33 @@
+<h1> Package goarch </h1> <ul id="short-nav">
+<li><code>import "internal/goarch"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>package goarch contains GOARCH-specific constants. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#ArchFamilyType">type ArchFamilyType</a></li>
+</ul> <h3>Package files</h3> <p> <span>goarch.go</span> <span>goarch_amd64.go</span> <span>zgoarch_amd64.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>BigEndian reports whether the architecture is big-endian. </p>
+<pre data-language="go">const BigEndian = IsArmbe|IsArm64be|IsMips|IsMips64|IsPpc|IsPpc64|IsS390|IsS390x|IsSparc|IsSparc64 == 1</pre> <p>DefaultPhysPageSize is the default physical page size. </p>
+<pre data-language="go">const DefaultPhysPageSize = _DefaultPhysPageSize</pre> <pre data-language="go">const GOARCH = `amd64`</pre> <p>Int64Align is the required alignment for a 64-bit integer (4 on 32-bit systems, 8 on 64-bit). </p>
+<pre data-language="go">const Int64Align = PtrSize</pre> <pre data-language="go">const Is386 = 0</pre> <pre data-language="go">const IsAmd64 = 1</pre> <pre data-language="go">const IsAmd64p32 = 0</pre> <pre data-language="go">const IsArm = 0</pre> <pre data-language="go">const IsArm64 = 0</pre> <pre data-language="go">const IsArm64be = 0</pre> <pre data-language="go">const IsArmbe = 0</pre> <pre data-language="go">const IsLoong64 = 0</pre> <pre data-language="go">const IsMips = 0</pre> <pre data-language="go">const IsMips64 = 0</pre> <pre data-language="go">const IsMips64le = 0</pre> <pre data-language="go">const IsMips64p32 = 0</pre> <pre data-language="go">const IsMips64p32le = 0</pre> <pre data-language="go">const IsMipsle = 0</pre> <pre data-language="go">const IsPpc = 0</pre> <pre data-language="go">const IsPpc64 = 0</pre> <pre data-language="go">const IsPpc64le = 0</pre> <pre data-language="go">const IsRiscv = 0</pre> <pre data-language="go">const IsRiscv64 = 0</pre> <pre data-language="go">const IsS390 = 0</pre> <pre data-language="go">const IsS390x = 0</pre> <pre data-language="go">const IsSparc = 0</pre> <pre data-language="go">const IsSparc64 = 0</pre> <pre data-language="go">const IsWasm = 0</pre> <p>MinFrameSize is the size of the system-reserved words at the bottom of a frame (just above the architectural stack pointer). It is zero on x86 and PtrSize on most non-x86 (LR-based) systems. On PowerPC it is larger, to cover three more reserved words: the compiler word, the link editor word, and the TOC save word. </p>
+<pre data-language="go">const MinFrameSize = _MinFrameSize</pre> <p>PCQuantum is the minimal unit for a program counter (1 on x86, 4 on most other systems). The various PC tables record PC deltas pre-divided by PCQuantum. </p>
+<pre data-language="go">const PCQuantum = _PCQuantum</pre> <p>PtrSize is the size of a pointer in bytes - unsafe.Sizeof(uintptr(0)) but as an ideal constant. It is also the size of the machine's native word size (that is, 4 on 32-bit systems, 8 on 64-bit). </p>
+<pre data-language="go">const PtrSize = 4 &lt;&lt; (^uintptr(0) &gt;&gt; 63)</pre> <p>StackAlign is the required alignment of the SP register. The stack must be at least word aligned, but some architectures require more. </p>
+<pre data-language="go">const StackAlign = _StackAlign</pre> <h2 id="ArchFamilyType">type <span>ArchFamilyType</span> </h2> <pre data-language="go">type ArchFamilyType int</pre> <pre data-language="go">const (
+ AMD64 ArchFamilyType = iota
+ ARM
+ ARM64
+ I386
+ LOONG64
+ MIPS
+ MIPS64
+ PPC64
+ RISCV64
+ S390X
+ WASM
+)</pre> <p>ArchFamily is the architecture family (AMD64, ARM, ...) </p>
+<pre data-language="go">const ArchFamily ArchFamilyType = _ArchFamily</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/internal/goarch/" class="_attribution-link">http://golang.org/pkg/internal/goarch/</a>
+ </p>
+</div>
diff --git a/devdocs/go/internal%2Fgoos%2Findex.html b/devdocs/go/internal%2Fgoos%2Findex.html
new file mode 100644
index 00000000..dbc8d171
--- /dev/null
+++ b/devdocs/go/internal%2Fgoos%2Findex.html
@@ -0,0 +1,10 @@
+<h1> Package goos </h1> <ul id="short-nav">
+<li><code>import "internal/goos"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>package goos contains GOOS-specific constants. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav"><li><a href="#pkg-constants">Constants</a></li></ul> <h3>Package files</h3> <p> <span>goos.go</span> <span>unix.go</span> <span>zgoos_linux.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const GOOS = `linux`</pre> <pre data-language="go">const IsAix = 0</pre> <pre data-language="go">const IsAndroid = 0</pre> <pre data-language="go">const IsDarwin = 0</pre> <pre data-language="go">const IsDragonfly = 0</pre> <pre data-language="go">const IsFreebsd = 0</pre> <pre data-language="go">const IsHurd = 0</pre> <pre data-language="go">const IsIllumos = 0</pre> <pre data-language="go">const IsIos = 0</pre> <pre data-language="go">const IsJs = 0</pre> <pre data-language="go">const IsLinux = 1</pre> <pre data-language="go">const IsNacl = 0</pre> <pre data-language="go">const IsNetbsd = 0</pre> <pre data-language="go">const IsOpenbsd = 0</pre> <pre data-language="go">const IsPlan9 = 0</pre> <pre data-language="go">const IsSolaris = 0</pre> <pre data-language="go">const IsUnix = true</pre> <pre data-language="go">const IsWasip1 = 0</pre> <pre data-language="go">const IsWindows = 0</pre> <pre data-language="go">const IsZos = 0</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/internal/goos/" class="_attribution-link">http://golang.org/pkg/internal/goos/</a>
+ </p>
+</div>
diff --git a/devdocs/go/io%2Ffs%2Findex.html b/devdocs/go/io%2Ffs%2Findex.html
new file mode 100644
index 00000000..4b0094cb
--- /dev/null
+++ b/devdocs/go/io%2Ffs%2Findex.html
@@ -0,0 +1,256 @@
+<h1> Package fs </h1> <ul id="short-nav">
+<li><code>import "io/fs"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package fs defines basic interfaces to a file system. A file system can be provided by the host operating system but also by other packages. </p>
+<p>See the <span>testing/fstest</span> package for support with testing implementations of file systems. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#FormatDirEntry">func FormatDirEntry(dir DirEntry) string</a></li>
+<li><a href="#FormatFileInfo">func FormatFileInfo(info FileInfo) string</a></li>
+<li><a href="#Glob">func Glob(fsys FS, pattern string) (matches []string, err error)</a></li>
+<li><a href="#ReadFile">func ReadFile(fsys FS, name string) ([]byte, error)</a></li>
+<li><a href="#ValidPath">func ValidPath(name string) bool</a></li>
+<li><a href="#WalkDir">func WalkDir(fsys FS, root string, fn WalkDirFunc) error</a></li>
+<li><a href="#DirEntry">type DirEntry</a></li>
+<li> <a href="#FileInfoToDirEntry">func FileInfoToDirEntry(info FileInfo) DirEntry</a>
+</li>
+<li> <a href="#ReadDir">func ReadDir(fsys FS, name string) ([]DirEntry, error)</a>
+</li>
+<li><a href="#FS">type FS</a></li>
+<li> <a href="#Sub">func Sub(fsys FS, dir string) (FS, error)</a>
+</li>
+<li><a href="#File">type File</a></li>
+<li><a href="#FileInfo">type FileInfo</a></li>
+<li> <a href="#Stat">func Stat(fsys FS, name string) (FileInfo, error)</a>
+</li>
+<li><a href="#FileMode">type FileMode</a></li>
+<li> <a href="#FileMode.IsDir">func (m FileMode) IsDir() bool</a>
+</li>
+<li> <a href="#FileMode.IsRegular">func (m FileMode) IsRegular() bool</a>
+</li>
+<li> <a href="#FileMode.Perm">func (m FileMode) Perm() FileMode</a>
+</li>
+<li> <a href="#FileMode.String">func (m FileMode) String() string</a>
+</li>
+<li> <a href="#FileMode.Type">func (m FileMode) Type() FileMode</a>
+</li>
+<li><a href="#GlobFS">type GlobFS</a></li>
+<li><a href="#PathError">type PathError</a></li>
+<li> <a href="#PathError.Error">func (e *PathError) Error() string</a>
+</li>
+<li> <a href="#PathError.Timeout">func (e *PathError) Timeout() bool</a>
+</li>
+<li> <a href="#PathError.Unwrap">func (e *PathError) Unwrap() error</a>
+</li>
+<li><a href="#ReadDirFS">type ReadDirFS</a></li>
+<li><a href="#ReadDirFile">type ReadDirFile</a></li>
+<li><a href="#ReadFileFS">type ReadFileFS</a></li>
+<li><a href="#StatFS">type StatFS</a></li>
+<li><a href="#SubFS">type SubFS</a></li>
+<li><a href="#WalkDirFunc">type WalkDirFunc</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_WalkDir">WalkDir</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>format.go</span> <span>fs.go</span> <span>glob.go</span> <span>readdir.go</span> <span>readfile.go</span> <span>stat.go</span> <span>sub.go</span> <span>walk.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>Generic file system errors. Errors returned by file systems can be tested against these errors using <span>errors.Is</span>. </p>
+<pre data-language="go">var (
+ ErrInvalid = errInvalid() // "invalid argument"
+ ErrPermission = errPermission() // "permission denied"
+ ErrExist = errExist() // "file already exists"
+ ErrNotExist = errNotExist() // "file does not exist"
+ ErrClosed = errClosed() // "file already closed"
+)</pre> <p>SkipAll is used as a return value from <a href="#WalkDirFunc">WalkDirFunc</a> to indicate that all remaining files and directories are to be skipped. It is not returned as an error by any function. </p>
+<pre data-language="go">var SkipAll = errors.New("skip everything and stop the walk")</pre> <p>SkipDir is used as a return value from <a href="#WalkDirFunc">WalkDirFunc</a> to indicate that the directory named in the call is to be skipped. It is not returned as an error by any function. </p>
+<pre data-language="go">var SkipDir = errors.New("skip this directory")</pre> <h2 id="FormatDirEntry">func <span>FormatDirEntry</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func FormatDirEntry(dir DirEntry) string</pre> <p>FormatDirEntry returns a formatted version of dir for human readability. Implementations of <a href="#DirEntry">DirEntry</a> can call this from a String method. The outputs for a directory named subdir and a file named hello.go are: </p>
+<pre data-language="go">d subdir/
+- hello.go
+</pre> <h2 id="FormatFileInfo">func <span>FormatFileInfo</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func FormatFileInfo(info FileInfo) string</pre> <p>FormatFileInfo returns a formatted version of info for human readability. Implementations of <a href="#FileInfo">FileInfo</a> can call this from a String method. The output for a file named "hello.go", 100 bytes, mode 0o644, created January 1, 1970 at noon is </p>
+<pre data-language="go">-rw-r--r-- 100 1970-01-01 12:00:00 hello.go
+</pre> <h2 id="Glob">func <span>Glob</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func Glob(fsys FS, pattern string) (matches []string, err error)</pre> <p>Glob returns the names of all files matching pattern or nil if there is no matching file. The syntax of patterns is the same as in <span>path.Match</span>. The pattern may describe hierarchical names such as usr/*/bin/ed. </p>
+<p>Glob ignores file system errors such as I/O errors reading directories. The only possible returned error is <span>path.ErrBadPattern</span>, reporting that the pattern is malformed. </p>
+<p>If fs implements <a href="#GlobFS">GlobFS</a>, Glob calls fs.Glob. Otherwise, Glob uses <a href="#ReadDir">ReadDir</a> to traverse the directory tree and look for matches for the pattern. </p>
+<h2 id="ReadFile">func <span>ReadFile</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func ReadFile(fsys FS, name string) ([]byte, error)</pre> <p>ReadFile reads the named file from the file system fs and returns its contents. A successful call returns a nil error, not <span>io.EOF</span>. (Because ReadFile reads the whole file, the expected EOF from the final Read is not treated as an error to be reported.) </p>
+<p>If fs implements <a href="#ReadFileFS">ReadFileFS</a>, ReadFile calls fs.ReadFile. Otherwise ReadFile calls fs.Open and uses Read and Close on the returned <a href="#File">File</a>. </p>
+<h2 id="ValidPath">func <span>ValidPath</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func ValidPath(name string) bool</pre> <p>ValidPath reports whether the given path name is valid for use in a call to Open. </p>
+<p>Path names passed to open are UTF-8-encoded, unrooted, slash-separated sequences of path elements, like “x/y/z”. Path names must not contain an element that is “.” or “..” or the empty string, except for the special case that the root directory is named “.”. Paths must not start or end with a slash: “/x” and “x/” are invalid. </p>
+<p>Note that paths are slash-separated on all systems, even Windows. Paths containing other characters such as backslash and colon are accepted as valid, but those characters must never be interpreted by an <a href="#FS">FS</a> implementation as path element separators. </p>
+<h2 id="WalkDir">func <span>WalkDir</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func WalkDir(fsys FS, root string, fn WalkDirFunc) error</pre> <p>WalkDir walks the file tree rooted at root, calling fn for each file or directory in the tree, including root. </p>
+<p>All errors that arise visiting files and directories are filtered by fn: see the <a href="#WalkDirFunc">fs.WalkDirFunc</a> documentation for details. </p>
+<p>The files are walked in lexical order, which makes the output deterministic but requires WalkDir to read an entire directory into memory before proceeding to walk that directory. </p>
+<p>WalkDir does not follow symbolic links found in directories, but if root itself is a symbolic link, its target will be walked. </p> <h4 id="example_WalkDir"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+root := "/usr/local/go/bin"
+fileSystem := os.DirFS(root)
+
+fs.WalkDir(fileSystem, ".", func(path string, d fs.DirEntry, err error) error {
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Println(path)
+ return nil
+})
+</pre> <h2 id="DirEntry">type <span>DirEntry</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A DirEntry is an entry read from a directory (using the <a href="#ReadDir">ReadDir</a> function or a <a href="#ReadDirFile">ReadDirFile</a>'s ReadDir method). </p>
+<pre data-language="go">type DirEntry interface {
+ // Name returns the name of the file (or subdirectory) described by the entry.
+ // This name is only the final element of the path (the base name), not the entire path.
+ // For example, Name would return "hello.go" not "home/gopher/hello.go".
+ Name() string
+
+ // IsDir reports whether the entry describes a directory.
+ IsDir() bool
+
+ // Type returns the type bits for the entry.
+ // The type bits are a subset of the usual FileMode bits, those returned by the FileMode.Type method.
+ Type() FileMode
+
+ // Info returns the FileInfo for the file or subdirectory described by the entry.
+ // The returned FileInfo may be from the time of the original directory read
+ // or from the time of the call to Info. If the file has been removed or renamed
+ // since the directory read, Info may return an error satisfying errors.Is(err, ErrNotExist).
+ // If the entry denotes a symbolic link, Info reports the information about the link itself,
+ // not the link's target.
+ Info() (FileInfo, error)
+}</pre> <h3 id="FileInfoToDirEntry">func <span>FileInfoToDirEntry</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func FileInfoToDirEntry(info FileInfo) DirEntry</pre> <p>FileInfoToDirEntry returns a <a href="#DirEntry">DirEntry</a> that returns information from info. If info is nil, FileInfoToDirEntry returns nil. </p>
+<h3 id="ReadDir">func <span>ReadDir</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func ReadDir(fsys FS, name string) ([]DirEntry, error)</pre> <p>ReadDir reads the named directory and returns a list of directory entries sorted by filename. </p>
+<p>If fs implements <a href="#ReadDirFS">ReadDirFS</a>, ReadDir calls fs.ReadDir. Otherwise ReadDir calls fs.Open and uses ReadDir and Close on the returned file. </p>
+<h2 id="FS">type <span>FS</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>An FS provides access to a hierarchical file system. </p>
+<p>The FS interface is the minimum implementation required of the file system. A file system may implement additional interfaces, such as <a href="#ReadFileFS">ReadFileFS</a>, to provide additional or optimized functionality. </p>
+<p><span>testing/fstest.TestFS</span> may be used to test implementations of an FS for correctness. </p>
+<pre data-language="go">type FS interface {
+ // Open opens the named file.
+ //
+ // When Open returns an error, it should be of type *PathError
+ // with the Op field set to "open", the Path field set to name,
+ // and the Err field describing the problem.
+ //
+ // Open should reject attempts to open names that do not satisfy
+ // ValidPath(name), returning a *PathError with Err set to
+ // ErrInvalid or ErrNotExist.
+ Open(name string) (File, error)
+}</pre> <h3 id="Sub">func <span>Sub</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func Sub(fsys FS, dir string) (FS, error)</pre> <p>Sub returns an <a href="#FS">FS</a> corresponding to the subtree rooted at fsys's dir. </p>
+<p>If dir is ".", Sub returns fsys unchanged. Otherwise, if fs implements <a href="#SubFS">SubFS</a>, Sub returns fsys.Sub(dir). Otherwise, Sub returns a new <a href="#FS">FS</a> implementation sub that, in effect, implements sub.Open(name) as fsys.Open(path.Join(dir, name)). The implementation also translates calls to ReadDir, ReadFile, and Glob appropriately. </p>
+<p>Note that Sub(os.DirFS("/"), "prefix") is equivalent to os.DirFS("/prefix") and that neither of them guarantees to avoid operating system accesses outside "/prefix", because the implementation of <span>os.DirFS</span> does not check for symbolic links inside "/prefix" that point to other directories. That is, <span>os.DirFS</span> is not a general substitute for a chroot-style security mechanism, and Sub does not change that fact. </p>
+<h2 id="File">type <span>File</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A File provides access to a single file. The File interface is the minimum implementation required of the file. Directory files should also implement <a href="#ReadDirFile">ReadDirFile</a>. A file may implement <span>io.ReaderAt</span> or <span>io.Seeker</span> as optimizations. </p>
+<pre data-language="go">type File interface {
+ Stat() (FileInfo, error)
+ Read([]byte) (int, error)
+ Close() error
+}</pre> <h2 id="FileInfo">type <span>FileInfo</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A FileInfo describes a file and is returned by <a href="#Stat">Stat</a>. </p>
+<pre data-language="go">type FileInfo interface {
+ Name() string // base name of the file
+ Size() int64 // length in bytes for regular files; system-dependent for others
+ Mode() FileMode // file mode bits
+ ModTime() time.Time // modification time
+ IsDir() bool // abbreviation for Mode().IsDir()
+ Sys() any // underlying data source (can return nil)
+}</pre> <h3 id="Stat">func <span>Stat</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func Stat(fsys FS, name string) (FileInfo, error)</pre> <p>Stat returns a <a href="#FileInfo">FileInfo</a> describing the named file from the file system. </p>
+<p>If fs implements <a href="#StatFS">StatFS</a>, Stat calls fs.Stat. Otherwise, Stat opens the <a href="#File">File</a> to stat it. </p>
+<h2 id="FileMode">type <span>FileMode</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A FileMode represents a file's mode and permission bits. The bits have the same definition on all systems, so that information about files can be moved from one system to another portably. Not all bits apply to all systems. The only required bit is <a href="#ModeDir">ModeDir</a> for directories. </p>
+<pre data-language="go">type FileMode uint32</pre> <p>The defined file mode bits are the most significant bits of the <a href="#FileMode">FileMode</a>. The nine least-significant bits are the standard Unix rwxrwxrwx permissions. The values of these bits should be considered part of the public API and may be used in wire protocols or disk representations: they must not be changed, although new bits might be added. </p>
+<pre data-language="go">const (
+ // The single letters are the abbreviations
+ // used by the String method's formatting.
+ ModeDir FileMode = 1 &lt;&lt; (32 - 1 - iota) // d: is a directory
+ ModeAppend // a: append-only
+ ModeExclusive // l: exclusive use
+ ModeTemporary // T: temporary file; Plan 9 only
+ ModeSymlink // L: symbolic link
+ ModeDevice // D: device file
+ ModeNamedPipe // p: named pipe (FIFO)
+ ModeSocket // S: Unix domain socket
+ ModeSetuid // u: setuid
+ ModeSetgid // g: setgid
+ ModeCharDevice // c: Unix character device, when ModeDevice is set
+ ModeSticky // t: sticky
+ ModeIrregular // ?: non-regular file; nothing else is known about this file
+
+ // Mask for the type bits. For regular files, none will be set.
+ ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice | ModeCharDevice | ModeIrregular
+
+ ModePerm FileMode = 0777 // Unix permission bits
+)</pre> <h3 id="FileMode.IsDir">func (FileMode) <span>IsDir</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (m FileMode) IsDir() bool</pre> <p>IsDir reports whether m describes a directory. That is, it tests for the <a href="#ModeDir">ModeDir</a> bit being set in m. </p>
+<h3 id="FileMode.IsRegular">func (FileMode) <span>IsRegular</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (m FileMode) IsRegular() bool</pre> <p>IsRegular reports whether m describes a regular file. That is, it tests that no mode type bits are set. </p>
+<h3 id="FileMode.Perm">func (FileMode) <span>Perm</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (m FileMode) Perm() FileMode</pre> <p>Perm returns the Unix permission bits in m (m &amp; <a href="#ModePerm">ModePerm</a>). </p>
+<h3 id="FileMode.String">func (FileMode) <span>String</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (m FileMode) String() string</pre> <h3 id="FileMode.Type">func (FileMode) <span>Type</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (m FileMode) Type() FileMode</pre> <p>Type returns type bits in m (m &amp; <a href="#ModeType">ModeType</a>). </p>
+<h2 id="GlobFS">type <span>GlobFS</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A GlobFS is a file system with a Glob method. </p>
+<pre data-language="go">type GlobFS interface {
+ FS
+
+ // Glob returns the names of all files matching pattern,
+ // providing an implementation of the top-level
+ // Glob function.
+ Glob(pattern string) ([]string, error)
+}</pre> <h2 id="PathError">type <span>PathError</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>PathError records an error and the operation and file path that caused it. </p>
+<pre data-language="go">type PathError struct {
+ Op string
+ Path string
+ Err error
+}
+</pre> <h3 id="PathError.Error">func (*PathError) <span>Error</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (e *PathError) Error() string</pre> <h3 id="PathError.Timeout">func (*PathError) <span>Timeout</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (e *PathError) Timeout() bool</pre> <p>Timeout reports whether this error represents a timeout. </p>
+<h3 id="PathError.Unwrap">func (*PathError) <span>Unwrap</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (e *PathError) Unwrap() error</pre> <h2 id="ReadDirFS">type <span>ReadDirFS</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>ReadDirFS is the interface implemented by a file system that provides an optimized implementation of <a href="#ReadDir">ReadDir</a>. </p>
+<pre data-language="go">type ReadDirFS interface {
+ FS
+
+ // ReadDir reads the named directory
+ // and returns a list of directory entries sorted by filename.
+ ReadDir(name string) ([]DirEntry, error)
+}</pre> <h2 id="ReadDirFile">type <span>ReadDirFile</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A ReadDirFile is a directory file whose entries can be read with the ReadDir method. Every directory file should implement this interface. (It is permissible for any file to implement this interface, but if so ReadDir should return an error for non-directories.) </p>
+<pre data-language="go">type ReadDirFile interface {
+ File
+
+ // ReadDir reads the contents of the directory and returns
+ // a slice of up to n DirEntry values in directory order.
+ // Subsequent calls on the same file will yield further DirEntry values.
+ //
+ // If n &gt; 0, ReadDir returns at most n DirEntry structures.
+ // In this case, if ReadDir returns an empty slice, it will return
+ // a non-nil error explaining why.
+ // At the end of a directory, the error is io.EOF.
+ // (ReadDir must return io.EOF itself, not an error wrapping io.EOF.)
+ //
+ // If n &lt;= 0, ReadDir returns all the DirEntry values from the directory
+ // in a single slice. In this case, if ReadDir succeeds (reads all the way
+ // to the end of the directory), it returns the slice and a nil error.
+ // If it encounters an error before the end of the directory,
+ // ReadDir returns the DirEntry list read until that point and a non-nil error.
+ ReadDir(n int) ([]DirEntry, error)
+}</pre> <h2 id="ReadFileFS">type <span>ReadFileFS</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>ReadFileFS is the interface implemented by a file system that provides an optimized implementation of <a href="#ReadFile">ReadFile</a>. </p>
+<pre data-language="go">type ReadFileFS interface {
+ FS
+
+ // ReadFile reads the named file and returns its contents.
+ // A successful call returns a nil error, not io.EOF.
+ // (Because ReadFile reads the whole file, the expected EOF
+ // from the final Read is not treated as an error to be reported.)
+ //
+ // The caller is permitted to modify the returned byte slice.
+ // This method should return a copy of the underlying data.
+ ReadFile(name string) ([]byte, error)
+}</pre> <h2 id="StatFS">type <span>StatFS</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A StatFS is a file system with a Stat method. </p>
+<pre data-language="go">type StatFS interface {
+ FS
+
+ // Stat returns a FileInfo describing the file.
+ // If there is an error, it should be of type *PathError.
+ Stat(name string) (FileInfo, error)
+}</pre> <h2 id="SubFS">type <span>SubFS</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A SubFS is a file system with a Sub method. </p>
+<pre data-language="go">type SubFS interface {
+ FS
+
+ // Sub returns an FS corresponding to the subtree rooted at dir.
+ Sub(dir string) (FS, error)
+}</pre> <h2 id="WalkDirFunc">type <span>WalkDirFunc</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>WalkDirFunc is the type of the function called by <a href="#WalkDir">WalkDir</a> to visit each file or directory. </p>
+<p>The path argument contains the argument to <a href="#WalkDir">WalkDir</a> as a prefix. That is, if WalkDir is called with root argument "dir" and finds a file named "a" in that directory, the walk function will be called with argument "dir/a". </p>
+<p>The d argument is the <a href="#DirEntry">DirEntry</a> for the named path. </p>
+<p>The error result returned by the function controls how <a href="#WalkDir">WalkDir</a> continues. If the function returns the special value <a href="#SkipDir">SkipDir</a>, WalkDir skips the current directory (path if d.IsDir() is true, otherwise path's parent directory). If the function returns the special value <a href="#SkipAll">SkipAll</a>, WalkDir skips all remaining files and directories. Otherwise, if the function returns a non-nil error, WalkDir stops entirely and returns that error. </p>
+<p>The err argument reports an error related to path, signaling that <a href="#WalkDir">WalkDir</a> will not walk into that directory. The function can decide how to handle that error; as described earlier, returning the error will cause WalkDir to stop walking the entire tree. </p>
+<p><a href="#WalkDir">WalkDir</a> calls the function with a non-nil err argument in two cases. </p>
+<p>First, if the initial <a href="#Stat">Stat</a> on the root directory fails, WalkDir calls the function with path set to root, d set to nil, and err set to the error from <a href="#Stat">fs.Stat</a>. </p>
+<p>Second, if a directory's ReadDir method (see <a href="#ReadDirFile">ReadDirFile</a>) fails, WalkDir calls the function with path set to the directory's path, d set to an <a href="#DirEntry">DirEntry</a> describing the directory, and err set to the error from ReadDir. In this second case, the function is called twice with the path of the directory: the first call is before the directory read is attempted and has err set to nil, giving the function a chance to return <a href="#SkipDir">SkipDir</a> or <a href="#SkipAll">SkipAll</a> and avoid the ReadDir entirely. The second call is after a failed ReadDir and reports the error from ReadDir. (If ReadDir succeeds, there is no second call.) </p>
+<p>The differences between WalkDirFunc compared to <span>path/filepath.WalkFunc</span> are: </p>
+<ul> <li>The second argument has type <a href="#DirEntry">DirEntry</a> instead of <a href="#FileInfo">FileInfo</a>. </li>
+<li>The function is called before reading a directory, to allow <a href="#SkipDir">SkipDir</a> or <a href="#SkipAll">SkipAll</a> to bypass the directory read entirely or skip all remaining files and directories respectively. </li>
+<li>If a directory read fails, the function is called a second time for that directory to report the error. </li>
+</ul> <pre data-language="go">type WalkDirFunc func(path string, d DirEntry, err error) error</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/io/fs/" class="_attribution-link">http://golang.org/pkg/io/fs/</a>
+ </p>
+</div>
diff --git a/devdocs/go/io%2Findex.html b/devdocs/go/io%2Findex.html
new file mode 100644
index 00000000..c06f3459
--- /dev/null
+++ b/devdocs/go/io%2Findex.html
@@ -0,0 +1,461 @@
+<h1> Package io </h1> <ul id="short-nav">
+<li><code>import "io"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package io provides basic interfaces to I/O primitives. Its primary job is to wrap existing implementations of such primitives, such as those in package os, into shared public interfaces that abstract the functionality, plus some other related primitives. </p>
+<p>Because these interfaces and primitives wrap lower-level operations with various implementations, unless otherwise informed clients should not assume they are safe for parallel execution. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Copy">func Copy(dst Writer, src Reader) (written int64, err error)</a></li>
+<li><a href="#CopyBuffer">func CopyBuffer(dst Writer, src Reader, buf []byte) (written int64, err error)</a></li>
+<li><a href="#CopyN">func CopyN(dst Writer, src Reader, n int64) (written int64, err error)</a></li>
+<li><a href="#Pipe">func Pipe() (*PipeReader, *PipeWriter)</a></li>
+<li><a href="#ReadAll">func ReadAll(r Reader) ([]byte, error)</a></li>
+<li><a href="#ReadAtLeast">func ReadAtLeast(r Reader, buf []byte, min int) (n int, err error)</a></li>
+<li><a href="#ReadFull">func ReadFull(r Reader, buf []byte) (n int, err error)</a></li>
+<li><a href="#WriteString">func WriteString(w Writer, s string) (n int, err error)</a></li>
+<li><a href="#ByteReader">type ByteReader</a></li>
+<li><a href="#ByteScanner">type ByteScanner</a></li>
+<li><a href="#ByteWriter">type ByteWriter</a></li>
+<li><a href="#Closer">type Closer</a></li>
+<li><a href="#LimitedReader">type LimitedReader</a></li>
+<li> <a href="#LimitedReader.Read">func (l *LimitedReader) Read(p []byte) (n int, err error)</a>
+</li>
+<li><a href="#OffsetWriter">type OffsetWriter</a></li>
+<li> <a href="#NewOffsetWriter">func NewOffsetWriter(w WriterAt, off int64) *OffsetWriter</a>
+</li>
+<li> <a href="#OffsetWriter.Seek">func (o *OffsetWriter) Seek(offset int64, whence int) (int64, error)</a>
+</li>
+<li> <a href="#OffsetWriter.Write">func (o *OffsetWriter) Write(p []byte) (n int, err error)</a>
+</li>
+<li> <a href="#OffsetWriter.WriteAt">func (o *OffsetWriter) WriteAt(p []byte, off int64) (n int, err error)</a>
+</li>
+<li><a href="#PipeReader">type PipeReader</a></li>
+<li> <a href="#PipeReader.Close">func (r *PipeReader) Close() error</a>
+</li>
+<li> <a href="#PipeReader.CloseWithError">func (r *PipeReader) CloseWithError(err error) error</a>
+</li>
+<li> <a href="#PipeReader.Read">func (r *PipeReader) Read(data []byte) (n int, err error)</a>
+</li>
+<li><a href="#PipeWriter">type PipeWriter</a></li>
+<li> <a href="#PipeWriter.Close">func (w *PipeWriter) Close() error</a>
+</li>
+<li> <a href="#PipeWriter.CloseWithError">func (w *PipeWriter) CloseWithError(err error) error</a>
+</li>
+<li> <a href="#PipeWriter.Write">func (w *PipeWriter) Write(data []byte) (n int, err error)</a>
+</li>
+<li><a href="#ReadCloser">type ReadCloser</a></li>
+<li> <a href="#NopCloser">func NopCloser(r Reader) ReadCloser</a>
+</li>
+<li><a href="#ReadSeekCloser">type ReadSeekCloser</a></li>
+<li><a href="#ReadSeeker">type ReadSeeker</a></li>
+<li><a href="#ReadWriteCloser">type ReadWriteCloser</a></li>
+<li><a href="#ReadWriteSeeker">type ReadWriteSeeker</a></li>
+<li><a href="#ReadWriter">type ReadWriter</a></li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#LimitReader">func LimitReader(r Reader, n int64) Reader</a>
+</li>
+<li> <a href="#MultiReader">func MultiReader(readers ...Reader) Reader</a>
+</li>
+<li> <a href="#TeeReader">func TeeReader(r Reader, w Writer) Reader</a>
+</li>
+<li><a href="#ReaderAt">type ReaderAt</a></li>
+<li><a href="#ReaderFrom">type ReaderFrom</a></li>
+<li><a href="#RuneReader">type RuneReader</a></li>
+<li><a href="#RuneScanner">type RuneScanner</a></li>
+<li><a href="#SectionReader">type SectionReader</a></li>
+<li> <a href="#NewSectionReader">func NewSectionReader(r ReaderAt, off int64, n int64) *SectionReader</a>
+</li>
+<li> <a href="#SectionReader.Outer">func (s *SectionReader) Outer() (r ReaderAt, off int64, n int64)</a>
+</li>
+<li> <a href="#SectionReader.Read">func (s *SectionReader) Read(p []byte) (n int, err error)</a>
+</li>
+<li> <a href="#SectionReader.ReadAt">func (s *SectionReader) ReadAt(p []byte, off int64) (n int, err error)</a>
+</li>
+<li> <a href="#SectionReader.Seek">func (s *SectionReader) Seek(offset int64, whence int) (int64, error)</a>
+</li>
+<li> <a href="#SectionReader.Size">func (s *SectionReader) Size() int64</a>
+</li>
+<li><a href="#Seeker">type Seeker</a></li>
+<li><a href="#StringWriter">type StringWriter</a></li>
+<li><a href="#WriteCloser">type WriteCloser</a></li>
+<li><a href="#WriteSeeker">type WriteSeeker</a></li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#MultiWriter">func MultiWriter(writers ...Writer) Writer</a>
+</li>
+<li><a href="#WriterAt">type WriterAt</a></li>
+<li><a href="#WriterTo">type WriterTo</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Copy">Copy</a></dd> <dd><a class="exampleLink" href="#example_CopyBuffer">CopyBuffer</a></dd> <dd><a class="exampleLink" href="#example_CopyN">CopyN</a></dd> <dd><a class="exampleLink" href="#example_LimitReader">LimitReader</a></dd> <dd><a class="exampleLink" href="#example_MultiReader">MultiReader</a></dd> <dd><a class="exampleLink" href="#example_MultiWriter">MultiWriter</a></dd> <dd><a class="exampleLink" href="#example_Pipe">Pipe</a></dd> <dd><a class="exampleLink" href="#example_ReadAll">ReadAll</a></dd> <dd><a class="exampleLink" href="#example_ReadAtLeast">ReadAtLeast</a></dd> <dd><a class="exampleLink" href="#example_ReadFull">ReadFull</a></dd> <dd><a class="exampleLink" href="#example_SectionReader">SectionReader</a></dd> <dd><a class="exampleLink" href="#example_SectionReader_Read">SectionReader.Read</a></dd> <dd><a class="exampleLink" href="#example_SectionReader_ReadAt">SectionReader.ReadAt</a></dd> <dd><a class="exampleLink" href="#example_SectionReader_Seek">SectionReader.Seek</a></dd> <dd><a class="exampleLink" href="#example_SectionReader_Size">SectionReader.Size</a></dd> <dd><a class="exampleLink" href="#example_TeeReader">TeeReader</a></dd> <dd><a class="exampleLink" href="#example_WriteString">WriteString</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>io.go</span> <span>multi.go</span> <span>pipe.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Seek whence values. </p>
+<pre data-language="go">const (
+ SeekStart = 0 // seek relative to the origin of the file
+ SeekCurrent = 1 // seek relative to the current offset
+ SeekEnd = 2 // seek relative to the end
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>EOF is the error returned by Read when no more input is available. (Read must return EOF itself, not an error wrapping EOF, because callers will test for EOF using ==.) Functions should return EOF only to signal a graceful end of input. If the EOF occurs unexpectedly in a structured data stream, the appropriate error is either <a href="#ErrUnexpectedEOF">ErrUnexpectedEOF</a> or some other error giving more detail. </p>
+<pre data-language="go">var EOF = errors.New("EOF")</pre> <p>ErrClosedPipe is the error used for read or write operations on a closed pipe. </p>
+<pre data-language="go">var ErrClosedPipe = errors.New("io: read/write on closed pipe")</pre> <p>ErrNoProgress is returned by some clients of a <a href="#Reader">Reader</a> when many calls to Read have failed to return any data or error, usually the sign of a broken <a href="#Reader">Reader</a> implementation. </p>
+<pre data-language="go">var ErrNoProgress = errors.New("multiple Read calls return no data or error")</pre> <p>ErrShortBuffer means that a read required a longer buffer than was provided. </p>
+<pre data-language="go">var ErrShortBuffer = errors.New("short buffer")</pre> <p>ErrShortWrite means that a write accepted fewer bytes than requested but failed to return an explicit error. </p>
+<pre data-language="go">var ErrShortWrite = errors.New("short write")</pre> <p>ErrUnexpectedEOF means that EOF was encountered in the middle of reading a fixed-size block or data structure. </p>
+<pre data-language="go">var ErrUnexpectedEOF = errors.New("unexpected EOF")</pre> <h2 id="Copy">func <span>Copy</span> </h2> <pre data-language="go">func Copy(dst Writer, src Reader) (written int64, err error)</pre> <p>Copy copies from src to dst until either EOF is reached on src or an error occurs. It returns the number of bytes copied and the first error encountered while copying, if any. </p>
+<p>A successful Copy returns err == nil, not err == EOF. Because Copy is defined to read from src until EOF, it does not treat an EOF from Read as an error to be reported. </p>
+<p>If src implements <a href="#WriterTo">WriterTo</a>, the copy is implemented by calling src.WriteTo(dst). Otherwise, if dst implements <a href="#ReaderFrom">ReaderFrom</a>, the copy is implemented by calling dst.ReadFrom(src). </p> <h4 id="example_Copy"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+
+if _, err := io.Copy(os.Stdout, r); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">some io.Reader stream to be read
+</pre> <h2 id="CopyBuffer">func <span>CopyBuffer</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func CopyBuffer(dst Writer, src Reader, buf []byte) (written int64, err error)</pre> <p>CopyBuffer is identical to Copy except that it stages through the provided buffer (if one is required) rather than allocating a temporary one. If buf is nil, one is allocated; otherwise if it has zero length, CopyBuffer panics. </p>
+<p>If either src implements <a href="#WriterTo">WriterTo</a> or dst implements <a href="#ReaderFrom">ReaderFrom</a>, buf will not be used to perform the copy. </p> <h4 id="example_CopyBuffer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r1 := strings.NewReader("first reader\n")
+r2 := strings.NewReader("second reader\n")
+buf := make([]byte, 8)
+
+// buf is used here...
+if _, err := io.CopyBuffer(os.Stdout, r1, buf); err != nil {
+ log.Fatal(err)
+}
+
+// ... reused here also. No need to allocate an extra buffer.
+if _, err := io.CopyBuffer(os.Stdout, r2, buf); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">first reader
+second reader
+</pre> <h2 id="CopyN">func <span>CopyN</span> </h2> <pre data-language="go">func CopyN(dst Writer, src Reader, n int64) (written int64, err error)</pre> <p>CopyN copies n bytes (or until an error) from src to dst. It returns the number of bytes copied and the earliest error encountered while copying. On return, written == n if and only if err == nil. </p>
+<p>If dst implements <a href="#ReaderFrom">ReaderFrom</a>, the copy is implemented using it. </p> <h4 id="example_CopyN"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read")
+
+if _, err := io.CopyN(os.Stdout, r, 4); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">some
+</pre> <h2 id="Pipe">func <span>Pipe</span> </h2> <pre data-language="go">func Pipe() (*PipeReader, *PipeWriter)</pre> <p>Pipe creates a synchronous in-memory pipe. It can be used to connect code expecting an <a href="#Reader">io.Reader</a> with code expecting an <a href="#Writer">io.Writer</a>. </p>
+<p>Reads and Writes on the pipe are matched one to one except when multiple Reads are needed to consume a single Write. That is, each Write to the <a href="#PipeWriter">PipeWriter</a> blocks until it has satisfied one or more Reads from the <a href="#PipeReader">PipeReader</a> that fully consume the written data. The data is copied directly from the Write to the corresponding Read (or Reads); there is no internal buffering. </p>
+<p>It is safe to call Read and Write in parallel with each other or with Close. Parallel calls to Read and parallel calls to Write are also safe: the individual calls will be gated sequentially. </p> <h4 id="example_Pipe"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r, w := io.Pipe()
+
+go func() {
+ fmt.Fprint(w, "some io.Reader stream to be read\n")
+ w.Close()
+}()
+
+if _, err := io.Copy(os.Stdout, r); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">some io.Reader stream to be read
+</pre> <h2 id="ReadAll">func <span>ReadAll</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func ReadAll(r Reader) ([]byte, error)</pre> <p>ReadAll reads from r until an error or EOF and returns the data it read. A successful call returns err == nil, not err == EOF. Because ReadAll is defined to read from src until EOF, it does not treat an EOF from Read as an error to be reported. </p> <h4 id="example_ReadAll"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("Go is a general-purpose language designed with systems programming in mind.")
+
+b, err := io.ReadAll(r)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s", b)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Go is a general-purpose language designed with systems programming in mind.
+</pre> <h2 id="ReadAtLeast">func <span>ReadAtLeast</span> </h2> <pre data-language="go">func ReadAtLeast(r Reader, buf []byte, min int) (n int, err error)</pre> <p>ReadAtLeast reads from r into buf until it has read at least min bytes. It returns the number of bytes copied and an error if fewer bytes were read. The error is EOF only if no bytes were read. If an EOF happens after reading fewer than min bytes, ReadAtLeast returns <a href="#ErrUnexpectedEOF">ErrUnexpectedEOF</a>. If min is greater than the length of buf, ReadAtLeast returns <a href="#ErrShortBuffer">ErrShortBuffer</a>. On return, n &gt;= min if and only if err == nil. If r returns an error having read at least min bytes, the error is dropped. </p> <h4 id="example_ReadAtLeast"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+
+buf := make([]byte, 14)
+if _, err := io.ReadAtLeast(r, buf, 4); err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s\n", buf)
+
+// buffer smaller than minimal read size.
+shortBuf := make([]byte, 3)
+if _, err := io.ReadAtLeast(r, shortBuf, 4); err != nil {
+ fmt.Println("error:", err)
+}
+
+// minimal read size bigger than io.Reader stream
+longBuf := make([]byte, 64)
+if _, err := io.ReadAtLeast(r, longBuf, 64); err != nil {
+ fmt.Println("error:", err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">some io.Reader
+error: short buffer
+error: unexpected EOF
+</pre> <h2 id="ReadFull">func <span>ReadFull</span> </h2> <pre data-language="go">func ReadFull(r Reader, buf []byte) (n int, err error)</pre> <p>ReadFull reads exactly len(buf) bytes from r into buf. It returns the number of bytes copied and an error if fewer bytes were read. The error is EOF only if no bytes were read. If an EOF happens after reading some but not all the bytes, ReadFull returns <a href="#ErrUnexpectedEOF">ErrUnexpectedEOF</a>. On return, n == len(buf) if and only if err == nil. If r returns an error having read at least len(buf) bytes, the error is dropped. </p> <h4 id="example_ReadFull"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+
+buf := make([]byte, 4)
+if _, err := io.ReadFull(r, buf); err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s\n", buf)
+
+// minimal read size bigger than io.Reader stream
+longBuf := make([]byte, 64)
+if _, err := io.ReadFull(r, longBuf); err != nil {
+ fmt.Println("error:", err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">some
+error: unexpected EOF
+</pre> <h2 id="WriteString">func <span>WriteString</span> </h2> <pre data-language="go">func WriteString(w Writer, s string) (n int, err error)</pre> <p>WriteString writes the contents of the string s to w, which accepts a slice of bytes. If w implements <a href="#StringWriter">StringWriter</a>, [StringWriter.WriteString] is invoked directly. Otherwise, [Writer.Write] is called exactly once. </p> <h4 id="example_WriteString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">if _, err := io.WriteString(os.Stdout, "Hello World"); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello World
+</pre> <h2 id="ByteReader">type <span>ByteReader</span> </h2> <p>ByteReader is the interface that wraps the ReadByte method. </p>
+<p>ReadByte reads and returns the next byte from the input or any error encountered. If ReadByte returns an error, no input byte was consumed, and the returned byte value is undefined. </p>
+<p>ReadByte provides an efficient interface for byte-at-time processing. A <a href="#Reader">Reader</a> that does not implement ByteReader can be wrapped using bufio.NewReader to add this method. </p>
+<pre data-language="go">type ByteReader interface {
+ ReadByte() (byte, error)
+}</pre> <h2 id="ByteScanner">type <span>ByteScanner</span> </h2> <p>ByteScanner is the interface that adds the UnreadByte method to the basic ReadByte method. </p>
+<p>UnreadByte causes the next call to ReadByte to return the last byte read. If the last operation was not a successful call to ReadByte, UnreadByte may return an error, unread the last byte read (or the byte prior to the last-unread byte), or (in implementations that support the <a href="#Seeker">Seeker</a> interface) seek to one byte before the current offset. </p>
+<pre data-language="go">type ByteScanner interface {
+ ByteReader
+ UnreadByte() error
+}</pre> <h2 id="ByteWriter">type <span>ByteWriter</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>ByteWriter is the interface that wraps the WriteByte method. </p>
+<pre data-language="go">type ByteWriter interface {
+ WriteByte(c byte) error
+}</pre> <h2 id="Closer">type <span>Closer</span> </h2> <p>Closer is the interface that wraps the basic Close method. </p>
+<p>The behavior of Close after the first call is undefined. Specific implementations may document their own behavior. </p>
+<pre data-language="go">type Closer interface {
+ Close() error
+}</pre> <h2 id="LimitedReader">type <span>LimitedReader</span> </h2> <p>A LimitedReader reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining. Read returns EOF when N &lt;= 0 or when the underlying R returns EOF. </p>
+<pre data-language="go">type LimitedReader struct {
+ R Reader // underlying reader
+ N int64 // max bytes remaining
+}
+</pre> <h3 id="LimitedReader.Read">func (*LimitedReader) <span>Read</span> </h3> <pre data-language="go">func (l *LimitedReader) Read(p []byte) (n int, err error)</pre> <h2 id="OffsetWriter">type <span>OffsetWriter</span> <span title="Added in Go 1.20">1.20</span> </h2> <p>An OffsetWriter maps writes at offset base to offset base+off in the underlying writer. </p>
+<pre data-language="go">type OffsetWriter struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewOffsetWriter">func <span>NewOffsetWriter</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func NewOffsetWriter(w WriterAt, off int64) *OffsetWriter</pre> <p>NewOffsetWriter returns an <a href="#OffsetWriter">OffsetWriter</a> that writes to w starting at offset off. </p>
+<h3 id="OffsetWriter.Seek">func (*OffsetWriter) <span>Seek</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (o *OffsetWriter) Seek(offset int64, whence int) (int64, error)</pre> <h3 id="OffsetWriter.Write">func (*OffsetWriter) <span>Write</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (o *OffsetWriter) Write(p []byte) (n int, err error)</pre> <h3 id="OffsetWriter.WriteAt">func (*OffsetWriter) <span>WriteAt</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (o *OffsetWriter) WriteAt(p []byte, off int64) (n int, err error)</pre> <h2 id="PipeReader">type <span>PipeReader</span> </h2> <p>A PipeReader is the read half of a pipe. </p>
+<pre data-language="go">type PipeReader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="PipeReader.Close">func (*PipeReader) <span>Close</span> </h3> <pre data-language="go">func (r *PipeReader) Close() error</pre> <p>Close closes the reader; subsequent writes to the write half of the pipe will return the error <a href="#ErrClosedPipe">ErrClosedPipe</a>. </p>
+<h3 id="PipeReader.CloseWithError">func (*PipeReader) <span>CloseWithError</span> </h3> <pre data-language="go">func (r *PipeReader) CloseWithError(err error) error</pre> <p>CloseWithError closes the reader; subsequent writes to the write half of the pipe will return the error err. </p>
+<p>CloseWithError never overwrites the previous error if it exists and always returns nil. </p>
+<h3 id="PipeReader.Read">func (*PipeReader) <span>Read</span> </h3> <pre data-language="go">func (r *PipeReader) Read(data []byte) (n int, err error)</pre> <p>Read implements the standard Read interface: it reads data from the pipe, blocking until a writer arrives or the write end is closed. If the write end is closed with an error, that error is returned as err; otherwise err is EOF. </p>
+<h2 id="PipeWriter">type <span>PipeWriter</span> </h2> <p>A PipeWriter is the write half of a pipe. </p>
+<pre data-language="go">type PipeWriter struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="PipeWriter.Close">func (*PipeWriter) <span>Close</span> </h3> <pre data-language="go">func (w *PipeWriter) Close() error</pre> <p>Close closes the writer; subsequent reads from the read half of the pipe will return no bytes and EOF. </p>
+<h3 id="PipeWriter.CloseWithError">func (*PipeWriter) <span>CloseWithError</span> </h3> <pre data-language="go">func (w *PipeWriter) CloseWithError(err error) error</pre> <p>CloseWithError closes the writer; subsequent reads from the read half of the pipe will return no bytes and the error err, or EOF if err is nil. </p>
+<p>CloseWithError never overwrites the previous error if it exists and always returns nil. </p>
+<h3 id="PipeWriter.Write">func (*PipeWriter) <span>Write</span> </h3> <pre data-language="go">func (w *PipeWriter) Write(data []byte) (n int, err error)</pre> <p>Write implements the standard Write interface: it writes data to the pipe, blocking until one or more readers have consumed all the data or the read end is closed. If the read end is closed with an error, that err is returned as err; otherwise err is <a href="#ErrClosedPipe">ErrClosedPipe</a>. </p>
+<h2 id="ReadCloser">type <span>ReadCloser</span> </h2> <p>ReadCloser is the interface that groups the basic Read and Close methods. </p>
+<pre data-language="go">type ReadCloser interface {
+ Reader
+ Closer
+}</pre> <h3 id="NopCloser">func <span>NopCloser</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func NopCloser(r Reader) ReadCloser</pre> <p>NopCloser returns a <a href="#ReadCloser">ReadCloser</a> with a no-op Close method wrapping the provided <a href="#Reader">Reader</a> r. If r implements <a href="#WriterTo">WriterTo</a>, the returned <a href="#ReadCloser">ReadCloser</a> will implement <a href="#WriterTo">WriterTo</a> by forwarding calls to r. </p>
+<h2 id="ReadSeekCloser">type <span>ReadSeekCloser</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>ReadSeekCloser is the interface that groups the basic Read, Seek and Close methods. </p>
+<pre data-language="go">type ReadSeekCloser interface {
+ Reader
+ Seeker
+ Closer
+}</pre> <h2 id="ReadSeeker">type <span>ReadSeeker</span> </h2> <p>ReadSeeker is the interface that groups the basic Read and Seek methods. </p>
+<pre data-language="go">type ReadSeeker interface {
+ Reader
+ Seeker
+}</pre> <h2 id="ReadWriteCloser">type <span>ReadWriteCloser</span> </h2> <p>ReadWriteCloser is the interface that groups the basic Read, Write and Close methods. </p>
+<pre data-language="go">type ReadWriteCloser interface {
+ Reader
+ Writer
+ Closer
+}</pre> <h2 id="ReadWriteSeeker">type <span>ReadWriteSeeker</span> </h2> <p>ReadWriteSeeker is the interface that groups the basic Read, Write and Seek methods. </p>
+<pre data-language="go">type ReadWriteSeeker interface {
+ Reader
+ Writer
+ Seeker
+}</pre> <h2 id="ReadWriter">type <span>ReadWriter</span> </h2> <p>ReadWriter is the interface that groups the basic Read and Write methods. </p>
+<pre data-language="go">type ReadWriter interface {
+ Reader
+ Writer
+}</pre> <h2 id="Reader">type <span>Reader</span> </h2> <p>Reader is the interface that wraps the basic Read method. </p>
+<p>Read reads up to len(p) bytes into p. It returns the number of bytes read (0 &lt;= n &lt;= len(p)) and any error encountered. Even if Read returns n &lt; len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more. </p>
+<p>When Read encounters an error or end-of-file condition after successfully reading n &gt; 0 bytes, it returns the number of bytes read. It may return the (non-nil) error from the same call or return the error (and n == 0) from a subsequent call. An instance of this general case is that a Reader returning a non-zero number of bytes at the end of the input stream may return either err == EOF or err == nil. The next Read should return 0, EOF. </p>
+<p>Callers should always process the n &gt; 0 bytes returned before considering the error err. Doing so correctly handles I/O errors that happen after reading some bytes and also both of the allowed EOF behaviors. </p>
+<p>If len(p) == 0, Read should always return n == 0. It may return a non-nil error if some error condition is known, such as EOF. </p>
+<p>Implementations of Read are discouraged from returning a zero byte count with a nil error, except when len(p) == 0. Callers should treat a return of 0 and nil as indicating that nothing happened; in particular it does not indicate EOF. </p>
+<p>Implementations must not retain p. </p>
+<pre data-language="go">type Reader interface {
+ Read(p []byte) (n int, err error)
+}</pre> <h3 id="LimitReader">func <span>LimitReader</span> </h3> <pre data-language="go">func LimitReader(r Reader, n int64) Reader</pre> <p>LimitReader returns a Reader that reads from r but stops with EOF after n bytes. The underlying implementation is a *LimitedReader. </p> <h4 id="example_LimitReader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+lr := io.LimitReader(r, 4)
+
+if _, err := io.Copy(os.Stdout, lr); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">some
+</pre> <h3 id="MultiReader">func <span>MultiReader</span> </h3> <pre data-language="go">func MultiReader(readers ...Reader) Reader</pre> <p>MultiReader returns a Reader that's the logical concatenation of the provided input readers. They're read sequentially. Once all inputs have returned EOF, Read will return EOF. If any of the readers return a non-nil, non-EOF error, Read will return that error. </p> <h4 id="example_MultiReader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r1 := strings.NewReader("first reader ")
+r2 := strings.NewReader("second reader ")
+r3 := strings.NewReader("third reader\n")
+r := io.MultiReader(r1, r2, r3)
+
+if _, err := io.Copy(os.Stdout, r); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">first reader second reader third reader
+</pre> <h3 id="TeeReader">func <span>TeeReader</span> </h3> <pre data-language="go">func TeeReader(r Reader, w Writer) Reader</pre> <p>TeeReader returns a <a href="#Reader">Reader</a> that writes to w what it reads from r. All reads from r performed through it are matched with corresponding writes to w. There is no internal buffering - the write must complete before the read completes. Any error encountered while writing is reported as a read error. </p> <h4 id="example_TeeReader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var r io.Reader = strings.NewReader("some io.Reader stream to be read\n")
+
+r = io.TeeReader(r, os.Stdout)
+
+// Everything read from r will be copied to stdout.
+if _, err := io.ReadAll(r); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">some io.Reader stream to be read
+</pre> <h2 id="ReaderAt">type <span>ReaderAt</span> </h2> <p>ReaderAt is the interface that wraps the basic ReadAt method. </p>
+<p>ReadAt reads len(p) bytes into p starting at offset off in the underlying input source. It returns the number of bytes read (0 &lt;= n &lt;= len(p)) and any error encountered. </p>
+<p>When ReadAt returns n &lt; len(p), it returns a non-nil error explaining why more bytes were not returned. In this respect, ReadAt is stricter than Read. </p>
+<p>Even if ReadAt returns n &lt; len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, ReadAt blocks until either all the data is available or an error occurs. In this respect ReadAt is different from Read. </p>
+<p>If the n = len(p) bytes returned by ReadAt are at the end of the input source, ReadAt may return either err == EOF or err == nil. </p>
+<p>If ReadAt is reading from an input source with a seek offset, ReadAt should not affect nor be affected by the underlying seek offset. </p>
+<p>Clients of ReadAt can execute parallel ReadAt calls on the same input source. </p>
+<p>Implementations must not retain p. </p>
+<pre data-language="go">type ReaderAt interface {
+ ReadAt(p []byte, off int64) (n int, err error)
+}</pre> <h2 id="ReaderFrom">type <span>ReaderFrom</span> </h2> <p>ReaderFrom is the interface that wraps the ReadFrom method. </p>
+<p>ReadFrom reads data from r until EOF or error. The return value n is the number of bytes read. Any error except EOF encountered during the read is also returned. </p>
+<p>The <a href="#Copy">Copy</a> function uses <a href="#ReaderFrom">ReaderFrom</a> if available. </p>
+<pre data-language="go">type ReaderFrom interface {
+ ReadFrom(r Reader) (n int64, err error)
+}</pre> <h2 id="RuneReader">type <span>RuneReader</span> </h2> <p>RuneReader is the interface that wraps the ReadRune method. </p>
+<p>ReadRune reads a single encoded Unicode character and returns the rune and its size in bytes. If no character is available, err will be set. </p>
+<pre data-language="go">type RuneReader interface {
+ ReadRune() (r rune, size int, err error)
+}</pre> <h2 id="RuneScanner">type <span>RuneScanner</span> </h2> <p>RuneScanner is the interface that adds the UnreadRune method to the basic ReadRune method. </p>
+<p>UnreadRune causes the next call to ReadRune to return the last rune read. If the last operation was not a successful call to ReadRune, UnreadRune may return an error, unread the last rune read (or the rune prior to the last-unread rune), or (in implementations that support the <a href="#Seeker">Seeker</a> interface) seek to the start of the rune before the current offset. </p>
+<pre data-language="go">type RuneScanner interface {
+ RuneReader
+ UnreadRune() error
+}</pre> <h2 id="SectionReader">type <span>SectionReader</span> </h2> <p>SectionReader implements Read, Seek, and ReadAt on a section of an underlying <a href="#ReaderAt">ReaderAt</a>. </p>
+<pre data-language="go">type SectionReader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_SectionReader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+s := io.NewSectionReader(r, 5, 17)
+
+if _, err := io.Copy(os.Stdout, s); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">io.Reader stream
+</pre> <h3 id="NewSectionReader">func <span>NewSectionReader</span> </h3> <pre data-language="go">func NewSectionReader(r ReaderAt, off int64, n int64) *SectionReader</pre> <p>NewSectionReader returns a <a href="#SectionReader">SectionReader</a> that reads from r starting at offset off and stops with EOF after n bytes. </p>
+<h3 id="SectionReader.Outer">func (*SectionReader) <span>Outer</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (s *SectionReader) Outer() (r ReaderAt, off int64, n int64)</pre> <p>Outer returns the underlying <a href="#ReaderAt">ReaderAt</a> and offsets for the section. </p>
+<p>The returned values are the same that were passed to <a href="#NewSectionReader">NewSectionReader</a> when the <a href="#SectionReader">SectionReader</a> was created. </p>
+<h3 id="SectionReader.Read">func (*SectionReader) <span>Read</span> </h3> <pre data-language="go">func (s *SectionReader) Read(p []byte) (n int, err error)</pre> <h4 id="example_SectionReader_Read"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+s := io.NewSectionReader(r, 5, 17)
+
+buf := make([]byte, 9)
+if _, err := s.Read(buf); err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s\n", buf)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">io.Reader
+</pre> <h3 id="SectionReader.ReadAt">func (*SectionReader) <span>ReadAt</span> </h3> <pre data-language="go">func (s *SectionReader) ReadAt(p []byte, off int64) (n int, err error)</pre> <h4 id="example_SectionReader_ReadAt"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+s := io.NewSectionReader(r, 5, 17)
+
+buf := make([]byte, 6)
+if _, err := s.ReadAt(buf, 10); err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s\n", buf)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">stream
+</pre> <h3 id="SectionReader.Seek">func (*SectionReader) <span>Seek</span> </h3> <pre data-language="go">func (s *SectionReader) Seek(offset int64, whence int) (int64, error)</pre> <h4 id="example_SectionReader_Seek"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+s := io.NewSectionReader(r, 5, 17)
+
+if _, err := s.Seek(10, io.SeekStart); err != nil {
+ log.Fatal(err)
+}
+
+if _, err := io.Copy(os.Stdout, s); err != nil {
+ log.Fatal(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">stream
+</pre> <h3 id="SectionReader.Size">func (*SectionReader) <span>Size</span> </h3> <pre data-language="go">func (s *SectionReader) Size() int64</pre> <p>Size returns the size of the section in bytes. </p> <h4 id="example_SectionReader_Size"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+s := io.NewSectionReader(r, 5, 17)
+
+fmt.Println(s.Size())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">17
+</pre> <h2 id="Seeker">type <span>Seeker</span> </h2> <p>Seeker is the interface that wraps the basic Seek method. </p>
+<p>Seek sets the offset for the next Read or Write to offset, interpreted according to whence: <a href="#SeekStart">SeekStart</a> means relative to the start of the file, <a href="#SeekCurrent">SeekCurrent</a> means relative to the current offset, and <a href="#SeekEnd">SeekEnd</a> means relative to the end (for example, offset = -2 specifies the penultimate byte of the file). Seek returns the new offset relative to the start of the file or an error, if any. </p>
+<p>Seeking to an offset before the start of the file is an error. Seeking to any positive offset may be allowed, but if the new offset exceeds the size of the underlying object the behavior of subsequent I/O operations is implementation-dependent. </p>
+<pre data-language="go">type Seeker interface {
+ Seek(offset int64, whence int) (int64, error)
+}</pre> <h2 id="StringWriter">type <span>StringWriter</span> <span title="Added in Go 1.12">1.12</span> </h2> <p>StringWriter is the interface that wraps the WriteString method. </p>
+<pre data-language="go">type StringWriter interface {
+ WriteString(s string) (n int, err error)
+}</pre> <h2 id="WriteCloser">type <span>WriteCloser</span> </h2> <p>WriteCloser is the interface that groups the basic Write and Close methods. </p>
+<pre data-language="go">type WriteCloser interface {
+ Writer
+ Closer
+}</pre> <h2 id="WriteSeeker">type <span>WriteSeeker</span> </h2> <p>WriteSeeker is the interface that groups the basic Write and Seek methods. </p>
+<pre data-language="go">type WriteSeeker interface {
+ Writer
+ Seeker
+}</pre> <h2 id="Writer">type <span>Writer</span> </h2> <p>Writer is the interface that wraps the basic Write method. </p>
+<p>Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 &lt;= n &lt;= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n &lt; len(p). Write must not modify the slice data, even temporarily. </p>
+<p>Implementations must not retain p. </p>
+<pre data-language="go">type Writer interface {
+ Write(p []byte) (n int, err error)
+}</pre> <p>Discard is a <a href="#Writer">Writer</a> on which all Write calls succeed without doing anything. </p>
+<pre data-language="go">var Discard Writer = discard{}</pre> <h3 id="MultiWriter">func <span>MultiWriter</span> </h3> <pre data-language="go">func MultiWriter(writers ...Writer) Writer</pre> <p>MultiWriter creates a writer that duplicates its writes to all the provided writers, similar to the Unix tee(1) command. </p>
+<p>Each write is written to each listed writer, one at a time. If a listed writer returns an error, that overall write operation stops and returns the error; it does not continue down the list. </p> <h4 id="example_MultiWriter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("some io.Reader stream to be read\n")
+
+var buf1, buf2 strings.Builder
+w := io.MultiWriter(&amp;buf1, &amp;buf2)
+
+if _, err := io.Copy(w, r); err != nil {
+ log.Fatal(err)
+}
+
+fmt.Print(buf1.String())
+fmt.Print(buf2.String())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">some io.Reader stream to be read
+some io.Reader stream to be read
+</pre> <h2 id="WriterAt">type <span>WriterAt</span> </h2> <p>WriterAt is the interface that wraps the basic WriteAt method. </p>
+<p>WriteAt writes len(p) bytes from p to the underlying data stream at offset off. It returns the number of bytes written from p (0 &lt;= n &lt;= len(p)) and any error encountered that caused the write to stop early. WriteAt must return a non-nil error if it returns n &lt; len(p). </p>
+<p>If WriteAt is writing to a destination with a seek offset, WriteAt should not affect nor be affected by the underlying seek offset. </p>
+<p>Clients of WriteAt can execute parallel WriteAt calls on the same destination if the ranges do not overlap. </p>
+<p>Implementations must not retain p. </p>
+<pre data-language="go">type WriterAt interface {
+ WriteAt(p []byte, off int64) (n int, err error)
+}</pre> <h2 id="WriterTo">type <span>WriterTo</span> </h2> <p>WriterTo is the interface that wraps the WriteTo method. </p>
+<p>WriteTo writes data to w until there's no more data to write or when an error occurs. The return value n is the number of bytes written. Any error encountered during the write is also returned. </p>
+<p>The Copy function uses WriterTo if available. </p>
+<pre data-language="go">type WriterTo interface {
+ WriteTo(w Writer) (n int64, err error)
+}</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="fs/index">fs</a> </td> <td class="pkg-synopsis"> Package fs defines basic interfaces to a file system. </td> </tr> <tr> <td class="pkg-name"> <a href="ioutil/index">ioutil</a> </td> <td class="pkg-synopsis"> Package ioutil implements some I/O utility functions. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/io/" class="_attribution-link">http://golang.org/pkg/io/</a>
+ </p>
+</div>
diff --git a/devdocs/go/io%2Fioutil%2Findex.html b/devdocs/go/io%2Fioutil%2Findex.html
new file mode 100644
index 00000000..072cc201
--- /dev/null
+++ b/devdocs/go/io%2Fioutil%2Findex.html
@@ -0,0 +1,147 @@
+<h1> Package ioutil </h1> <ul id="short-nav">
+<li><code>import "io/ioutil"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package ioutil implements some I/O utility functions. </p>
+<p>Deprecated: As of Go 1.16, the same functionality is now provided by package <span>io</span> or package <span>os</span>, and those implementations should be preferred in new code. See the specific function documentation for details. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#NopCloser">func NopCloser(r io.Reader) io.ReadCloser</a></li>
+<li><a href="#ReadAll">func ReadAll(r io.Reader) ([]byte, error)</a></li>
+<li><a href="#ReadDir">func ReadDir(dirname string) ([]fs.FileInfo, error)</a></li>
+<li><a href="#ReadFile">func ReadFile(filename string) ([]byte, error)</a></li>
+<li><a href="#TempDir">func TempDir(dir, pattern string) (name string, err error)</a></li>
+<li><a href="#TempFile">func TempFile(dir, pattern string) (f *os.File, err error)</a></li>
+<li><a href="#WriteFile">func WriteFile(filename string, data []byte, perm fs.FileMode) error</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_ReadAll">ReadAll</a></dd> <dd><a class="exampleLink" href="#example_ReadDir">ReadDir</a></dd> <dd><a class="exampleLink" href="#example_ReadFile">ReadFile</a></dd> <dd><a class="exampleLink" href="#example_TempDir">TempDir</a></dd> <dd><a class="exampleLink" href="#example_TempDir_suffix">TempDir (Suffix)</a></dd> <dd><a class="exampleLink" href="#example_TempFile">TempFile</a></dd> <dd><a class="exampleLink" href="#example_TempFile_suffix">TempFile (Suffix)</a></dd> <dd><a class="exampleLink" href="#example_WriteFile">WriteFile</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>ioutil.go</span> <span>tempfile.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>Discard is an io.Writer on which all Write calls succeed without doing anything. </p>
+<p>Deprecated: As of Go 1.16, this value is simply <span>io.Discard</span>. </p>
+<pre data-language="go">var Discard io.Writer = io.Discard</pre> <h2 id="NopCloser">func <span>NopCloser</span> </h2> <pre data-language="go">func NopCloser(r io.Reader) io.ReadCloser</pre> <p>NopCloser returns a ReadCloser with a no-op Close method wrapping the provided Reader r. </p>
+<p>Deprecated: As of Go 1.16, this function simply calls <span>io.NopCloser</span>. </p>
+<h2 id="ReadAll">func <span>ReadAll</span> </h2> <pre data-language="go">func ReadAll(r io.Reader) ([]byte, error)</pre> <p>ReadAll reads from r until an error or EOF and returns the data it read. A successful call returns err == nil, not err == EOF. Because ReadAll is defined to read from src until EOF, it does not treat an EOF from Read as an error to be reported. </p>
+<p>Deprecated: As of Go 1.16, this function simply calls <span>io.ReadAll</span>. </p> <h4 id="example_ReadAll"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReader("Go is a general-purpose language designed with systems programming in mind.")
+
+b, err := ioutil.ReadAll(r)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s", b)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Go is a general-purpose language designed with systems programming in mind.
+</pre> <h2 id="ReadDir">func <span>ReadDir</span> </h2> <pre data-language="go">func ReadDir(dirname string) ([]fs.FileInfo, error)</pre> <p>ReadDir reads the directory named by dirname and returns a list of fs.FileInfo for the directory's contents, sorted by filename. If an error occurs reading the directory, ReadDir returns no directory entries along with the error. </p>
+<p>Deprecated: As of Go 1.16, <span>os.ReadDir</span> is a more efficient and correct choice: it returns a list of <span>fs.DirEntry</span> instead of <span>fs.FileInfo</span>, and it returns partial results in the case of an error midway through reading a directory. </p>
+<p>If you must continue obtaining a list of <span>fs.FileInfo</span>, you still can: </p>
+<pre data-language="go">entries, err := os.ReadDir(dirname)
+if err != nil { ... }
+infos := make([]fs.FileInfo, 0, len(entries))
+for _, entry := range entries {
+ info, err := entry.Info()
+ if err != nil { ... }
+ infos = append(infos, info)
+}
+</pre> <h4 id="example_ReadDir"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+files, err := ioutil.ReadDir(".")
+if err != nil {
+ log.Fatal(err)
+}
+
+for _, file := range files {
+ fmt.Println(file.Name())
+}
+</pre> <h2 id="ReadFile">func <span>ReadFile</span> </h2> <pre data-language="go">func ReadFile(filename string) ([]byte, error)</pre> <p>ReadFile reads the file named by filename and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads the whole file, it does not treat an EOF from Read as an error to be reported. </p>
+<p>Deprecated: As of Go 1.16, this function simply calls <span>os.ReadFile</span>. </p> <h4 id="example_ReadFile"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">content, err := ioutil.ReadFile("testdata/hello")
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("File contents: %s", content)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">File contents: Hello, Gophers!
+</pre> <h2 id="TempDir">func <span>TempDir</span> </h2> <pre data-language="go">func TempDir(dir, pattern string) (name string, err error)</pre> <p>TempDir creates a new temporary directory in the directory dir. The directory name is generated by taking pattern and applying a random string to the end. If pattern includes a "*", the random string replaces the last "*". TempDir returns the name of the new directory. If dir is the empty string, TempDir uses the default directory for temporary files (see <span>os.TempDir</span>). Multiple programs calling TempDir simultaneously will not choose the same directory. It is the caller's responsibility to remove the directory when no longer needed. </p>
+<p>Deprecated: As of Go 1.17, this function simply calls <span>os.MkdirTemp</span>. </p> <h4 id="example_TempDir"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+content := []byte("temporary file's content")
+dir, err := ioutil.TempDir("", "example")
+if err != nil {
+ log.Fatal(err)
+}
+
+defer os.RemoveAll(dir) // clean up
+
+tmpfn := filepath.Join(dir, "tmpfile")
+if err := ioutil.WriteFile(tmpfn, content, 0666); err != nil {
+ log.Fatal(err)
+}
+</pre> <h4 id="example_TempDir_suffix"> <span class="text">Example (Suffix)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+parentDir := os.TempDir()
+logsDir, err := ioutil.TempDir(parentDir, "*-logs")
+if err != nil {
+ log.Fatal(err)
+}
+defer os.RemoveAll(logsDir) // clean up
+
+// Logs can be cleaned out earlier if needed by searching
+// for all directories whose suffix ends in *-logs.
+globPattern := filepath.Join(parentDir, "*-logs")
+matches, err := filepath.Glob(globPattern)
+if err != nil {
+ log.Fatalf("Failed to match %q: %v", globPattern, err)
+}
+
+for _, match := range matches {
+ if err := os.RemoveAll(match); err != nil {
+ log.Printf("Failed to remove %q: %v", match, err)
+ }
+}
+</pre> <h2 id="TempFile">func <span>TempFile</span> </h2> <pre data-language="go">func TempFile(dir, pattern string) (f *os.File, err error)</pre> <p>TempFile creates a new temporary file in the directory dir, opens the file for reading and writing, and returns the resulting *<span>os.File</span>. The filename is generated by taking pattern and adding a random string to the end. If pattern includes a "*", the random string replaces the last "*". If dir is the empty string, TempFile uses the default directory for temporary files (see <span>os.TempDir</span>). Multiple programs calling TempFile simultaneously will not choose the same file. The caller can use f.Name() to find the pathname of the file. It is the caller's responsibility to remove the file when no longer needed. </p>
+<p>Deprecated: As of Go 1.17, this function simply calls <span>os.CreateTemp</span>. </p> <h4 id="example_TempFile"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+content := []byte("temporary file's content")
+tmpfile, err := ioutil.TempFile("", "example")
+if err != nil {
+ log.Fatal(err)
+}
+
+defer os.Remove(tmpfile.Name()) // clean up
+
+if _, err := tmpfile.Write(content); err != nil {
+ log.Fatal(err)
+}
+if err := tmpfile.Close(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h4 id="example_TempFile_suffix"> <span class="text">Example (Suffix)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+content := []byte("temporary file's content")
+tmpfile, err := ioutil.TempFile("", "example.*.txt")
+if err != nil {
+ log.Fatal(err)
+}
+
+defer os.Remove(tmpfile.Name()) // clean up
+
+if _, err := tmpfile.Write(content); err != nil {
+ tmpfile.Close()
+ log.Fatal(err)
+}
+if err := tmpfile.Close(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="WriteFile">func <span>WriteFile</span> </h2> <pre data-language="go">func WriteFile(filename string, data []byte, perm fs.FileMode) error</pre> <p>WriteFile writes data to a file named by filename. If the file does not exist, WriteFile creates it with permissions perm (before umask); otherwise WriteFile truncates it before writing, without changing permissions. </p>
+<p>Deprecated: As of Go 1.16, this function simply calls <span>os.WriteFile</span>. </p> <h4 id="example_WriteFile"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+message := []byte("Hello, Gophers!")
+err := ioutil.WriteFile("hello", message, 0644)
+if err != nil {
+ log.Fatal(err)
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/io/ioutil/" class="_attribution-link">http://golang.org/pkg/io/ioutil/</a>
+ </p>
+</div>
diff --git a/devdocs/go/iter%2Findex.html b/devdocs/go/iter%2Findex.html
new file mode 100644
index 00000000..4fb4cc84
--- /dev/null
+++ b/devdocs/go/iter%2Findex.html
@@ -0,0 +1,7 @@
+<h1> Command iter </h1> <p>Package iter provides basic definitions and operations related to iteration in Go. </p>
+<p>This package is experimental and can only be imported when building with GOEXPERIMENT=rangefunc. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/iter/" class="_attribution-link">http://golang.org/pkg/iter/</a>
+ </p>
+</div>
diff --git a/devdocs/go/log%2Findex.html b/devdocs/go/log%2Findex.html
new file mode 100644
index 00000000..74b005a4
--- /dev/null
+++ b/devdocs/go/log%2Findex.html
@@ -0,0 +1,141 @@
+<h1> Package log </h1> <ul id="short-nav">
+<li><code>import "log"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package log implements a simple logging package. It defines a type, <a href="#Logger">Logger</a>, with methods for formatting output. It also has a predefined 'standard' Logger accessible through helper functions Print[f|ln], Fatal[f|ln], and Panic[f|ln], which are easier to use than creating a Logger manually. That logger writes to standard error and prints the date and time of each logged message. Every log message is output on a separate line: if the message being printed does not end in a newline, the logger will add one. The Fatal functions call <span>os.Exit</span>(1) after writing the log message. The Panic functions call panic after writing the log message. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Fatal">func Fatal(v ...any)</a></li>
+<li><a href="#Fatalf">func Fatalf(format string, v ...any)</a></li>
+<li><a href="#Fatalln">func Fatalln(v ...any)</a></li>
+<li><a href="#Flags">func Flags() int</a></li>
+<li><a href="#Output">func Output(calldepth int, s string) error</a></li>
+<li><a href="#Panic">func Panic(v ...any)</a></li>
+<li><a href="#Panicf">func Panicf(format string, v ...any)</a></li>
+<li><a href="#Panicln">func Panicln(v ...any)</a></li>
+<li><a href="#Prefix">func Prefix() string</a></li>
+<li><a href="#Print">func Print(v ...any)</a></li>
+<li><a href="#Printf">func Printf(format string, v ...any)</a></li>
+<li><a href="#Println">func Println(v ...any)</a></li>
+<li><a href="#SetFlags">func SetFlags(flag int)</a></li>
+<li><a href="#SetOutput">func SetOutput(w io.Writer)</a></li>
+<li><a href="#SetPrefix">func SetPrefix(prefix string)</a></li>
+<li><a href="#Writer">func Writer() io.Writer</a></li>
+<li><a href="#Logger">type Logger</a></li>
+<li> <a href="#Default">func Default() *Logger</a>
+</li>
+<li> <a href="#New">func New(out io.Writer, prefix string, flag int) *Logger</a>
+</li>
+<li> <a href="#Logger.Fatal">func (l *Logger) Fatal(v ...any)</a>
+</li>
+<li> <a href="#Logger.Fatalf">func (l *Logger) Fatalf(format string, v ...any)</a>
+</li>
+<li> <a href="#Logger.Fatalln">func (l *Logger) Fatalln(v ...any)</a>
+</li>
+<li> <a href="#Logger.Flags">func (l *Logger) Flags() int</a>
+</li>
+<li> <a href="#Logger.Output">func (l *Logger) Output(calldepth int, s string) error</a>
+</li>
+<li> <a href="#Logger.Panic">func (l *Logger) Panic(v ...any)</a>
+</li>
+<li> <a href="#Logger.Panicf">func (l *Logger) Panicf(format string, v ...any)</a>
+</li>
+<li> <a href="#Logger.Panicln">func (l *Logger) Panicln(v ...any)</a>
+</li>
+<li> <a href="#Logger.Prefix">func (l *Logger) Prefix() string</a>
+</li>
+<li> <a href="#Logger.Print">func (l *Logger) Print(v ...any)</a>
+</li>
+<li> <a href="#Logger.Printf">func (l *Logger) Printf(format string, v ...any)</a>
+</li>
+<li> <a href="#Logger.Println">func (l *Logger) Println(v ...any)</a>
+</li>
+<li> <a href="#Logger.SetFlags">func (l *Logger) SetFlags(flag int)</a>
+</li>
+<li> <a href="#Logger.SetOutput">func (l *Logger) SetOutput(w io.Writer)</a>
+</li>
+<li> <a href="#Logger.SetPrefix">func (l *Logger) SetPrefix(prefix string)</a>
+</li>
+<li> <a href="#Logger.Writer">func (l *Logger) Writer() io.Writer</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Logger">Logger</a></dd> <dd><a class="exampleLink" href="#example_Logger_Output">Logger.Output</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>log.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>These flags define which text to prefix to each log entry generated by the <a href="#Logger">Logger</a>. Bits are or'ed together to control what's printed. With the exception of the Lmsgprefix flag, there is no control over the order they appear (the order listed here) or the format they present (as described in the comments). The prefix is followed by a colon only when Llongfile or Lshortfile is specified. For example, flags Ldate | Ltime (or LstdFlags) produce, </p>
+<pre data-language="go">2009/01/23 01:23:23 message
+</pre> <p>while flags Ldate | Ltime | Lmicroseconds | Llongfile produce, </p>
+<pre data-language="go">2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message
+</pre> <pre data-language="go">const (
+ Ldate = 1 &lt;&lt; iota // the date in the local time zone: 2009/01/23
+ Ltime // the time in the local time zone: 01:23:23
+ Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime.
+ Llongfile // full file name and line number: /a/b/c/d.go:23
+ Lshortfile // final file name element and line number: d.go:23. overrides Llongfile
+ LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone
+ Lmsgprefix // move the "prefix" from the beginning of the line to before the message
+ LstdFlags = Ldate | Ltime // initial values for the standard logger
+)</pre> <h2 id="Fatal">func <span>Fatal</span> </h2> <pre data-language="go">func Fatal(v ...any)</pre> <p>Fatal is equivalent to <a href="#Print">Print</a> followed by a call to <span>os.Exit</span>(1). </p>
+<h2 id="Fatalf">func <span>Fatalf</span> </h2> <pre data-language="go">func Fatalf(format string, v ...any)</pre> <p>Fatalf is equivalent to <a href="#Printf">Printf</a> followed by a call to <span>os.Exit</span>(1). </p>
+<h2 id="Fatalln">func <span>Fatalln</span> </h2> <pre data-language="go">func Fatalln(v ...any)</pre> <p>Fatalln is equivalent to <a href="#Println">Println</a> followed by a call to <span>os.Exit</span>(1). </p>
+<h2 id="Flags">func <span>Flags</span> </h2> <pre data-language="go">func Flags() int</pre> <p>Flags returns the output flags for the standard logger. The flag bits are <a href="#Ldate">Ldate</a>, <a href="#Ltime">Ltime</a>, and so on. </p>
+<h2 id="Output">func <span>Output</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Output(calldepth int, s string) error</pre> <p>Output writes the output for a logging event. The string s contains the text to print after the prefix specified by the flags of the Logger. A newline is appended if the last character of s is not already a newline. Calldepth is the count of the number of frames to skip when computing the file name and line number if <a href="#Llongfile">Llongfile</a> or <a href="#Lshortfile">Lshortfile</a> is set; a value of 1 will print the details for the caller of Output. </p>
+<h2 id="Panic">func <span>Panic</span> </h2> <pre data-language="go">func Panic(v ...any)</pre> <p>Panic is equivalent to <a href="#Print">Print</a> followed by a call to panic(). </p>
+<h2 id="Panicf">func <span>Panicf</span> </h2> <pre data-language="go">func Panicf(format string, v ...any)</pre> <p>Panicf is equivalent to <a href="#Printf">Printf</a> followed by a call to panic(). </p>
+<h2 id="Panicln">func <span>Panicln</span> </h2> <pre data-language="go">func Panicln(v ...any)</pre> <p>Panicln is equivalent to <a href="#Println">Println</a> followed by a call to panic(). </p>
+<h2 id="Prefix">func <span>Prefix</span> </h2> <pre data-language="go">func Prefix() string</pre> <p>Prefix returns the output prefix for the standard logger. </p>
+<h2 id="Print">func <span>Print</span> </h2> <pre data-language="go">func Print(v ...any)</pre> <p>Print calls Output to print to the standard logger. Arguments are handled in the manner of <span>fmt.Print</span>. </p>
+<h2 id="Printf">func <span>Printf</span> </h2> <pre data-language="go">func Printf(format string, v ...any)</pre> <p>Printf calls Output to print to the standard logger. Arguments are handled in the manner of <span>fmt.Printf</span>. </p>
+<h2 id="Println">func <span>Println</span> </h2> <pre data-language="go">func Println(v ...any)</pre> <p>Println calls Output to print to the standard logger. Arguments are handled in the manner of <span>fmt.Println</span>. </p>
+<h2 id="SetFlags">func <span>SetFlags</span> </h2> <pre data-language="go">func SetFlags(flag int)</pre> <p>SetFlags sets the output flags for the standard logger. The flag bits are <a href="#Ldate">Ldate</a>, <a href="#Ltime">Ltime</a>, and so on. </p>
+<h2 id="SetOutput">func <span>SetOutput</span> </h2> <pre data-language="go">func SetOutput(w io.Writer)</pre> <p>SetOutput sets the output destination for the standard logger. </p>
+<h2 id="SetPrefix">func <span>SetPrefix</span> </h2> <pre data-language="go">func SetPrefix(prefix string)</pre> <p>SetPrefix sets the output prefix for the standard logger. </p>
+<h2 id="Writer">func <span>Writer</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func Writer() io.Writer</pre> <p>Writer returns the output destination for the standard logger. </p>
+<h2 id="Logger">type <span>Logger</span> </h2> <p>A Logger represents an active logging object that generates lines of output to an <span>io.Writer</span>. Each logging operation makes a single call to the Writer's Write method. A Logger can be used simultaneously from multiple goroutines; it guarantees to serialize access to the Writer. </p>
+<pre data-language="go">type Logger struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Logger"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var (
+ buf bytes.Buffer
+ logger = log.New(&amp;buf, "logger: ", log.Lshortfile)
+)
+
+logger.Print("Hello, log file!")
+
+fmt.Print(&amp;buf)
+</pre> <p>Output:</p> <pre class="output" data-language="go">logger: example_test.go:19: Hello, log file!
+</pre> <h3 id="Default">func <span>Default</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func Default() *Logger</pre> <p>Default returns the standard logger used by the package-level output functions. </p>
+<h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(out io.Writer, prefix string, flag int) *Logger</pre> <p>New creates a new <a href="#Logger">Logger</a>. The out variable sets the destination to which log data will be written. The prefix appears at the beginning of each generated log line, or after the log header if the <a href="#Lmsgprefix">Lmsgprefix</a> flag is provided. The flag argument defines the logging properties. </p>
+<h3 id="Logger.Fatal">func (*Logger) <span>Fatal</span> </h3> <pre data-language="go">func (l *Logger) Fatal(v ...any)</pre> <p>Fatal is equivalent to l.Print() followed by a call to <span>os.Exit</span>(1). </p>
+<h3 id="Logger.Fatalf">func (*Logger) <span>Fatalf</span> </h3> <pre data-language="go">func (l *Logger) Fatalf(format string, v ...any)</pre> <p>Fatalf is equivalent to l.Printf() followed by a call to <span>os.Exit</span>(1). </p>
+<h3 id="Logger.Fatalln">func (*Logger) <span>Fatalln</span> </h3> <pre data-language="go">func (l *Logger) Fatalln(v ...any)</pre> <p>Fatalln is equivalent to l.Println() followed by a call to <span>os.Exit</span>(1). </p>
+<h3 id="Logger.Flags">func (*Logger) <span>Flags</span> </h3> <pre data-language="go">func (l *Logger) Flags() int</pre> <p>Flags returns the output flags for the logger. The flag bits are <a href="#Ldate">Ldate</a>, <a href="#Ltime">Ltime</a>, and so on. </p>
+<h3 id="Logger.Output">func (*Logger) <span>Output</span> </h3> <pre data-language="go">func (l *Logger) Output(calldepth int, s string) error</pre> <p>Output writes the output for a logging event. The string s contains the text to print after the prefix specified by the flags of the Logger. A newline is appended if the last character of s is not already a newline. Calldepth is used to recover the PC and is provided for generality, although at the moment on all pre-defined paths it will be 2. </p> <h4 id="example_Logger_Output"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var (
+ buf bytes.Buffer
+ logger = log.New(&amp;buf, "INFO: ", log.Lshortfile)
+
+ infof = func(info string) {
+ logger.Output(2, info)
+ }
+)
+
+infof("Hello world")
+
+fmt.Print(&amp;buf)
+</pre> <p>Output:</p> <pre class="output" data-language="go">INFO: example_test.go:36: Hello world
+</pre> <h3 id="Logger.Panic">func (*Logger) <span>Panic</span> </h3> <pre data-language="go">func (l *Logger) Panic(v ...any)</pre> <p>Panic is equivalent to l.Print() followed by a call to panic(). </p>
+<h3 id="Logger.Panicf">func (*Logger) <span>Panicf</span> </h3> <pre data-language="go">func (l *Logger) Panicf(format string, v ...any)</pre> <p>Panicf is equivalent to l.Printf() followed by a call to panic(). </p>
+<h3 id="Logger.Panicln">func (*Logger) <span>Panicln</span> </h3> <pre data-language="go">func (l *Logger) Panicln(v ...any)</pre> <p>Panicln is equivalent to l.Println() followed by a call to panic(). </p>
+<h3 id="Logger.Prefix">func (*Logger) <span>Prefix</span> </h3> <pre data-language="go">func (l *Logger) Prefix() string</pre> <p>Prefix returns the output prefix for the logger. </p>
+<h3 id="Logger.Print">func (*Logger) <span>Print</span> </h3> <pre data-language="go">func (l *Logger) Print(v ...any)</pre> <p>Print calls l.Output to print to the logger. Arguments are handled in the manner of <span>fmt.Print</span>. </p>
+<h3 id="Logger.Printf">func (*Logger) <span>Printf</span> </h3> <pre data-language="go">func (l *Logger) Printf(format string, v ...any)</pre> <p>Printf calls l.Output to print to the logger. Arguments are handled in the manner of <span>fmt.Printf</span>. </p>
+<h3 id="Logger.Println">func (*Logger) <span>Println</span> </h3> <pre data-language="go">func (l *Logger) Println(v ...any)</pre> <p>Println calls l.Output to print to the logger. Arguments are handled in the manner of <span>fmt.Println</span>. </p>
+<h3 id="Logger.SetFlags">func (*Logger) <span>SetFlags</span> </h3> <pre data-language="go">func (l *Logger) SetFlags(flag int)</pre> <p>SetFlags sets the output flags for the logger. The flag bits are <a href="#Ldate">Ldate</a>, <a href="#Ltime">Ltime</a>, and so on. </p>
+<h3 id="Logger.SetOutput">func (*Logger) <span>SetOutput</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (l *Logger) SetOutput(w io.Writer)</pre> <p>SetOutput sets the output destination for the logger. </p>
+<h3 id="Logger.SetPrefix">func (*Logger) <span>SetPrefix</span> </h3> <pre data-language="go">func (l *Logger) SetPrefix(prefix string)</pre> <p>SetPrefix sets the output prefix for the logger. </p>
+<h3 id="Logger.Writer">func (*Logger) <span>Writer</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (l *Logger) Writer() io.Writer</pre> <p>Writer returns the output destination for the logger. </p>
+<h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="slog/index">slog</a> </td> <td class="pkg-synopsis"> Package slog provides structured logging, in which log records include a message, a severity level, and various other attributes expressed as key-value pairs. </td> </tr> <tr> <td class="pkg-name"> <a href="syslog/index">syslog</a> </td> <td class="pkg-synopsis"> Package syslog provides a simple interface to the system log service. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/log/" class="_attribution-link">http://golang.org/pkg/log/</a>
+ </p>
+</div>
diff --git a/devdocs/go/log%2Fslog%2Findex.html b/devdocs/go/log%2Fslog%2Findex.html
new file mode 100644
index 00000000..4c81a471
--- /dev/null
+++ b/devdocs/go/log%2Fslog%2Findex.html
@@ -0,0 +1,931 @@
+<h1> Package slog </h1> <ul id="short-nav">
+<li><code>import "log/slog"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package slog provides structured logging, in which log records include a message, a severity level, and various other attributes expressed as key-value pairs. </p>
+<p>It defines a type, <a href="#Logger">Logger</a>, which provides several methods (such as <a href="#Logger.Info">Logger.Info</a> and <a href="#Logger.Error">Logger.Error</a>) for reporting events of interest. </p>
+<p>Each Logger is associated with a <a href="#Handler">Handler</a>. A Logger output method creates a <a href="#Record">Record</a> from the method arguments and passes it to the Handler, which decides how to handle it. There is a default Logger accessible through top-level functions (such as <a href="#Info">Info</a> and <a href="#Error">Error</a>) that call the corresponding Logger methods. </p>
+<p>A log record consists of a time, a level, a message, and a set of key-value pairs, where the keys are strings and the values may be of any type. As an example, </p>
+<pre data-language="go">slog.Info("hello", "count", 3)
+</pre> <p>creates a record containing the time of the call, a level of Info, the message "hello", and a single pair with key "count" and value 3. </p>
+<p>The <a href="#Info">Info</a> top-level function calls the <a href="#Logger.Info">Logger.Info</a> method on the default Logger. In addition to <a href="#Logger.Info">Logger.Info</a>, there are methods for Debug, Warn and Error levels. Besides these convenience methods for common levels, there is also a <a href="#Logger.Log">Logger.Log</a> method which takes the level as an argument. Each of these methods has a corresponding top-level function that uses the default logger. </p>
+<p>The default handler formats the log record's message, time, level, and attributes as a string and passes it to the <span>log</span> package. </p>
+<pre data-language="go">2022/11/08 15:28:26 INFO hello count=3
+</pre> <p>For more control over the output format, create a logger with a different handler. This statement uses <a href="#New">New</a> to create a new logger with a <a href="#TextHandler">TextHandler</a> that writes structured records in text form to standard error: </p>
+<pre data-language="go">logger := slog.New(slog.NewTextHandler(os.Stderr, nil))
+</pre> <p><a href="#TextHandler">TextHandler</a> output is a sequence of key=value pairs, easily and unambiguously parsed by machine. This statement: </p>
+<pre data-language="go">logger.Info("hello", "count", 3)
+</pre> <p>produces this output: </p>
+<pre data-language="go">time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3
+</pre> <p>The package also provides <a href="#JSONHandler">JSONHandler</a>, whose output is line-delimited JSON: </p>
+<pre data-language="go">logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
+logger.Info("hello", "count", 3)
+</pre> <p>produces this output: </p>
+<pre data-language="go">{"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3}
+</pre> <p>Both <a href="#TextHandler">TextHandler</a> and <a href="#JSONHandler">JSONHandler</a> can be configured with <a href="#HandlerOptions">HandlerOptions</a>. There are options for setting the minimum level (see Levels, below), displaying the source file and line of the log call, and modifying attributes before they are logged. </p>
+<p>Setting a logger as the default with </p>
+<pre data-language="go">slog.SetDefault(logger)
+</pre> <p>will cause the top-level functions like <a href="#Info">Info</a> to use it. <a href="#SetDefault">SetDefault</a> also updates the default logger used by the <span>log</span> package, so that existing applications that use <span>log.Printf</span> and related functions will send log records to the logger's handler without needing to be rewritten. </p>
+<p>Some attributes are common to many log calls. For example, you may wish to include the URL or trace identifier of a server request with all log events arising from the request. Rather than repeat the attribute with every log call, you can use <a href="#Logger.With">Logger.With</a> to construct a new Logger containing the attributes: </p>
+<pre data-language="go">logger2 := logger.With("url", r.URL)
+</pre> <p>The arguments to With are the same key-value pairs used in <a href="#Logger.Info">Logger.Info</a>. The result is a new Logger with the same handler as the original, but additional attributes that will appear in the output of every call. </p>
+<h3 id="hdr-Levels">Levels</h3> <p>A <a href="#Level">Level</a> is an integer representing the importance or severity of a log event. The higher the level, the more severe the event. This package defines constants for the most common levels, but any int can be used as a level. </p>
+<p>In an application, you may wish to log messages only at a certain level or greater. One common configuration is to log messages at Info or higher levels, suppressing debug logging until it is needed. The built-in handlers can be configured with the minimum level to output by setting [HandlerOptions.Level]. The program's `main` function typically does this. The default value is LevelInfo. </p>
+<p>Setting the [HandlerOptions.Level] field to a <a href="#Level">Level</a> value fixes the handler's minimum level throughout its lifetime. Setting it to a <a href="#LevelVar">LevelVar</a> allows the level to be varied dynamically. A LevelVar holds a Level and is safe to read or write from multiple goroutines. To vary the level dynamically for an entire program, first initialize a global LevelVar: </p>
+<pre data-language="go">var programLevel = new(slog.LevelVar) // Info by default
+</pre> <p>Then use the LevelVar to construct a handler, and make it the default: </p>
+<pre data-language="go">h := slog.NewJSONHandler(os.Stderr, &amp;slog.HandlerOptions{Level: programLevel})
+slog.SetDefault(slog.New(h))
+</pre> <p>Now the program can change its logging level with a single statement: </p>
+<pre data-language="go">programLevel.Set(slog.LevelDebug)
+</pre> <h3 id="hdr-Groups">Groups</h3> <p>Attributes can be collected into groups. A group has a name that is used to qualify the names of its attributes. How this qualification is displayed depends on the handler. <a href="#TextHandler">TextHandler</a> separates the group and attribute names with a dot. <a href="#JSONHandler">JSONHandler</a> treats each group as a separate JSON object, with the group name as the key. </p>
+<p>Use <a href="#Group">Group</a> to create a Group attribute from a name and a list of key-value pairs: </p>
+<pre data-language="go">slog.Group("request",
+ "method", r.Method,
+ "url", r.URL)
+</pre> <p>TextHandler would display this group as </p>
+<pre data-language="go">request.method=GET request.url=http://example.com
+</pre> <p>JSONHandler would display it as </p>
+<pre data-language="go">"request":{"method":"GET","url":"http://example.com"}
+</pre> <p>Use <a href="#Logger.WithGroup">Logger.WithGroup</a> to qualify all of a Logger's output with a group name. Calling WithGroup on a Logger results in a new Logger with the same Handler as the original, but with all its attributes qualified by the group name. </p>
+<p>This can help prevent duplicate attribute keys in large systems, where subsystems might use the same keys. Pass each subsystem a different Logger with its own group name so that potential duplicates are qualified: </p>
+<pre data-language="go">logger := slog.Default().With("id", systemID)
+parserLogger := logger.WithGroup("parser")
+parseInput(input, parserLogger)
+</pre> <p>When parseInput logs with parserLogger, its keys will be qualified with "parser", so even if it uses the common key "id", the log line will have distinct keys. </p>
+<h3 id="hdr-Contexts">Contexts</h3> <p>Some handlers may wish to include information from the <span>context.Context</span> that is available at the call site. One example of such information is the identifier for the current span when tracing is enabled. </p>
+<p>The <a href="#Logger.Log">Logger.Log</a> and <a href="#Logger.LogAttrs">Logger.LogAttrs</a> methods take a context as a first argument, as do their corresponding top-level functions. </p>
+<p>Although the convenience methods on Logger (Info and so on) and the corresponding top-level functions do not take a context, the alternatives ending in "Context" do. For example, </p>
+<pre data-language="go">slog.InfoContext(ctx, "message")
+</pre> <p>It is recommended to pass a context to an output method if one is available. </p>
+<h3 id="hdr-Attrs_and_Values">Attrs and Values</h3> <p>An <a href="#Attr">Attr</a> is a key-value pair. The Logger output methods accept Attrs as well as alternating keys and values. The statement </p>
+<pre data-language="go">slog.Info("hello", slog.Int("count", 3))
+</pre> <p>behaves the same as </p>
+<pre data-language="go">slog.Info("hello", "count", 3)
+</pre> <p>There are convenience constructors for <a href="#Attr">Attr</a> such as <a href="#Int">Int</a>, <a href="#String">String</a>, and <a href="#Bool">Bool</a> for common types, as well as the function <a href="#Any">Any</a> for constructing Attrs of any type. </p>
+<p>The value part of an Attr is a type called <a href="#Value">Value</a>. Like an [any], a Value can hold any Go value, but it can represent typical values, including all numbers and strings, without an allocation. </p>
+<p>For the most efficient log output, use <a href="#Logger.LogAttrs">Logger.LogAttrs</a>. It is similar to <a href="#Logger.Log">Logger.Log</a> but accepts only Attrs, not alternating keys and values; this allows it, too, to avoid allocation. </p>
+<p>The call </p>
+<pre data-language="go">logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3))
+</pre> <p>is the most efficient way to achieve the same output as </p>
+<pre data-language="go">slog.InfoContext(ctx, "hello", "count", 3)
+</pre> <h3 id="hdr-Customizing_a_type_s_logging_behavior">Customizing a type's logging behavior</h3> <p>If a type implements the <a href="#LogValuer">LogValuer</a> interface, the <a href="#Value">Value</a> returned from its LogValue method is used for logging. You can use this to control how values of the type appear in logs. For example, you can redact secret information like passwords, or gather a struct's fields in a Group. See the examples under <a href="#LogValuer">LogValuer</a> for details. </p>
+<p>A LogValue method may return a Value that itself implements <a href="#LogValuer">LogValuer</a>. The <a href="#Value.Resolve">Value.Resolve</a> method handles these cases carefully, avoiding infinite loops and unbounded recursion. Handler authors and others may wish to use <a href="#Value.Resolve">Value.Resolve</a> instead of calling LogValue directly. </p>
+<h3 id="hdr-Wrapping_output_methods">Wrapping output methods</h3> <p>The logger functions use reflection over the call stack to find the file name and line number of the logging call within the application. This can produce incorrect source information for functions that wrap slog. For instance, if you define this function in file mylog.go: </p>
+<pre data-language="go">func Infof(logger *slog.Logger, format string, args ...any) {
+ logger.Info(fmt.Sprintf(format, args...))
+}
+</pre> <p>and you call it like this in main.go: </p>
+<pre data-language="go">Infof(slog.Default(), "hello, %s", "world")
+</pre> <p>then slog will report the source file as mylog.go, not main.go. </p>
+<p>A correct implementation of Infof will obtain the source location (pc) and pass it to NewRecord. The Infof function in the package-level example called "wrapping" demonstrates how to do this. </p>
+<h3 id="hdr-Working_with_Records">Working with Records</h3> <p>Sometimes a Handler will need to modify a Record before passing it on to another Handler or backend. A Record contains a mixture of simple public fields (e.g. Time, Level, Message) and hidden fields that refer to state (such as attributes) indirectly. This means that modifying a simple copy of a Record (e.g. by calling <a href="#Record.Add">Record.Add</a> or <a href="#Record.AddAttrs">Record.AddAttrs</a> to add attributes) may have unexpected effects on the original. Before modifying a Record, use <a href="#Record.Clone">Record.Clone</a> to create a copy that shares no state with the original, or create a new Record with <a href="#NewRecord">NewRecord</a> and build up its Attrs by traversing the old ones with <a href="#Record.Attrs">Record.Attrs</a>. </p>
+<h3 id="hdr-Performance_considerations">Performance considerations</h3> <p>If profiling your application demonstrates that logging is taking significant time, the following suggestions may help. </p>
+<p>If many log lines have a common attribute, use <a href="#Logger.With">Logger.With</a> to create a Logger with that attribute. The built-in handlers will format that attribute only once, at the call to <a href="#Logger.With">Logger.With</a>. The <a href="#Handler">Handler</a> interface is designed to allow that optimization, and a well-written Handler should take advantage of it. </p>
+<p>The arguments to a log call are always evaluated, even if the log event is discarded. If possible, defer computation so that it happens only if the value is actually logged. For example, consider the call </p>
+<pre data-language="go">slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily
+</pre> <p>The URL.String method will be called even if the logger discards Info-level events. Instead, pass the URL directly: </p>
+<pre data-language="go">slog.Info("starting request", "url", &amp;r.URL) // calls URL.String only if needed
+</pre> <p>The built-in <a href="#TextHandler">TextHandler</a> will call its String method, but only if the log event is enabled. Avoiding the call to String also preserves the structure of the underlying value. For example <a href="#JSONHandler">JSONHandler</a> emits the components of the parsed URL as a JSON object. If you want to avoid eagerly paying the cost of the String call without causing the handler to potentially inspect the structure of the value, wrap the value in a fmt.Stringer implementation that hides its Marshal methods. </p>
+<p>You can also use the <a href="#LogValuer">LogValuer</a> interface to avoid unnecessary work in disabled log calls. Say you need to log some expensive value: </p>
+<pre data-language="go">slog.Debug("frobbing", "value", computeExpensiveValue(arg))
+</pre> <p>Even if this line is disabled, computeExpensiveValue will be called. To avoid that, define a type implementing LogValuer: </p>
+<pre data-language="go">type expensive struct { arg int }
+
+func (e expensive) LogValue() slog.Value {
+ return slog.AnyValue(computeExpensiveValue(e.arg))
+}
+</pre> <p>Then use a value of that type in log calls: </p>
+<pre data-language="go">slog.Debug("frobbing", "value", expensive{arg})
+</pre> <p>Now computeExpensiveValue will only be called when the line is enabled. </p>
+<p>The built-in handlers acquire a lock before calling <span>io.Writer.Write</span> to ensure that each record is written in one piece. User-defined handlers are responsible for their own locking. </p>
+<h3 id="hdr-Writing_a_handler">Writing a handler</h3> <p>For a guide to writing a custom handler, see <a href="https://golang.org/s/slog-handler-guide">https://golang.org/s/slog-handler-guide</a>. </p> <h4 id="example__wrapping"> <span class="text">Example (Wrapping)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package slog_test
+
+import (
+ "context"
+ "fmt"
+ "log/slog"
+ "os"
+ "path/filepath"
+ "runtime"
+ "time"
+)
+
+// Infof is an example of a user-defined logging function that wraps slog.
+// The log record contains the source position of the caller of Infof.
+func Infof(logger *slog.Logger, format string, args ...any) {
+ if !logger.Enabled(context.Background(), slog.LevelInfo) {
+ return
+ }
+ var pcs [1]uintptr
+ runtime.Callers(2, pcs[:]) // skip [Callers, Infof]
+ r := slog.NewRecord(time.Now(), slog.LevelInfo, fmt.Sprintf(format, args...), pcs[0])
+ _ = logger.Handler().Handle(context.Background(), r)
+}
+
+func Example_wrapping() {
+ replace := func(groups []string, a slog.Attr) slog.Attr {
+ // Remove time.
+ if a.Key == slog.TimeKey &amp;&amp; len(groups) == 0 {
+ return slog.Attr{}
+ }
+ // Remove the directory from the source's filename.
+ if a.Key == slog.SourceKey {
+ source := a.Value.Any().(*slog.Source)
+ source.File = filepath.Base(source.File)
+ }
+ return a
+ }
+ logger := slog.New(slog.NewTextHandler(os.Stdout, &amp;slog.HandlerOptions{AddSource: true, ReplaceAttr: replace}))
+ Infof(logger, "message, %s", "formatted")
+
+ // Output:
+ // level=INFO source=example_wrap_test.go:43 msg="message, formatted"
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Debug">func Debug(msg string, args ...any)</a></li>
+<li><a href="#DebugContext">func DebugContext(ctx context.Context, msg string, args ...any)</a></li>
+<li><a href="#Error">func Error(msg string, args ...any)</a></li>
+<li><a href="#ErrorContext">func ErrorContext(ctx context.Context, msg string, args ...any)</a></li>
+<li><a href="#Info">func Info(msg string, args ...any)</a></li>
+<li><a href="#InfoContext">func InfoContext(ctx context.Context, msg string, args ...any)</a></li>
+<li><a href="#Log">func Log(ctx context.Context, level Level, msg string, args ...any)</a></li>
+<li><a href="#LogAttrs">func LogAttrs(ctx context.Context, level Level, msg string, attrs ...Attr)</a></li>
+<li><a href="#NewLogLogger">func NewLogLogger(h Handler, level Level) *log.Logger</a></li>
+<li><a href="#SetDefault">func SetDefault(l *Logger)</a></li>
+<li><a href="#Warn">func Warn(msg string, args ...any)</a></li>
+<li><a href="#WarnContext">func WarnContext(ctx context.Context, msg string, args ...any)</a></li>
+<li><a href="#Attr">type Attr</a></li>
+<li> <a href="#Any">func Any(key string, value any) Attr</a>
+</li>
+<li> <a href="#Bool">func Bool(key string, v bool) Attr</a>
+</li>
+<li> <a href="#Duration">func Duration(key string, v time.Duration) Attr</a>
+</li>
+<li> <a href="#Float64">func Float64(key string, v float64) Attr</a>
+</li>
+<li> <a href="#Group">func Group(key string, args ...any) Attr</a>
+</li>
+<li> <a href="#Int">func Int(key string, value int) Attr</a>
+</li>
+<li> <a href="#Int64">func Int64(key string, value int64) Attr</a>
+</li>
+<li> <a href="#String">func String(key, value string) Attr</a>
+</li>
+<li> <a href="#Time">func Time(key string, v time.Time) Attr</a>
+</li>
+<li> <a href="#Uint64">func Uint64(key string, v uint64) Attr</a>
+</li>
+<li> <a href="#Attr.Equal">func (a Attr) Equal(b Attr) bool</a>
+</li>
+<li> <a href="#Attr.String">func (a Attr) String() string</a>
+</li>
+<li><a href="#Handler">type Handler</a></li>
+<li><a href="#HandlerOptions">type HandlerOptions</a></li>
+<li><a href="#JSONHandler">type JSONHandler</a></li>
+<li> <a href="#NewJSONHandler">func NewJSONHandler(w io.Writer, opts *HandlerOptions) *JSONHandler</a>
+</li>
+<li> <a href="#JSONHandler.Enabled">func (h *JSONHandler) Enabled(_ context.Context, level Level) bool</a>
+</li>
+<li> <a href="#JSONHandler.Handle">func (h *JSONHandler) Handle(_ context.Context, r Record) error</a>
+</li>
+<li> <a href="#JSONHandler.WithAttrs">func (h *JSONHandler) WithAttrs(attrs []Attr) Handler</a>
+</li>
+<li> <a href="#JSONHandler.WithGroup">func (h *JSONHandler) WithGroup(name string) Handler</a>
+</li>
+<li><a href="#Kind">type Kind</a></li>
+<li> <a href="#Kind.String">func (k Kind) String() string</a>
+</li>
+<li><a href="#Level">type Level</a></li>
+<li> <a href="#SetLogLoggerLevel">func SetLogLoggerLevel(level Level) (oldLevel Level)</a>
+</li>
+<li> <a href="#Level.Level">func (l Level) Level() Level</a>
+</li>
+<li> <a href="#Level.MarshalJSON">func (l Level) MarshalJSON() ([]byte, error)</a>
+</li>
+<li> <a href="#Level.MarshalText">func (l Level) MarshalText() ([]byte, error)</a>
+</li>
+<li> <a href="#Level.String">func (l Level) String() string</a>
+</li>
+<li> <a href="#Level.UnmarshalJSON">func (l *Level) UnmarshalJSON(data []byte) error</a>
+</li>
+<li> <a href="#Level.UnmarshalText">func (l *Level) UnmarshalText(data []byte) error</a>
+</li>
+<li><a href="#LevelVar">type LevelVar</a></li>
+<li> <a href="#LevelVar.Level">func (v *LevelVar) Level() Level</a>
+</li>
+<li> <a href="#LevelVar.MarshalText">func (v *LevelVar) MarshalText() ([]byte, error)</a>
+</li>
+<li> <a href="#LevelVar.Set">func (v *LevelVar) Set(l Level)</a>
+</li>
+<li> <a href="#LevelVar.String">func (v *LevelVar) String() string</a>
+</li>
+<li> <a href="#LevelVar.UnmarshalText">func (v *LevelVar) UnmarshalText(data []byte) error</a>
+</li>
+<li><a href="#Leveler">type Leveler</a></li>
+<li><a href="#LogValuer">type LogValuer</a></li>
+<li><a href="#Logger">type Logger</a></li>
+<li> <a href="#Default">func Default() *Logger</a>
+</li>
+<li> <a href="#New">func New(h Handler) *Logger</a>
+</li>
+<li> <a href="#With">func With(args ...any) *Logger</a>
+</li>
+<li> <a href="#Logger.Debug">func (l *Logger) Debug(msg string, args ...any)</a>
+</li>
+<li> <a href="#Logger.DebugContext">func (l *Logger) DebugContext(ctx context.Context, msg string, args ...any)</a>
+</li>
+<li> <a href="#Logger.Enabled">func (l *Logger) Enabled(ctx context.Context, level Level) bool</a>
+</li>
+<li> <a href="#Logger.Error">func (l *Logger) Error(msg string, args ...any)</a>
+</li>
+<li> <a href="#Logger.ErrorContext">func (l *Logger) ErrorContext(ctx context.Context, msg string, args ...any)</a>
+</li>
+<li> <a href="#Logger.Handler">func (l *Logger) Handler() Handler</a>
+</li>
+<li> <a href="#Logger.Info">func (l *Logger) Info(msg string, args ...any)</a>
+</li>
+<li> <a href="#Logger.InfoContext">func (l *Logger) InfoContext(ctx context.Context, msg string, args ...any)</a>
+</li>
+<li> <a href="#Logger.Log">func (l *Logger) Log(ctx context.Context, level Level, msg string, args ...any)</a>
+</li>
+<li> <a href="#Logger.LogAttrs">func (l *Logger) LogAttrs(ctx context.Context, level Level, msg string, attrs ...Attr)</a>
+</li>
+<li> <a href="#Logger.Warn">func (l *Logger) Warn(msg string, args ...any)</a>
+</li>
+<li> <a href="#Logger.WarnContext">func (l *Logger) WarnContext(ctx context.Context, msg string, args ...any)</a>
+</li>
+<li> <a href="#Logger.With">func (l *Logger) With(args ...any) *Logger</a>
+</li>
+<li> <a href="#Logger.WithGroup">func (l *Logger) WithGroup(name string) *Logger</a>
+</li>
+<li><a href="#Record">type Record</a></li>
+<li> <a href="#NewRecord">func NewRecord(t time.Time, level Level, msg string, pc uintptr) Record</a>
+</li>
+<li> <a href="#Record.Add">func (r *Record) Add(args ...any)</a>
+</li>
+<li> <a href="#Record.AddAttrs">func (r *Record) AddAttrs(attrs ...Attr)</a>
+</li>
+<li> <a href="#Record.Attrs">func (r Record) Attrs(f func(Attr) bool)</a>
+</li>
+<li> <a href="#Record.Clone">func (r Record) Clone() Record</a>
+</li>
+<li> <a href="#Record.NumAttrs">func (r Record) NumAttrs() int</a>
+</li>
+<li><a href="#Source">type Source</a></li>
+<li><a href="#TextHandler">type TextHandler</a></li>
+<li> <a href="#NewTextHandler">func NewTextHandler(w io.Writer, opts *HandlerOptions) *TextHandler</a>
+</li>
+<li> <a href="#TextHandler.Enabled">func (h *TextHandler) Enabled(_ context.Context, level Level) bool</a>
+</li>
+<li> <a href="#TextHandler.Handle">func (h *TextHandler) Handle(_ context.Context, r Record) error</a>
+</li>
+<li> <a href="#TextHandler.WithAttrs">func (h *TextHandler) WithAttrs(attrs []Attr) Handler</a>
+</li>
+<li> <a href="#TextHandler.WithGroup">func (h *TextHandler) WithGroup(name string) Handler</a>
+</li>
+<li><a href="#Value">type Value</a></li>
+<li> <a href="#AnyValue">func AnyValue(v any) Value</a>
+</li>
+<li> <a href="#BoolValue">func BoolValue(v bool) Value</a>
+</li>
+<li> <a href="#DurationValue">func DurationValue(v time.Duration) Value</a>
+</li>
+<li> <a href="#Float64Value">func Float64Value(v float64) Value</a>
+</li>
+<li> <a href="#GroupValue">func GroupValue(as ...Attr) Value</a>
+</li>
+<li> <a href="#Int64Value">func Int64Value(v int64) Value</a>
+</li>
+<li> <a href="#IntValue">func IntValue(v int) Value</a>
+</li>
+<li> <a href="#StringValue">func StringValue(value string) Value</a>
+</li>
+<li> <a href="#TimeValue">func TimeValue(v time.Time) Value</a>
+</li>
+<li> <a href="#Uint64Value">func Uint64Value(v uint64) Value</a>
+</li>
+<li> <a href="#Value.Any">func (v Value) Any() any</a>
+</li>
+<li> <a href="#Value.Bool">func (v Value) Bool() bool</a>
+</li>
+<li> <a href="#Value.Duration">func (v Value) Duration() time.Duration</a>
+</li>
+<li> <a href="#Value.Equal">func (v Value) Equal(w Value) bool</a>
+</li>
+<li> <a href="#Value.Float64">func (v Value) Float64() float64</a>
+</li>
+<li> <a href="#Value.Group">func (v Value) Group() []Attr</a>
+</li>
+<li> <a href="#Value.Int64">func (v Value) Int64() int64</a>
+</li>
+<li> <a href="#Value.Kind">func (v Value) Kind() Kind</a>
+</li>
+<li> <a href="#Value.LogValuer">func (v Value) LogValuer() LogValuer</a>
+</li>
+<li> <a href="#Value.Resolve">func (v Value) Resolve() (rv Value)</a>
+</li>
+<li> <a href="#Value.String">func (v Value) String() string</a>
+</li>
+<li> <a href="#Value.Time">func (v Value) Time() time.Time</a>
+</li>
+<li> <a href="#Value.Uint64">func (v Value) Uint64() uint64</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Group">Group</a></dd> <dd><a class="exampleLink" href="#example_HandlerOptions_customLevels">HandlerOptions (CustomLevels)</a></dd> <dd><a class="exampleLink" href="#example_Handler_levelHandler">Handler (LevelHandler)</a></dd> <dd><a class="exampleLink" href="#example_LogValuer_group">LogValuer (Group)</a></dd> <dd><a class="exampleLink" href="#example_LogValuer_secret">LogValuer (Secret)</a></dd> <dd><a class="exampleLink" href="#example_SetLogLoggerLevel_log">SetLogLoggerLevel (Log)</a></dd> <dd><a class="exampleLink" href="#example_SetLogLoggerLevel_slog">SetLogLoggerLevel (Slog)</a></dd> <dd><a class="exampleLink" href="#example__wrapping">Package (Wrapping)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>attr.go</span> <span>doc.go</span> <span>handler.go</span> <span>json_handler.go</span> <span>level.go</span> <span>logger.go</span> <span>record.go</span> <span>text_handler.go</span> <span>value.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Keys for "built-in" attributes. </p>
+<pre data-language="go">const (
+ // TimeKey is the key used by the built-in handlers for the time
+ // when the log method is called. The associated Value is a [time.Time].
+ TimeKey = "time"
+ // LevelKey is the key used by the built-in handlers for the level
+ // of the log call. The associated value is a [Level].
+ LevelKey = "level"
+ // MessageKey is the key used by the built-in handlers for the
+ // message of the log call. The associated value is a string.
+ MessageKey = "msg"
+ // SourceKey is the key used by the built-in handlers for the source file
+ // and line of the log call. The associated value is a *[Source].
+ SourceKey = "source"
+)</pre> <h2 id="Debug">func <span>Debug</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func Debug(msg string, args ...any)</pre> <p>Debug calls <a href="#Logger.Debug">Logger.Debug</a> on the default logger. </p>
+<h2 id="DebugContext">func <span>DebugContext</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func DebugContext(ctx context.Context, msg string, args ...any)</pre> <p>DebugContext calls <a href="#Logger.DebugContext">Logger.DebugContext</a> on the default logger. </p>
+<h2 id="Error">func <span>Error</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func Error(msg string, args ...any)</pre> <p>Error calls <a href="#Logger.Error">Logger.Error</a> on the default logger. </p>
+<h2 id="ErrorContext">func <span>ErrorContext</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func ErrorContext(ctx context.Context, msg string, args ...any)</pre> <p>ErrorContext calls <a href="#Logger.ErrorContext">Logger.ErrorContext</a> on the default logger. </p>
+<h2 id="Info">func <span>Info</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func Info(msg string, args ...any)</pre> <p>Info calls <a href="#Logger.Info">Logger.Info</a> on the default logger. </p>
+<h2 id="InfoContext">func <span>InfoContext</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func InfoContext(ctx context.Context, msg string, args ...any)</pre> <p>InfoContext calls <a href="#Logger.InfoContext">Logger.InfoContext</a> on the default logger. </p>
+<h2 id="Log">func <span>Log</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func Log(ctx context.Context, level Level, msg string, args ...any)</pre> <p>Log calls <a href="#Logger.Log">Logger.Log</a> on the default logger. </p>
+<h2 id="LogAttrs">func <span>LogAttrs</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func LogAttrs(ctx context.Context, level Level, msg string, attrs ...Attr)</pre> <p>LogAttrs calls <a href="#Logger.LogAttrs">Logger.LogAttrs</a> on the default logger. </p>
+<h2 id="NewLogLogger">func <span>NewLogLogger</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func NewLogLogger(h Handler, level Level) *log.Logger</pre> <p>NewLogLogger returns a new <span>log.Logger</span> such that each call to its Output method dispatches a Record to the specified handler. The logger acts as a bridge from the older log API to newer structured logging handlers. </p>
+<h2 id="SetDefault">func <span>SetDefault</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func SetDefault(l *Logger)</pre> <p>SetDefault makes l the default <a href="#Logger">Logger</a>, which is used by the top-level functions <a href="#Info">Info</a>, <a href="#Debug">Debug</a> and so on. After this call, output from the log package's default Logger (as with <span>log.Print</span>, etc.) will be logged using l's Handler, at a level controlled by <a href="#SetLogLoggerLevel">SetLogLoggerLevel</a>. </p>
+<h2 id="Warn">func <span>Warn</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func Warn(msg string, args ...any)</pre> <p>Warn calls <a href="#Logger.Warn">Logger.Warn</a> on the default logger. </p>
+<h2 id="WarnContext">func <span>WarnContext</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func WarnContext(ctx context.Context, msg string, args ...any)</pre> <p>WarnContext calls <a href="#Logger.WarnContext">Logger.WarnContext</a> on the default logger. </p>
+<h2 id="Attr">type <span>Attr</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>An Attr is a key-value pair. </p>
+<pre data-language="go">type Attr struct {
+ Key string
+ Value Value
+}
+</pre> <h3 id="Any">func <span>Any</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Any(key string, value any) Attr</pre> <p>Any returns an Attr for the supplied value. See <a href="#AnyValue">AnyValue</a> for how values are treated. </p>
+<h3 id="Bool">func <span>Bool</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Bool(key string, v bool) Attr</pre> <p>Bool returns an Attr for a bool. </p>
+<h3 id="Duration">func <span>Duration</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Duration(key string, v time.Duration) Attr</pre> <p>Duration returns an Attr for a <span>time.Duration</span>. </p>
+<h3 id="Float64">func <span>Float64</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Float64(key string, v float64) Attr</pre> <p>Float64 returns an Attr for a floating-point number. </p>
+<h3 id="Group">func <span>Group</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Group(key string, args ...any) Attr</pre> <p>Group returns an Attr for a Group <a href="#Value">Value</a>. The first argument is the key; the remaining arguments are converted to Attrs as in <a href="#Logger.Log">Logger.Log</a>. </p>
+<p>Use Group to collect several key-value pairs under a single key on a log line, or as the result of LogValue in order to log a single value as multiple Attrs. </p> <h4 id="example_Group"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r, _ := http.NewRequest("GET", "localhost", nil)
+// ...
+
+logger := slog.New(
+ slog.NewTextHandler(os.Stdout, &amp;slog.HandlerOptions{
+ ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
+ if a.Key == slog.TimeKey &amp;&amp; len(groups) == 0 {
+ return slog.Attr{}
+ }
+ return a
+ },
+ }),
+)
+logger.Info("finished",
+ slog.Group("req",
+ slog.String("method", r.Method),
+ slog.String("url", r.URL.String())),
+ slog.Int("status", http.StatusOK),
+ slog.Duration("duration", time.Second))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">level=INFO msg=finished req.method=GET req.url=localhost status=200 duration=1s
+</pre> <h3 id="Int">func <span>Int</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Int(key string, value int) Attr</pre> <p>Int converts an int to an int64 and returns an Attr with that value. </p>
+<h3 id="Int64">func <span>Int64</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Int64(key string, value int64) Attr</pre> <p>Int64 returns an Attr for an int64. </p>
+<h3 id="String">func <span>String</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func String(key, value string) Attr</pre> <p>String returns an Attr for a string value. </p>
+<h3 id="Time">func <span>Time</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Time(key string, v time.Time) Attr</pre> <p>Time returns an Attr for a <span>time.Time</span>. It discards the monotonic portion. </p>
+<h3 id="Uint64">func <span>Uint64</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Uint64(key string, v uint64) Attr</pre> <p>Uint64 returns an Attr for a uint64. </p>
+<h3 id="Attr.Equal">func (Attr) <span>Equal</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (a Attr) Equal(b Attr) bool</pre> <p>Equal reports whether a and b have equal keys and values. </p>
+<h3 id="Attr.String">func (Attr) <span>String</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (a Attr) String() string</pre> <h2 id="Handler">type <span>Handler</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A Handler handles log records produced by a Logger. </p>
+<p>A typical handler may print log records to standard error, or write them to a file or database, or perhaps augment them with additional attributes and pass them on to another handler. </p>
+<p>Any of the Handler's methods may be called concurrently with itself or with other methods. It is the responsibility of the Handler to manage this concurrency. </p>
+<p>Users of the slog package should not invoke Handler methods directly. They should use the methods of <a href="#Logger">Logger</a> instead. </p>
+<pre data-language="go">type Handler interface {
+ // Enabled reports whether the handler handles records at the given level.
+ // The handler ignores records whose level is lower.
+ // It is called early, before any arguments are processed,
+ // to save effort if the log event should be discarded.
+ // If called from a Logger method, the first argument is the context
+ // passed to that method, or context.Background() if nil was passed
+ // or the method does not take a context.
+ // The context is passed so Enabled can use its values
+ // to make a decision.
+ Enabled(context.Context, Level) bool
+
+ // Handle handles the Record.
+ // It will only be called when Enabled returns true.
+ // The Context argument is as for Enabled.
+ // It is present solely to provide Handlers access to the context's values.
+ // Canceling the context should not affect record processing.
+ // (Among other things, log messages may be necessary to debug a
+ // cancellation-related problem.)
+ //
+ // Handle methods that produce output should observe the following rules:
+ // - If r.Time is the zero time, ignore the time.
+ // - If r.PC is zero, ignore it.
+ // - Attr's values should be resolved.
+ // - If an Attr's key and value are both the zero value, ignore the Attr.
+ // This can be tested with attr.Equal(Attr{}).
+ // - If a group's key is empty, inline the group's Attrs.
+ // - If a group has no Attrs (even if it has a non-empty key),
+ // ignore it.
+ Handle(context.Context, Record) error
+
+ // WithAttrs returns a new Handler whose attributes consist of
+ // both the receiver's attributes and the arguments.
+ // The Handler owns the slice: it may retain, modify or discard it.
+ WithAttrs(attrs []Attr) Handler
+
+ // WithGroup returns a new Handler with the given group appended to
+ // the receiver's existing groups.
+ // The keys of all subsequent attributes, whether added by With or in a
+ // Record, should be qualified by the sequence of group names.
+ //
+ // How this qualification happens is up to the Handler, so long as
+ // this Handler's attribute keys differ from those of another Handler
+ // with a different sequence of group names.
+ //
+ // A Handler should treat WithGroup as starting a Group of Attrs that ends
+ // at the end of the log event. That is,
+ //
+ // logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2))
+ //
+ // should behave like
+ //
+ // logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2)))
+ //
+ // If the name is empty, WithGroup returns the receiver.
+ WithGroup(name string) Handler
+}</pre> <h4 id="example_Handler_levelHandler"> <span class="text">Example (LevelHandler)</span>
+</h4> <p>This example shows how to Use a LevelHandler to change the level of an existing Handler while preserving its other behavior. This example demonstrates increasing the log level to reduce a logger's output. Another typical use would be to decrease the log level (to LevelDebug, say) during a part of the program that was suspected of containing a bug. </p> <p>Code:</p> <pre class="code" data-language="go">package slog_test
+
+import (
+ "context"
+ "log/slog"
+ "log/slog/internal/slogtest"
+ "os"
+)
+
+// A LevelHandler wraps a Handler with an Enabled method
+// that returns false for levels below a minimum.
+type LevelHandler struct {
+ level slog.Leveler
+ handler slog.Handler
+}
+
+// NewLevelHandler returns a LevelHandler with the given level.
+// All methods except Enabled delegate to h.
+func NewLevelHandler(level slog.Leveler, h slog.Handler) *LevelHandler {
+ // Optimization: avoid chains of LevelHandlers.
+ if lh, ok := h.(*LevelHandler); ok {
+ h = lh.Handler()
+ }
+ return &amp;LevelHandler{level, h}
+}
+
+// Enabled implements Handler.Enabled by reporting whether
+// level is at least as large as h's level.
+func (h *LevelHandler) Enabled(_ context.Context, level slog.Level) bool {
+ return level &gt;= h.level.Level()
+}
+
+// Handle implements Handler.Handle.
+func (h *LevelHandler) Handle(ctx context.Context, r slog.Record) error {
+ return h.handler.Handle(ctx, r)
+}
+
+// WithAttrs implements Handler.WithAttrs.
+func (h *LevelHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
+ return NewLevelHandler(h.level, h.handler.WithAttrs(attrs))
+}
+
+// WithGroup implements Handler.WithGroup.
+func (h *LevelHandler) WithGroup(name string) slog.Handler {
+ return NewLevelHandler(h.level, h.handler.WithGroup(name))
+}
+
+// Handler returns the Handler wrapped by h.
+func (h *LevelHandler) Handler() slog.Handler {
+ return h.handler
+}
+
+// This example shows how to Use a LevelHandler to change the level of an
+// existing Handler while preserving its other behavior.
+//
+// This example demonstrates increasing the log level to reduce a logger's
+// output.
+//
+// Another typical use would be to decrease the log level (to LevelDebug, say)
+// during a part of the program that was suspected of containing a bug.
+func ExampleHandler_levelHandler() {
+ th := slog.NewTextHandler(os.Stdout, &amp;slog.HandlerOptions{ReplaceAttr: slogtest.RemoveTime})
+ logger := slog.New(NewLevelHandler(slog.LevelWarn, th))
+ logger.Info("not printed")
+ logger.Warn("printed")
+
+ // Output:
+ // level=WARN msg=printed
+}
+</pre> <h2 id="HandlerOptions">type <span>HandlerOptions</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>HandlerOptions are options for a <a href="#TextHandler">TextHandler</a> or <a href="#JSONHandler">JSONHandler</a>. A zero HandlerOptions consists entirely of default values. </p>
+<pre data-language="go">type HandlerOptions struct {
+ // AddSource causes the handler to compute the source code position
+ // of the log statement and add a SourceKey attribute to the output.
+ AddSource bool
+
+ // Level reports the minimum record level that will be logged.
+ // The handler discards records with lower levels.
+ // If Level is nil, the handler assumes LevelInfo.
+ // The handler calls Level.Level for each record processed;
+ // to adjust the minimum level dynamically, use a LevelVar.
+ Level Leveler
+
+ // ReplaceAttr is called to rewrite each non-group attribute before it is logged.
+ // The attribute's value has been resolved (see [Value.Resolve]).
+ // If ReplaceAttr returns a zero Attr, the attribute is discarded.
+ //
+ // The built-in attributes with keys "time", "level", "source", and "msg"
+ // are passed to this function, except that time is omitted
+ // if zero, and source is omitted if AddSource is false.
+ //
+ // The first argument is a list of currently open groups that contain the
+ // Attr. It must not be retained or modified. ReplaceAttr is never called
+ // for Group attributes, only their contents. For example, the attribute
+ // list
+ //
+ // Int("a", 1), Group("g", Int("b", 2)), Int("c", 3)
+ //
+ // results in consecutive calls to ReplaceAttr with the following arguments:
+ //
+ // nil, Int("a", 1)
+ // []string{"g"}, Int("b", 2)
+ // nil, Int("c", 3)
+ //
+ // ReplaceAttr can be used to change the default keys of the built-in
+ // attributes, convert types (for example, to replace a `time.Time` with the
+ // integer seconds since the Unix epoch), sanitize personal information, or
+ // remove attributes from the output.
+ ReplaceAttr func(groups []string, a Attr) Attr
+}
+</pre> <h4 id="example_HandlerOptions_customLevels"> <span class="text">Example (CustomLevels)</span>
+</h4> <p>This example demonstrates using custom log levels and custom log level names. In addition to the default log levels, it introduces Trace, Notice, and Emergency levels. The ReplaceAttr changes the way levels are printed for both the standard log levels and the custom log levels. </p> <p>Code:</p> <pre class="code" data-language="go">// Exported constants from a custom logging package.
+const (
+ LevelTrace = slog.Level(-8)
+ LevelDebug = slog.LevelDebug
+ LevelInfo = slog.LevelInfo
+ LevelNotice = slog.Level(2)
+ LevelWarning = slog.LevelWarn
+ LevelError = slog.LevelError
+ LevelEmergency = slog.Level(12)
+)
+
+th := slog.NewTextHandler(os.Stdout, &amp;slog.HandlerOptions{
+ // Set a custom level to show all log output. The default value is
+ // LevelInfo, which would drop Debug and Trace logs.
+ Level: LevelTrace,
+
+ ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
+ // Remove time from the output for predictable test output.
+ if a.Key == slog.TimeKey {
+ return slog.Attr{}
+ }
+
+ // Customize the name of the level key and the output string, including
+ // custom level values.
+ if a.Key == slog.LevelKey {
+ // Rename the level key from "level" to "sev".
+ a.Key = "sev"
+
+ // Handle custom level values.
+ level := a.Value.Any().(slog.Level)
+
+ // This could also look up the name from a map or other structure, but
+ // this demonstrates using a switch statement to rename levels. For
+ // maximum performance, the string values should be constants, but this
+ // example uses the raw strings for readability.
+ switch {
+ case level &lt; LevelDebug:
+ a.Value = slog.StringValue("TRACE")
+ case level &lt; LevelInfo:
+ a.Value = slog.StringValue("DEBUG")
+ case level &lt; LevelNotice:
+ a.Value = slog.StringValue("INFO")
+ case level &lt; LevelWarning:
+ a.Value = slog.StringValue("NOTICE")
+ case level &lt; LevelError:
+ a.Value = slog.StringValue("WARNING")
+ case level &lt; LevelEmergency:
+ a.Value = slog.StringValue("ERROR")
+ default:
+ a.Value = slog.StringValue("EMERGENCY")
+ }
+ }
+
+ return a
+ },
+})
+
+logger := slog.New(th)
+ctx := context.Background()
+logger.Log(ctx, LevelEmergency, "missing pilots")
+logger.Error("failed to start engines", "err", "missing fuel")
+logger.Warn("falling back to default value")
+logger.Log(ctx, LevelNotice, "all systems are running")
+logger.Info("initiating launch")
+logger.Debug("starting background job")
+logger.Log(ctx, LevelTrace, "button clicked")
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">sev=EMERGENCY msg="missing pilots"
+sev=ERROR msg="failed to start engines" err="missing fuel"
+sev=WARNING msg="falling back to default value"
+sev=NOTICE msg="all systems are running"
+sev=INFO msg="initiating launch"
+sev=DEBUG msg="starting background job"
+sev=TRACE msg="button clicked"
+</pre> <h2 id="JSONHandler">type <span>JSONHandler</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>JSONHandler is a <a href="#Handler">Handler</a> that writes Records to an <span>io.Writer</span> as line-delimited JSON objects. </p>
+<pre data-language="go">type JSONHandler struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewJSONHandler">func <span>NewJSONHandler</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func NewJSONHandler(w io.Writer, opts *HandlerOptions) *JSONHandler</pre> <p>NewJSONHandler creates a <a href="#JSONHandler">JSONHandler</a> that writes to w, using the given options. If opts is nil, the default options are used. </p>
+<h3 id="JSONHandler.Enabled">func (*JSONHandler) <span>Enabled</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (h *JSONHandler) Enabled(_ context.Context, level Level) bool</pre> <p>Enabled reports whether the handler handles records at the given level. The handler ignores records whose level is lower. </p>
+<h3 id="JSONHandler.Handle">func (*JSONHandler) <span>Handle</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (h *JSONHandler) Handle(_ context.Context, r Record) error</pre> <p>Handle formats its argument <a href="#Record">Record</a> as a JSON object on a single line. </p>
+<p>If the Record's time is zero, the time is omitted. Otherwise, the key is "time" and the value is output as with json.Marshal. </p>
+<p>If the Record's level is zero, the level is omitted. Otherwise, the key is "level" and the value of <a href="#Level.String">Level.String</a> is output. </p>
+<p>If the AddSource option is set and source information is available, the key is "source", and the value is a record of type <a href="#Source">Source</a>. </p>
+<p>The message's key is "msg". </p>
+<p>To modify these or other attributes, or remove them from the output, use [HandlerOptions.ReplaceAttr]. </p>
+<p>Values are formatted as with an <span>encoding/json.Encoder</span> with SetEscapeHTML(false), with two exceptions. </p>
+<p>First, an Attr whose Value is of type error is formatted as a string, by calling its Error method. Only errors in Attrs receive this special treatment, not errors embedded in structs, slices, maps or other data structures that are processed by the <span>encoding/json</span> package. </p>
+<p>Second, an encoding failure does not cause Handle to return an error. Instead, the error message is formatted as a string. </p>
+<p>Each call to Handle results in a single serialized call to io.Writer.Write. </p>
+<h3 id="JSONHandler.WithAttrs">func (*JSONHandler) <span>WithAttrs</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (h *JSONHandler) WithAttrs(attrs []Attr) Handler</pre> <p>WithAttrs returns a new <a href="#JSONHandler">JSONHandler</a> whose attributes consists of h's attributes followed by attrs. </p>
+<h3 id="JSONHandler.WithGroup">func (*JSONHandler) <span>WithGroup</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (h *JSONHandler) WithGroup(name string) Handler</pre> <h2 id="Kind">type <span>Kind</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>Kind is the kind of a <a href="#Value">Value</a>. </p>
+<pre data-language="go">type Kind int</pre> <pre data-language="go">const (
+ KindAny Kind = iota
+ KindBool
+ KindDuration
+ KindFloat64
+ KindInt64
+ KindString
+ KindTime
+ KindUint64
+ KindGroup
+ KindLogValuer
+)</pre> <h3 id="Kind.String">func (Kind) <span>String</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (k Kind) String() string</pre> <h2 id="Level">type <span>Level</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A Level is the importance or severity of a log event. The higher the level, the more important or severe the event. </p>
+<pre data-language="go">type Level int</pre> <p>Names for common levels. </p>
+<p>Level numbers are inherently arbitrary, but we picked them to satisfy three constraints. Any system can map them to another numbering scheme if it wishes. </p>
+<p>First, we wanted the default level to be Info, Since Levels are ints, Info is the default value for int, zero. </p>
+<p>Second, we wanted to make it easy to use levels to specify logger verbosity. Since a larger level means a more severe event, a logger that accepts events with smaller (or more negative) level means a more verbose logger. Logger verbosity is thus the negation of event severity, and the default verbosity of 0 accepts all events at least as severe as INFO. </p>
+<p>Third, we wanted some room between levels to accommodate schemes with named levels between ours. For example, Google Cloud Logging defines a Notice level between Info and Warn. Since there are only a few of these intermediate levels, the gap between the numbers need not be large. Our gap of 4 matches OpenTelemetry's mapping. Subtracting 9 from an OpenTelemetry level in the DEBUG, INFO, WARN and ERROR ranges converts it to the corresponding slog Level range. OpenTelemetry also has the names TRACE and FATAL, which slog does not. But those OpenTelemetry levels can still be represented as slog Levels by using the appropriate integers. </p>
+<pre data-language="go">const (
+ LevelDebug Level = -4
+ LevelInfo Level = 0
+ LevelWarn Level = 4
+ LevelError Level = 8
+)</pre> <h3 id="SetLogLoggerLevel">func <span>SetLogLoggerLevel</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func SetLogLoggerLevel(level Level) (oldLevel Level)</pre> <p>SetLogLoggerLevel controls the level for the bridge to the <span>log</span> package. </p>
+<p>Before <a href="#SetDefault">SetDefault</a> is called, slog top-level logging functions call the default <span>log.Logger</span>. In that mode, SetLogLoggerLevel sets the minimum level for those calls. By default, the minimum level is Info, so calls to <a href="#Debug">Debug</a> (as well as top-level logging calls at lower levels) will not be passed to the log.Logger. After calling </p>
+<pre data-language="go">slog.SetLogLoggerLevel(slog.LevelDebug)
+</pre> <p>calls to <a href="#Debug">Debug</a> will be passed to the log.Logger. </p>
+<p>After <a href="#SetDefault">SetDefault</a> is called, calls to the default <span>log.Logger</span> are passed to the slog default handler. In that mode, SetLogLoggerLevel sets the level at which those calls are logged. That is, after calling </p>
+<pre data-language="go">slog.SetLogLoggerLevel(slog.LevelDebug)
+</pre> <p>A call to <span>log.Printf</span> will result in output at level <a href="#LevelDebug">LevelDebug</a>. </p>
+<p>SetLogLoggerLevel returns the previous value. </p> <h4 id="example_SetLogLoggerLevel_log"> <span class="text">Example (Log)</span>
+</h4> <p>This example shows how to use slog.SetLogLoggerLevel to change the minimal level of the internal default handler for slog package before calling slog.SetDefault. </p> <p>Code:</p> <pre class="code" data-language="go">defer log.SetFlags(log.Flags()) // revert changes after the example
+log.SetFlags(0)
+defer log.SetOutput(log.Writer()) // revert changes after the example
+log.SetOutput(os.Stdout)
+
+// Default logging level is slog.LevelInfo.
+log.Print("log debug") // log debug
+slog.Debug("debug") // no output
+slog.Info("info") // INFO info
+
+// Set the default logging level to slog.LevelDebug.
+currentLogLevel := slog.SetLogLoggerLevel(slog.LevelDebug)
+defer slog.SetLogLoggerLevel(currentLogLevel) // revert changes after the example
+
+log.Print("log debug") // log debug
+slog.Debug("debug") // DEBUG debug
+slog.Info("info") // INFO info
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">log debug
+INFO info
+log debug
+DEBUG debug
+INFO info
+</pre> <h4 id="example_SetLogLoggerLevel_slog"> <span class="text">Example (Slog)</span>
+</h4> <p>This example shows how to use slog.SetLogLoggerLevel to change the minimal level of the internal writer that uses the custom handler for log package after calling slog.SetDefault. </p> <p>Code:</p> <pre class="code" data-language="go">// Set the default logging level to slog.LevelError.
+currentLogLevel := slog.SetLogLoggerLevel(slog.LevelError)
+defer slog.SetLogLoggerLevel(currentLogLevel) // revert changes after the example
+
+defer slog.SetDefault(slog.Default()) // revert changes after the example
+slog.SetDefault(slog.New(slog.NewTextHandler(os.Stdout, &amp;slog.HandlerOptions{ReplaceAttr: slogtest.RemoveTime})))
+
+log.Print("error") // level=ERROR msg=error
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">level=ERROR msg=error
+</pre> <h3 id="Level.Level">func (Level) <span>Level</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l Level) Level() Level</pre> <p>Level returns the receiver. It implements <a href="#Leveler">Leveler</a>. </p>
+<h3 id="Level.MarshalJSON">func (Level) <span>MarshalJSON</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l Level) MarshalJSON() ([]byte, error)</pre> <p>MarshalJSON implements <span>encoding/json.Marshaler</span> by quoting the output of <a href="#Level.String">Level.String</a>. </p>
+<h3 id="Level.MarshalText">func (Level) <span>MarshalText</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l Level) MarshalText() ([]byte, error)</pre> <p>MarshalText implements <span>encoding.TextMarshaler</span> by calling <a href="#Level.String">Level.String</a>. </p>
+<h3 id="Level.String">func (Level) <span>String</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l Level) String() string</pre> <p>String returns a name for the level. If the level has a name, then that name in uppercase is returned. If the level is between named values, then an integer is appended to the uppercased name. Examples: </p>
+<pre data-language="go">LevelWarn.String() =&gt; "WARN"
+(LevelInfo+2).String() =&gt; "INFO+2"
+</pre> <h3 id="Level.UnmarshalJSON">func (*Level) <span>UnmarshalJSON</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Level) UnmarshalJSON(data []byte) error</pre> <p>UnmarshalJSON implements <span>encoding/json.Unmarshaler</span> It accepts any string produced by <a href="#Level.MarshalJSON">Level.MarshalJSON</a>, ignoring case. It also accepts numeric offsets that would result in a different string on output. For example, "Error-8" would marshal as "INFO". </p>
+<h3 id="Level.UnmarshalText">func (*Level) <span>UnmarshalText</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Level) UnmarshalText(data []byte) error</pre> <p>UnmarshalText implements <span>encoding.TextUnmarshaler</span>. It accepts any string produced by <a href="#Level.MarshalText">Level.MarshalText</a>, ignoring case. It also accepts numeric offsets that would result in a different string on output. For example, "Error-8" would marshal as "INFO". </p>
+<h2 id="LevelVar">type <span>LevelVar</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A LevelVar is a <a href="#Level">Level</a> variable, to allow a <a href="#Handler">Handler</a> level to change dynamically. It implements <a href="#Leveler">Leveler</a> as well as a Set method, and it is safe for use by multiple goroutines. The zero LevelVar corresponds to <a href="#LevelInfo">LevelInfo</a>. </p>
+<pre data-language="go">type LevelVar struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="LevelVar.Level">func (*LevelVar) <span>Level</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v *LevelVar) Level() Level</pre> <p>Level returns v's level. </p>
+<h3 id="LevelVar.MarshalText">func (*LevelVar) <span>MarshalText</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v *LevelVar) MarshalText() ([]byte, error)</pre> <p>MarshalText implements <span>encoding.TextMarshaler</span> by calling <a href="#Level.MarshalText">Level.MarshalText</a>. </p>
+<h3 id="LevelVar.Set">func (*LevelVar) <span>Set</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v *LevelVar) Set(l Level)</pre> <p>Set sets v's level to l. </p>
+<h3 id="LevelVar.String">func (*LevelVar) <span>String</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v *LevelVar) String() string</pre> <h3 id="LevelVar.UnmarshalText">func (*LevelVar) <span>UnmarshalText</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v *LevelVar) UnmarshalText(data []byte) error</pre> <p>UnmarshalText implements <span>encoding.TextUnmarshaler</span> by calling <a href="#Level.UnmarshalText">Level.UnmarshalText</a>. </p>
+<h2 id="Leveler">type <span>Leveler</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A Leveler provides a <a href="#Level">Level</a> value. </p>
+<p>As Level itself implements Leveler, clients typically supply a Level value wherever a Leveler is needed, such as in <a href="#HandlerOptions">HandlerOptions</a>. Clients who need to vary the level dynamically can provide a more complex Leveler implementation such as *<a href="#LevelVar">LevelVar</a>. </p>
+<pre data-language="go">type Leveler interface {
+ Level() Level
+}</pre> <h2 id="LogValuer">type <span>LogValuer</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A LogValuer is any Go value that can convert itself into a Value for logging. </p>
+<p>This mechanism may be used to defer expensive operations until they are needed, or to expand a single value into a sequence of components. </p>
+<pre data-language="go">type LogValuer interface {
+ LogValue() Value
+}</pre> <h4 id="example_LogValuer_group"> <span class="text">Example (Group)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package slog_test
+
+import "log/slog"
+
+type Name struct {
+ First, Last string
+}
+
+// LogValue implements slog.LogValuer.
+// It returns a group containing the fields of
+// the Name, so that they appear together in the log output.
+func (n Name) LogValue() slog.Value {
+ return slog.GroupValue(
+ slog.String("first", n.First),
+ slog.String("last", n.Last))
+}
+
+func ExampleLogValuer_group() {
+ n := Name{"Perry", "Platypus"}
+ slog.Info("mission accomplished", "agent", n)
+
+ // JSON Output would look in part like:
+ // {
+ // ...
+ // "msg": "mission accomplished",
+ // "agent": {
+ // "first": "Perry",
+ // "last": "Platypus"
+ // }
+ // }
+}
+</pre> <h4 id="example_LogValuer_secret"> <span class="text">Example (Secret)</span>
+</h4> <p>This example demonstrates a Value that replaces itself with an alternative representation to avoid revealing secrets. </p> <p>Code:</p> <pre class="code" data-language="go">package slog_test
+
+import (
+ "log/slog"
+ "log/slog/internal/slogtest"
+ "os"
+)
+
+// A token is a secret value that grants permissions.
+type Token string
+
+// LogValue implements slog.LogValuer.
+// It avoids revealing the token.
+func (Token) LogValue() slog.Value {
+ return slog.StringValue("REDACTED_TOKEN")
+}
+
+// This example demonstrates a Value that replaces itself
+// with an alternative representation to avoid revealing secrets.
+func ExampleLogValuer_secret() {
+ t := Token("shhhh!")
+ logger := slog.New(slog.NewTextHandler(os.Stdout, &amp;slog.HandlerOptions{ReplaceAttr: slogtest.RemoveTime}))
+ logger.Info("permission granted", "user", "Perry", "token", t)
+
+ // Output:
+ // level=INFO msg="permission granted" user=Perry token=REDACTED_TOKEN
+}
+</pre> <h2 id="Logger">type <span>Logger</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A Logger records structured information about each call to its Log, Debug, Info, Warn, and Error methods. For each call, it creates a <a href="#Record">Record</a> and passes it to a <a href="#Handler">Handler</a>. </p>
+<p>To create a new Logger, call <a href="#New">New</a> or a Logger method that begins "With". </p>
+<pre data-language="go">type Logger struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Default">func <span>Default</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Default() *Logger</pre> <p>Default returns the default <a href="#Logger">Logger</a>. </p>
+<h3 id="New">func <span>New</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func New(h Handler) *Logger</pre> <p>New creates a new Logger with the given non-nil Handler. </p>
+<h3 id="With">func <span>With</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func With(args ...any) *Logger</pre> <p>With calls <a href="#Logger.With">Logger.With</a> on the default logger. </p>
+<h3 id="Logger.Debug">func (*Logger) <span>Debug</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) Debug(msg string, args ...any)</pre> <p>Debug logs at <a href="#LevelDebug">LevelDebug</a>. </p>
+<h3 id="Logger.DebugContext">func (*Logger) <span>DebugContext</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) DebugContext(ctx context.Context, msg string, args ...any)</pre> <p>DebugContext logs at <a href="#LevelDebug">LevelDebug</a> with the given context. </p>
+<h3 id="Logger.Enabled">func (*Logger) <span>Enabled</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) Enabled(ctx context.Context, level Level) bool</pre> <p>Enabled reports whether l emits log records at the given context and level. </p>
+<h3 id="Logger.Error">func (*Logger) <span>Error</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) Error(msg string, args ...any)</pre> <p>Error logs at <a href="#LevelError">LevelError</a>. </p>
+<h3 id="Logger.ErrorContext">func (*Logger) <span>ErrorContext</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) ErrorContext(ctx context.Context, msg string, args ...any)</pre> <p>ErrorContext logs at <a href="#LevelError">LevelError</a> with the given context. </p>
+<h3 id="Logger.Handler">func (*Logger) <span>Handler</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) Handler() Handler</pre> <p>Handler returns l's Handler. </p>
+<h3 id="Logger.Info">func (*Logger) <span>Info</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) Info(msg string, args ...any)</pre> <p>Info logs at <a href="#LevelInfo">LevelInfo</a>. </p>
+<h3 id="Logger.InfoContext">func (*Logger) <span>InfoContext</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) InfoContext(ctx context.Context, msg string, args ...any)</pre> <p>InfoContext logs at <a href="#LevelInfo">LevelInfo</a> with the given context. </p>
+<h3 id="Logger.Log">func (*Logger) <span>Log</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) Log(ctx context.Context, level Level, msg string, args ...any)</pre> <p>Log emits a log record with the current time and the given level and message. The Record's Attrs consist of the Logger's attributes followed by the Attrs specified by args. </p>
+<p>The attribute arguments are processed as follows: </p>
+<ul> <li>If an argument is an Attr, it is used as is. </li>
+<li>If an argument is a string and this is not the last argument, the following argument is treated as the value and the two are combined into an Attr. </li>
+<li>Otherwise, the argument is treated as a value with key "!BADKEY". </li>
+</ul> <h3 id="Logger.LogAttrs">func (*Logger) <span>LogAttrs</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) LogAttrs(ctx context.Context, level Level, msg string, attrs ...Attr)</pre> <p>LogAttrs is a more efficient version of <a href="#Logger.Log">Logger.Log</a> that accepts only Attrs. </p>
+<h3 id="Logger.Warn">func (*Logger) <span>Warn</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) Warn(msg string, args ...any)</pre> <p>Warn logs at <a href="#LevelWarn">LevelWarn</a>. </p>
+<h3 id="Logger.WarnContext">func (*Logger) <span>WarnContext</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) WarnContext(ctx context.Context, msg string, args ...any)</pre> <p>WarnContext logs at <a href="#LevelWarn">LevelWarn</a> with the given context. </p>
+<h3 id="Logger.With">func (*Logger) <span>With</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) With(args ...any) *Logger</pre> <p>With returns a Logger that includes the given attributes in each output operation. Arguments are converted to attributes as if by <a href="#Logger.Log">Logger.Log</a>. </p>
+<h3 id="Logger.WithGroup">func (*Logger) <span>WithGroup</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (l *Logger) WithGroup(name string) *Logger</pre> <p>WithGroup returns a Logger that starts a group, if name is non-empty. The keys of all attributes added to the Logger will be qualified by the given name. (How that qualification happens depends on the [Handler.WithGroup] method of the Logger's Handler.) </p>
+<p>If name is empty, WithGroup returns the receiver. </p>
+<h2 id="Record">type <span>Record</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A Record holds information about a log event. Copies of a Record share state. Do not modify a Record after handing out a copy to it. Call <a href="#NewRecord">NewRecord</a> to create a new Record. Use <a href="#Record.Clone">Record.Clone</a> to create a copy with no shared state. </p>
+<pre data-language="go">type Record struct {
+ // The time at which the output method (Log, Info, etc.) was called.
+ Time time.Time
+
+ // The log message.
+ Message string
+
+ // The level of the event.
+ Level Level
+
+ // The program counter at the time the record was constructed, as determined
+ // by runtime.Callers. If zero, no program counter is available.
+ //
+ // The only valid use for this value is as an argument to
+ // [runtime.CallersFrames]. In particular, it must not be passed to
+ // [runtime.FuncForPC].
+ PC uintptr
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewRecord">func <span>NewRecord</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func NewRecord(t time.Time, level Level, msg string, pc uintptr) Record</pre> <p>NewRecord creates a <a href="#Record">Record</a> from the given arguments. Use <a href="#Record.AddAttrs">Record.AddAttrs</a> to add attributes to the Record. </p>
+<p>NewRecord is intended for logging APIs that want to support a <a href="#Handler">Handler</a> as a backend. </p>
+<h3 id="Record.Add">func (*Record) <span>Add</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (r *Record) Add(args ...any)</pre> <p>Add converts the args to Attrs as described in <a href="#Logger.Log">Logger.Log</a>, then appends the Attrs to the <a href="#Record">Record</a>'s list of Attrs. It omits empty groups. </p>
+<h3 id="Record.AddAttrs">func (*Record) <span>AddAttrs</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (r *Record) AddAttrs(attrs ...Attr)</pre> <p>AddAttrs appends the given Attrs to the <a href="#Record">Record</a>'s list of Attrs. It omits empty groups. </p>
+<h3 id="Record.Attrs">func (Record) <span>Attrs</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (r Record) Attrs(f func(Attr) bool)</pre> <p>Attrs calls f on each Attr in the <a href="#Record">Record</a>. Iteration stops if f returns false. </p>
+<h3 id="Record.Clone">func (Record) <span>Clone</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (r Record) Clone() Record</pre> <p>Clone returns a copy of the record with no shared state. The original record and the clone can both be modified without interfering with each other. </p>
+<h3 id="Record.NumAttrs">func (Record) <span>NumAttrs</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (r Record) NumAttrs() int</pre> <p>NumAttrs returns the number of attributes in the <a href="#Record">Record</a>. </p>
+<h2 id="Source">type <span>Source</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>Source describes the location of a line of source code. </p>
+<pre data-language="go">type Source struct {
+ // Function is the package path-qualified function name containing the
+ // source line. If non-empty, this string uniquely identifies a single
+ // function in the program. This may be the empty string if not known.
+ Function string `json:"function"`
+ // File and Line are the file name and line number (1-based) of the source
+ // line. These may be the empty string and zero, respectively, if not known.
+ File string `json:"file"`
+ Line int `json:"line"`
+}
+</pre> <h2 id="TextHandler">type <span>TextHandler</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>TextHandler is a <a href="#Handler">Handler</a> that writes Records to an <span>io.Writer</span> as a sequence of key=value pairs separated by spaces and followed by a newline. </p>
+<pre data-language="go">type TextHandler struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewTextHandler">func <span>NewTextHandler</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func NewTextHandler(w io.Writer, opts *HandlerOptions) *TextHandler</pre> <p>NewTextHandler creates a <a href="#TextHandler">TextHandler</a> that writes to w, using the given options. If opts is nil, the default options are used. </p>
+<h3 id="TextHandler.Enabled">func (*TextHandler) <span>Enabled</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (h *TextHandler) Enabled(_ context.Context, level Level) bool</pre> <p>Enabled reports whether the handler handles records at the given level. The handler ignores records whose level is lower. </p>
+<h3 id="TextHandler.Handle">func (*TextHandler) <span>Handle</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (h *TextHandler) Handle(_ context.Context, r Record) error</pre> <p>Handle formats its argument <a href="#Record">Record</a> as a single line of space-separated key=value items. </p>
+<p>If the Record's time is zero, the time is omitted. Otherwise, the key is "time" and the value is output in RFC3339 format with millisecond precision. </p>
+<p>If the Record's level is zero, the level is omitted. Otherwise, the key is "level" and the value of <a href="#Level.String">Level.String</a> is output. </p>
+<p>If the AddSource option is set and source information is available, the key is "source" and the value is output as FILE:LINE. </p>
+<p>The message's key is "msg". </p>
+<p>To modify these or other attributes, or remove them from the output, use [HandlerOptions.ReplaceAttr]. </p>
+<p>If a value implements <span>encoding.TextMarshaler</span>, the result of MarshalText is written. Otherwise, the result of <span>fmt.Sprint</span> is written. </p>
+<p>Keys and values are quoted with <span>strconv.Quote</span> if they contain Unicode space characters, non-printing characters, '"' or '='. </p>
+<p>Keys inside groups consist of components (keys or group names) separated by dots. No further escaping is performed. Thus there is no way to determine from the key "a.b.c" whether there are two groups "a" and "b" and a key "c", or a single group "a.b" and a key "c", or single group "a" and a key "b.c". If it is necessary to reconstruct the group structure of a key even in the presence of dots inside components, use [HandlerOptions.ReplaceAttr] to encode that information in the key. </p>
+<p>Each call to Handle results in a single serialized call to io.Writer.Write. </p>
+<h3 id="TextHandler.WithAttrs">func (*TextHandler) <span>WithAttrs</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (h *TextHandler) WithAttrs(attrs []Attr) Handler</pre> <p>WithAttrs returns a new <a href="#TextHandler">TextHandler</a> whose attributes consists of h's attributes followed by attrs. </p>
+<h3 id="TextHandler.WithGroup">func (*TextHandler) <span>WithGroup</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (h *TextHandler) WithGroup(name string) Handler</pre> <h2 id="Value">type <span>Value</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A Value can represent any Go value, but unlike type any, it can represent most small values without an allocation. The zero Value corresponds to nil. </p>
+<pre data-language="go">type Value struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="AnyValue">func <span>AnyValue</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func AnyValue(v any) Value</pre> <p>AnyValue returns a <a href="#Value">Value</a> for the supplied value. </p>
+<p>If the supplied value is of type Value, it is returned unmodified. </p>
+<p>Given a value of one of Go's predeclared string, bool, or (non-complex) numeric types, AnyValue returns a Value of kind <a href="#KindString">KindString</a>, <a href="#KindBool">KindBool</a>, <a href="#KindUint64">KindUint64</a>, <a href="#KindInt64">KindInt64</a>, or <a href="#KindFloat64">KindFloat64</a>. The width of the original numeric type is not preserved. </p>
+<p>Given a <span>time.Time</span> or <span>time.Duration</span> value, AnyValue returns a Value of kind <a href="#KindTime">KindTime</a> or <a href="#KindDuration">KindDuration</a>. The monotonic time is not preserved. </p>
+<p>For nil, or values of all other types, including named types whose underlying type is numeric, AnyValue returns a value of kind <a href="#KindAny">KindAny</a>. </p>
+<h3 id="BoolValue">func <span>BoolValue</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func BoolValue(v bool) Value</pre> <p>BoolValue returns a <a href="#Value">Value</a> for a bool. </p>
+<h3 id="DurationValue">func <span>DurationValue</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func DurationValue(v time.Duration) Value</pre> <p>DurationValue returns a <a href="#Value">Value</a> for a <span>time.Duration</span>. </p>
+<h3 id="Float64Value">func <span>Float64Value</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Float64Value(v float64) Value</pre> <p>Float64Value returns a <a href="#Value">Value</a> for a floating-point number. </p>
+<h3 id="GroupValue">func <span>GroupValue</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func GroupValue(as ...Attr) Value</pre> <p>GroupValue returns a new <a href="#Value">Value</a> for a list of Attrs. The caller must not subsequently mutate the argument slice. </p>
+<h3 id="Int64Value">func <span>Int64Value</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Int64Value(v int64) Value</pre> <p>Int64Value returns a <a href="#Value">Value</a> for an int64. </p>
+<h3 id="IntValue">func <span>IntValue</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func IntValue(v int) Value</pre> <p>IntValue returns a <a href="#Value">Value</a> for an int. </p>
+<h3 id="StringValue">func <span>StringValue</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func StringValue(value string) Value</pre> <p>StringValue returns a new <a href="#Value">Value</a> for a string. </p>
+<h3 id="TimeValue">func <span>TimeValue</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func TimeValue(v time.Time) Value</pre> <p>TimeValue returns a <a href="#Value">Value</a> for a <span>time.Time</span>. It discards the monotonic portion. </p>
+<h3 id="Uint64Value">func <span>Uint64Value</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func Uint64Value(v uint64) Value</pre> <p>Uint64Value returns a <a href="#Value">Value</a> for a uint64. </p>
+<h3 id="Value.Any">func (Value) <span>Any</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Any() any</pre> <p>Any returns v's value as an any. </p>
+<h3 id="Value.Bool">func (Value) <span>Bool</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Bool() bool</pre> <p>Bool returns v's value as a bool. It panics if v is not a bool. </p>
+<h3 id="Value.Duration">func (Value) <span>Duration</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Duration() time.Duration</pre> <p>Duration returns v's value as a <span>time.Duration</span>. It panics if v is not a time.Duration. </p>
+<h3 id="Value.Equal">func (Value) <span>Equal</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Equal(w Value) bool</pre> <p>Equal reports whether v and w represent the same Go value. </p>
+<h3 id="Value.Float64">func (Value) <span>Float64</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Float64() float64</pre> <p>Float64 returns v's value as a float64. It panics if v is not a float64. </p>
+<h3 id="Value.Group">func (Value) <span>Group</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Group() []Attr</pre> <p>Group returns v's value as a []Attr. It panics if v's <a href="#Kind">Kind</a> is not <a href="#KindGroup">KindGroup</a>. </p>
+<h3 id="Value.Int64">func (Value) <span>Int64</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Int64() int64</pre> <p>Int64 returns v's value as an int64. It panics if v is not a signed integer. </p>
+<h3 id="Value.Kind">func (Value) <span>Kind</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Kind() Kind</pre> <p>Kind returns v's Kind. </p>
+<h3 id="Value.LogValuer">func (Value) <span>LogValuer</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) LogValuer() LogValuer</pre> <p>LogValuer returns v's value as a LogValuer. It panics if v is not a LogValuer. </p>
+<h3 id="Value.Resolve">func (Value) <span>Resolve</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Resolve() (rv Value)</pre> <p>Resolve repeatedly calls LogValue on v while it implements <a href="#LogValuer">LogValuer</a>, and returns the result. If v resolves to a group, the group's attributes' values are not recursively resolved. If the number of LogValue calls exceeds a threshold, a Value containing an error is returned. Resolve's return value is guaranteed not to be of Kind <a href="#KindLogValuer">KindLogValuer</a>. </p>
+<h3 id="Value.String">func (Value) <span>String</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) String() string</pre> <p>String returns Value's value as a string, formatted like <span>fmt.Sprint</span>. Unlike the methods Int64, Float64, and so on, which panic if v is of the wrong kind, String never panics. </p>
+<h3 id="Value.Time">func (Value) <span>Time</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Time() time.Time</pre> <p>Time returns v's value as a <span>time.Time</span>. It panics if v is not a time.Time. </p>
+<h3 id="Value.Uint64">func (Value) <span>Uint64</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Uint64() uint64</pre> <p>Uint64 returns v's value as a uint64. It panics if v is not an unsigned integer. </p>
+<h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/log/slog/" class="_attribution-link">http://golang.org/pkg/log/slog/</a>
+ </p>
+</div>
diff --git a/devdocs/go/log%2Fsyslog%2Findex.html b/devdocs/go/log%2Fsyslog%2Findex.html
new file mode 100644
index 00000000..e33c270c
--- /dev/null
+++ b/devdocs/go/log%2Fsyslog%2Findex.html
@@ -0,0 +1,109 @@
+<h1> Package syslog </h1> <ul id="short-nav">
+<li><code>import "log/syslog"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package syslog provides a simple interface to the system log service. It can send messages to the syslog daemon using UNIX domain sockets, UDP or TCP. </p>
+<p>Only one call to Dial is necessary. On write failures, the syslog client will attempt to reconnect to the server and write again. </p>
+<p>The syslog package is frozen and is not accepting new features. Some external packages provide more functionality. See: </p>
+<pre data-language="go">https://godoc.org/?q=syslog
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#NewLogger">func NewLogger(p Priority, logFlag int) (*log.Logger, error)</a></li>
+<li><a href="#Priority">type Priority</a></li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#Dial">func Dial(network, raddr string, priority Priority, tag string) (*Writer, error)</a>
+</li>
+<li> <a href="#New">func New(priority Priority, tag string) (*Writer, error)</a>
+</li>
+<li> <a href="#Writer.Alert">func (w *Writer) Alert(m string) error</a>
+</li>
+<li> <a href="#Writer.Close">func (w *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.Crit">func (w *Writer) Crit(m string) error</a>
+</li>
+<li> <a href="#Writer.Debug">func (w *Writer) Debug(m string) error</a>
+</li>
+<li> <a href="#Writer.Emerg">func (w *Writer) Emerg(m string) error</a>
+</li>
+<li> <a href="#Writer.Err">func (w *Writer) Err(m string) error</a>
+</li>
+<li> <a href="#Writer.Info">func (w *Writer) Info(m string) error</a>
+</li>
+<li> <a href="#Writer.Notice">func (w *Writer) Notice(m string) error</a>
+</li>
+<li> <a href="#Writer.Warning">func (w *Writer) Warning(m string) error</a>
+</li>
+<li> <a href="#Writer.Write">func (w *Writer) Write(b []byte) (int, error)</a>
+</li>
+<li><a href="#pkg-note-BUG">Bugs</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Dial">Dial</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>doc.go</span> <span>syslog.go</span> <span>syslog_unix.go</span> </p> <h2 id="NewLogger">func <span>NewLogger</span> </h2> <pre data-language="go">func NewLogger(p Priority, logFlag int) (*log.Logger, error)</pre> <p>NewLogger creates a <span>log.Logger</span> whose output is written to the system log service with the specified priority, a combination of the syslog facility and severity. The logFlag argument is the flag set passed through to <span>log.New</span> to create the Logger. </p>
+<h2 id="Priority">type <span>Priority</span> </h2> <p>The Priority is a combination of the syslog facility and severity. For example, <a href="#LOG_ALERT">LOG_ALERT</a> | <a href="#LOG_FTP">LOG_FTP</a> sends an alert severity message from the FTP facility. The default severity is <a href="#LOG_EMERG">LOG_EMERG</a>; the default facility is <a href="#LOG_KERN">LOG_KERN</a>. </p>
+<pre data-language="go">type Priority int</pre> <pre data-language="go">const (
+
+ // From /usr/include/sys/syslog.h.
+ // These are the same on Linux, BSD, and OS X.
+ LOG_EMERG Priority = iota
+ LOG_ALERT
+ LOG_CRIT
+ LOG_ERR
+ LOG_WARNING
+ LOG_NOTICE
+ LOG_INFO
+ LOG_DEBUG
+)</pre> <pre data-language="go">const (
+
+ // From /usr/include/sys/syslog.h.
+ // These are the same up to LOG_FTP on Linux, BSD, and OS X.
+ LOG_KERN Priority = iota &lt;&lt; 3
+ LOG_USER
+ LOG_MAIL
+ LOG_DAEMON
+ LOG_AUTH
+ LOG_SYSLOG
+ LOG_LPR
+ LOG_NEWS
+ LOG_UUCP
+ LOG_CRON
+ LOG_AUTHPRIV
+ LOG_FTP
+
+ LOG_LOCAL0
+ LOG_LOCAL1
+ LOG_LOCAL2
+ LOG_LOCAL3
+ LOG_LOCAL4
+ LOG_LOCAL5
+ LOG_LOCAL6
+ LOG_LOCAL7
+)</pre> <h2 id="Writer">type <span>Writer</span> </h2> <p>A Writer is a connection to a syslog server. </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Dial">func <span>Dial</span> </h3> <pre data-language="go">func Dial(network, raddr string, priority Priority, tag string) (*Writer, error)</pre> <p>Dial establishes a connection to a log daemon by connecting to address raddr on the specified network. Each write to the returned writer sends a log message with the facility and severity (from priority) and tag. If tag is empty, the <span>os.Args</span>[0] is used. If network is empty, Dial will connect to the local syslog server. Otherwise, see the documentation for net.Dial for valid values of network and raddr. </p> <h4 id="example_Dial"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+sysLog, err := syslog.Dial("tcp", "localhost:1234",
+ syslog.LOG_WARNING|syslog.LOG_DAEMON, "demotag")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Fprintf(sysLog, "This is a daemon warning with demotag.")
+sysLog.Emerg("And this is a daemon emergency with demotag.")
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(priority Priority, tag string) (*Writer, error)</pre> <p>New establishes a new connection to the system log daemon. Each write to the returned writer sends a log message with the given priority (a combination of the syslog facility and severity) and prefix tag. If tag is empty, the <span>os.Args</span>[0] is used. </p>
+<h3 id="Writer.Alert">func (*Writer) <span>Alert</span> </h3> <pre data-language="go">func (w *Writer) Alert(m string) error</pre> <p>Alert logs a message with severity <a href="#LOG_ALERT">LOG_ALERT</a>, ignoring the severity passed to New. </p>
+<h3 id="Writer.Close">func (*Writer) <span>Close</span> </h3> <pre data-language="go">func (w *Writer) Close() error</pre> <p>Close closes a connection to the syslog daemon. </p>
+<h3 id="Writer.Crit">func (*Writer) <span>Crit</span> </h3> <pre data-language="go">func (w *Writer) Crit(m string) error</pre> <p>Crit logs a message with severity <a href="#LOG_CRIT">LOG_CRIT</a>, ignoring the severity passed to New. </p>
+<h3 id="Writer.Debug">func (*Writer) <span>Debug</span> </h3> <pre data-language="go">func (w *Writer) Debug(m string) error</pre> <p>Debug logs a message with severity <a href="#LOG_DEBUG">LOG_DEBUG</a>, ignoring the severity passed to New. </p>
+<h3 id="Writer.Emerg">func (*Writer) <span>Emerg</span> </h3> <pre data-language="go">func (w *Writer) Emerg(m string) error</pre> <p>Emerg logs a message with severity <a href="#LOG_EMERG">LOG_EMERG</a>, ignoring the severity passed to New. </p>
+<h3 id="Writer.Err">func (*Writer) <span>Err</span> </h3> <pre data-language="go">func (w *Writer) Err(m string) error</pre> <p>Err logs a message with severity <a href="#LOG_ERR">LOG_ERR</a>, ignoring the severity passed to New. </p>
+<h3 id="Writer.Info">func (*Writer) <span>Info</span> </h3> <pre data-language="go">func (w *Writer) Info(m string) error</pre> <p>Info logs a message with severity <a href="#LOG_INFO">LOG_INFO</a>, ignoring the severity passed to New. </p>
+<h3 id="Writer.Notice">func (*Writer) <span>Notice</span> </h3> <pre data-language="go">func (w *Writer) Notice(m string) error</pre> <p>Notice logs a message with severity <a href="#LOG_NOTICE">LOG_NOTICE</a>, ignoring the severity passed to New. </p>
+<h3 id="Writer.Warning">func (*Writer) <span>Warning</span> </h3> <pre data-language="go">func (w *Writer) Warning(m string) error</pre> <p>Warning logs a message with severity <a href="#LOG_WARNING">LOG_WARNING</a>, ignoring the severity passed to New. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> </h3> <pre data-language="go">func (w *Writer) Write(b []byte) (int, error)</pre> <p>Write sends a log message to the syslog daemon. </p>
+<h2 id="pkg-note-BUG">Bugs</h2> <ul> <li>☞ <p>This package is not implemented on Windows. As the syslog package is frozen, Windows users are encouraged to use a package outside of the standard library. For background, see <a href="https://golang.org/issue/1108">https://golang.org/issue/1108</a>. </p>
+</li> <li>☞ <p>This package is not implemented on Plan 9. </p>
+</li> </ul><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/log/syslog/" class="_attribution-link">http://golang.org/pkg/log/syslog/</a>
+ </p>
+</div>
diff --git a/devdocs/go/maps%2Findex.html b/devdocs/go/maps%2Findex.html
new file mode 100644
index 00000000..3d751a7d
--- /dev/null
+++ b/devdocs/go/maps%2Findex.html
@@ -0,0 +1,126 @@
+<h1> Package maps </h1> <ul id="short-nav">
+<li><code>import "maps"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package maps defines various functions useful with maps of any type. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Clone">func Clone[M ~map[K]V, K comparable, V any](m M) M</a></li>
+<li><a href="#Copy">func Copy[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](dst M1, src M2)</a></li>
+<li><a href="#DeleteFunc">func DeleteFunc[M ~map[K]V, K comparable, V any](m M, del func(K, V) bool)</a></li>
+<li><a href="#Equal">func Equal[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool</a></li>
+<li><a href="#EqualFunc">func EqualFunc[M1 ~map[K]V1, M2 ~map[K]V2, K comparable, V1, V2 any](m1 M1, m2 M2, eq func(V1, V2) bool) bool</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Clone">Clone</a></dd> <dd><a class="exampleLink" href="#example_Copy">Copy</a></dd> <dd><a class="exampleLink" href="#example_DeleteFunc">DeleteFunc</a></dd> <dd><a class="exampleLink" href="#example_Equal">Equal</a></dd> <dd><a class="exampleLink" href="#example_EqualFunc">EqualFunc</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>maps.go</span> </p> <h2 id="Clone">func <span>Clone</span> </h2> <pre data-language="go">func Clone[M ~map[K]V, K comparable, V any](m M) M</pre> <p>Clone returns a copy of m. This is a shallow clone: the new keys and values are set using ordinary assignment. </p> <h4 id="example_Clone"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">m1 := map[string]int{
+ "key": 1,
+}
+m2 := maps.Clone(m1)
+m2["key"] = 100
+fmt.Println(m1["key"])
+fmt.Println(m2["key"])
+
+m3 := map[string][]int{
+ "key": {1, 2, 3},
+}
+m4 := maps.Clone(m3)
+fmt.Println(m4["key"][0])
+m4["key"][0] = 100
+fmt.Println(m3["key"][0])
+fmt.Println(m4["key"][0])
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1
+100
+1
+100
+100
+</pre> <h2 id="Copy">func <span>Copy</span> </h2> <pre data-language="go">func Copy[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](dst M1, src M2)</pre> <p>Copy copies all key/value pairs in src adding them to dst. When a key in src is already present in dst, the value in dst will be overwritten by the value associated with the key in src. </p> <h4 id="example_Copy"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">m1 := map[string]int{
+ "one": 1,
+ "two": 2,
+}
+m2 := map[string]int{
+ "one": 10,
+}
+
+maps.Copy(m2, m1)
+fmt.Println("m2 is:", m2)
+
+m2["one"] = 100
+fmt.Println("m1 is:", m1)
+fmt.Println("m2 is:", m2)
+
+m3 := map[string][]int{
+ "one": {1, 2, 3},
+ "two": {4, 5, 6},
+}
+m4 := map[string][]int{
+ "one": {7, 8, 9},
+}
+
+maps.Copy(m4, m3)
+fmt.Println("m4 is:", m4)
+
+m4["one"][0] = 100
+fmt.Println("m3 is:", m3)
+fmt.Println("m4 is:", m4)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">m2 is: map[one:1 two:2]
+m1 is: map[one:1 two:2]
+m2 is: map[one:100 two:2]
+m4 is: map[one:[1 2 3] two:[4 5 6]]
+m3 is: map[one:[100 2 3] two:[4 5 6]]
+m4 is: map[one:[100 2 3] two:[4 5 6]]
+</pre> <h2 id="DeleteFunc">func <span>DeleteFunc</span> </h2> <pre data-language="go">func DeleteFunc[M ~map[K]V, K comparable, V any](m M, del func(K, V) bool)</pre> <p>DeleteFunc deletes any key/value pairs from m for which del returns true. </p> <h4 id="example_DeleteFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">m := map[string]int{
+ "one": 1,
+ "two": 2,
+ "three": 3,
+ "four": 4,
+}
+maps.DeleteFunc(m, func(k string, v int) bool {
+ return v%2 != 0 // delete odd values
+})
+fmt.Println(m)
+</pre> <p>Output:</p> <pre class="output" data-language="go">map[four:4 two:2]
+</pre> <h2 id="Equal">func <span>Equal</span> </h2> <pre data-language="go">func Equal[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool</pre> <p>Equal reports whether two maps contain the same key/value pairs. Values are compared using ==. </p> <h4 id="example_Equal"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">m1 := map[int]string{
+ 1: "one",
+ 10: "Ten",
+ 1000: "THOUSAND",
+}
+m2 := map[int]string{
+ 1: "one",
+ 10: "Ten",
+ 1000: "THOUSAND",
+}
+m3 := map[int]string{
+ 1: "one",
+ 10: "ten",
+ 1000: "thousand",
+}
+
+fmt.Println(maps.Equal(m1, m2))
+fmt.Println(maps.Equal(m1, m3))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="EqualFunc">func <span>EqualFunc</span> </h2> <pre data-language="go">func EqualFunc[M1 ~map[K]V1, M2 ~map[K]V2, K comparable, V1, V2 any](m1 M1, m2 M2, eq func(V1, V2) bool) bool</pre> <p>EqualFunc is like Equal, but compares values using eq. Keys are still compared with ==. </p> <h4 id="example_EqualFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">m1 := map[int]string{
+ 1: "one",
+ 10: "Ten",
+ 1000: "THOUSAND",
+}
+m2 := map[int][]byte{
+ 1: []byte("One"),
+ 10: []byte("Ten"),
+ 1000: []byte("Thousand"),
+}
+eq := maps.EqualFunc(m1, m2, func(v1 string, v2 []byte) bool {
+ return strings.ToLower(v1) == strings.ToLower(string(v2))
+})
+fmt.Println(eq)
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/maps/" class="_attribution-link">http://golang.org/pkg/maps/</a>
+ </p>
+</div>
diff --git a/devdocs/go/math%2Fbig%2Findex.html b/devdocs/go/math%2Fbig%2Findex.html
new file mode 100644
index 00000000..1c1d9c2b
--- /dev/null
+++ b/devdocs/go/math%2Fbig%2Findex.html
@@ -0,0 +1,912 @@
+<h1> Package big </h1> <ul id="short-nav">
+<li><code>import "math/big"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package big implements arbitrary-precision arithmetic (big numbers). The following numeric types are supported: </p>
+<pre data-language="go">Int signed integers
+Rat rational numbers
+Float floating-point numbers
+</pre> <p>The zero value for an <a href="#Int">Int</a>, <a href="#Rat">Rat</a>, or <a href="#Float">Float</a> correspond to 0. Thus, new values can be declared in the usual ways and denote 0 without further initialization: </p>
+<pre data-language="go">var x Int // &amp;x is an *Int of value 0
+var r = &amp;Rat{} // r is a *Rat of value 0
+y := new(Float) // y is a *Float of value 0
+</pre> <p>Alternatively, new values can be allocated and initialized with factory functions of the form: </p>
+<pre data-language="go">func NewT(v V) *T
+</pre> <p>For instance, <a href="#NewInt">NewInt</a>(x) returns an *<a href="#Int">Int</a> set to the value of the int64 argument x, <a href="#NewRat">NewRat</a>(a, b) returns a *<a href="#Rat">Rat</a> set to the fraction a/b where a and b are int64 values, and <a href="#NewFloat">NewFloat</a>(f) returns a *<a href="#Float">Float</a> initialized to the float64 argument f. More flexibility is provided with explicit setters, for instance: </p>
+<pre data-language="go">var z1 Int
+z1.SetUint64(123) // z1 := 123
+z2 := new(Rat).SetFloat64(1.25) // z2 := 5/4
+z3 := new(Float).SetInt(z1) // z3 := 123.0
+</pre> <p>Setters, numeric operations and predicates are represented as methods of the form: </p>
+<pre data-language="go">func (z *T) SetV(v V) *T // z = v
+func (z *T) Unary(x *T) *T // z = unary x
+func (z *T) Binary(x, y *T) *T // z = x binary y
+func (x *T) Pred() P // p = pred(x)
+</pre> <p>with T one of <a href="#Int">Int</a>, <a href="#Rat">Rat</a>, or <a href="#Float">Float</a>. For unary and binary operations, the result is the receiver (usually named z in that case; see below); if it is one of the operands x or y it may be safely overwritten (and its memory reused). </p>
+<p>Arithmetic expressions are typically written as a sequence of individual method calls, with each call corresponding to an operation. The receiver denotes the result and the method arguments are the operation's operands. For instance, given three *Int values a, b and c, the invocation </p>
+<pre data-language="go">c.Add(a, b)
+</pre> <p>computes the sum a + b and stores the result in c, overwriting whatever value was held in c before. Unless specified otherwise, operations permit aliasing of parameters, so it is perfectly ok to write </p>
+<pre data-language="go">sum.Add(sum, x)
+</pre> <p>to accumulate values x in a sum. </p>
+<p>(By always passing in a result value via the receiver, memory use can be much better controlled. Instead of having to allocate new memory for each result, an operation can reuse the space allocated for the result value, and overwrite that value with the new result in the process.) </p>
+<p>Notational convention: Incoming method parameters (including the receiver) are named consistently in the API to clarify their use. Incoming operands are usually named x, y, a, b, and so on, but never z. A parameter specifying the result is named z (typically the receiver). </p>
+<p>For instance, the arguments for (*Int).Add are named x and y, and because the receiver specifies the result destination, it is called z: </p>
+<pre data-language="go">func (z *Int) Add(x, y *Int) *Int
+</pre> <p>Methods of this form typically return the incoming receiver as well, to enable simple call chaining. </p>
+<p>Methods which don't require a result value to be passed in (for instance, <a href="#Int.Sign">Int.Sign</a>), simply return the result. In this case, the receiver is typically the first operand, named x: </p>
+<pre data-language="go">func (x *Int) Sign() int
+</pre> <p>Various methods support conversions between strings and corresponding numeric values, and vice versa: *<a href="#Int">Int</a>, *<a href="#Rat">Rat</a>, and *<a href="#Float">Float</a> values implement the Stringer interface for a (default) string representation of the value, but also provide SetString methods to initialize a value from a string in a variety of supported formats (see the respective SetString documentation). </p>
+<p>Finally, *<a href="#Int">Int</a>, *<a href="#Rat">Rat</a>, and *<a href="#Float">Float</a> satisfy <span>fmt.Scanner</span> for scanning and (except for *<a href="#Rat">Rat</a>) the Formatter interface for formatted printing. </p> <h4 id="example__eConvergents"> <span class="text">Example (EConvergents)</span>
+</h4> <p>This example demonstrates how to use big.Rat to compute the first 15 terms in the sequence of rational convergents for the constant e (base of natural logarithm). </p> <p>Code:</p> <pre class="code" data-language="go">package big_test
+
+import (
+ "fmt"
+ "math/big"
+)
+
+// Use the classic continued fraction for e
+//
+// e = [1; 0, 1, 1, 2, 1, 1, ... 2n, 1, 1, ...]
+//
+// i.e., for the nth term, use
+//
+// 1 if n mod 3 != 1
+// (n-1)/3 * 2 if n mod 3 == 1
+func recur(n, lim int64) *big.Rat {
+ term := new(big.Rat)
+ if n%3 != 1 {
+ term.SetInt64(1)
+ } else {
+ term.SetInt64((n - 1) / 3 * 2)
+ }
+
+ if n &gt; lim {
+ return term
+ }
+
+ // Directly initialize frac as the fractional
+ // inverse of the result of recur.
+ frac := new(big.Rat).Inv(recur(n+1, lim))
+
+ return term.Add(term, frac)
+}
+
+// This example demonstrates how to use big.Rat to compute the
+// first 15 terms in the sequence of rational convergents for
+// the constant e (base of natural logarithm).
+func Example_eConvergents() {
+ for i := 1; i &lt;= 15; i++ {
+ r := recur(0, int64(i))
+
+ // Print r both as a fraction and as a floating-point number.
+ // Since big.Rat implements fmt.Formatter, we can use %-13s to
+ // get a left-aligned string representation of the fraction.
+ fmt.Printf("%-13s = %s\n", r, r.FloatString(8))
+ }
+
+ // Output:
+ // 2/1 = 2.00000000
+ // 3/1 = 3.00000000
+ // 8/3 = 2.66666667
+ // 11/4 = 2.75000000
+ // 19/7 = 2.71428571
+ // 87/32 = 2.71875000
+ // 106/39 = 2.71794872
+ // 193/71 = 2.71830986
+ // 1264/465 = 2.71827957
+ // 1457/536 = 2.71828358
+ // 2721/1001 = 2.71828172
+ // 23225/8544 = 2.71828184
+ // 25946/9545 = 2.71828182
+ // 49171/18089 = 2.71828183
+ // 517656/190435 = 2.71828183
+}
+</pre> <h4 id="example__fibonacci"> <span class="text">Example (Fibonacci)</span>
+</h4> <p>This example demonstrates how to use big.Int to compute the smallest Fibonacci number with 100 decimal digits and to test whether it is prime. </p> <p>Code:</p> <pre class="code" data-language="go">// Initialize two big ints with the first two numbers in the sequence.
+a := big.NewInt(0)
+b := big.NewInt(1)
+
+// Initialize limit as 10^99, the smallest integer with 100 digits.
+var limit big.Int
+limit.Exp(big.NewInt(10), big.NewInt(99), nil)
+
+// Loop while a is smaller than 1e100.
+for a.Cmp(&amp;limit) &lt; 0 {
+ // Compute the next Fibonacci number, storing it in a.
+ a.Add(a, b)
+ // Swap a and b so that b is the next number in the sequence.
+ a, b = b, a
+}
+fmt.Println(a) // 100-digit Fibonacci number
+
+// Test a for primality.
+// (ProbablyPrimes' argument sets the number of Miller-Rabin
+// rounds to be performed. 20 is a good value.)
+fmt.Println(a.ProbablyPrime(20))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1344719667586153181419716641724567886890850696275767987106294472017884974410332069524504824747437757
+false
+</pre> <h4 id="example__sqrt2"> <span class="text">Example (Sqrt2)</span>
+</h4> <p>This example shows how to use big.Float to compute the square root of 2 with a precision of 200 bits, and how to print the result as a decimal number. </p> <p>Code:</p> <pre class="code" data-language="go">// We'll do computations with 200 bits of precision in the mantissa.
+const prec = 200
+
+// Compute the square root of 2 using Newton's Method. We start with
+// an initial estimate for sqrt(2), and then iterate:
+// x_{n+1} = 1/2 * ( x_n + (2.0 / x_n) )
+
+// Since Newton's Method doubles the number of correct digits at each
+// iteration, we need at least log_2(prec) steps.
+steps := int(math.Log2(prec))
+
+// Initialize values we need for the computation.
+two := new(big.Float).SetPrec(prec).SetInt64(2)
+half := new(big.Float).SetPrec(prec).SetFloat64(0.5)
+
+// Use 1 as the initial estimate.
+x := new(big.Float).SetPrec(prec).SetInt64(1)
+
+// We use t as a temporary variable. There's no need to set its precision
+// since big.Float values with unset (== 0) precision automatically assume
+// the largest precision of the arguments when used as the result (receiver)
+// of a big.Float operation.
+t := new(big.Float)
+
+// Iterate.
+for i := 0; i &lt;= steps; i++ {
+ t.Quo(two, x) // t = 2.0 / x_n
+ t.Add(x, t) // t = x_n + (2.0 / x_n)
+ x.Mul(half, t) // x_{n+1} = 0.5 * t
+}
+
+// We can use the usual fmt.Printf verbs since big.Float implements fmt.Formatter
+fmt.Printf("sqrt(2) = %.50f\n", x)
+
+// Print the error between 2 and x*x.
+t.Mul(x, x) // t = x*x
+fmt.Printf("error = %e\n", t.Sub(two, t))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">sqrt(2) = 1.41421356237309504880168872420969807856967187537695
+error = 0.000000e+00
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Jacobi">func Jacobi(x, y *Int) int</a></li>
+<li><a href="#Accuracy">type Accuracy</a></li>
+<li> <a href="#Accuracy.String">func (i Accuracy) String() string</a>
+</li>
+<li><a href="#ErrNaN">type ErrNaN</a></li>
+<li> <a href="#ErrNaN.Error">func (err ErrNaN) Error() string</a>
+</li>
+<li><a href="#Float">type Float</a></li>
+<li> <a href="#NewFloat">func NewFloat(x float64) *Float</a>
+</li>
+<li> <a href="#ParseFloat">func ParseFloat(s string, base int, prec uint, mode RoundingMode) (f *Float, b int, err error)</a>
+</li>
+<li> <a href="#Float.Abs">func (z *Float) Abs(x *Float) *Float</a>
+</li>
+<li> <a href="#Float.Acc">func (x *Float) Acc() Accuracy</a>
+</li>
+<li> <a href="#Float.Add">func (z *Float) Add(x, y *Float) *Float</a>
+</li>
+<li> <a href="#Float.Append">func (x *Float) Append(buf []byte, fmt byte, prec int) []byte</a>
+</li>
+<li> <a href="#Float.Cmp">func (x *Float) Cmp(y *Float) int</a>
+</li>
+<li> <a href="#Float.Copy">func (z *Float) Copy(x *Float) *Float</a>
+</li>
+<li> <a href="#Float.Float32">func (x *Float) Float32() (float32, Accuracy)</a>
+</li>
+<li> <a href="#Float.Float64">func (x *Float) Float64() (float64, Accuracy)</a>
+</li>
+<li> <a href="#Float.Format">func (x *Float) Format(s fmt.State, format rune)</a>
+</li>
+<li> <a href="#Float.GobDecode">func (z *Float) GobDecode(buf []byte) error</a>
+</li>
+<li> <a href="#Float.GobEncode">func (x *Float) GobEncode() ([]byte, error)</a>
+</li>
+<li> <a href="#Float.Int">func (x *Float) Int(z *Int) (*Int, Accuracy)</a>
+</li>
+<li> <a href="#Float.Int64">func (x *Float) Int64() (int64, Accuracy)</a>
+</li>
+<li> <a href="#Float.IsInf">func (x *Float) IsInf() bool</a>
+</li>
+<li> <a href="#Float.IsInt">func (x *Float) IsInt() bool</a>
+</li>
+<li> <a href="#Float.MantExp">func (x *Float) MantExp(mant *Float) (exp int)</a>
+</li>
+<li> <a href="#Float.MarshalText">func (x *Float) MarshalText() (text []byte, err error)</a>
+</li>
+<li> <a href="#Float.MinPrec">func (x *Float) MinPrec() uint</a>
+</li>
+<li> <a href="#Float.Mode">func (x *Float) Mode() RoundingMode</a>
+</li>
+<li> <a href="#Float.Mul">func (z *Float) Mul(x, y *Float) *Float</a>
+</li>
+<li> <a href="#Float.Neg">func (z *Float) Neg(x *Float) *Float</a>
+</li>
+<li> <a href="#Float.Parse">func (z *Float) Parse(s string, base int) (f *Float, b int, err error)</a>
+</li>
+<li> <a href="#Float.Prec">func (x *Float) Prec() uint</a>
+</li>
+<li> <a href="#Float.Quo">func (z *Float) Quo(x, y *Float) *Float</a>
+</li>
+<li> <a href="#Float.Rat">func (x *Float) Rat(z *Rat) (*Rat, Accuracy)</a>
+</li>
+<li> <a href="#Float.Scan">func (z *Float) Scan(s fmt.ScanState, ch rune) error</a>
+</li>
+<li> <a href="#Float.Set">func (z *Float) Set(x *Float) *Float</a>
+</li>
+<li> <a href="#Float.SetFloat64">func (z *Float) SetFloat64(x float64) *Float</a>
+</li>
+<li> <a href="#Float.SetInf">func (z *Float) SetInf(signbit bool) *Float</a>
+</li>
+<li> <a href="#Float.SetInt">func (z *Float) SetInt(x *Int) *Float</a>
+</li>
+<li> <a href="#Float.SetInt64">func (z *Float) SetInt64(x int64) *Float</a>
+</li>
+<li> <a href="#Float.SetMantExp">func (z *Float) SetMantExp(mant *Float, exp int) *Float</a>
+</li>
+<li> <a href="#Float.SetMode">func (z *Float) SetMode(mode RoundingMode) *Float</a>
+</li>
+<li> <a href="#Float.SetPrec">func (z *Float) SetPrec(prec uint) *Float</a>
+</li>
+<li> <a href="#Float.SetRat">func (z *Float) SetRat(x *Rat) *Float</a>
+</li>
+<li> <a href="#Float.SetString">func (z *Float) SetString(s string) (*Float, bool)</a>
+</li>
+<li> <a href="#Float.SetUint64">func (z *Float) SetUint64(x uint64) *Float</a>
+</li>
+<li> <a href="#Float.Sign">func (x *Float) Sign() int</a>
+</li>
+<li> <a href="#Float.Signbit">func (x *Float) Signbit() bool</a>
+</li>
+<li> <a href="#Float.Sqrt">func (z *Float) Sqrt(x *Float) *Float</a>
+</li>
+<li> <a href="#Float.String">func (x *Float) String() string</a>
+</li>
+<li> <a href="#Float.Sub">func (z *Float) Sub(x, y *Float) *Float</a>
+</li>
+<li> <a href="#Float.Text">func (x *Float) Text(format byte, prec int) string</a>
+</li>
+<li> <a href="#Float.Uint64">func (x *Float) Uint64() (uint64, Accuracy)</a>
+</li>
+<li> <a href="#Float.UnmarshalText">func (z *Float) UnmarshalText(text []byte) error</a>
+</li>
+<li><a href="#Int">type Int</a></li>
+<li> <a href="#NewInt">func NewInt(x int64) *Int</a>
+</li>
+<li> <a href="#Int.Abs">func (z *Int) Abs(x *Int) *Int</a>
+</li>
+<li> <a href="#Int.Add">func (z *Int) Add(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.And">func (z *Int) And(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.AndNot">func (z *Int) AndNot(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.Append">func (x *Int) Append(buf []byte, base int) []byte</a>
+</li>
+<li> <a href="#Int.Binomial">func (z *Int) Binomial(n, k int64) *Int</a>
+</li>
+<li> <a href="#Int.Bit">func (x *Int) Bit(i int) uint</a>
+</li>
+<li> <a href="#Int.BitLen">func (x *Int) BitLen() int</a>
+</li>
+<li> <a href="#Int.Bits">func (x *Int) Bits() []Word</a>
+</li>
+<li> <a href="#Int.Bytes">func (x *Int) Bytes() []byte</a>
+</li>
+<li> <a href="#Int.Cmp">func (x *Int) Cmp(y *Int) (r int)</a>
+</li>
+<li> <a href="#Int.CmpAbs">func (x *Int) CmpAbs(y *Int) int</a>
+</li>
+<li> <a href="#Int.Div">func (z *Int) Div(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.DivMod">func (z *Int) DivMod(x, y, m *Int) (*Int, *Int)</a>
+</li>
+<li> <a href="#Int.Exp">func (z *Int) Exp(x, y, m *Int) *Int</a>
+</li>
+<li> <a href="#Int.FillBytes">func (x *Int) FillBytes(buf []byte) []byte</a>
+</li>
+<li> <a href="#Int.Float64">func (x *Int) Float64() (float64, Accuracy)</a>
+</li>
+<li> <a href="#Int.Format">func (x *Int) Format(s fmt.State, ch rune)</a>
+</li>
+<li> <a href="#Int.GCD">func (z *Int) GCD(x, y, a, b *Int) *Int</a>
+</li>
+<li> <a href="#Int.GobDecode">func (z *Int) GobDecode(buf []byte) error</a>
+</li>
+<li> <a href="#Int.GobEncode">func (x *Int) GobEncode() ([]byte, error)</a>
+</li>
+<li> <a href="#Int.Int64">func (x *Int) Int64() int64</a>
+</li>
+<li> <a href="#Int.IsInt64">func (x *Int) IsInt64() bool</a>
+</li>
+<li> <a href="#Int.IsUint64">func (x *Int) IsUint64() bool</a>
+</li>
+<li> <a href="#Int.Lsh">func (z *Int) Lsh(x *Int, n uint) *Int</a>
+</li>
+<li> <a href="#Int.MarshalJSON">func (x *Int) MarshalJSON() ([]byte, error)</a>
+</li>
+<li> <a href="#Int.MarshalText">func (x *Int) MarshalText() (text []byte, err error)</a>
+</li>
+<li> <a href="#Int.Mod">func (z *Int) Mod(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.ModInverse">func (z *Int) ModInverse(g, n *Int) *Int</a>
+</li>
+<li> <a href="#Int.ModSqrt">func (z *Int) ModSqrt(x, p *Int) *Int</a>
+</li>
+<li> <a href="#Int.Mul">func (z *Int) Mul(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.MulRange">func (z *Int) MulRange(a, b int64) *Int</a>
+</li>
+<li> <a href="#Int.Neg">func (z *Int) Neg(x *Int) *Int</a>
+</li>
+<li> <a href="#Int.Not">func (z *Int) Not(x *Int) *Int</a>
+</li>
+<li> <a href="#Int.Or">func (z *Int) Or(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.ProbablyPrime">func (x *Int) ProbablyPrime(n int) bool</a>
+</li>
+<li> <a href="#Int.Quo">func (z *Int) Quo(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.QuoRem">func (z *Int) QuoRem(x, y, r *Int) (*Int, *Int)</a>
+</li>
+<li> <a href="#Int.Rand">func (z *Int) Rand(rnd *rand.Rand, n *Int) *Int</a>
+</li>
+<li> <a href="#Int.Rem">func (z *Int) Rem(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.Rsh">func (z *Int) Rsh(x *Int, n uint) *Int</a>
+</li>
+<li> <a href="#Int.Scan">func (z *Int) Scan(s fmt.ScanState, ch rune) error</a>
+</li>
+<li> <a href="#Int.Set">func (z *Int) Set(x *Int) *Int</a>
+</li>
+<li> <a href="#Int.SetBit">func (z *Int) SetBit(x *Int, i int, b uint) *Int</a>
+</li>
+<li> <a href="#Int.SetBits">func (z *Int) SetBits(abs []Word) *Int</a>
+</li>
+<li> <a href="#Int.SetBytes">func (z *Int) SetBytes(buf []byte) *Int</a>
+</li>
+<li> <a href="#Int.SetInt64">func (z *Int) SetInt64(x int64) *Int</a>
+</li>
+<li> <a href="#Int.SetString">func (z *Int) SetString(s string, base int) (*Int, bool)</a>
+</li>
+<li> <a href="#Int.SetUint64">func (z *Int) SetUint64(x uint64) *Int</a>
+</li>
+<li> <a href="#Int.Sign">func (x *Int) Sign() int</a>
+</li>
+<li> <a href="#Int.Sqrt">func (z *Int) Sqrt(x *Int) *Int</a>
+</li>
+<li> <a href="#Int.String">func (x *Int) String() string</a>
+</li>
+<li> <a href="#Int.Sub">func (z *Int) Sub(x, y *Int) *Int</a>
+</li>
+<li> <a href="#Int.Text">func (x *Int) Text(base int) string</a>
+</li>
+<li> <a href="#Int.TrailingZeroBits">func (x *Int) TrailingZeroBits() uint</a>
+</li>
+<li> <a href="#Int.Uint64">func (x *Int) Uint64() uint64</a>
+</li>
+<li> <a href="#Int.UnmarshalJSON">func (z *Int) UnmarshalJSON(text []byte) error</a>
+</li>
+<li> <a href="#Int.UnmarshalText">func (z *Int) UnmarshalText(text []byte) error</a>
+</li>
+<li> <a href="#Int.Xor">func (z *Int) Xor(x, y *Int) *Int</a>
+</li>
+<li><a href="#Rat">type Rat</a></li>
+<li> <a href="#NewRat">func NewRat(a, b int64) *Rat</a>
+</li>
+<li> <a href="#Rat.Abs">func (z *Rat) Abs(x *Rat) *Rat</a>
+</li>
+<li> <a href="#Rat.Add">func (z *Rat) Add(x, y *Rat) *Rat</a>
+</li>
+<li> <a href="#Rat.Cmp">func (x *Rat) Cmp(y *Rat) int</a>
+</li>
+<li> <a href="#Rat.Denom">func (x *Rat) Denom() *Int</a>
+</li>
+<li> <a href="#Rat.Float32">func (x *Rat) Float32() (f float32, exact bool)</a>
+</li>
+<li> <a href="#Rat.Float64">func (x *Rat) Float64() (f float64, exact bool)</a>
+</li>
+<li> <a href="#Rat.FloatPrec">func (x *Rat) FloatPrec() (n int, exact bool)</a>
+</li>
+<li> <a href="#Rat.FloatString">func (x *Rat) FloatString(prec int) string</a>
+</li>
+<li> <a href="#Rat.GobDecode">func (z *Rat) GobDecode(buf []byte) error</a>
+</li>
+<li> <a href="#Rat.GobEncode">func (x *Rat) GobEncode() ([]byte, error)</a>
+</li>
+<li> <a href="#Rat.Inv">func (z *Rat) Inv(x *Rat) *Rat</a>
+</li>
+<li> <a href="#Rat.IsInt">func (x *Rat) IsInt() bool</a>
+</li>
+<li> <a href="#Rat.MarshalText">func (x *Rat) MarshalText() (text []byte, err error)</a>
+</li>
+<li> <a href="#Rat.Mul">func (z *Rat) Mul(x, y *Rat) *Rat</a>
+</li>
+<li> <a href="#Rat.Neg">func (z *Rat) Neg(x *Rat) *Rat</a>
+</li>
+<li> <a href="#Rat.Num">func (x *Rat) Num() *Int</a>
+</li>
+<li> <a href="#Rat.Quo">func (z *Rat) Quo(x, y *Rat) *Rat</a>
+</li>
+<li> <a href="#Rat.RatString">func (x *Rat) RatString() string</a>
+</li>
+<li> <a href="#Rat.Scan">func (z *Rat) Scan(s fmt.ScanState, ch rune) error</a>
+</li>
+<li> <a href="#Rat.Set">func (z *Rat) Set(x *Rat) *Rat</a>
+</li>
+<li> <a href="#Rat.SetFloat64">func (z *Rat) SetFloat64(f float64) *Rat</a>
+</li>
+<li> <a href="#Rat.SetFrac">func (z *Rat) SetFrac(a, b *Int) *Rat</a>
+</li>
+<li> <a href="#Rat.SetFrac64">func (z *Rat) SetFrac64(a, b int64) *Rat</a>
+</li>
+<li> <a href="#Rat.SetInt">func (z *Rat) SetInt(x *Int) *Rat</a>
+</li>
+<li> <a href="#Rat.SetInt64">func (z *Rat) SetInt64(x int64) *Rat</a>
+</li>
+<li> <a href="#Rat.SetString">func (z *Rat) SetString(s string) (*Rat, bool)</a>
+</li>
+<li> <a href="#Rat.SetUint64">func (z *Rat) SetUint64(x uint64) *Rat</a>
+</li>
+<li> <a href="#Rat.Sign">func (x *Rat) Sign() int</a>
+</li>
+<li> <a href="#Rat.String">func (x *Rat) String() string</a>
+</li>
+<li> <a href="#Rat.Sub">func (z *Rat) Sub(x, y *Rat) *Rat</a>
+</li>
+<li> <a href="#Rat.UnmarshalText">func (z *Rat) UnmarshalText(text []byte) error</a>
+</li>
+<li><a href="#RoundingMode">type RoundingMode</a></li>
+<li> <a href="#RoundingMode.String">func (i RoundingMode) String() string</a>
+</li>
+<li><a href="#Word">type Word</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Float_Add">Float.Add</a></dd> <dd><a class="exampleLink" href="#example_Float_Cmp">Float.Cmp</a></dd> <dd><a class="exampleLink" href="#example_Float_Scan">Float.Scan</a></dd> <dd><a class="exampleLink" href="#example_Float_SetString">Float.SetString</a></dd> <dd><a class="exampleLink" href="#example_Float_shift">Float (Shift)</a></dd> <dd><a class="exampleLink" href="#example_Int_Scan">Int.Scan</a></dd> <dd><a class="exampleLink" href="#example_Int_SetString">Int.SetString</a></dd> <dd><a class="exampleLink" href="#example_Rat_Scan">Rat.Scan</a></dd> <dd><a class="exampleLink" href="#example_Rat_SetString">Rat.SetString</a></dd> <dd><a class="exampleLink" href="#example_RoundingMode">RoundingMode</a></dd> <dd><a class="exampleLink" href="#example__eConvergents">Package (EConvergents)</a></dd> <dd><a class="exampleLink" href="#example__fibonacci">Package (Fibonacci)</a></dd> <dd><a class="exampleLink" href="#example__sqrt2">Package (Sqrt2)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>accuracy_string.go</span> <span>arith.go</span> <span>arith_amd64.go</span> <span>arith_decl.go</span> <span>decimal.go</span> <span>doc.go</span> <span>float.go</span> <span>floatconv.go</span> <span>floatmarsh.go</span> <span>ftoa.go</span> <span>int.go</span> <span>intconv.go</span> <span>intmarsh.go</span> <span>nat.go</span> <span>natconv.go</span> <span>natdiv.go</span> <span>prime.go</span> <span>rat.go</span> <span>ratconv.go</span> <span>ratmarsh.go</span> <span>roundingmode_string.go</span> <span>sqrt.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Exponent and precision limits. </p>
+<pre data-language="go">const (
+ MaxExp = math.MaxInt32 // largest supported exponent
+ MinExp = math.MinInt32 // smallest supported exponent
+ MaxPrec = math.MaxUint32 // largest (theoretically) supported precision; likely memory-limited
+)</pre> <p>MaxBase is the largest number base accepted for string conversions. </p>
+<pre data-language="go">const MaxBase = 10 + ('z' - 'a' + 1) + ('Z' - 'A' + 1)</pre> <h2 id="Jacobi">func <span>Jacobi</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Jacobi(x, y *Int) int</pre> <p>Jacobi returns the Jacobi symbol (x/y), either +1, -1, or 0. The y argument must be an odd integer. </p>
+<h2 id="Accuracy">type <span>Accuracy</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>Accuracy describes the rounding error produced by the most recent operation that generated a <a href="#Float">Float</a> value, relative to the exact value. </p>
+<pre data-language="go">type Accuracy int8</pre> <p>Constants describing the <a href="#Accuracy">Accuracy</a> of a <a href="#Float">Float</a>. </p>
+<pre data-language="go">const (
+ Below Accuracy = -1
+ Exact Accuracy = 0
+ Above Accuracy = +1
+)</pre> <h3 id="Accuracy.String">func (Accuracy) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (i Accuracy) String() string</pre> <h2 id="ErrNaN">type <span>ErrNaN</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>An ErrNaN panic is raised by a <a href="#Float">Float</a> operation that would lead to a NaN under IEEE-754 rules. An ErrNaN implements the error interface. </p>
+<pre data-language="go">type ErrNaN struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ErrNaN.Error">func (ErrNaN) <span>Error</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (err ErrNaN) Error() string</pre> <h2 id="Float">type <span>Float</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A nonzero finite Float represents a multi-precision floating point number </p>
+<pre data-language="go">sign × mantissa × 2**exponent
+</pre> <p>with 0.5 &lt;= mantissa &lt; 1.0, and MinExp &lt;= exponent &lt;= MaxExp. A Float may also be zero (+0, -0) or infinite (+Inf, -Inf). All Floats are ordered, and the ordering of two Floats x and y is defined by x.Cmp(y). </p>
+<p>Each Float value also has a precision, rounding mode, and accuracy. The precision is the maximum number of mantissa bits available to represent the value. The rounding mode specifies how a result should be rounded to fit into the mantissa bits, and accuracy describes the rounding error with respect to the exact result. </p>
+<p>Unless specified otherwise, all operations (including setters) that specify a *Float variable for the result (usually via the receiver with the exception of <a href="#Float.MantExp">Float.MantExp</a>), round the numeric result according to the precision and rounding mode of the result variable. </p>
+<p>If the provided result precision is 0 (see below), it is set to the precision of the argument with the largest precision value before any rounding takes place, and the rounding mode remains unchanged. Thus, uninitialized Floats provided as result arguments will have their precision set to a reasonable value determined by the operands, and their mode is the zero value for RoundingMode (ToNearestEven). </p>
+<p>By setting the desired precision to 24 or 53 and using matching rounding mode (typically <a href="#ToNearestEven">ToNearestEven</a>), Float operations produce the same results as the corresponding float32 or float64 IEEE-754 arithmetic for operands that correspond to normal (i.e., not denormal) float32 or float64 numbers. Exponent underflow and overflow lead to a 0 or an Infinity for different values than IEEE-754 because Float exponents have a much larger range. </p>
+<p>The zero (uninitialized) value for a Float is ready to use and represents the number +0.0 exactly, with precision 0 and rounding mode <a href="#ToNearestEven">ToNearestEven</a>. </p>
+<p>Operations always take pointer arguments (*Float) rather than Float values, and each unique Float value requires its own unique *Float pointer. To "copy" a Float value, an existing (or newly allocated) Float must be set to a new value using the <a href="#Float.Set">Float.Set</a> method; shallow copies of Floats are not supported and may lead to errors. </p>
+<pre data-language="go">type Float struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Float_shift"> <span class="text">Example (Shift)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Implement Float "shift" by modifying the (binary) exponents directly.
+for s := -5; s &lt;= 5; s++ {
+ x := big.NewFloat(0.5)
+ x.SetMantExp(x, x.MantExp(nil)+s) // shift x by s
+ fmt.Println(x)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.015625
+0.03125
+0.0625
+0.125
+0.25
+0.5
+1
+2
+4
+8
+16
+</pre> <h3 id="NewFloat">func <span>NewFloat</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewFloat(x float64) *Float</pre> <p>NewFloat allocates and returns a new <a href="#Float">Float</a> set to x, with precision 53 and rounding mode <a href="#ToNearestEven">ToNearestEven</a>. NewFloat panics with <a href="#ErrNaN">ErrNaN</a> if x is a NaN. </p>
+<h3 id="ParseFloat">func <span>ParseFloat</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func ParseFloat(s string, base int, prec uint, mode RoundingMode) (f *Float, b int, err error)</pre> <p>ParseFloat is like f.Parse(s, base) with f set to the given precision and rounding mode. </p>
+<h3 id="Float.Abs">func (*Float) <span>Abs</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) Abs(x *Float) *Float</pre> <p>Abs sets z to the (possibly rounded) value |x| (the absolute value of x) and returns z. </p>
+<h3 id="Float.Acc">func (*Float) <span>Acc</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Acc() Accuracy</pre> <p>Acc returns the accuracy of x produced by the most recent operation, unless explicitly documented otherwise by that operation. </p>
+<h3 id="Float.Add">func (*Float) <span>Add</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) Add(x, y *Float) *Float</pre> <p>Add sets z to the rounded sum x+y and returns z. If z's precision is 0, it is changed to the larger of x's or y's precision before the operation. Rounding is performed according to z's precision and rounding mode; and z's accuracy reports the result error relative to the exact (not rounded) result. Add panics with <a href="#ErrNaN">ErrNaN</a> if x and y are infinities with opposite signs. The value of z is undefined in that case. </p> <h4 id="example_Float_Add"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Operate on numbers of different precision.
+var x, y, z big.Float
+x.SetInt64(1000) // x is automatically set to 64bit precision
+y.SetFloat64(2.718281828) // y is automatically set to 53bit precision
+z.SetPrec(32)
+z.Add(&amp;x, &amp;y)
+fmt.Printf("x = %.10g (%s, prec = %d, acc = %s)\n", &amp;x, x.Text('p', 0), x.Prec(), x.Acc())
+fmt.Printf("y = %.10g (%s, prec = %d, acc = %s)\n", &amp;y, y.Text('p', 0), y.Prec(), y.Acc())
+fmt.Printf("z = %.10g (%s, prec = %d, acc = %s)\n", &amp;z, z.Text('p', 0), z.Prec(), z.Acc())
+</pre> <p>Output:</p> <pre class="output" data-language="go">x = 1000 (0x.fap+10, prec = 64, acc = Exact)
+y = 2.718281828 (0x.adf85458248cd8p+2, prec = 53, acc = Exact)
+z = 1002.718282 (0x.faadf854p+10, prec = 32, acc = Below)
+</pre> <h3 id="Float.Append">func (*Float) <span>Append</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Append(buf []byte, fmt byte, prec int) []byte</pre> <p>Append appends to buf the string form of the floating-point number x, as generated by x.Text, and returns the extended buffer. </p>
+<h3 id="Float.Cmp">func (*Float) <span>Cmp</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Cmp(y *Float) int</pre> <p>Cmp compares x and y and returns: </p>
+<pre data-language="go">-1 if x &lt; y
+ 0 if x == y (incl. -0 == 0, -Inf == -Inf, and +Inf == +Inf)
++1 if x &gt; y
+</pre> <h4 id="example_Float_Cmp"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">inf := math.Inf(1)
+zero := 0.0
+
+operands := []float64{-inf, -1.2, -zero, 0, +1.2, +inf}
+
+fmt.Println(" x y cmp")
+fmt.Println("---------------")
+for _, x64 := range operands {
+ x := big.NewFloat(x64)
+ for _, y64 := range operands {
+ y := big.NewFloat(y64)
+ fmt.Printf("%4g %4g %3d\n", x, y, x.Cmp(y))
+ }
+ fmt.Println()
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go"> x y cmp
+---------------
+-Inf -Inf 0
+-Inf -1.2 -1
+-Inf -0 -1
+-Inf 0 -1
+-Inf 1.2 -1
+-Inf +Inf -1
+
+-1.2 -Inf 1
+-1.2 -1.2 0
+-1.2 -0 -1
+-1.2 0 -1
+-1.2 1.2 -1
+-1.2 +Inf -1
+
+ -0 -Inf 1
+ -0 -1.2 1
+ -0 -0 0
+ -0 0 0
+ -0 1.2 -1
+ -0 +Inf -1
+
+ 0 -Inf 1
+ 0 -1.2 1
+ 0 -0 0
+ 0 0 0
+ 0 1.2 -1
+ 0 +Inf -1
+
+ 1.2 -Inf 1
+ 1.2 -1.2 1
+ 1.2 -0 1
+ 1.2 0 1
+ 1.2 1.2 0
+ 1.2 +Inf -1
+
++Inf -Inf 1
++Inf -1.2 1
++Inf -0 1
++Inf 0 1
++Inf 1.2 1
++Inf +Inf 0
+</pre> <h3 id="Float.Copy">func (*Float) <span>Copy</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) Copy(x *Float) *Float</pre> <p>Copy sets z to x, with the same precision, rounding mode, and accuracy as x, and returns z. x is not changed even if z and x are the same. </p>
+<h3 id="Float.Float32">func (*Float) <span>Float32</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Float32() (float32, Accuracy)</pre> <p>Float32 returns the float32 value nearest to x. If x is too small to be represented by a float32 (|x| &lt; <span>math.SmallestNonzeroFloat32</span>), the result is (0, <a href="#Below">Below</a>) or (-0, <a href="#Above">Above</a>), respectively, depending on the sign of x. If x is too large to be represented by a float32 (|x| &gt; <span>math.MaxFloat32</span>), the result is (+Inf, <a href="#Above">Above</a>) or (-Inf, <a href="#Below">Below</a>), depending on the sign of x. </p>
+<h3 id="Float.Float64">func (*Float) <span>Float64</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Float64() (float64, Accuracy)</pre> <p>Float64 returns the float64 value nearest to x. If x is too small to be represented by a float64 (|x| &lt; <span>math.SmallestNonzeroFloat64</span>), the result is (0, <a href="#Below">Below</a>) or (-0, <a href="#Above">Above</a>), respectively, depending on the sign of x. If x is too large to be represented by a float64 (|x| &gt; <span>math.MaxFloat64</span>), the result is (+Inf, <a href="#Above">Above</a>) or (-Inf, <a href="#Below">Below</a>), depending on the sign of x. </p>
+<h3 id="Float.Format">func (*Float) <span>Format</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Format(s fmt.State, format rune)</pre> <p>Format implements <span>fmt.Formatter</span>. It accepts all the regular formats for floating-point numbers ('b', 'e', 'E', 'f', 'F', 'g', 'G', 'x') as well as 'p' and 'v'. See (*Float).Text for the interpretation of 'p'. The 'v' format is handled like 'g'. Format also supports specification of the minimum precision in digits, the output field width, as well as the format flags '+' and ' ' for sign control, '0' for space or zero padding, and '-' for left or right justification. See the fmt package for details. </p>
+<h3 id="Float.GobDecode">func (*Float) <span>GobDecode</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (z *Float) GobDecode(buf []byte) error</pre> <p>GobDecode implements the <span>encoding/gob.GobDecoder</span> interface. The result is rounded per the precision and rounding mode of z unless z's precision is 0, in which case z is set exactly to the decoded value. </p>
+<h3 id="Float.GobEncode">func (*Float) <span>GobEncode</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (x *Float) GobEncode() ([]byte, error)</pre> <p>GobEncode implements the <span>encoding/gob.GobEncoder</span> interface. The <a href="#Float">Float</a> value and all its attributes (precision, rounding mode, accuracy) are marshaled. </p>
+<h3 id="Float.Int">func (*Float) <span>Int</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Int(z *Int) (*Int, Accuracy)</pre> <p>Int returns the result of truncating x towards zero; or nil if x is an infinity. The result is <a href="#Exact">Exact</a> if x.IsInt(); otherwise it is <a href="#Below">Below</a> for x &gt; 0, and <a href="#Above">Above</a> for x &lt; 0. If a non-nil *<a href="#Int">Int</a> argument z is provided, <a href="#Int">Int</a> stores the result in z instead of allocating a new <a href="#Int">Int</a>. </p>
+<h3 id="Float.Int64">func (*Float) <span>Int64</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Int64() (int64, Accuracy)</pre> <p>Int64 returns the integer resulting from truncating x towards zero. If <span>math.MinInt64</span> &lt;= x &lt;= <span>math.MaxInt64</span>, the result is <a href="#Exact">Exact</a> if x is an integer, and <a href="#Above">Above</a> (x &lt; 0) or <a href="#Below">Below</a> (x &gt; 0) otherwise. The result is (<span>math.MinInt64</span>, <a href="#Above">Above</a>) for x &lt; <span>math.MinInt64</span>, and (<span>math.MaxInt64</span>, <a href="#Below">Below</a>) for x &gt; <span>math.MaxInt64</span>. </p>
+<h3 id="Float.IsInf">func (*Float) <span>IsInf</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) IsInf() bool</pre> <p>IsInf reports whether x is +Inf or -Inf. </p>
+<h3 id="Float.IsInt">func (*Float) <span>IsInt</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) IsInt() bool</pre> <p>IsInt reports whether x is an integer. ±Inf values are not integers. </p>
+<h3 id="Float.MantExp">func (*Float) <span>MantExp</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) MantExp(mant *Float) (exp int)</pre> <p>MantExp breaks x into its mantissa and exponent components and returns the exponent. If a non-nil mant argument is provided its value is set to the mantissa of x, with the same precision and rounding mode as x. The components satisfy x == mant × 2**exp, with 0.5 &lt;= |mant| &lt; 1.0. Calling MantExp with a nil argument is an efficient way to get the exponent of the receiver. </p>
+<p>Special cases are: </p>
+<pre data-language="go">( ±0).MantExp(mant) = 0, with mant set to ±0
+(±Inf).MantExp(mant) = 0, with mant set to ±Inf
+</pre> <p>x and mant may be the same in which case x is set to its mantissa value. </p>
+<h3 id="Float.MarshalText">func (*Float) <span>MarshalText</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (x *Float) MarshalText() (text []byte, err error)</pre> <p>MarshalText implements the <span>encoding.TextMarshaler</span> interface. Only the <a href="#Float">Float</a> value is marshaled (in full precision), other attributes such as precision or accuracy are ignored. </p>
+<h3 id="Float.MinPrec">func (*Float) <span>MinPrec</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) MinPrec() uint</pre> <p>MinPrec returns the minimum precision required to represent x exactly (i.e., the smallest prec before x.SetPrec(prec) would start rounding x). The result is 0 for |x| == 0 and |x| == Inf. </p>
+<h3 id="Float.Mode">func (*Float) <span>Mode</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Mode() RoundingMode</pre> <p>Mode returns the rounding mode of x. </p>
+<h3 id="Float.Mul">func (*Float) <span>Mul</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) Mul(x, y *Float) *Float</pre> <p>Mul sets z to the rounded product x*y and returns z. Precision, rounding, and accuracy reporting are as for <a href="#Float.Add">Float.Add</a>. Mul panics with <a href="#ErrNaN">ErrNaN</a> if one operand is zero and the other operand an infinity. The value of z is undefined in that case. </p>
+<h3 id="Float.Neg">func (*Float) <span>Neg</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) Neg(x *Float) *Float</pre> <p>Neg sets z to the (possibly rounded) value of x with its sign negated, and returns z. </p>
+<h3 id="Float.Parse">func (*Float) <span>Parse</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) Parse(s string, base int) (f *Float, b int, err error)</pre> <p>Parse parses s which must contain a text representation of a floating- point number with a mantissa in the given conversion base (the exponent is always a decimal number), or a string representing an infinite value. </p>
+<p>For base 0, an underscore character “_” may appear between a base prefix and an adjacent digit, and between successive digits; such underscores do not change the value of the number, or the returned digit count. Incorrect placement of underscores is reported as an error if there are no other errors. If base != 0, underscores are not recognized and thus terminate scanning like any other character that is not a valid radix point or digit. </p>
+<p>It sets z to the (possibly rounded) value of the corresponding floating- point value, and returns z, the actual base b, and an error err, if any. The entire string (not just a prefix) must be consumed for success. If z's precision is 0, it is changed to 64 before rounding takes effect. The number must be of the form: </p>
+<pre data-language="go">number = [ sign ] ( float | "inf" | "Inf" ) .
+sign = "+" | "-" .
+float = ( mantissa | prefix pmantissa ) [ exponent ] .
+prefix = "0" [ "b" | "B" | "o" | "O" | "x" | "X" ] .
+mantissa = digits "." [ digits ] | digits | "." digits .
+pmantissa = [ "_" ] digits "." [ digits ] | [ "_" ] digits | "." digits .
+exponent = ( "e" | "E" | "p" | "P" ) [ sign ] digits .
+digits = digit { [ "_" ] digit } .
+digit = "0" ... "9" | "a" ... "z" | "A" ... "Z" .
+</pre> <p>The base argument must be 0, 2, 8, 10, or 16. Providing an invalid base argument will lead to a run-time panic. </p>
+<p>For base 0, the number prefix determines the actual base: A prefix of “0b” or “0B” selects base 2, “0o” or “0O” selects base 8, and “0x” or “0X” selects base 16. Otherwise, the actual base is 10 and no prefix is accepted. The octal prefix "0" is not supported (a leading "0" is simply considered a "0"). </p>
+<p>A "p" or "P" exponent indicates a base 2 (rather than base 10) exponent; for instance, "0x1.fffffffffffffp1023" (using base 0) represents the maximum float64 value. For hexadecimal mantissae, the exponent character must be one of 'p' or 'P', if present (an "e" or "E" exponent indicator cannot be distinguished from a mantissa digit). </p>
+<p>The returned *Float f is nil and the value of z is valid but not defined if an error is reported. </p>
+<h3 id="Float.Prec">func (*Float) <span>Prec</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Prec() uint</pre> <p>Prec returns the mantissa precision of x in bits. The result may be 0 for |x| == 0 and |x| == Inf. </p>
+<h3 id="Float.Quo">func (*Float) <span>Quo</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) Quo(x, y *Float) *Float</pre> <p>Quo sets z to the rounded quotient x/y and returns z. Precision, rounding, and accuracy reporting are as for <a href="#Float.Add">Float.Add</a>. Quo panics with <a href="#ErrNaN">ErrNaN</a> if both operands are zero or infinities. The value of z is undefined in that case. </p>
+<h3 id="Float.Rat">func (*Float) <span>Rat</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Rat(z *Rat) (*Rat, Accuracy)</pre> <p>Rat returns the rational number corresponding to x; or nil if x is an infinity. The result is <a href="#Exact">Exact</a> if x is not an Inf. If a non-nil *<a href="#Rat">Rat</a> argument z is provided, <a href="#Rat">Rat</a> stores the result in z instead of allocating a new <a href="#Rat">Rat</a>. </p>
+<h3 id="Float.Scan">func (*Float) <span>Scan</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (z *Float) Scan(s fmt.ScanState, ch rune) error</pre> <p>Scan is a support routine for <span>fmt.Scanner</span>; it sets z to the value of the scanned number. It accepts formats whose verbs are supported by <span>fmt.Scan</span> for floating point values, which are: 'b' (binary), 'e', 'E', 'f', 'F', 'g' and 'G'. Scan doesn't handle ±Inf. </p> <h4 id="example_Float_Scan"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// The Scan function is rarely used directly;
+// the fmt package recognizes it as an implementation of fmt.Scanner.
+f := new(big.Float)
+_, err := fmt.Sscan("1.19282e99", f)
+if err != nil {
+ log.Println("error scanning value:", err)
+} else {
+ fmt.Println(f)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">1.19282e+99
+</pre> <h3 id="Float.Set">func (*Float) <span>Set</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) Set(x *Float) *Float</pre> <p>Set sets z to the (possibly rounded) value of x and returns z. If z's precision is 0, it is changed to the precision of x before setting z (and rounding will have no effect). Rounding is performed according to z's precision and rounding mode; and z's accuracy reports the result error relative to the exact (not rounded) result. </p>
+<h3 id="Float.SetFloat64">func (*Float) <span>SetFloat64</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetFloat64(x float64) *Float</pre> <p>SetFloat64 sets z to the (possibly rounded) value of x and returns z. If z's precision is 0, it is changed to 53 (and rounding will have no effect). SetFloat64 panics with <a href="#ErrNaN">ErrNaN</a> if x is a NaN. </p>
+<h3 id="Float.SetInf">func (*Float) <span>SetInf</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetInf(signbit bool) *Float</pre> <p>SetInf sets z to the infinite Float -Inf if signbit is set, or +Inf if signbit is not set, and returns z. The precision of z is unchanged and the result is always <a href="#Exact">Exact</a>. </p>
+<h3 id="Float.SetInt">func (*Float) <span>SetInt</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetInt(x *Int) *Float</pre> <p>SetInt sets z to the (possibly rounded) value of x and returns z. If z's precision is 0, it is changed to the larger of x.BitLen() or 64 (and rounding will have no effect). </p>
+<h3 id="Float.SetInt64">func (*Float) <span>SetInt64</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetInt64(x int64) *Float</pre> <p>SetInt64 sets z to the (possibly rounded) value of x and returns z. If z's precision is 0, it is changed to 64 (and rounding will have no effect). </p>
+<h3 id="Float.SetMantExp">func (*Float) <span>SetMantExp</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetMantExp(mant *Float, exp int) *Float</pre> <p>SetMantExp sets z to mant × 2**exp and returns z. The result z has the same precision and rounding mode as mant. SetMantExp is an inverse of <a href="#Float.MantExp">Float.MantExp</a> but does not require 0.5 &lt;= |mant| &lt; 1.0. Specifically, for a given x of type *<a href="#Float">Float</a>, SetMantExp relates to <a href="#Float.MantExp">Float.MantExp</a> as follows: </p>
+<pre data-language="go">mant := new(Float)
+new(Float).SetMantExp(mant, x.MantExp(mant)).Cmp(x) == 0
+</pre> <p>Special cases are: </p>
+<pre data-language="go">z.SetMantExp( ±0, exp) = ±0
+z.SetMantExp(±Inf, exp) = ±Inf
+</pre> <p>z and mant may be the same in which case z's exponent is set to exp. </p>
+<h3 id="Float.SetMode">func (*Float) <span>SetMode</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetMode(mode RoundingMode) *Float</pre> <p>SetMode sets z's rounding mode to mode and returns an exact z. z remains unchanged otherwise. z.SetMode(z.Mode()) is a cheap way to set z's accuracy to <a href="#Exact">Exact</a>. </p>
+<h3 id="Float.SetPrec">func (*Float) <span>SetPrec</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetPrec(prec uint) *Float</pre> <p>SetPrec sets z's precision to prec and returns the (possibly) rounded value of z. Rounding occurs according to z's rounding mode if the mantissa cannot be represented in prec bits without loss of precision. SetPrec(0) maps all finite values to ±0; infinite values remain unchanged. If prec &gt; <a href="#MaxPrec">MaxPrec</a>, it is set to <a href="#MaxPrec">MaxPrec</a>. </p>
+<h3 id="Float.SetRat">func (*Float) <span>SetRat</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetRat(x *Rat) *Float</pre> <p>SetRat sets z to the (possibly rounded) value of x and returns z. If z's precision is 0, it is changed to the largest of a.BitLen(), b.BitLen(), or 64; with x = a/b. </p>
+<h3 id="Float.SetString">func (*Float) <span>SetString</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetString(s string) (*Float, bool)</pre> <p>SetString sets z to the value of s and returns z and a boolean indicating success. s must be a floating-point number of the same format as accepted by <a href="#Float.Parse">Float.Parse</a>, with base argument 0. The entire string (not just a prefix) must be valid for success. If the operation failed, the value of z is undefined but the returned value is nil. </p> <h4 id="example_Float_SetString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">f := new(big.Float)
+f.SetString("3.14159")
+fmt.Println(f)
+</pre> <p>Output:</p> <pre class="output" data-language="go">3.14159
+</pre> <h3 id="Float.SetUint64">func (*Float) <span>SetUint64</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) SetUint64(x uint64) *Float</pre> <p>SetUint64 sets z to the (possibly rounded) value of x and returns z. If z's precision is 0, it is changed to 64 (and rounding will have no effect). </p>
+<h3 id="Float.Sign">func (*Float) <span>Sign</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Sign() int</pre> <p>Sign returns: </p>
+<pre data-language="go">-1 if x &lt; 0
+ 0 if x is ±0
++1 if x &gt; 0
+</pre> <h3 id="Float.Signbit">func (*Float) <span>Signbit</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Signbit() bool</pre> <p>Signbit reports whether x is negative or negative zero. </p>
+<h3 id="Float.Sqrt">func (*Float) <span>Sqrt</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (z *Float) Sqrt(x *Float) *Float</pre> <p>Sqrt sets z to the rounded square root of x, and returns it. </p>
+<p>If z's precision is 0, it is changed to x's precision before the operation. Rounding is performed according to z's precision and rounding mode, but z's accuracy is not computed. Specifically, the result of z.Acc() is undefined. </p>
+<p>The function panics if z &lt; 0. The value of z is undefined in that case. </p>
+<h3 id="Float.String">func (*Float) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) String() string</pre> <p>String formats x like x.Text('g', 10). (String must be called explicitly, <a href="#Float.Format">Float.Format</a> does not support %s verb.) </p>
+<h3 id="Float.Sub">func (*Float) <span>Sub</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Float) Sub(x, y *Float) *Float</pre> <p>Sub sets z to the rounded difference x-y and returns z. Precision, rounding, and accuracy reporting are as for <a href="#Float.Add">Float.Add</a>. Sub panics with <a href="#ErrNaN">ErrNaN</a> if x and y are infinities with equal signs. The value of z is undefined in that case. </p>
+<h3 id="Float.Text">func (*Float) <span>Text</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Text(format byte, prec int) string</pre> <p>Text converts the floating-point number x to a string according to the given format and precision prec. The format is one of: </p>
+<pre data-language="go">'e' -d.dddde±dd, decimal exponent, at least two (possibly 0) exponent digits
+'E' -d.ddddE±dd, decimal exponent, at least two (possibly 0) exponent digits
+'f' -ddddd.dddd, no exponent
+'g' like 'e' for large exponents, like 'f' otherwise
+'G' like 'E' for large exponents, like 'f' otherwise
+'x' -0xd.dddddp±dd, hexadecimal mantissa, decimal power of two exponent
+'p' -0x.dddp±dd, hexadecimal mantissa, decimal power of two exponent (non-standard)
+'b' -ddddddp±dd, decimal mantissa, decimal power of two exponent (non-standard)
+</pre> <p>For the power-of-two exponent formats, the mantissa is printed in normalized form: </p>
+<pre data-language="go">'x' hexadecimal mantissa in [1, 2), or 0
+'p' hexadecimal mantissa in [½, 1), or 0
+'b' decimal integer mantissa using x.Prec() bits, or 0
+</pre> <p>Note that the 'x' form is the one used by most other languages and libraries. </p>
+<p>If format is a different character, Text returns a "%" followed by the unrecognized format character. </p>
+<p>The precision prec controls the number of digits (excluding the exponent) printed by the 'e', 'E', 'f', 'g', 'G', and 'x' formats. For 'e', 'E', 'f', and 'x', it is the number of digits after the decimal point. For 'g' and 'G' it is the total number of digits. A negative precision selects the smallest number of decimal digits necessary to identify the value x uniquely using x.Prec() mantissa bits. The prec value is ignored for the 'b' and 'p' formats. </p>
+<h3 id="Float.Uint64">func (*Float) <span>Uint64</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (x *Float) Uint64() (uint64, Accuracy)</pre> <p>Uint64 returns the unsigned integer resulting from truncating x towards zero. If 0 &lt;= x &lt;= math.MaxUint64, the result is <a href="#Exact">Exact</a> if x is an integer and <a href="#Below">Below</a> otherwise. The result is (0, <a href="#Above">Above</a>) for x &lt; 0, and (<span>math.MaxUint64</span>, <a href="#Below">Below</a>) for x &gt; <span>math.MaxUint64</span>. </p>
+<h3 id="Float.UnmarshalText">func (*Float) <span>UnmarshalText</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (z *Float) UnmarshalText(text []byte) error</pre> <p>UnmarshalText implements the <span>encoding.TextUnmarshaler</span> interface. The result is rounded per the precision and rounding mode of z. If z's precision is 0, it is changed to 64 before rounding takes effect. </p>
+<h2 id="Int">type <span>Int</span> </h2> <p>An Int represents a signed multi-precision integer. The zero value for an Int represents the value 0. </p>
+<p>Operations always take pointer arguments (*Int) rather than Int values, and each unique Int value requires its own unique *Int pointer. To "copy" an Int value, an existing (or newly allocated) Int must be set to a new value using the <a href="#Int.Set">Int.Set</a> method; shallow copies of Ints are not supported and may lead to errors. </p>
+<p>Note that methods may leak the Int's value through timing side-channels. Because of this and because of the scope and complexity of the implementation, Int is not well-suited to implement cryptographic operations. The standard library avoids exposing non-trivial Int methods to attacker-controlled inputs and the determination of whether a bug in math/big is considered a security vulnerability might depend on the impact on the standard library. </p>
+<pre data-language="go">type Int struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewInt">func <span>NewInt</span> </h3> <pre data-language="go">func NewInt(x int64) *Int</pre> <p>NewInt allocates and returns a new <a href="#Int">Int</a> set to x. </p>
+<h3 id="Int.Abs">func (*Int) <span>Abs</span> </h3> <pre data-language="go">func (z *Int) Abs(x *Int) *Int</pre> <p>Abs sets z to |x| (the absolute value of x) and returns z. </p>
+<h3 id="Int.Add">func (*Int) <span>Add</span> </h3> <pre data-language="go">func (z *Int) Add(x, y *Int) *Int</pre> <p>Add sets z to the sum x+y and returns z. </p>
+<h3 id="Int.And">func (*Int) <span>And</span> </h3> <pre data-language="go">func (z *Int) And(x, y *Int) *Int</pre> <p>And sets z = x &amp; y and returns z. </p>
+<h3 id="Int.AndNot">func (*Int) <span>AndNot</span> </h3> <pre data-language="go">func (z *Int) AndNot(x, y *Int) *Int</pre> <p>AndNot sets z = x &amp;^ y and returns z. </p>
+<h3 id="Int.Append">func (*Int) <span>Append</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (x *Int) Append(buf []byte, base int) []byte</pre> <p>Append appends the string representation of x, as generated by x.Text(base), to buf and returns the extended buffer. </p>
+<h3 id="Int.Binomial">func (*Int) <span>Binomial</span> </h3> <pre data-language="go">func (z *Int) Binomial(n, k int64) *Int</pre> <p>Binomial sets z to the binomial coefficient C(n, k) and returns z. </p>
+<h3 id="Int.Bit">func (*Int) <span>Bit</span> </h3> <pre data-language="go">func (x *Int) Bit(i int) uint</pre> <p>Bit returns the value of the i'th bit of x. That is, it returns (x&gt;&gt;i)&amp;1. The bit index i must be &gt;= 0. </p>
+<h3 id="Int.BitLen">func (*Int) <span>BitLen</span> </h3> <pre data-language="go">func (x *Int) BitLen() int</pre> <p>BitLen returns the length of the absolute value of x in bits. The bit length of 0 is 0. </p>
+<h3 id="Int.Bits">func (*Int) <span>Bits</span> </h3> <pre data-language="go">func (x *Int) Bits() []Word</pre> <p>Bits provides raw (unchecked but fast) access to x by returning its absolute value as a little-endian <a href="#Word">Word</a> slice. The result and x share the same underlying array. Bits is intended to support implementation of missing low-level <a href="#Int">Int</a> functionality outside this package; it should be avoided otherwise. </p>
+<h3 id="Int.Bytes">func (*Int) <span>Bytes</span> </h3> <pre data-language="go">func (x *Int) Bytes() []byte</pre> <p>Bytes returns the absolute value of x as a big-endian byte slice. </p>
+<p>To use a fixed length slice, or a preallocated one, use <a href="#Int.FillBytes">Int.FillBytes</a>. </p>
+<h3 id="Int.Cmp">func (*Int) <span>Cmp</span> </h3> <pre data-language="go">func (x *Int) Cmp(y *Int) (r int)</pre> <p>Cmp compares x and y and returns: </p>
+<pre data-language="go">-1 if x &lt; y
+ 0 if x == y
++1 if x &gt; y
+</pre> <h3 id="Int.CmpAbs">func (*Int) <span>CmpAbs</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (x *Int) CmpAbs(y *Int) int</pre> <p>CmpAbs compares the absolute values of x and y and returns: </p>
+<pre data-language="go">-1 if |x| &lt; |y|
+ 0 if |x| == |y|
++1 if |x| &gt; |y|
+</pre> <h3 id="Int.Div">func (*Int) <span>Div</span> </h3> <pre data-language="go">func (z *Int) Div(x, y *Int) *Int</pre> <p>Div sets z to the quotient x/y for y != 0 and returns z. If y == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see <a href="#Int.DivMod">Int.DivMod</a> for more details. </p>
+<h3 id="Int.DivMod">func (*Int) <span>DivMod</span> </h3> <pre data-language="go">func (z *Int) DivMod(x, y, m *Int) (*Int, *Int)</pre> <p>DivMod sets z to the quotient x div y and m to the modulus x mod y and returns the pair (z, m) for y != 0. If y == 0, a division-by-zero run-time panic occurs. </p>
+<p>DivMod implements Euclidean division and modulus (unlike Go): </p>
+<pre data-language="go">q = x div y such that
+m = x - y*q with 0 &lt;= m &lt; |y|
+</pre> <p>(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See <a href="#Int.QuoRem">Int.QuoRem</a> for T-division and modulus (like Go). </p>
+<h3 id="Int.Exp">func (*Int) <span>Exp</span> </h3> <pre data-language="go">func (z *Int) Exp(x, y, m *Int) *Int</pre> <p>Exp sets z = x**y mod |m| (i.e. the sign of m is ignored), and returns z. If m == nil or m == 0, z = x**y unless y &lt;= 0 then z = 1. If m != 0, y &lt; 0, and x and m are not relatively prime, z is unchanged and nil is returned. </p>
+<p>Modular exponentiation of inputs of a particular size is not a cryptographically constant-time operation. </p>
+<h3 id="Int.FillBytes">func (*Int) <span>FillBytes</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (x *Int) FillBytes(buf []byte) []byte</pre> <p>FillBytes sets buf to the absolute value of x, storing it as a zero-extended big-endian byte slice, and returns buf. </p>
+<p>If the absolute value of x doesn't fit in buf, FillBytes will panic. </p>
+<h3 id="Int.Float64">func (*Int) <span>Float64</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (x *Int) Float64() (float64, Accuracy)</pre> <p>Float64 returns the float64 value nearest x, and an indication of any rounding that occurred. </p>
+<h3 id="Int.Format">func (*Int) <span>Format</span> </h3> <pre data-language="go">func (x *Int) Format(s fmt.State, ch rune)</pre> <p>Format implements <span>fmt.Formatter</span>. It accepts the formats 'b' (binary), 'o' (octal with 0 prefix), 'O' (octal with 0o prefix), 'd' (decimal), 'x' (lowercase hexadecimal), and 'X' (uppercase hexadecimal). Also supported are the full suite of package fmt's format flags for integral types, including '+' and ' ' for sign control, '#' for leading zero in octal and for hexadecimal, a leading "0x" or "0X" for "%#x" and "%#X" respectively, specification of minimum digits precision, output field width, space or zero padding, and '-' for left or right justification. </p>
+<h3 id="Int.GCD">func (*Int) <span>GCD</span> </h3> <pre data-language="go">func (z *Int) GCD(x, y, a, b *Int) *Int</pre> <p>GCD sets z to the greatest common divisor of a and b and returns z. If x or y are not nil, GCD sets their value such that z = a*x + b*y. </p>
+<p>a and b may be positive, zero or negative. (Before Go 1.14 both had to be &gt; 0.) Regardless of the signs of a and b, z is always &gt;= 0. </p>
+<p>If a == b == 0, GCD sets z = x = y = 0. </p>
+<p>If a == 0 and b != 0, GCD sets z = |b|, x = 0, y = sign(b) * 1. </p>
+<p>If a != 0 and b == 0, GCD sets z = |a|, x = sign(a) * 1, y = 0. </p>
+<h3 id="Int.GobDecode">func (*Int) <span>GobDecode</span> </h3> <pre data-language="go">func (z *Int) GobDecode(buf []byte) error</pre> <p>GobDecode implements the <span>encoding/gob.GobDecoder</span> interface. </p>
+<h3 id="Int.GobEncode">func (*Int) <span>GobEncode</span> </h3> <pre data-language="go">func (x *Int) GobEncode() ([]byte, error)</pre> <p>GobEncode implements the <span>encoding/gob.GobEncoder</span> interface. </p>
+<h3 id="Int.Int64">func (*Int) <span>Int64</span> </h3> <pre data-language="go">func (x *Int) Int64() int64</pre> <p>Int64 returns the int64 representation of x. If x cannot be represented in an int64, the result is undefined. </p>
+<h3 id="Int.IsInt64">func (*Int) <span>IsInt64</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (x *Int) IsInt64() bool</pre> <p>IsInt64 reports whether x can be represented as an int64. </p>
+<h3 id="Int.IsUint64">func (*Int) <span>IsUint64</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (x *Int) IsUint64() bool</pre> <p>IsUint64 reports whether x can be represented as a uint64. </p>
+<h3 id="Int.Lsh">func (*Int) <span>Lsh</span> </h3> <pre data-language="go">func (z *Int) Lsh(x *Int, n uint) *Int</pre> <p>Lsh sets z = x &lt;&lt; n and returns z. </p>
+<h3 id="Int.MarshalJSON">func (*Int) <span>MarshalJSON</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (x *Int) MarshalJSON() ([]byte, error)</pre> <p>MarshalJSON implements the <span>encoding/json.Marshaler</span> interface. </p>
+<h3 id="Int.MarshalText">func (*Int) <span>MarshalText</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (x *Int) MarshalText() (text []byte, err error)</pre> <p>MarshalText implements the <span>encoding.TextMarshaler</span> interface. </p>
+<h3 id="Int.Mod">func (*Int) <span>Mod</span> </h3> <pre data-language="go">func (z *Int) Mod(x, y *Int) *Int</pre> <p>Mod sets z to the modulus x%y for y != 0 and returns z. If y == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean modulus (unlike Go); see <a href="#Int.DivMod">Int.DivMod</a> for more details. </p>
+<h3 id="Int.ModInverse">func (*Int) <span>ModInverse</span> </h3> <pre data-language="go">func (z *Int) ModInverse(g, n *Int) *Int</pre> <p>ModInverse sets z to the multiplicative inverse of g in the ring ℤ/nℤ and returns z. If g and n are not relatively prime, g has no multiplicative inverse in the ring ℤ/nℤ. In this case, z is unchanged and the return value is nil. If n == 0, a division-by-zero run-time panic occurs. </p>
+<h3 id="Int.ModSqrt">func (*Int) <span>ModSqrt</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (z *Int) ModSqrt(x, p *Int) *Int</pre> <p>ModSqrt sets z to a square root of x mod p if such a square root exists, and returns z. The modulus p must be an odd prime. If x is not a square mod p, ModSqrt leaves z unchanged and returns nil. This function panics if p is not an odd integer, its behavior is undefined if p is odd but not prime. </p>
+<h3 id="Int.Mul">func (*Int) <span>Mul</span> </h3> <pre data-language="go">func (z *Int) Mul(x, y *Int) *Int</pre> <p>Mul sets z to the product x*y and returns z. </p>
+<h3 id="Int.MulRange">func (*Int) <span>MulRange</span> </h3> <pre data-language="go">func (z *Int) MulRange(a, b int64) *Int</pre> <p>MulRange sets z to the product of all integers in the range [a, b] inclusively and returns z. If a &gt; b (empty range), the result is 1. </p>
+<h3 id="Int.Neg">func (*Int) <span>Neg</span> </h3> <pre data-language="go">func (z *Int) Neg(x *Int) *Int</pre> <p>Neg sets z to -x and returns z. </p>
+<h3 id="Int.Not">func (*Int) <span>Not</span> </h3> <pre data-language="go">func (z *Int) Not(x *Int) *Int</pre> <p>Not sets z = ^x and returns z. </p>
+<h3 id="Int.Or">func (*Int) <span>Or</span> </h3> <pre data-language="go">func (z *Int) Or(x, y *Int) *Int</pre> <p>Or sets z = x | y and returns z. </p>
+<h3 id="Int.ProbablyPrime">func (*Int) <span>ProbablyPrime</span> </h3> <pre data-language="go">func (x *Int) ProbablyPrime(n int) bool</pre> <p>ProbablyPrime reports whether x is probably prime, applying the Miller-Rabin test with n pseudorandomly chosen bases as well as a Baillie-PSW test. </p>
+<p>If x is prime, ProbablyPrime returns true. If x is chosen randomly and not prime, ProbablyPrime probably returns false. The probability of returning true for a randomly chosen non-prime is at most ¼ⁿ. </p>
+<p>ProbablyPrime is 100% accurate for inputs less than 2⁶⁴. See Menezes et al., Handbook of Applied Cryptography, 1997, pp. 145-149, and FIPS 186-4 Appendix F for further discussion of the error probabilities. </p>
+<p>ProbablyPrime is not suitable for judging primes that an adversary may have crafted to fool the test. </p>
+<p>As of Go 1.8, ProbablyPrime(0) is allowed and applies only a Baillie-PSW test. Before Go 1.8, ProbablyPrime applied only the Miller-Rabin tests, and ProbablyPrime(0) panicked. </p>
+<h3 id="Int.Quo">func (*Int) <span>Quo</span> </h3> <pre data-language="go">func (z *Int) Quo(x, y *Int) *Int</pre> <p>Quo sets z to the quotient x/y for y != 0 and returns z. If y == 0, a division-by-zero run-time panic occurs. Quo implements truncated division (like Go); see <a href="#Int.QuoRem">Int.QuoRem</a> for more details. </p>
+<h3 id="Int.QuoRem">func (*Int) <span>QuoRem</span> </h3> <pre data-language="go">func (z *Int) QuoRem(x, y, r *Int) (*Int, *Int)</pre> <p>QuoRem sets z to the quotient x/y and r to the remainder x%y and returns the pair (z, r) for y != 0. If y == 0, a division-by-zero run-time panic occurs. </p>
+<p>QuoRem implements T-division and modulus (like Go): </p>
+<pre data-language="go">q = x/y with the result truncated to zero
+r = x - y*q
+</pre> <p>(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See DivMod for Euclidean division and modulus (unlike Go). </p>
+<h3 id="Int.Rand">func (*Int) <span>Rand</span> </h3> <pre data-language="go">func (z *Int) Rand(rnd *rand.Rand, n *Int) *Int</pre> <p>Rand sets z to a pseudo-random number in [0, n) and returns z. </p>
+<p>As this uses the <span>math/rand</span> package, it must not be used for security-sensitive work. Use <span>crypto/rand.Int</span> instead. </p>
+<h3 id="Int.Rem">func (*Int) <span>Rem</span> </h3> <pre data-language="go">func (z *Int) Rem(x, y *Int) *Int</pre> <p>Rem sets z to the remainder x%y for y != 0 and returns z. If y == 0, a division-by-zero run-time panic occurs. Rem implements truncated modulus (like Go); see <a href="#Int.QuoRem">Int.QuoRem</a> for more details. </p>
+<h3 id="Int.Rsh">func (*Int) <span>Rsh</span> </h3> <pre data-language="go">func (z *Int) Rsh(x *Int, n uint) *Int</pre> <p>Rsh sets z = x &gt;&gt; n and returns z. </p>
+<h3 id="Int.Scan">func (*Int) <span>Scan</span> </h3> <pre data-language="go">func (z *Int) Scan(s fmt.ScanState, ch rune) error</pre> <p>Scan is a support routine for <span>fmt.Scanner</span>; it sets z to the value of the scanned number. It accepts the formats 'b' (binary), 'o' (octal), 'd' (decimal), 'x' (lowercase hexadecimal), and 'X' (uppercase hexadecimal). </p> <h4 id="example_Int_Scan"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// The Scan function is rarely used directly;
+// the fmt package recognizes it as an implementation of fmt.Scanner.
+i := new(big.Int)
+_, err := fmt.Sscan("18446744073709551617", i)
+if err != nil {
+ log.Println("error scanning value:", err)
+} else {
+ fmt.Println(i)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">18446744073709551617
+</pre> <h3 id="Int.Set">func (*Int) <span>Set</span> </h3> <pre data-language="go">func (z *Int) Set(x *Int) *Int</pre> <p>Set sets z to x and returns z. </p>
+<h3 id="Int.SetBit">func (*Int) <span>SetBit</span> </h3> <pre data-language="go">func (z *Int) SetBit(x *Int, i int, b uint) *Int</pre> <p>SetBit sets z to x, with x's i'th bit set to b (0 or 1). That is, if b is 1 SetBit sets z = x | (1 &lt;&lt; i); if b is 0 SetBit sets z = x &amp;^ (1 &lt;&lt; i). If b is not 0 or 1, SetBit will panic. </p>
+<h3 id="Int.SetBits">func (*Int) <span>SetBits</span> </h3> <pre data-language="go">func (z *Int) SetBits(abs []Word) *Int</pre> <p>SetBits provides raw (unchecked but fast) access to z by setting its value to abs, interpreted as a little-endian <a href="#Word">Word</a> slice, and returning z. The result and abs share the same underlying array. SetBits is intended to support implementation of missing low-level <a href="#Int">Int</a> functionality outside this package; it should be avoided otherwise. </p>
+<h3 id="Int.SetBytes">func (*Int) <span>SetBytes</span> </h3> <pre data-language="go">func (z *Int) SetBytes(buf []byte) *Int</pre> <p>SetBytes interprets buf as the bytes of a big-endian unsigned integer, sets z to that value, and returns z. </p>
+<h3 id="Int.SetInt64">func (*Int) <span>SetInt64</span> </h3> <pre data-language="go">func (z *Int) SetInt64(x int64) *Int</pre> <p>SetInt64 sets z to x and returns z. </p>
+<h3 id="Int.SetString">func (*Int) <span>SetString</span> </h3> <pre data-language="go">func (z *Int) SetString(s string, base int) (*Int, bool)</pre> <p>SetString sets z to the value of s, interpreted in the given base, and returns z and a boolean indicating success. The entire string (not just a prefix) must be valid for success. If SetString fails, the value of z is undefined but the returned value is nil. </p>
+<p>The base argument must be 0 or a value between 2 and <a href="#MaxBase">MaxBase</a>. For base 0, the number prefix determines the actual base: A prefix of “0b” or “0B” selects base 2, “0”, “0o” or “0O” selects base 8, and “0x” or “0X” selects base 16. Otherwise, the selected base is 10 and no prefix is accepted. </p>
+<p>For bases &lt;= 36, lower and upper case letters are considered the same: The letters 'a' to 'z' and 'A' to 'Z' represent digit values 10 to 35. For bases &gt; 36, the upper case letters 'A' to 'Z' represent the digit values 36 to 61. </p>
+<p>For base 0, an underscore character “_” may appear between a base prefix and an adjacent digit, and between successive digits; such underscores do not change the value of the number. Incorrect placement of underscores is reported as an error if there are no other errors. If base != 0, underscores are not recognized and act like any other character that is not a valid digit. </p> <h4 id="example_Int_SetString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">i := new(big.Int)
+i.SetString("644", 8) // octal
+fmt.Println(i)
+</pre> <p>Output:</p> <pre class="output" data-language="go">420
+</pre> <h3 id="Int.SetUint64">func (*Int) <span>SetUint64</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (z *Int) SetUint64(x uint64) *Int</pre> <p>SetUint64 sets z to x and returns z. </p>
+<h3 id="Int.Sign">func (*Int) <span>Sign</span> </h3> <pre data-language="go">func (x *Int) Sign() int</pre> <p>Sign returns: </p>
+<pre data-language="go">-1 if x &lt; 0
+ 0 if x == 0
++1 if x &gt; 0
+</pre> <h3 id="Int.Sqrt">func (*Int) <span>Sqrt</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (z *Int) Sqrt(x *Int) *Int</pre> <p>Sqrt sets z to ⌊√x⌋, the largest integer such that z² ≤ x, and returns z. It panics if x is negative. </p>
+<h3 id="Int.String">func (*Int) <span>String</span> </h3> <pre data-language="go">func (x *Int) String() string</pre> <p>String returns the decimal representation of x as generated by x.Text(10). </p>
+<h3 id="Int.Sub">func (*Int) <span>Sub</span> </h3> <pre data-language="go">func (z *Int) Sub(x, y *Int) *Int</pre> <p>Sub sets z to the difference x-y and returns z. </p>
+<h3 id="Int.Text">func (*Int) <span>Text</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (x *Int) Text(base int) string</pre> <p>Text returns the string representation of x in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string. If x is a nil pointer it returns "&lt;nil&gt;". </p>
+<h3 id="Int.TrailingZeroBits">func (*Int) <span>TrailingZeroBits</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (x *Int) TrailingZeroBits() uint</pre> <p>TrailingZeroBits returns the number of consecutive least significant zero bits of |x|. </p>
+<h3 id="Int.Uint64">func (*Int) <span>Uint64</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (x *Int) Uint64() uint64</pre> <p>Uint64 returns the uint64 representation of x. If x cannot be represented in a uint64, the result is undefined. </p>
+<h3 id="Int.UnmarshalJSON">func (*Int) <span>UnmarshalJSON</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (z *Int) UnmarshalJSON(text []byte) error</pre> <p>UnmarshalJSON implements the <span>encoding/json.Unmarshaler</span> interface. </p>
+<h3 id="Int.UnmarshalText">func (*Int) <span>UnmarshalText</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (z *Int) UnmarshalText(text []byte) error</pre> <p>UnmarshalText implements the <span>encoding.TextUnmarshaler</span> interface. </p>
+<h3 id="Int.Xor">func (*Int) <span>Xor</span> </h3> <pre data-language="go">func (z *Int) Xor(x, y *Int) *Int</pre> <p>Xor sets z = x ^ y and returns z. </p>
+<h2 id="Rat">type <span>Rat</span> </h2> <p>A Rat represents a quotient a/b of arbitrary precision. The zero value for a Rat represents the value 0. </p>
+<p>Operations always take pointer arguments (*Rat) rather than Rat values, and each unique Rat value requires its own unique *Rat pointer. To "copy" a Rat value, an existing (or newly allocated) Rat must be set to a new value using the <a href="#Rat.Set">Rat.Set</a> method; shallow copies of Rats are not supported and may lead to errors. </p>
+<pre data-language="go">type Rat struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewRat">func <span>NewRat</span> </h3> <pre data-language="go">func NewRat(a, b int64) *Rat</pre> <p>NewRat creates a new <a href="#Rat">Rat</a> with numerator a and denominator b. </p>
+<h3 id="Rat.Abs">func (*Rat) <span>Abs</span> </h3> <pre data-language="go">func (z *Rat) Abs(x *Rat) *Rat</pre> <p>Abs sets z to |x| (the absolute value of x) and returns z. </p>
+<h3 id="Rat.Add">func (*Rat) <span>Add</span> </h3> <pre data-language="go">func (z *Rat) Add(x, y *Rat) *Rat</pre> <p>Add sets z to the sum x+y and returns z. </p>
+<h3 id="Rat.Cmp">func (*Rat) <span>Cmp</span> </h3> <pre data-language="go">func (x *Rat) Cmp(y *Rat) int</pre> <p>Cmp compares x and y and returns: </p>
+<pre data-language="go">-1 if x &lt; y
+ 0 if x == y
++1 if x &gt; y
+</pre> <h3 id="Rat.Denom">func (*Rat) <span>Denom</span> </h3> <pre data-language="go">func (x *Rat) Denom() *Int</pre> <p>Denom returns the denominator of x; it is always &gt; 0. The result is a reference to x's denominator, unless x is an uninitialized (zero value) <a href="#Rat">Rat</a>, in which case the result is a new <a href="#Int">Int</a> of value 1. (To initialize x, any operation that sets x will do, including x.Set(x).) If the result is a reference to x's denominator it may change if a new value is assigned to x, and vice versa. </p>
+<h3 id="Rat.Float32">func (*Rat) <span>Float32</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (x *Rat) Float32() (f float32, exact bool)</pre> <p>Float32 returns the nearest float32 value for x and a bool indicating whether f represents x exactly. If the magnitude of x is too large to be represented by a float32, f is an infinity and exact is false. The sign of f always matches the sign of x, even if f == 0. </p>
+<h3 id="Rat.Float64">func (*Rat) <span>Float64</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (x *Rat) Float64() (f float64, exact bool)</pre> <p>Float64 returns the nearest float64 value for x and a bool indicating whether f represents x exactly. If the magnitude of x is too large to be represented by a float64, f is an infinity and exact is false. The sign of f always matches the sign of x, even if f == 0. </p>
+<h3 id="Rat.FloatPrec">func (*Rat) <span>FloatPrec</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (x *Rat) FloatPrec() (n int, exact bool)</pre> <p>FloatPrec returns the number n of non-repeating digits immediately following the decimal point of the decimal representation of x. The boolean result indicates whether a decimal representation of x with that many fractional digits is exact or rounded. </p>
+<p>Examples: </p>
+<pre data-language="go">x n exact decimal representation n fractional digits
+0 0 true 0
+1 0 true 1
+1/2 1 true 0.5
+1/3 0 false 0 (0.333... rounded)
+1/4 2 true 0.25
+1/6 1 false 0.2 (0.166... rounded)
+</pre> <h3 id="Rat.FloatString">func (*Rat) <span>FloatString</span> </h3> <pre data-language="go">func (x *Rat) FloatString(prec int) string</pre> <p>FloatString returns a string representation of x in decimal form with prec digits of precision after the radix point. The last digit is rounded to nearest, with halves rounded away from zero. </p>
+<h3 id="Rat.GobDecode">func (*Rat) <span>GobDecode</span> </h3> <pre data-language="go">func (z *Rat) GobDecode(buf []byte) error</pre> <p>GobDecode implements the <span>encoding/gob.GobDecoder</span> interface. </p>
+<h3 id="Rat.GobEncode">func (*Rat) <span>GobEncode</span> </h3> <pre data-language="go">func (x *Rat) GobEncode() ([]byte, error)</pre> <p>GobEncode implements the <span>encoding/gob.GobEncoder</span> interface. </p>
+<h3 id="Rat.Inv">func (*Rat) <span>Inv</span> </h3> <pre data-language="go">func (z *Rat) Inv(x *Rat) *Rat</pre> <p>Inv sets z to 1/x and returns z. If x == 0, Inv panics. </p>
+<h3 id="Rat.IsInt">func (*Rat) <span>IsInt</span> </h3> <pre data-language="go">func (x *Rat) IsInt() bool</pre> <p>IsInt reports whether the denominator of x is 1. </p>
+<h3 id="Rat.MarshalText">func (*Rat) <span>MarshalText</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (x *Rat) MarshalText() (text []byte, err error)</pre> <p>MarshalText implements the <span>encoding.TextMarshaler</span> interface. </p>
+<h3 id="Rat.Mul">func (*Rat) <span>Mul</span> </h3> <pre data-language="go">func (z *Rat) Mul(x, y *Rat) *Rat</pre> <p>Mul sets z to the product x*y and returns z. </p>
+<h3 id="Rat.Neg">func (*Rat) <span>Neg</span> </h3> <pre data-language="go">func (z *Rat) Neg(x *Rat) *Rat</pre> <p>Neg sets z to -x and returns z. </p>
+<h3 id="Rat.Num">func (*Rat) <span>Num</span> </h3> <pre data-language="go">func (x *Rat) Num() *Int</pre> <p>Num returns the numerator of x; it may be &lt;= 0. The result is a reference to x's numerator; it may change if a new value is assigned to x, and vice versa. The sign of the numerator corresponds to the sign of x. </p>
+<h3 id="Rat.Quo">func (*Rat) <span>Quo</span> </h3> <pre data-language="go">func (z *Rat) Quo(x, y *Rat) *Rat</pre> <p>Quo sets z to the quotient x/y and returns z. If y == 0, Quo panics. </p>
+<h3 id="Rat.RatString">func (*Rat) <span>RatString</span> </h3> <pre data-language="go">func (x *Rat) RatString() string</pre> <p>RatString returns a string representation of x in the form "a/b" if b != 1, and in the form "a" if b == 1. </p>
+<h3 id="Rat.Scan">func (*Rat) <span>Scan</span> </h3> <pre data-language="go">func (z *Rat) Scan(s fmt.ScanState, ch rune) error</pre> <p>Scan is a support routine for fmt.Scanner. It accepts the formats 'e', 'E', 'f', 'F', 'g', 'G', and 'v'. All formats are equivalent. </p> <h4 id="example_Rat_Scan"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// The Scan function is rarely used directly;
+// the fmt package recognizes it as an implementation of fmt.Scanner.
+r := new(big.Rat)
+_, err := fmt.Sscan("1.5000", r)
+if err != nil {
+ log.Println("error scanning value:", err)
+} else {
+ fmt.Println(r)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">3/2
+</pre> <h3 id="Rat.Set">func (*Rat) <span>Set</span> </h3> <pre data-language="go">func (z *Rat) Set(x *Rat) *Rat</pre> <p>Set sets z to x (by making a copy of x) and returns z. </p>
+<h3 id="Rat.SetFloat64">func (*Rat) <span>SetFloat64</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (z *Rat) SetFloat64(f float64) *Rat</pre> <p>SetFloat64 sets z to exactly f and returns z. If f is not finite, SetFloat returns nil. </p>
+<h3 id="Rat.SetFrac">func (*Rat) <span>SetFrac</span> </h3> <pre data-language="go">func (z *Rat) SetFrac(a, b *Int) *Rat</pre> <p>SetFrac sets z to a/b and returns z. If b == 0, SetFrac panics. </p>
+<h3 id="Rat.SetFrac64">func (*Rat) <span>SetFrac64</span> </h3> <pre data-language="go">func (z *Rat) SetFrac64(a, b int64) *Rat</pre> <p>SetFrac64 sets z to a/b and returns z. If b == 0, SetFrac64 panics. </p>
+<h3 id="Rat.SetInt">func (*Rat) <span>SetInt</span> </h3> <pre data-language="go">func (z *Rat) SetInt(x *Int) *Rat</pre> <p>SetInt sets z to x (by making a copy of x) and returns z. </p>
+<h3 id="Rat.SetInt64">func (*Rat) <span>SetInt64</span> </h3> <pre data-language="go">func (z *Rat) SetInt64(x int64) *Rat</pre> <p>SetInt64 sets z to x and returns z. </p>
+<h3 id="Rat.SetString">func (*Rat) <span>SetString</span> </h3> <pre data-language="go">func (z *Rat) SetString(s string) (*Rat, bool)</pre> <p>SetString sets z to the value of s and returns z and a boolean indicating success. s can be given as a (possibly signed) fraction "a/b", or as a floating-point number optionally followed by an exponent. If a fraction is provided, both the dividend and the divisor may be a decimal integer or independently use a prefix of “0b”, “0” or “0o”, or “0x” (or their upper-case variants) to denote a binary, octal, or hexadecimal integer, respectively. The divisor may not be signed. If a floating-point number is provided, it may be in decimal form or use any of the same prefixes as above but for “0” to denote a non-decimal mantissa. A leading “0” is considered a decimal leading 0; it does not indicate octal representation in this case. An optional base-10 “e” or base-2 “p” (or their upper-case variants) exponent may be provided as well, except for hexadecimal floats which only accept an (optional) “p” exponent (because an “e” or “E” cannot be distinguished from a mantissa digit). If the exponent's absolute value is too large, the operation may fail. The entire string, not just a prefix, must be valid for success. If the operation failed, the value of z is undefined but the returned value is nil. </p> <h4 id="example_Rat_SetString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := new(big.Rat)
+r.SetString("355/113")
+fmt.Println(r.FloatString(3))
+</pre> <p>Output:</p> <pre class="output" data-language="go">3.142
+</pre> <h3 id="Rat.SetUint64">func (*Rat) <span>SetUint64</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (z *Rat) SetUint64(x uint64) *Rat</pre> <p>SetUint64 sets z to x and returns z. </p>
+<h3 id="Rat.Sign">func (*Rat) <span>Sign</span> </h3> <pre data-language="go">func (x *Rat) Sign() int</pre> <p>Sign returns: </p>
+<pre data-language="go">-1 if x &lt; 0
+ 0 if x == 0
++1 if x &gt; 0
+</pre> <h3 id="Rat.String">func (*Rat) <span>String</span> </h3> <pre data-language="go">func (x *Rat) String() string</pre> <p>String returns a string representation of x in the form "a/b" (even if b == 1). </p>
+<h3 id="Rat.Sub">func (*Rat) <span>Sub</span> </h3> <pre data-language="go">func (z *Rat) Sub(x, y *Rat) *Rat</pre> <p>Sub sets z to the difference x-y and returns z. </p>
+<h3 id="Rat.UnmarshalText">func (*Rat) <span>UnmarshalText</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (z *Rat) UnmarshalText(text []byte) error</pre> <p>UnmarshalText implements the <span>encoding.TextUnmarshaler</span> interface. </p>
+<h2 id="RoundingMode">type <span>RoundingMode</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>RoundingMode determines how a <a href="#Float">Float</a> value is rounded to the desired precision. Rounding may change the <a href="#Float">Float</a> value; the rounding error is described by the <a href="#Float">Float</a>'s <a href="#Accuracy">Accuracy</a>. </p>
+<pre data-language="go">type RoundingMode byte</pre> <p>These constants define supported rounding modes. </p>
+<pre data-language="go">const (
+ ToNearestEven RoundingMode = iota // == IEEE 754-2008 roundTiesToEven
+ ToNearestAway // == IEEE 754-2008 roundTiesToAway
+ ToZero // == IEEE 754-2008 roundTowardZero
+ AwayFromZero // no IEEE 754-2008 equivalent
+ ToNegativeInf // == IEEE 754-2008 roundTowardNegative
+ ToPositiveInf // == IEEE 754-2008 roundTowardPositive
+)</pre> <h4 id="example_RoundingMode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">operands := []float64{2.6, 2.5, 2.1, -2.1, -2.5, -2.6}
+
+fmt.Print(" x")
+for mode := big.ToNearestEven; mode &lt;= big.ToPositiveInf; mode++ {
+ fmt.Printf(" %s", mode)
+}
+fmt.Println()
+
+for _, f64 := range operands {
+ fmt.Printf("%4g", f64)
+ for mode := big.ToNearestEven; mode &lt;= big.ToPositiveInf; mode++ {
+ // sample operands above require 2 bits to represent mantissa
+ // set binary precision to 2 to round them to integer values
+ f := new(big.Float).SetPrec(2).SetMode(mode).SetFloat64(f64)
+ fmt.Printf(" %*g", len(mode.String()), f)
+ }
+ fmt.Println()
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go"> x ToNearestEven ToNearestAway ToZero AwayFromZero ToNegativeInf ToPositiveInf
+ 2.6 3 3 2 3 2 3
+ 2.5 2 3 2 3 2 3
+ 2.1 2 2 2 3 2 3
+-2.1 -2 -2 -2 -3 -3 -2
+-2.5 -2 -3 -2 -3 -3 -2
+-2.6 -3 -3 -2 -3 -3 -2
+</pre> <h3 id="RoundingMode.String">func (RoundingMode) <span>String</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (i RoundingMode) String() string</pre> <h2 id="Word">type <span>Word</span> </h2> <p>A Word represents a single digit of a multi-precision unsigned integer. </p>
+<pre data-language="go">type Word uint</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/math/big/" class="_attribution-link">http://golang.org/pkg/math/big/</a>
+ </p>
+</div>
diff --git a/devdocs/go/math%2Fbits%2Findex.html b/devdocs/go/math%2Fbits%2Findex.html
new file mode 100644
index 00000000..e0461437
--- /dev/null
+++ b/devdocs/go/math%2Fbits%2Findex.html
@@ -0,0 +1,377 @@
+<h1> Package bits </h1> <ul id="short-nav">
+<li><code>import "math/bits"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package bits implements bit counting and manipulation functions for the predeclared unsigned integer types. </p>
+<p>Functions in this package may be implemented directly by the compiler, for better performance. For those functions the code in this package will not be used. Which functions are implemented by the compiler depends on the architecture and the Go release. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Add">func Add(x, y, carry uint) (sum, carryOut uint)</a></li>
+<li><a href="#Add32">func Add32(x, y, carry uint32) (sum, carryOut uint32)</a></li>
+<li><a href="#Add64">func Add64(x, y, carry uint64) (sum, carryOut uint64)</a></li>
+<li><a href="#Div">func Div(hi, lo, y uint) (quo, rem uint)</a></li>
+<li><a href="#Div32">func Div32(hi, lo, y uint32) (quo, rem uint32)</a></li>
+<li><a href="#Div64">func Div64(hi, lo, y uint64) (quo, rem uint64)</a></li>
+<li><a href="#LeadingZeros">func LeadingZeros(x uint) int</a></li>
+<li><a href="#LeadingZeros16">func LeadingZeros16(x uint16) int</a></li>
+<li><a href="#LeadingZeros32">func LeadingZeros32(x uint32) int</a></li>
+<li><a href="#LeadingZeros64">func LeadingZeros64(x uint64) int</a></li>
+<li><a href="#LeadingZeros8">func LeadingZeros8(x uint8) int</a></li>
+<li><a href="#Len">func Len(x uint) int</a></li>
+<li><a href="#Len16">func Len16(x uint16) (n int)</a></li>
+<li><a href="#Len32">func Len32(x uint32) (n int)</a></li>
+<li><a href="#Len64">func Len64(x uint64) (n int)</a></li>
+<li><a href="#Len8">func Len8(x uint8) int</a></li>
+<li><a href="#Mul">func Mul(x, y uint) (hi, lo uint)</a></li>
+<li><a href="#Mul32">func Mul32(x, y uint32) (hi, lo uint32)</a></li>
+<li><a href="#Mul64">func Mul64(x, y uint64) (hi, lo uint64)</a></li>
+<li><a href="#OnesCount">func OnesCount(x uint) int</a></li>
+<li><a href="#OnesCount16">func OnesCount16(x uint16) int</a></li>
+<li><a href="#OnesCount32">func OnesCount32(x uint32) int</a></li>
+<li><a href="#OnesCount64">func OnesCount64(x uint64) int</a></li>
+<li><a href="#OnesCount8">func OnesCount8(x uint8) int</a></li>
+<li><a href="#Rem">func Rem(hi, lo, y uint) uint</a></li>
+<li><a href="#Rem32">func Rem32(hi, lo, y uint32) uint32</a></li>
+<li><a href="#Rem64">func Rem64(hi, lo, y uint64) uint64</a></li>
+<li><a href="#Reverse">func Reverse(x uint) uint</a></li>
+<li><a href="#Reverse16">func Reverse16(x uint16) uint16</a></li>
+<li><a href="#Reverse32">func Reverse32(x uint32) uint32</a></li>
+<li><a href="#Reverse64">func Reverse64(x uint64) uint64</a></li>
+<li><a href="#Reverse8">func Reverse8(x uint8) uint8</a></li>
+<li><a href="#ReverseBytes">func ReverseBytes(x uint) uint</a></li>
+<li><a href="#ReverseBytes16">func ReverseBytes16(x uint16) uint16</a></li>
+<li><a href="#ReverseBytes32">func ReverseBytes32(x uint32) uint32</a></li>
+<li><a href="#ReverseBytes64">func ReverseBytes64(x uint64) uint64</a></li>
+<li><a href="#RotateLeft">func RotateLeft(x uint, k int) uint</a></li>
+<li><a href="#RotateLeft16">func RotateLeft16(x uint16, k int) uint16</a></li>
+<li><a href="#RotateLeft32">func RotateLeft32(x uint32, k int) uint32</a></li>
+<li><a href="#RotateLeft64">func RotateLeft64(x uint64, k int) uint64</a></li>
+<li><a href="#RotateLeft8">func RotateLeft8(x uint8, k int) uint8</a></li>
+<li><a href="#Sub">func Sub(x, y, borrow uint) (diff, borrowOut uint)</a></li>
+<li><a href="#Sub32">func Sub32(x, y, borrow uint32) (diff, borrowOut uint32)</a></li>
+<li><a href="#Sub64">func Sub64(x, y, borrow uint64) (diff, borrowOut uint64)</a></li>
+<li><a href="#TrailingZeros">func TrailingZeros(x uint) int</a></li>
+<li><a href="#TrailingZeros16">func TrailingZeros16(x uint16) int</a></li>
+<li><a href="#TrailingZeros32">func TrailingZeros32(x uint32) int</a></li>
+<li><a href="#TrailingZeros64">func TrailingZeros64(x uint64) int</a></li>
+<li><a href="#TrailingZeros8">func TrailingZeros8(x uint8) int</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Add32">Add32</a></dd> <dd><a class="exampleLink" href="#example_Add64">Add64</a></dd> <dd><a class="exampleLink" href="#example_Div32">Div32</a></dd> <dd><a class="exampleLink" href="#example_Div64">Div64</a></dd> <dd><a class="exampleLink" href="#example_LeadingZeros16">LeadingZeros16</a></dd> <dd><a class="exampleLink" href="#example_LeadingZeros32">LeadingZeros32</a></dd> <dd><a class="exampleLink" href="#example_LeadingZeros64">LeadingZeros64</a></dd> <dd><a class="exampleLink" href="#example_LeadingZeros8">LeadingZeros8</a></dd> <dd><a class="exampleLink" href="#example_Len16">Len16</a></dd> <dd><a class="exampleLink" href="#example_Len32">Len32</a></dd> <dd><a class="exampleLink" href="#example_Len64">Len64</a></dd> <dd><a class="exampleLink" href="#example_Len8">Len8</a></dd> <dd><a class="exampleLink" href="#example_Mul32">Mul32</a></dd> <dd><a class="exampleLink" href="#example_Mul64">Mul64</a></dd> <dd><a class="exampleLink" href="#example_OnesCount">OnesCount</a></dd> <dd><a class="exampleLink" href="#example_OnesCount16">OnesCount16</a></dd> <dd><a class="exampleLink" href="#example_OnesCount32">OnesCount32</a></dd> <dd><a class="exampleLink" href="#example_OnesCount64">OnesCount64</a></dd> <dd><a class="exampleLink" href="#example_OnesCount8">OnesCount8</a></dd> <dd><a class="exampleLink" href="#example_Reverse16">Reverse16</a></dd> <dd><a class="exampleLink" href="#example_Reverse32">Reverse32</a></dd> <dd><a class="exampleLink" href="#example_Reverse64">Reverse64</a></dd> <dd><a class="exampleLink" href="#example_Reverse8">Reverse8</a></dd> <dd><a class="exampleLink" href="#example_ReverseBytes16">ReverseBytes16</a></dd> <dd><a class="exampleLink" href="#example_ReverseBytes32">ReverseBytes32</a></dd> <dd><a class="exampleLink" href="#example_ReverseBytes64">ReverseBytes64</a></dd> <dd><a class="exampleLink" href="#example_RotateLeft16">RotateLeft16</a></dd> <dd><a class="exampleLink" href="#example_RotateLeft32">RotateLeft32</a></dd> <dd><a class="exampleLink" href="#example_RotateLeft64">RotateLeft64</a></dd> <dd><a class="exampleLink" href="#example_RotateLeft8">RotateLeft8</a></dd> <dd><a class="exampleLink" href="#example_Sub32">Sub32</a></dd> <dd><a class="exampleLink" href="#example_Sub64">Sub64</a></dd> <dd><a class="exampleLink" href="#example_TrailingZeros16">TrailingZeros16</a></dd> <dd><a class="exampleLink" href="#example_TrailingZeros32">TrailingZeros32</a></dd> <dd><a class="exampleLink" href="#example_TrailingZeros64">TrailingZeros64</a></dd> <dd><a class="exampleLink" href="#example_TrailingZeros8">TrailingZeros8</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>bits.go</span> <span>bits_errors.go</span> <span>bits_tables.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>UintSize is the size of a uint in bits. </p>
+<pre data-language="go">const UintSize = uintSize</pre> <h2 id="Add">func <span>Add</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Add(x, y, carry uint) (sum, carryOut uint)</pre> <p>Add returns the sum with carry of x, y and carry: sum = x + y + carry. The carry input must be 0 or 1; otherwise the behavior is undefined. The carryOut output is guaranteed to be 0 or 1. </p>
+<p>This function's execution time does not depend on the inputs. </p>
+<h2 id="Add32">func <span>Add32</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Add32(x, y, carry uint32) (sum, carryOut uint32)</pre> <p>Add32 returns the sum with carry of x, y and carry: sum = x + y + carry. The carry input must be 0 or 1; otherwise the behavior is undefined. The carryOut output is guaranteed to be 0 or 1. </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_Add32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// First number is 33&lt;&lt;32 + 12
+n1 := []uint32{33, 12}
+// Second number is 21&lt;&lt;32 + 23
+n2 := []uint32{21, 23}
+// Add them together without producing carry.
+d1, carry := bits.Add32(n1[1], n2[1], 0)
+d0, _ := bits.Add32(n1[0], n2[0], carry)
+nsum := []uint32{d0, d1}
+fmt.Printf("%v + %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
+
+// First number is 1&lt;&lt;32 + 2147483648
+n1 = []uint32{1, 0x80000000}
+// Second number is 1&lt;&lt;32 + 2147483648
+n2 = []uint32{1, 0x80000000}
+// Add them together producing carry.
+d1, carry = bits.Add32(n1[1], n2[1], 0)
+d0, _ = bits.Add32(n1[0], n2[0], carry)
+nsum = []uint32{d0, d1}
+fmt.Printf("%v + %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[33 12] + [21 23] = [54 35] (carry bit was 0)
+[1 2147483648] + [1 2147483648] = [3 0] (carry bit was 1)
+</pre> <h2 id="Add64">func <span>Add64</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Add64(x, y, carry uint64) (sum, carryOut uint64)</pre> <p>Add64 returns the sum with carry of x, y and carry: sum = x + y + carry. The carry input must be 0 or 1; otherwise the behavior is undefined. The carryOut output is guaranteed to be 0 or 1. </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_Add64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// First number is 33&lt;&lt;64 + 12
+n1 := []uint64{33, 12}
+// Second number is 21&lt;&lt;64 + 23
+n2 := []uint64{21, 23}
+// Add them together without producing carry.
+d1, carry := bits.Add64(n1[1], n2[1], 0)
+d0, _ := bits.Add64(n1[0], n2[0], carry)
+nsum := []uint64{d0, d1}
+fmt.Printf("%v + %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
+
+// First number is 1&lt;&lt;64 + 9223372036854775808
+n1 = []uint64{1, 0x8000000000000000}
+// Second number is 1&lt;&lt;64 + 9223372036854775808
+n2 = []uint64{1, 0x8000000000000000}
+// Add them together producing carry.
+d1, carry = bits.Add64(n1[1], n2[1], 0)
+d0, _ = bits.Add64(n1[0], n2[0], carry)
+nsum = []uint64{d0, d1}
+fmt.Printf("%v + %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[33 12] + [21 23] = [54 35] (carry bit was 0)
+[1 9223372036854775808] + [1 9223372036854775808] = [3 0] (carry bit was 1)
+</pre> <h2 id="Div">func <span>Div</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Div(hi, lo, y uint) (quo, rem uint)</pre> <p>Div returns the quotient and remainder of (hi, lo) divided by y: quo = (hi, lo)/y, rem = (hi, lo)%y with the dividend bits' upper half in parameter hi and the lower half in parameter lo. Div panics for y == 0 (division by zero) or y &lt;= hi (quotient overflow). </p>
+<h2 id="Div32">func <span>Div32</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Div32(hi, lo, y uint32) (quo, rem uint32)</pre> <p>Div32 returns the quotient and remainder of (hi, lo) divided by y: quo = (hi, lo)/y, rem = (hi, lo)%y with the dividend bits' upper half in parameter hi and the lower half in parameter lo. Div32 panics for y == 0 (division by zero) or y &lt;= hi (quotient overflow). </p> <h4 id="example_Div32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// First number is 0&lt;&lt;32 + 6
+n1 := []uint32{0, 6}
+// Second number is 0&lt;&lt;32 + 3
+n2 := []uint32{0, 3}
+// Divide them together.
+quo, rem := bits.Div32(n1[0], n1[1], n2[1])
+nsum := []uint32{quo, rem}
+fmt.Printf("[%v %v] / %v = %v\n", n1[0], n1[1], n2[1], nsum)
+
+// First number is 2&lt;&lt;32 + 2147483648
+n1 = []uint32{2, 0x80000000}
+// Second number is 0&lt;&lt;32 + 2147483648
+n2 = []uint32{0, 0x80000000}
+// Divide them together.
+quo, rem = bits.Div32(n1[0], n1[1], n2[1])
+nsum = []uint32{quo, rem}
+fmt.Printf("[%v %v] / %v = %v\n", n1[0], n1[1], n2[1], nsum)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[0 6] / 3 = [2 0]
+[2 2147483648] / 2147483648 = [5 0]
+</pre> <h2 id="Div64">func <span>Div64</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Div64(hi, lo, y uint64) (quo, rem uint64)</pre> <p>Div64 returns the quotient and remainder of (hi, lo) divided by y: quo = (hi, lo)/y, rem = (hi, lo)%y with the dividend bits' upper half in parameter hi and the lower half in parameter lo. Div64 panics for y == 0 (division by zero) or y &lt;= hi (quotient overflow). </p> <h4 id="example_Div64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// First number is 0&lt;&lt;64 + 6
+n1 := []uint64{0, 6}
+// Second number is 0&lt;&lt;64 + 3
+n2 := []uint64{0, 3}
+// Divide them together.
+quo, rem := bits.Div64(n1[0], n1[1], n2[1])
+nsum := []uint64{quo, rem}
+fmt.Printf("[%v %v] / %v = %v\n", n1[0], n1[1], n2[1], nsum)
+
+// First number is 2&lt;&lt;64 + 9223372036854775808
+n1 = []uint64{2, 0x8000000000000000}
+// Second number is 0&lt;&lt;64 + 9223372036854775808
+n2 = []uint64{0, 0x8000000000000000}
+// Divide them together.
+quo, rem = bits.Div64(n1[0], n1[1], n2[1])
+nsum = []uint64{quo, rem}
+fmt.Printf("[%v %v] / %v = %v\n", n1[0], n1[1], n2[1], nsum)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[0 6] / 3 = [2 0]
+[2 9223372036854775808] / 9223372036854775808 = [5 0]
+</pre> <h2 id="LeadingZeros">func <span>LeadingZeros</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func LeadingZeros(x uint) int</pre> <p>LeadingZeros returns the number of leading zero bits in x; the result is <a href="#UintSize">UintSize</a> for x == 0. </p>
+<h2 id="LeadingZeros16">func <span>LeadingZeros16</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func LeadingZeros16(x uint16) int</pre> <p>LeadingZeros16 returns the number of leading zero bits in x; the result is 16 for x == 0. </p> <h4 id="example_LeadingZeros16"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("LeadingZeros16(%016b) = %d\n", 1, bits.LeadingZeros16(1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">LeadingZeros16(0000000000000001) = 15
+</pre> <h2 id="LeadingZeros32">func <span>LeadingZeros32</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func LeadingZeros32(x uint32) int</pre> <p>LeadingZeros32 returns the number of leading zero bits in x; the result is 32 for x == 0. </p> <h4 id="example_LeadingZeros32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("LeadingZeros32(%032b) = %d\n", 1, bits.LeadingZeros32(1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">LeadingZeros32(00000000000000000000000000000001) = 31
+</pre> <h2 id="LeadingZeros64">func <span>LeadingZeros64</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func LeadingZeros64(x uint64) int</pre> <p>LeadingZeros64 returns the number of leading zero bits in x; the result is 64 for x == 0. </p> <h4 id="example_LeadingZeros64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("LeadingZeros64(%064b) = %d\n", 1, bits.LeadingZeros64(1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">LeadingZeros64(0000000000000000000000000000000000000000000000000000000000000001) = 63
+</pre> <h2 id="LeadingZeros8">func <span>LeadingZeros8</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func LeadingZeros8(x uint8) int</pre> <p>LeadingZeros8 returns the number of leading zero bits in x; the result is 8 for x == 0. </p> <h4 id="example_LeadingZeros8"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("LeadingZeros8(%08b) = %d\n", 1, bits.LeadingZeros8(1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">LeadingZeros8(00000001) = 7
+</pre> <h2 id="Len">func <span>Len</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Len(x uint) int</pre> <p>Len returns the minimum number of bits required to represent x; the result is 0 for x == 0. </p>
+<h2 id="Len16">func <span>Len16</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Len16(x uint16) (n int)</pre> <p>Len16 returns the minimum number of bits required to represent x; the result is 0 for x == 0. </p> <h4 id="example_Len16"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("Len16(%016b) = %d\n", 8, bits.Len16(8))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Len16(0000000000001000) = 4
+</pre> <h2 id="Len32">func <span>Len32</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Len32(x uint32) (n int)</pre> <p>Len32 returns the minimum number of bits required to represent x; the result is 0 for x == 0. </p> <h4 id="example_Len32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("Len32(%032b) = %d\n", 8, bits.Len32(8))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Len32(00000000000000000000000000001000) = 4
+</pre> <h2 id="Len64">func <span>Len64</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Len64(x uint64) (n int)</pre> <p>Len64 returns the minimum number of bits required to represent x; the result is 0 for x == 0. </p> <h4 id="example_Len64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("Len64(%064b) = %d\n", 8, bits.Len64(8))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Len64(0000000000000000000000000000000000000000000000000000000000001000) = 4
+</pre> <h2 id="Len8">func <span>Len8</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Len8(x uint8) int</pre> <p>Len8 returns the minimum number of bits required to represent x; the result is 0 for x == 0. </p> <h4 id="example_Len8"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("Len8(%08b) = %d\n", 8, bits.Len8(8))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Len8(00001000) = 4
+</pre> <h2 id="Mul">func <span>Mul</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Mul(x, y uint) (hi, lo uint)</pre> <p>Mul returns the full-width product of x and y: (hi, lo) = x * y with the product bits' upper half returned in hi and the lower half returned in lo. </p>
+<p>This function's execution time does not depend on the inputs. </p>
+<h2 id="Mul32">func <span>Mul32</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Mul32(x, y uint32) (hi, lo uint32)</pre> <p>Mul32 returns the 64-bit product of x and y: (hi, lo) = x * y with the product bits' upper half returned in hi and the lower half returned in lo. </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_Mul32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// First number is 0&lt;&lt;32 + 12
+n1 := []uint32{0, 12}
+// Second number is 0&lt;&lt;32 + 12
+n2 := []uint32{0, 12}
+// Multiply them together without producing overflow.
+hi, lo := bits.Mul32(n1[1], n2[1])
+nsum := []uint32{hi, lo}
+fmt.Printf("%v * %v = %v\n", n1[1], n2[1], nsum)
+
+// First number is 0&lt;&lt;32 + 2147483648
+n1 = []uint32{0, 0x80000000}
+// Second number is 0&lt;&lt;32 + 2
+n2 = []uint32{0, 2}
+// Multiply them together producing overflow.
+hi, lo = bits.Mul32(n1[1], n2[1])
+nsum = []uint32{hi, lo}
+fmt.Printf("%v * %v = %v\n", n1[1], n2[1], nsum)
+</pre> <p>Output:</p> <pre class="output" data-language="go">12 * 12 = [0 144]
+2147483648 * 2 = [1 0]
+</pre> <h2 id="Mul64">func <span>Mul64</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Mul64(x, y uint64) (hi, lo uint64)</pre> <p>Mul64 returns the 128-bit product of x and y: (hi, lo) = x * y with the product bits' upper half returned in hi and the lower half returned in lo. </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_Mul64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// First number is 0&lt;&lt;64 + 12
+n1 := []uint64{0, 12}
+// Second number is 0&lt;&lt;64 + 12
+n2 := []uint64{0, 12}
+// Multiply them together without producing overflow.
+hi, lo := bits.Mul64(n1[1], n2[1])
+nsum := []uint64{hi, lo}
+fmt.Printf("%v * %v = %v\n", n1[1], n2[1], nsum)
+
+// First number is 0&lt;&lt;64 + 9223372036854775808
+n1 = []uint64{0, 0x8000000000000000}
+// Second number is 0&lt;&lt;64 + 2
+n2 = []uint64{0, 2}
+// Multiply them together producing overflow.
+hi, lo = bits.Mul64(n1[1], n2[1])
+nsum = []uint64{hi, lo}
+fmt.Printf("%v * %v = %v\n", n1[1], n2[1], nsum)
+</pre> <p>Output:</p> <pre class="output" data-language="go">12 * 12 = [0 144]
+9223372036854775808 * 2 = [1 0]
+</pre> <h2 id="OnesCount">func <span>OnesCount</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func OnesCount(x uint) int</pre> <p>OnesCount returns the number of one bits ("population count") in x. </p> <h4 id="example_OnesCount"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("OnesCount(%b) = %d\n", 14, bits.OnesCount(14))
+</pre> <p>Output:</p> <pre class="output" data-language="go">OnesCount(1110) = 3
+</pre> <h2 id="OnesCount16">func <span>OnesCount16</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func OnesCount16(x uint16) int</pre> <p>OnesCount16 returns the number of one bits ("population count") in x. </p> <h4 id="example_OnesCount16"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("OnesCount16(%016b) = %d\n", 14, bits.OnesCount16(14))
+</pre> <p>Output:</p> <pre class="output" data-language="go">OnesCount16(0000000000001110) = 3
+</pre> <h2 id="OnesCount32">func <span>OnesCount32</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func OnesCount32(x uint32) int</pre> <p>OnesCount32 returns the number of one bits ("population count") in x. </p> <h4 id="example_OnesCount32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("OnesCount32(%032b) = %d\n", 14, bits.OnesCount32(14))
+</pre> <p>Output:</p> <pre class="output" data-language="go">OnesCount32(00000000000000000000000000001110) = 3
+</pre> <h2 id="OnesCount64">func <span>OnesCount64</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func OnesCount64(x uint64) int</pre> <p>OnesCount64 returns the number of one bits ("population count") in x. </p> <h4 id="example_OnesCount64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("OnesCount64(%064b) = %d\n", 14, bits.OnesCount64(14))
+</pre> <p>Output:</p> <pre class="output" data-language="go">OnesCount64(0000000000000000000000000000000000000000000000000000000000001110) = 3
+</pre> <h2 id="OnesCount8">func <span>OnesCount8</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func OnesCount8(x uint8) int</pre> <p>OnesCount8 returns the number of one bits ("population count") in x. </p> <h4 id="example_OnesCount8"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("OnesCount8(%08b) = %d\n", 14, bits.OnesCount8(14))
+</pre> <p>Output:</p> <pre class="output" data-language="go">OnesCount8(00001110) = 3
+</pre> <h2 id="Rem">func <span>Rem</span> <span title="Added in Go 1.14">1.14</span> </h2> <pre data-language="go">func Rem(hi, lo, y uint) uint</pre> <p>Rem returns the remainder of (hi, lo) divided by y. Rem panics for y == 0 (division by zero) but, unlike Div, it doesn't panic on a quotient overflow. </p>
+<h2 id="Rem32">func <span>Rem32</span> <span title="Added in Go 1.14">1.14</span> </h2> <pre data-language="go">func Rem32(hi, lo, y uint32) uint32</pre> <p>Rem32 returns the remainder of (hi, lo) divided by y. Rem32 panics for y == 0 (division by zero) but, unlike <a href="#Div32">Div32</a>, it doesn't panic on a quotient overflow. </p>
+<h2 id="Rem64">func <span>Rem64</span> <span title="Added in Go 1.14">1.14</span> </h2> <pre data-language="go">func Rem64(hi, lo, y uint64) uint64</pre> <p>Rem64 returns the remainder of (hi, lo) divided by y. Rem64 panics for y == 0 (division by zero) but, unlike <a href="#Div64">Div64</a>, it doesn't panic on a quotient overflow. </p>
+<h2 id="Reverse">func <span>Reverse</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Reverse(x uint) uint</pre> <p>Reverse returns the value of x with its bits in reversed order. </p>
+<h2 id="Reverse16">func <span>Reverse16</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Reverse16(x uint16) uint16</pre> <p>Reverse16 returns the value of x with its bits in reversed order. </p> <h4 id="example_Reverse16"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%016b\n", 19)
+fmt.Printf("%016b\n", bits.Reverse16(19))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0000000000010011
+1100100000000000
+</pre> <h2 id="Reverse32">func <span>Reverse32</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Reverse32(x uint32) uint32</pre> <p>Reverse32 returns the value of x with its bits in reversed order. </p> <h4 id="example_Reverse32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%032b\n", 19)
+fmt.Printf("%032b\n", bits.Reverse32(19))
+</pre> <p>Output:</p> <pre class="output" data-language="go">00000000000000000000000000010011
+11001000000000000000000000000000
+</pre> <h2 id="Reverse64">func <span>Reverse64</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Reverse64(x uint64) uint64</pre> <p>Reverse64 returns the value of x with its bits in reversed order. </p> <h4 id="example_Reverse64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%064b\n", 19)
+fmt.Printf("%064b\n", bits.Reverse64(19))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0000000000000000000000000000000000000000000000000000000000010011
+1100100000000000000000000000000000000000000000000000000000000000
+</pre> <h2 id="Reverse8">func <span>Reverse8</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Reverse8(x uint8) uint8</pre> <p>Reverse8 returns the value of x with its bits in reversed order. </p> <h4 id="example_Reverse8"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%08b\n", 19)
+fmt.Printf("%08b\n", bits.Reverse8(19))
+</pre> <p>Output:</p> <pre class="output" data-language="go">00010011
+11001000
+</pre> <h2 id="ReverseBytes">func <span>ReverseBytes</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func ReverseBytes(x uint) uint</pre> <p>ReverseBytes returns the value of x with its bytes in reversed order. </p>
+<p>This function's execution time does not depend on the inputs. </p>
+<h2 id="ReverseBytes16">func <span>ReverseBytes16</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func ReverseBytes16(x uint16) uint16</pre> <p>ReverseBytes16 returns the value of x with its bytes in reversed order. </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_ReverseBytes16"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%016b\n", 15)
+fmt.Printf("%016b\n", bits.ReverseBytes16(15))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0000000000001111
+0000111100000000
+</pre> <h2 id="ReverseBytes32">func <span>ReverseBytes32</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func ReverseBytes32(x uint32) uint32</pre> <p>ReverseBytes32 returns the value of x with its bytes in reversed order. </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_ReverseBytes32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%032b\n", 15)
+fmt.Printf("%032b\n", bits.ReverseBytes32(15))
+</pre> <p>Output:</p> <pre class="output" data-language="go">00000000000000000000000000001111
+00001111000000000000000000000000
+</pre> <h2 id="ReverseBytes64">func <span>ReverseBytes64</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func ReverseBytes64(x uint64) uint64</pre> <p>ReverseBytes64 returns the value of x with its bytes in reversed order. </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_ReverseBytes64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%064b\n", 15)
+fmt.Printf("%064b\n", bits.ReverseBytes64(15))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0000000000000000000000000000000000000000000000000000000000001111
+0000111100000000000000000000000000000000000000000000000000000000
+</pre> <h2 id="RotateLeft">func <span>RotateLeft</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func RotateLeft(x uint, k int) uint</pre> <p>RotateLeft returns the value of x rotated left by (k mod <a href="#UintSize">UintSize</a>) bits. To rotate x right by k bits, call RotateLeft(x, -k). </p>
+<p>This function's execution time does not depend on the inputs. </p>
+<h2 id="RotateLeft16">func <span>RotateLeft16</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func RotateLeft16(x uint16, k int) uint16</pre> <p>RotateLeft16 returns the value of x rotated left by (k mod 16) bits. To rotate x right by k bits, call RotateLeft16(x, -k). </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_RotateLeft16"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%016b\n", 15)
+fmt.Printf("%016b\n", bits.RotateLeft16(15, 2))
+fmt.Printf("%016b\n", bits.RotateLeft16(15, -2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0000000000001111
+0000000000111100
+1100000000000011
+</pre> <h2 id="RotateLeft32">func <span>RotateLeft32</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func RotateLeft32(x uint32, k int) uint32</pre> <p>RotateLeft32 returns the value of x rotated left by (k mod 32) bits. To rotate x right by k bits, call RotateLeft32(x, -k). </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_RotateLeft32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%032b\n", 15)
+fmt.Printf("%032b\n", bits.RotateLeft32(15, 2))
+fmt.Printf("%032b\n", bits.RotateLeft32(15, -2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">00000000000000000000000000001111
+00000000000000000000000000111100
+11000000000000000000000000000011
+</pre> <h2 id="RotateLeft64">func <span>RotateLeft64</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func RotateLeft64(x uint64, k int) uint64</pre> <p>RotateLeft64 returns the value of x rotated left by (k mod 64) bits. To rotate x right by k bits, call RotateLeft64(x, -k). </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_RotateLeft64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%064b\n", 15)
+fmt.Printf("%064b\n", bits.RotateLeft64(15, 2))
+fmt.Printf("%064b\n", bits.RotateLeft64(15, -2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0000000000000000000000000000000000000000000000000000000000001111
+0000000000000000000000000000000000000000000000000000000000111100
+1100000000000000000000000000000000000000000000000000000000000011
+</pre> <h2 id="RotateLeft8">func <span>RotateLeft8</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func RotateLeft8(x uint8, k int) uint8</pre> <p>RotateLeft8 returns the value of x rotated left by (k mod 8) bits. To rotate x right by k bits, call RotateLeft8(x, -k). </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_RotateLeft8"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%08b\n", 15)
+fmt.Printf("%08b\n", bits.RotateLeft8(15, 2))
+fmt.Printf("%08b\n", bits.RotateLeft8(15, -2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">00001111
+00111100
+11000011
+</pre> <h2 id="Sub">func <span>Sub</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Sub(x, y, borrow uint) (diff, borrowOut uint)</pre> <p>Sub returns the difference of x, y and borrow: diff = x - y - borrow. The borrow input must be 0 or 1; otherwise the behavior is undefined. The borrowOut output is guaranteed to be 0 or 1. </p>
+<p>This function's execution time does not depend on the inputs. </p>
+<h2 id="Sub32">func <span>Sub32</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Sub32(x, y, borrow uint32) (diff, borrowOut uint32)</pre> <p>Sub32 returns the difference of x, y and borrow, diff = x - y - borrow. The borrow input must be 0 or 1; otherwise the behavior is undefined. The borrowOut output is guaranteed to be 0 or 1. </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_Sub32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// First number is 33&lt;&lt;32 + 23
+n1 := []uint32{33, 23}
+// Second number is 21&lt;&lt;32 + 12
+n2 := []uint32{21, 12}
+// Sub them together without producing carry.
+d1, carry := bits.Sub32(n1[1], n2[1], 0)
+d0, _ := bits.Sub32(n1[0], n2[0], carry)
+nsum := []uint32{d0, d1}
+fmt.Printf("%v - %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
+
+// First number is 3&lt;&lt;32 + 2147483647
+n1 = []uint32{3, 0x7fffffff}
+// Second number is 1&lt;&lt;32 + 2147483648
+n2 = []uint32{1, 0x80000000}
+// Sub them together producing carry.
+d1, carry = bits.Sub32(n1[1], n2[1], 0)
+d0, _ = bits.Sub32(n1[0], n2[0], carry)
+nsum = []uint32{d0, d1}
+fmt.Printf("%v - %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[33 23] - [21 12] = [12 11] (carry bit was 0)
+[3 2147483647] - [1 2147483648] = [1 4294967295] (carry bit was 1)
+</pre> <h2 id="Sub64">func <span>Sub64</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func Sub64(x, y, borrow uint64) (diff, borrowOut uint64)</pre> <p>Sub64 returns the difference of x, y and borrow: diff = x - y - borrow. The borrow input must be 0 or 1; otherwise the behavior is undefined. The borrowOut output is guaranteed to be 0 or 1. </p>
+<p>This function's execution time does not depend on the inputs. </p> <h4 id="example_Sub64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// First number is 33&lt;&lt;64 + 23
+n1 := []uint64{33, 23}
+// Second number is 21&lt;&lt;64 + 12
+n2 := []uint64{21, 12}
+// Sub them together without producing carry.
+d1, carry := bits.Sub64(n1[1], n2[1], 0)
+d0, _ := bits.Sub64(n1[0], n2[0], carry)
+nsum := []uint64{d0, d1}
+fmt.Printf("%v - %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
+
+// First number is 3&lt;&lt;64 + 9223372036854775807
+n1 = []uint64{3, 0x7fffffffffffffff}
+// Second number is 1&lt;&lt;64 + 9223372036854775808
+n2 = []uint64{1, 0x8000000000000000}
+// Sub them together producing carry.
+d1, carry = bits.Sub64(n1[1], n2[1], 0)
+d0, _ = bits.Sub64(n1[0], n2[0], carry)
+nsum = []uint64{d0, d1}
+fmt.Printf("%v - %v = %v (carry bit was %v)\n", n1, n2, nsum, carry)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[33 23] - [21 12] = [12 11] (carry bit was 0)
+[3 9223372036854775807] - [1 9223372036854775808] = [1 18446744073709551615] (carry bit was 1)
+</pre> <h2 id="TrailingZeros">func <span>TrailingZeros</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func TrailingZeros(x uint) int</pre> <p>TrailingZeros returns the number of trailing zero bits in x; the result is <a href="#UintSize">UintSize</a> for x == 0. </p>
+<h2 id="TrailingZeros16">func <span>TrailingZeros16</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func TrailingZeros16(x uint16) int</pre> <p>TrailingZeros16 returns the number of trailing zero bits in x; the result is 16 for x == 0. </p> <h4 id="example_TrailingZeros16"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("TrailingZeros16(%016b) = %d\n", 14, bits.TrailingZeros16(14))
+</pre> <p>Output:</p> <pre class="output" data-language="go">TrailingZeros16(0000000000001110) = 1
+</pre> <h2 id="TrailingZeros32">func <span>TrailingZeros32</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func TrailingZeros32(x uint32) int</pre> <p>TrailingZeros32 returns the number of trailing zero bits in x; the result is 32 for x == 0. </p> <h4 id="example_TrailingZeros32"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("TrailingZeros32(%032b) = %d\n", 14, bits.TrailingZeros32(14))
+</pre> <p>Output:</p> <pre class="output" data-language="go">TrailingZeros32(00000000000000000000000000001110) = 1
+</pre> <h2 id="TrailingZeros64">func <span>TrailingZeros64</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func TrailingZeros64(x uint64) int</pre> <p>TrailingZeros64 returns the number of trailing zero bits in x; the result is 64 for x == 0. </p> <h4 id="example_TrailingZeros64"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("TrailingZeros64(%064b) = %d\n", 14, bits.TrailingZeros64(14))
+</pre> <p>Output:</p> <pre class="output" data-language="go">TrailingZeros64(0000000000000000000000000000000000000000000000000000000000001110) = 1
+</pre> <h2 id="TrailingZeros8">func <span>TrailingZeros8</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func TrailingZeros8(x uint8) int</pre> <p>TrailingZeros8 returns the number of trailing zero bits in x; the result is 8 for x == 0. </p> <h4 id="example_TrailingZeros8"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("TrailingZeros8(%08b) = %d\n", 14, bits.TrailingZeros8(14))
+</pre> <p>Output:</p> <pre class="output" data-language="go">TrailingZeros8(00001110) = 1
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/math/bits/" class="_attribution-link">http://golang.org/pkg/math/bits/</a>
+ </p>
+</div>
diff --git a/devdocs/go/math%2Fcmplx%2Findex.html b/devdocs/go/math%2Fcmplx%2Findex.html
new file mode 100644
index 00000000..8d64ef40
--- /dev/null
+++ b/devdocs/go/math%2Fcmplx%2Findex.html
@@ -0,0 +1,74 @@
+<h1> Package cmplx </h1> <ul id="short-nav">
+<li><code>import "math/cmplx"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package cmplx provides basic constants and mathematical functions for complex numbers. Special case handling conforms to the C99 standard Annex G IEC 60559-compatible complex arithmetic. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Abs">func Abs(x complex128) float64</a></li>
+<li><a href="#Acos">func Acos(x complex128) complex128</a></li>
+<li><a href="#Acosh">func Acosh(x complex128) complex128</a></li>
+<li><a href="#Asin">func Asin(x complex128) complex128</a></li>
+<li><a href="#Asinh">func Asinh(x complex128) complex128</a></li>
+<li><a href="#Atan">func Atan(x complex128) complex128</a></li>
+<li><a href="#Atanh">func Atanh(x complex128) complex128</a></li>
+<li><a href="#Conj">func Conj(x complex128) complex128</a></li>
+<li><a href="#Cos">func Cos(x complex128) complex128</a></li>
+<li><a href="#Cosh">func Cosh(x complex128) complex128</a></li>
+<li><a href="#Cot">func Cot(x complex128) complex128</a></li>
+<li><a href="#Exp">func Exp(x complex128) complex128</a></li>
+<li><a href="#Inf">func Inf() complex128</a></li>
+<li><a href="#IsInf">func IsInf(x complex128) bool</a></li>
+<li><a href="#IsNaN">func IsNaN(x complex128) bool</a></li>
+<li><a href="#Log">func Log(x complex128) complex128</a></li>
+<li><a href="#Log10">func Log10(x complex128) complex128</a></li>
+<li><a href="#NaN">func NaN() complex128</a></li>
+<li><a href="#Phase">func Phase(x complex128) float64</a></li>
+<li><a href="#Polar">func Polar(x complex128) (r, θ float64)</a></li>
+<li><a href="#Pow">func Pow(x, y complex128) complex128</a></li>
+<li><a href="#Rect">func Rect(r, θ float64) complex128</a></li>
+<li><a href="#Sin">func Sin(x complex128) complex128</a></li>
+<li><a href="#Sinh">func Sinh(x complex128) complex128</a></li>
+<li><a href="#Sqrt">func Sqrt(x complex128) complex128</a></li>
+<li><a href="#Tan">func Tan(x complex128) complex128</a></li>
+<li><a href="#Tanh">func Tanh(x complex128) complex128</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Abs">Abs</a></dd> <dd><a class="exampleLink" href="#example_Exp">Exp</a></dd> <dd><a class="exampleLink" href="#example_Polar">Polar</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>abs.go</span> <span>asin.go</span> <span>conj.go</span> <span>exp.go</span> <span>isinf.go</span> <span>isnan.go</span> <span>log.go</span> <span>phase.go</span> <span>polar.go</span> <span>pow.go</span> <span>rect.go</span> <span>sin.go</span> <span>sqrt.go</span> <span>tan.go</span> </p> <h2 id="Abs">func <span>Abs</span> </h2> <pre data-language="go">func Abs(x complex128) float64</pre> <p>Abs returns the absolute value (also called the modulus) of x. </p> <h4 id="example_Abs"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.1f", cmplx.Abs(3+4i))
+</pre> <p>Output:</p> <pre class="output" data-language="go">5.0
+</pre> <h2 id="Acos">func <span>Acos</span> </h2> <pre data-language="go">func Acos(x complex128) complex128</pre> <p>Acos returns the inverse cosine of x. </p>
+<h2 id="Acosh">func <span>Acosh</span> </h2> <pre data-language="go">func Acosh(x complex128) complex128</pre> <p>Acosh returns the inverse hyperbolic cosine of x. </p>
+<h2 id="Asin">func <span>Asin</span> </h2> <pre data-language="go">func Asin(x complex128) complex128</pre> <p>Asin returns the inverse sine of x. </p>
+<h2 id="Asinh">func <span>Asinh</span> </h2> <pre data-language="go">func Asinh(x complex128) complex128</pre> <p>Asinh returns the inverse hyperbolic sine of x. </p>
+<h2 id="Atan">func <span>Atan</span> </h2> <pre data-language="go">func Atan(x complex128) complex128</pre> <p>Atan returns the inverse tangent of x. </p>
+<h2 id="Atanh">func <span>Atanh</span> </h2> <pre data-language="go">func Atanh(x complex128) complex128</pre> <p>Atanh returns the inverse hyperbolic tangent of x. </p>
+<h2 id="Conj">func <span>Conj</span> </h2> <pre data-language="go">func Conj(x complex128) complex128</pre> <p>Conj returns the complex conjugate of x. </p>
+<h2 id="Cos">func <span>Cos</span> </h2> <pre data-language="go">func Cos(x complex128) complex128</pre> <p>Cos returns the cosine of x. </p>
+<h2 id="Cosh">func <span>Cosh</span> </h2> <pre data-language="go">func Cosh(x complex128) complex128</pre> <p>Cosh returns the hyperbolic cosine of x. </p>
+<h2 id="Cot">func <span>Cot</span> </h2> <pre data-language="go">func Cot(x complex128) complex128</pre> <p>Cot returns the cotangent of x. </p>
+<h2 id="Exp">func <span>Exp</span> </h2> <pre data-language="go">func Exp(x complex128) complex128</pre> <p>Exp returns e**x, the base-e exponential of x. </p> <h4 id="example_Exp"> <span class="text">Example</span>
+</h4> <p>ExampleExp computes Euler's identity. </p> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.1f", cmplx.Exp(1i*math.Pi)+1)
+</pre> <p>Output:</p> <pre class="output" data-language="go">(0.0+0.0i)
+</pre> <h2 id="Inf">func <span>Inf</span> </h2> <pre data-language="go">func Inf() complex128</pre> <p>Inf returns a complex infinity, complex(+Inf, +Inf). </p>
+<h2 id="IsInf">func <span>IsInf</span> </h2> <pre data-language="go">func IsInf(x complex128) bool</pre> <p>IsInf reports whether either real(x) or imag(x) is an infinity. </p>
+<h2 id="IsNaN">func <span>IsNaN</span> </h2> <pre data-language="go">func IsNaN(x complex128) bool</pre> <p>IsNaN reports whether either real(x) or imag(x) is NaN and neither is an infinity. </p>
+<h2 id="Log">func <span>Log</span> </h2> <pre data-language="go">func Log(x complex128) complex128</pre> <p>Log returns the natural logarithm of x. </p>
+<h2 id="Log10">func <span>Log10</span> </h2> <pre data-language="go">func Log10(x complex128) complex128</pre> <p>Log10 returns the decimal logarithm of x. </p>
+<h2 id="NaN">func <span>NaN</span> </h2> <pre data-language="go">func NaN() complex128</pre> <p>NaN returns a complex “not-a-number” value. </p>
+<h2 id="Phase">func <span>Phase</span> </h2> <pre data-language="go">func Phase(x complex128) float64</pre> <p>Phase returns the phase (also called the argument) of x. The returned value is in the range [-Pi, Pi]. </p>
+<h2 id="Polar">func <span>Polar</span> </h2> <pre data-language="go">func Polar(x complex128) (r, θ float64)</pre> <p>Polar returns the absolute value r and phase θ of x, such that x = r * e**θi. The phase is in the range [-Pi, Pi]. </p> <h4 id="example_Polar"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r, theta := cmplx.Polar(2i)
+fmt.Printf("r: %.1f, θ: %.1f*π", r, theta/math.Pi)
+</pre> <p>Output:</p> <pre class="output" data-language="go">r: 2.0, θ: 0.5*π
+</pre> <h2 id="Pow">func <span>Pow</span> </h2> <pre data-language="go">func Pow(x, y complex128) complex128</pre> <p>Pow returns x**y, the base-x exponential of y. For generalized compatibility with <span>math.Pow</span>: </p>
+<pre data-language="go">Pow(0, ±0) returns 1+0i
+Pow(0, c) for real(c)&lt;0 returns Inf+0i if imag(c) is zero, otherwise Inf+Inf i.
+</pre> <h2 id="Rect">func <span>Rect</span> </h2> <pre data-language="go">func Rect(r, θ float64) complex128</pre> <p>Rect returns the complex number x with polar coordinates r, θ. </p>
+<h2 id="Sin">func <span>Sin</span> </h2> <pre data-language="go">func Sin(x complex128) complex128</pre> <p>Sin returns the sine of x. </p>
+<h2 id="Sinh">func <span>Sinh</span> </h2> <pre data-language="go">func Sinh(x complex128) complex128</pre> <p>Sinh returns the hyperbolic sine of x. </p>
+<h2 id="Sqrt">func <span>Sqrt</span> </h2> <pre data-language="go">func Sqrt(x complex128) complex128</pre> <p>Sqrt returns the square root of x. The result r is chosen so that real(r) ≥ 0 and imag(r) has the same sign as imag(x). </p>
+<h2 id="Tan">func <span>Tan</span> </h2> <pre data-language="go">func Tan(x complex128) complex128</pre> <p>Tan returns the tangent of x. </p>
+<h2 id="Tanh">func <span>Tanh</span> </h2> <pre data-language="go">func Tanh(x complex128) complex128</pre> <p>Tanh returns the hyperbolic tangent of x. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/math/cmplx/" class="_attribution-link">http://golang.org/pkg/math/cmplx/</a>
+ </p>
+</div>
diff --git a/devdocs/go/math%2Findex.html b/devdocs/go/math%2Findex.html
new file mode 100644
index 00000000..158845f5
--- /dev/null
+++ b/devdocs/go/math%2Findex.html
@@ -0,0 +1,597 @@
+<h1> Package math </h1> <ul id="short-nav">
+<li><code>import "math"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package math provides basic constants and mathematical functions. </p>
+<p>This package does not guarantee bit-identical results across architectures. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Abs">func Abs(x float64) float64</a></li>
+<li><a href="#Acos">func Acos(x float64) float64</a></li>
+<li><a href="#Acosh">func Acosh(x float64) float64</a></li>
+<li><a href="#Asin">func Asin(x float64) float64</a></li>
+<li><a href="#Asinh">func Asinh(x float64) float64</a></li>
+<li><a href="#Atan">func Atan(x float64) float64</a></li>
+<li><a href="#Atan2">func Atan2(y, x float64) float64</a></li>
+<li><a href="#Atanh">func Atanh(x float64) float64</a></li>
+<li><a href="#Cbrt">func Cbrt(x float64) float64</a></li>
+<li><a href="#Ceil">func Ceil(x float64) float64</a></li>
+<li><a href="#Copysign">func Copysign(f, sign float64) float64</a></li>
+<li><a href="#Cos">func Cos(x float64) float64</a></li>
+<li><a href="#Cosh">func Cosh(x float64) float64</a></li>
+<li><a href="#Dim">func Dim(x, y float64) float64</a></li>
+<li><a href="#Erf">func Erf(x float64) float64</a></li>
+<li><a href="#Erfc">func Erfc(x float64) float64</a></li>
+<li><a href="#Erfcinv">func Erfcinv(x float64) float64</a></li>
+<li><a href="#Erfinv">func Erfinv(x float64) float64</a></li>
+<li><a href="#Exp">func Exp(x float64) float64</a></li>
+<li><a href="#Exp2">func Exp2(x float64) float64</a></li>
+<li><a href="#Expm1">func Expm1(x float64) float64</a></li>
+<li><a href="#FMA">func FMA(x, y, z float64) float64</a></li>
+<li><a href="#Float32bits">func Float32bits(f float32) uint32</a></li>
+<li><a href="#Float32frombits">func Float32frombits(b uint32) float32</a></li>
+<li><a href="#Float64bits">func Float64bits(f float64) uint64</a></li>
+<li><a href="#Float64frombits">func Float64frombits(b uint64) float64</a></li>
+<li><a href="#Floor">func Floor(x float64) float64</a></li>
+<li><a href="#Frexp">func Frexp(f float64) (frac float64, exp int)</a></li>
+<li><a href="#Gamma">func Gamma(x float64) float64</a></li>
+<li><a href="#Hypot">func Hypot(p, q float64) float64</a></li>
+<li><a href="#Ilogb">func Ilogb(x float64) int</a></li>
+<li><a href="#Inf">func Inf(sign int) float64</a></li>
+<li><a href="#IsInf">func IsInf(f float64, sign int) bool</a></li>
+<li><a href="#IsNaN">func IsNaN(f float64) (is bool)</a></li>
+<li><a href="#J0">func J0(x float64) float64</a></li>
+<li><a href="#J1">func J1(x float64) float64</a></li>
+<li><a href="#Jn">func Jn(n int, x float64) float64</a></li>
+<li><a href="#Ldexp">func Ldexp(frac float64, exp int) float64</a></li>
+<li><a href="#Lgamma">func Lgamma(x float64) (lgamma float64, sign int)</a></li>
+<li><a href="#Log">func Log(x float64) float64</a></li>
+<li><a href="#Log10">func Log10(x float64) float64</a></li>
+<li><a href="#Log1p">func Log1p(x float64) float64</a></li>
+<li><a href="#Log2">func Log2(x float64) float64</a></li>
+<li><a href="#Logb">func Logb(x float64) float64</a></li>
+<li><a href="#Max">func Max(x, y float64) float64</a></li>
+<li><a href="#Min">func Min(x, y float64) float64</a></li>
+<li><a href="#Mod">func Mod(x, y float64) float64</a></li>
+<li><a href="#Modf">func Modf(f float64) (int float64, frac float64)</a></li>
+<li><a href="#NaN">func NaN() float64</a></li>
+<li><a href="#Nextafter">func Nextafter(x, y float64) (r float64)</a></li>
+<li><a href="#Nextafter32">func Nextafter32(x, y float32) (r float32)</a></li>
+<li><a href="#Pow">func Pow(x, y float64) float64</a></li>
+<li><a href="#Pow10">func Pow10(n int) float64</a></li>
+<li><a href="#Remainder">func Remainder(x, y float64) float64</a></li>
+<li><a href="#Round">func Round(x float64) float64</a></li>
+<li><a href="#RoundToEven">func RoundToEven(x float64) float64</a></li>
+<li><a href="#Signbit">func Signbit(x float64) bool</a></li>
+<li><a href="#Sin">func Sin(x float64) float64</a></li>
+<li><a href="#Sincos">func Sincos(x float64) (sin, cos float64)</a></li>
+<li><a href="#Sinh">func Sinh(x float64) float64</a></li>
+<li><a href="#Sqrt">func Sqrt(x float64) float64</a></li>
+<li><a href="#Tan">func Tan(x float64) float64</a></li>
+<li><a href="#Tanh">func Tanh(x float64) float64</a></li>
+<li><a href="#Trunc">func Trunc(x float64) float64</a></li>
+<li><a href="#Y0">func Y0(x float64) float64</a></li>
+<li><a href="#Y1">func Y1(x float64) float64</a></li>
+<li><a href="#Yn">func Yn(n int, x float64) float64</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Abs">Abs</a></dd> <dd><a class="exampleLink" href="#example_Acos">Acos</a></dd> <dd><a class="exampleLink" href="#example_Acosh">Acosh</a></dd> <dd><a class="exampleLink" href="#example_Asin">Asin</a></dd> <dd><a class="exampleLink" href="#example_Asinh">Asinh</a></dd> <dd><a class="exampleLink" href="#example_Atan">Atan</a></dd> <dd><a class="exampleLink" href="#example_Atan2">Atan2</a></dd> <dd><a class="exampleLink" href="#example_Atanh">Atanh</a></dd> <dd><a class="exampleLink" href="#example_Cbrt">Cbrt</a></dd> <dd><a class="exampleLink" href="#example_Ceil">Ceil</a></dd> <dd><a class="exampleLink" href="#example_Copysign">Copysign</a></dd> <dd><a class="exampleLink" href="#example_Cos">Cos</a></dd> <dd><a class="exampleLink" href="#example_Cosh">Cosh</a></dd> <dd><a class="exampleLink" href="#example_Dim">Dim</a></dd> <dd><a class="exampleLink" href="#example_Exp">Exp</a></dd> <dd><a class="exampleLink" href="#example_Exp2">Exp2</a></dd> <dd><a class="exampleLink" href="#example_Expm1">Expm1</a></dd> <dd><a class="exampleLink" href="#example_Floor">Floor</a></dd> <dd><a class="exampleLink" href="#example_Log">Log</a></dd> <dd><a class="exampleLink" href="#example_Log10">Log10</a></dd> <dd><a class="exampleLink" href="#example_Log2">Log2</a></dd> <dd><a class="exampleLink" href="#example_Mod">Mod</a></dd> <dd><a class="exampleLink" href="#example_Modf">Modf</a></dd> <dd><a class="exampleLink" href="#example_Pow">Pow</a></dd> <dd><a class="exampleLink" href="#example_Pow10">Pow10</a></dd> <dd><a class="exampleLink" href="#example_Remainder">Remainder</a></dd> <dd><a class="exampleLink" href="#example_Round">Round</a></dd> <dd><a class="exampleLink" href="#example_RoundToEven">RoundToEven</a></dd> <dd><a class="exampleLink" href="#example_Sin">Sin</a></dd> <dd><a class="exampleLink" href="#example_Sincos">Sincos</a></dd> <dd><a class="exampleLink" href="#example_Sinh">Sinh</a></dd> <dd><a class="exampleLink" href="#example_Sqrt">Sqrt</a></dd> <dd><a class="exampleLink" href="#example_Tan">Tan</a></dd> <dd><a class="exampleLink" href="#example_Tanh">Tanh</a></dd> <dd><a class="exampleLink" href="#example_Trunc">Trunc</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>abs.go</span> <span>acosh.go</span> <span>asin.go</span> <span>asinh.go</span> <span>atan.go</span> <span>atan2.go</span> <span>atanh.go</span> <span>bits.go</span> <span>cbrt.go</span> <span>const.go</span> <span>copysign.go</span> <span>dim.go</span> <span>dim_asm.go</span> <span>erf.go</span> <span>erfinv.go</span> <span>exp.go</span> <span>exp2_noasm.go</span> <span>exp_amd64.go</span> <span>exp_asm.go</span> <span>expm1.go</span> <span>floor.go</span> <span>floor_asm.go</span> <span>fma.go</span> <span>frexp.go</span> <span>gamma.go</span> <span>hypot.go</span> <span>hypot_asm.go</span> <span>j0.go</span> <span>j1.go</span> <span>jn.go</span> <span>ldexp.go</span> <span>lgamma.go</span> <span>log.go</span> <span>log10.go</span> <span>log1p.go</span> <span>log_asm.go</span> <span>logb.go</span> <span>mod.go</span> <span>modf.go</span> <span>modf_noasm.go</span> <span>nextafter.go</span> <span>pow.go</span> <span>pow10.go</span> <span>remainder.go</span> <span>signbit.go</span> <span>sin.go</span> <span>sincos.go</span> <span>sinh.go</span> <span>sqrt.go</span> <span>stubs.go</span> <span>tan.go</span> <span>tanh.go</span> <span>trig_reduce.go</span> <span>unsafe.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Mathematical constants. </p>
+<pre data-language="go">const (
+ E = 2.71828182845904523536028747135266249775724709369995957496696763 // https://oeis.org/A001113
+ Pi = 3.14159265358979323846264338327950288419716939937510582097494459 // https://oeis.org/A000796
+ Phi = 1.61803398874989484820458683436563811772030917980576286213544862 // https://oeis.org/A001622
+
+ Sqrt2 = 1.41421356237309504880168872420969807856967187537694807317667974 // https://oeis.org/A002193
+ SqrtE = 1.64872127070012814684865078781416357165377610071014801157507931 // https://oeis.org/A019774
+ SqrtPi = 1.77245385090551602729816748334114518279754945612238712821380779 // https://oeis.org/A002161
+ SqrtPhi = 1.27201964951406896425242246173749149171560804184009624861664038 // https://oeis.org/A139339
+
+ Ln2 = 0.693147180559945309417232121458176568075500134360255254120680009 // https://oeis.org/A002162
+ Log2E = 1 / Ln2
+ Ln10 = 2.30258509299404568401799145468436420760110148862877297603332790 // https://oeis.org/A002392
+ Log10E = 1 / Ln10
+)</pre> <p>Floating-point limit values. Max is the largest finite value representable by the type. SmallestNonzero is the smallest positive, non-zero value representable by the type. </p>
+<pre data-language="go">const (
+ MaxFloat32 = 0x1p127 * (1 + (1 - 0x1p-23)) // 3.40282346638528859811704183484516925440e+38
+ SmallestNonzeroFloat32 = 0x1p-126 * 0x1p-23 // 1.401298464324817070923729583289916131280e-45
+
+ MaxFloat64 = 0x1p1023 * (1 + (1 - 0x1p-52)) // 1.79769313486231570814527423731704356798070e+308
+ SmallestNonzeroFloat64 = 0x1p-1022 * 0x1p-52 // 4.9406564584124654417656879286822137236505980e-324
+)</pre> <p>Integer limit values. </p>
+<pre data-language="go">const (
+ MaxInt = 1&lt;&lt;(intSize-1) - 1 // MaxInt32 or MaxInt64 depending on intSize.
+ MinInt = -1 &lt;&lt; (intSize - 1) // MinInt32 or MinInt64 depending on intSize.
+ MaxInt8 = 1&lt;&lt;7 - 1 // 127
+ MinInt8 = -1 &lt;&lt; 7 // -128
+ MaxInt16 = 1&lt;&lt;15 - 1 // 32767
+ MinInt16 = -1 &lt;&lt; 15 // -32768
+ MaxInt32 = 1&lt;&lt;31 - 1 // 2147483647
+ MinInt32 = -1 &lt;&lt; 31 // -2147483648
+ MaxInt64 = 1&lt;&lt;63 - 1 // 9223372036854775807
+ MinInt64 = -1 &lt;&lt; 63 // -9223372036854775808
+ MaxUint = 1&lt;&lt;intSize - 1 // MaxUint32 or MaxUint64 depending on intSize.
+ MaxUint8 = 1&lt;&lt;8 - 1 // 255
+ MaxUint16 = 1&lt;&lt;16 - 1 // 65535
+ MaxUint32 = 1&lt;&lt;32 - 1 // 4294967295
+ MaxUint64 = 1&lt;&lt;64 - 1 // 18446744073709551615
+)</pre> <h2 id="Abs">func <span>Abs</span> </h2> <pre data-language="go">func Abs(x float64) float64</pre> <p>Abs returns the absolute value of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Abs(±Inf) = +Inf
+Abs(NaN) = NaN
+</pre> <h4 id="example_Abs"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">x := math.Abs(-2)
+fmt.Printf("%.1f\n", x)
+
+y := math.Abs(2)
+fmt.Printf("%.1f\n", y)
+</pre> <p>Output:</p> <pre class="output" data-language="go">2.0
+2.0
+</pre> <h2 id="Acos">func <span>Acos</span> </h2> <pre data-language="go">func Acos(x float64) float64</pre> <p>Acos returns the arccosine, in radians, of x. </p>
+<p>Special case is: </p>
+<pre data-language="go">Acos(x) = NaN if x &lt; -1 or x &gt; 1
+</pre> <h4 id="example_Acos"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Acos(1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Acosh">func <span>Acosh</span> </h2> <pre data-language="go">func Acosh(x float64) float64</pre> <p>Acosh returns the inverse hyperbolic cosine of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Acosh(+Inf) = +Inf
+Acosh(x) = NaN if x &lt; 1
+Acosh(NaN) = NaN
+</pre> <h4 id="example_Acosh"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Acosh(1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Asin">func <span>Asin</span> </h2> <pre data-language="go">func Asin(x float64) float64</pre> <p>Asin returns the arcsine, in radians, of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Asin(±0) = ±0
+Asin(x) = NaN if x &lt; -1 or x &gt; 1
+</pre> <h4 id="example_Asin"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Asin(0))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Asinh">func <span>Asinh</span> </h2> <pre data-language="go">func Asinh(x float64) float64</pre> <p>Asinh returns the inverse hyperbolic sine of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Asinh(±0) = ±0
+Asinh(±Inf) = ±Inf
+Asinh(NaN) = NaN
+</pre> <h4 id="example_Asinh"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Asinh(0))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Atan">func <span>Atan</span> </h2> <pre data-language="go">func Atan(x float64) float64</pre> <p>Atan returns the arctangent, in radians, of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Atan(±0) = ±0
+Atan(±Inf) = ±Pi/2
+</pre> <h4 id="example_Atan"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Atan(0))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Atan2">func <span>Atan2</span> </h2> <pre data-language="go">func Atan2(y, x float64) float64</pre> <p>Atan2 returns the arc tangent of y/x, using the signs of the two to determine the quadrant of the return value. </p>
+<p>Special cases are (in order): </p>
+<pre data-language="go">Atan2(y, NaN) = NaN
+Atan2(NaN, x) = NaN
+Atan2(+0, x&gt;=0) = +0
+Atan2(-0, x&gt;=0) = -0
+Atan2(+0, x&lt;=-0) = +Pi
+Atan2(-0, x&lt;=-0) = -Pi
+Atan2(y&gt;0, 0) = +Pi/2
+Atan2(y&lt;0, 0) = -Pi/2
+Atan2(+Inf, +Inf) = +Pi/4
+Atan2(-Inf, +Inf) = -Pi/4
+Atan2(+Inf, -Inf) = 3Pi/4
+Atan2(-Inf, -Inf) = -3Pi/4
+Atan2(y, +Inf) = 0
+Atan2(y&gt;0, -Inf) = +Pi
+Atan2(y&lt;0, -Inf) = -Pi
+Atan2(+Inf, x) = +Pi/2
+Atan2(-Inf, x) = -Pi/2
+</pre> <h4 id="example_Atan2"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Atan2(0, 0))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Atanh">func <span>Atanh</span> </h2> <pre data-language="go">func Atanh(x float64) float64</pre> <p>Atanh returns the inverse hyperbolic tangent of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Atanh(1) = +Inf
+Atanh(±0) = ±0
+Atanh(-1) = -Inf
+Atanh(x) = NaN if x &lt; -1 or x &gt; 1
+Atanh(NaN) = NaN
+</pre> <h4 id="example_Atanh"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Atanh(0))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Cbrt">func <span>Cbrt</span> </h2> <pre data-language="go">func Cbrt(x float64) float64</pre> <p>Cbrt returns the cube root of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Cbrt(±0) = ±0
+Cbrt(±Inf) = ±Inf
+Cbrt(NaN) = NaN
+</pre> <h4 id="example_Cbrt"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f\n", math.Cbrt(8))
+fmt.Printf("%.2f\n", math.Cbrt(27))
+</pre> <p>Output:</p> <pre class="output" data-language="go">2.00
+3.00
+</pre> <h2 id="Ceil">func <span>Ceil</span> </h2> <pre data-language="go">func Ceil(x float64) float64</pre> <p>Ceil returns the least integer value greater than or equal to x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Ceil(±0) = ±0
+Ceil(±Inf) = ±Inf
+Ceil(NaN) = NaN
+</pre> <h4 id="example_Ceil"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">c := math.Ceil(1.49)
+fmt.Printf("%.1f", c)
+</pre> <p>Output:</p> <pre class="output" data-language="go">2.0
+</pre> <h2 id="Copysign">func <span>Copysign</span> </h2> <pre data-language="go">func Copysign(f, sign float64) float64</pre> <p>Copysign returns a value with the magnitude of f and the sign of sign. </p> <h4 id="example_Copysign"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Copysign(3.2, -1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">-3.20
+</pre> <h2 id="Cos">func <span>Cos</span> </h2> <pre data-language="go">func Cos(x float64) float64</pre> <p>Cos returns the cosine of the radian argument x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Cos(±Inf) = NaN
+Cos(NaN) = NaN
+</pre> <h4 id="example_Cos"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Cos(math.Pi/2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Cosh">func <span>Cosh</span> </h2> <pre data-language="go">func Cosh(x float64) float64</pre> <p>Cosh returns the hyperbolic cosine of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Cosh(±0) = 1
+Cosh(±Inf) = +Inf
+Cosh(NaN) = NaN
+</pre> <h4 id="example_Cosh"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Cosh(0))
+</pre> <p>Output:</p> <pre class="output" data-language="go">1.00
+</pre> <h2 id="Dim">func <span>Dim</span> </h2> <pre data-language="go">func Dim(x, y float64) float64</pre> <p>Dim returns the maximum of x-y or 0. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Dim(+Inf, +Inf) = NaN
+Dim(-Inf, -Inf) = NaN
+Dim(x, NaN) = Dim(NaN, x) = NaN
+</pre> <h4 id="example_Dim"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f\n", math.Dim(4, -2))
+fmt.Printf("%.2f\n", math.Dim(-4, 2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">6.00
+0.00
+</pre> <h2 id="Erf">func <span>Erf</span> </h2> <pre data-language="go">func Erf(x float64) float64</pre> <p>Erf returns the error function of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Erf(+Inf) = 1
+Erf(-Inf) = -1
+Erf(NaN) = NaN
+</pre> <h2 id="Erfc">func <span>Erfc</span> </h2> <pre data-language="go">func Erfc(x float64) float64</pre> <p>Erfc returns the complementary error function of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Erfc(+Inf) = 0
+Erfc(-Inf) = 2
+Erfc(NaN) = NaN
+</pre> <h2 id="Erfcinv">func <span>Erfcinv</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func Erfcinv(x float64) float64</pre> <p>Erfcinv returns the inverse of <a href="#Erfc">Erfc</a>(x). </p>
+<p>Special cases are: </p>
+<pre data-language="go">Erfcinv(0) = +Inf
+Erfcinv(2) = -Inf
+Erfcinv(x) = NaN if x &lt; 0 or x &gt; 2
+Erfcinv(NaN) = NaN
+</pre> <h2 id="Erfinv">func <span>Erfinv</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func Erfinv(x float64) float64</pre> <p>Erfinv returns the inverse error function of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Erfinv(1) = +Inf
+Erfinv(-1) = -Inf
+Erfinv(x) = NaN if x &lt; -1 or x &gt; 1
+Erfinv(NaN) = NaN
+</pre> <h2 id="Exp">func <span>Exp</span> </h2> <pre data-language="go">func Exp(x float64) float64</pre> <p>Exp returns e**x, the base-e exponential of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Exp(+Inf) = +Inf
+Exp(NaN) = NaN
+</pre> <p>Very large values overflow to 0 or +Inf. Very small values underflow to 1. </p> <h4 id="example_Exp"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f\n", math.Exp(1))
+fmt.Printf("%.2f\n", math.Exp(2))
+fmt.Printf("%.2f\n", math.Exp(-1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">2.72
+7.39
+0.37
+</pre> <h2 id="Exp2">func <span>Exp2</span> </h2> <pre data-language="go">func Exp2(x float64) float64</pre> <p>Exp2 returns 2**x, the base-2 exponential of x. </p>
+<p>Special cases are the same as <a href="#Exp">Exp</a>. </p> <h4 id="example_Exp2"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f\n", math.Exp2(1))
+fmt.Printf("%.2f\n", math.Exp2(-3))
+</pre> <p>Output:</p> <pre class="output" data-language="go">2.00
+0.12
+</pre> <h2 id="Expm1">func <span>Expm1</span> </h2> <pre data-language="go">func Expm1(x float64) float64</pre> <p>Expm1 returns e**x - 1, the base-e exponential of x minus 1. It is more accurate than <a href="#Exp">Exp</a>(x) - 1 when x is near zero. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Expm1(+Inf) = +Inf
+Expm1(-Inf) = -1
+Expm1(NaN) = NaN
+</pre> <p>Very large values overflow to -1 or +Inf. </p> <h4 id="example_Expm1"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.6f\n", math.Expm1(0.01))
+fmt.Printf("%.6f\n", math.Expm1(-1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.010050
+-0.632121
+</pre> <h2 id="FMA">func <span>FMA</span> <span title="Added in Go 1.14">1.14</span> </h2> <pre data-language="go">func FMA(x, y, z float64) float64</pre> <p>FMA returns x * y + z, computed with only one rounding. (That is, FMA returns the fused multiply-add of x, y, and z.) </p>
+<h2 id="Float32bits">func <span>Float32bits</span> </h2> <pre data-language="go">func Float32bits(f float32) uint32</pre> <p>Float32bits returns the IEEE 754 binary representation of f, with the sign bit of f and the result in the same bit position. Float32bits(Float32frombits(x)) == x. </p>
+<h2 id="Float32frombits">func <span>Float32frombits</span> </h2> <pre data-language="go">func Float32frombits(b uint32) float32</pre> <p>Float32frombits returns the floating-point number corresponding to the IEEE 754 binary representation b, with the sign bit of b and the result in the same bit position. Float32frombits(Float32bits(x)) == x. </p>
+<h2 id="Float64bits">func <span>Float64bits</span> </h2> <pre data-language="go">func Float64bits(f float64) uint64</pre> <p>Float64bits returns the IEEE 754 binary representation of f, with the sign bit of f and the result in the same bit position, and Float64bits(Float64frombits(x)) == x. </p>
+<h2 id="Float64frombits">func <span>Float64frombits</span> </h2> <pre data-language="go">func Float64frombits(b uint64) float64</pre> <p>Float64frombits returns the floating-point number corresponding to the IEEE 754 binary representation b, with the sign bit of b and the result in the same bit position. Float64frombits(Float64bits(x)) == x. </p>
+<h2 id="Floor">func <span>Floor</span> </h2> <pre data-language="go">func Floor(x float64) float64</pre> <p>Floor returns the greatest integer value less than or equal to x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Floor(±0) = ±0
+Floor(±Inf) = ±Inf
+Floor(NaN) = NaN
+</pre> <h4 id="example_Floor"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">c := math.Floor(1.51)
+fmt.Printf("%.1f", c)
+</pre> <p>Output:</p> <pre class="output" data-language="go">1.0
+</pre> <h2 id="Frexp">func <span>Frexp</span> </h2> <pre data-language="go">func Frexp(f float64) (frac float64, exp int)</pre> <p>Frexp breaks f into a normalized fraction and an integral power of two. It returns frac and exp satisfying f == frac × 2**exp, with the absolute value of frac in the interval [½, 1). </p>
+<p>Special cases are: </p>
+<pre data-language="go">Frexp(±0) = ±0, 0
+Frexp(±Inf) = ±Inf, 0
+Frexp(NaN) = NaN, 0
+</pre> <h2 id="Gamma">func <span>Gamma</span> </h2> <pre data-language="go">func Gamma(x float64) float64</pre> <p>Gamma returns the Gamma function of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Gamma(+Inf) = +Inf
+Gamma(+0) = +Inf
+Gamma(-0) = -Inf
+Gamma(x) = NaN for integer x &lt; 0
+Gamma(-Inf) = NaN
+Gamma(NaN) = NaN
+</pre> <h2 id="Hypot">func <span>Hypot</span> </h2> <pre data-language="go">func Hypot(p, q float64) float64</pre> <p>Hypot returns <a href="#Sqrt">Sqrt</a>(p*p + q*q), taking care to avoid unnecessary overflow and underflow. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Hypot(±Inf, q) = +Inf
+Hypot(p, ±Inf) = +Inf
+Hypot(NaN, q) = NaN
+Hypot(p, NaN) = NaN
+</pre> <h2 id="Ilogb">func <span>Ilogb</span> </h2> <pre data-language="go">func Ilogb(x float64) int</pre> <p>Ilogb returns the binary exponent of x as an integer. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Ilogb(±Inf) = MaxInt32
+Ilogb(0) = MinInt32
+Ilogb(NaN) = MaxInt32
+</pre> <h2 id="Inf">func <span>Inf</span> </h2> <pre data-language="go">func Inf(sign int) float64</pre> <p>Inf returns positive infinity if sign &gt;= 0, negative infinity if sign &lt; 0. </p>
+<h2 id="IsInf">func <span>IsInf</span> </h2> <pre data-language="go">func IsInf(f float64, sign int) bool</pre> <p>IsInf reports whether f is an infinity, according to sign. If sign &gt; 0, IsInf reports whether f is positive infinity. If sign &lt; 0, IsInf reports whether f is negative infinity. If sign == 0, IsInf reports whether f is either infinity. </p>
+<h2 id="IsNaN">func <span>IsNaN</span> </h2> <pre data-language="go">func IsNaN(f float64) (is bool)</pre> <p>IsNaN reports whether f is an IEEE 754 “not-a-number” value. </p>
+<h2 id="J0">func <span>J0</span> </h2> <pre data-language="go">func J0(x float64) float64</pre> <p>J0 returns the order-zero Bessel function of the first kind. </p>
+<p>Special cases are: </p>
+<pre data-language="go">J0(±Inf) = 0
+J0(0) = 1
+J0(NaN) = NaN
+</pre> <h2 id="J1">func <span>J1</span> </h2> <pre data-language="go">func J1(x float64) float64</pre> <p>J1 returns the order-one Bessel function of the first kind. </p>
+<p>Special cases are: </p>
+<pre data-language="go">J1(±Inf) = 0
+J1(NaN) = NaN
+</pre> <h2 id="Jn">func <span>Jn</span> </h2> <pre data-language="go">func Jn(n int, x float64) float64</pre> <p>Jn returns the order-n Bessel function of the first kind. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Jn(n, ±Inf) = 0
+Jn(n, NaN) = NaN
+</pre> <h2 id="Ldexp">func <span>Ldexp</span> </h2> <pre data-language="go">func Ldexp(frac float64, exp int) float64</pre> <p>Ldexp is the inverse of <a href="#Frexp">Frexp</a>. It returns frac × 2**exp. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Ldexp(±0, exp) = ±0
+Ldexp(±Inf, exp) = ±Inf
+Ldexp(NaN, exp) = NaN
+</pre> <h2 id="Lgamma">func <span>Lgamma</span> </h2> <pre data-language="go">func Lgamma(x float64) (lgamma float64, sign int)</pre> <p>Lgamma returns the natural logarithm and sign (-1 or +1) of <a href="#Gamma">Gamma</a>(x). </p>
+<p>Special cases are: </p>
+<pre data-language="go">Lgamma(+Inf) = +Inf
+Lgamma(0) = +Inf
+Lgamma(-integer) = +Inf
+Lgamma(-Inf) = -Inf
+Lgamma(NaN) = NaN
+</pre> <h2 id="Log">func <span>Log</span> </h2> <pre data-language="go">func Log(x float64) float64</pre> <p>Log returns the natural logarithm of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Log(+Inf) = +Inf
+Log(0) = -Inf
+Log(x &lt; 0) = NaN
+Log(NaN) = NaN
+</pre> <h4 id="example_Log"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">x := math.Log(1)
+fmt.Printf("%.1f\n", x)
+
+y := math.Log(2.7183)
+fmt.Printf("%.1f\n", y)
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.0
+1.0
+</pre> <h2 id="Log10">func <span>Log10</span> </h2> <pre data-language="go">func Log10(x float64) float64</pre> <p>Log10 returns the decimal logarithm of x. The special cases are the same as for <a href="#Log">Log</a>. </p> <h4 id="example_Log10"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.1f", math.Log10(100))
+</pre> <p>Output:</p> <pre class="output" data-language="go">2.0
+</pre> <h2 id="Log1p">func <span>Log1p</span> </h2> <pre data-language="go">func Log1p(x float64) float64</pre> <p>Log1p returns the natural logarithm of 1 plus its argument x. It is more accurate than <a href="#Log">Log</a>(1 + x) when x is near zero. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Log1p(+Inf) = +Inf
+Log1p(±0) = ±0
+Log1p(-1) = -Inf
+Log1p(x &lt; -1) = NaN
+Log1p(NaN) = NaN
+</pre> <h2 id="Log2">func <span>Log2</span> </h2> <pre data-language="go">func Log2(x float64) float64</pre> <p>Log2 returns the binary logarithm of x. The special cases are the same as for <a href="#Log">Log</a>. </p> <h4 id="example_Log2"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.1f", math.Log2(256))
+</pre> <p>Output:</p> <pre class="output" data-language="go">8.0
+</pre> <h2 id="Logb">func <span>Logb</span> </h2> <pre data-language="go">func Logb(x float64) float64</pre> <p>Logb returns the binary exponent of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Logb(±Inf) = +Inf
+Logb(0) = -Inf
+Logb(NaN) = NaN
+</pre> <h2 id="Max">func <span>Max</span> </h2> <pre data-language="go">func Max(x, y float64) float64</pre> <p>Max returns the larger of x or y. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Max(x, +Inf) = Max(+Inf, x) = +Inf
+Max(x, NaN) = Max(NaN, x) = NaN
+Max(+0, ±0) = Max(±0, +0) = +0
+Max(-0, -0) = -0
+</pre> <p>Note that this differs from the built-in function max when called with NaN and +Inf. </p>
+<h2 id="Min">func <span>Min</span> </h2> <pre data-language="go">func Min(x, y float64) float64</pre> <p>Min returns the smaller of x or y. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Min(x, -Inf) = Min(-Inf, x) = -Inf
+Min(x, NaN) = Min(NaN, x) = NaN
+Min(-0, ±0) = Min(±0, -0) = -0
+</pre> <p>Note that this differs from the built-in function min when called with NaN and -Inf. </p>
+<h2 id="Mod">func <span>Mod</span> </h2> <pre data-language="go">func Mod(x, y float64) float64</pre> <p>Mod returns the floating-point remainder of x/y. The magnitude of the result is less than y and its sign agrees with that of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Mod(±Inf, y) = NaN
+Mod(NaN, y) = NaN
+Mod(x, 0) = NaN
+Mod(x, ±Inf) = x
+Mod(x, NaN) = NaN
+</pre> <h4 id="example_Mod"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">c := math.Mod(7, 4)
+fmt.Printf("%.1f", c)
+</pre> <p>Output:</p> <pre class="output" data-language="go">3.0
+</pre> <h2 id="Modf">func <span>Modf</span> </h2> <pre data-language="go">func Modf(f float64) (int float64, frac float64)</pre> <p>Modf returns integer and fractional floating-point numbers that sum to f. Both values have the same sign as f. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Modf(±Inf) = ±Inf, NaN
+Modf(NaN) = NaN, NaN
+</pre> <h4 id="example_Modf"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">int, frac := math.Modf(3.14)
+fmt.Printf("%.2f, %.2f\n", int, frac)
+
+int, frac = math.Modf(-2.71)
+fmt.Printf("%.2f, %.2f\n", int, frac)
+</pre> <p>Output:</p> <pre class="output" data-language="go">3.00, 0.14
+-2.00, -0.71
+</pre> <h2 id="NaN">func <span>NaN</span> </h2> <pre data-language="go">func NaN() float64</pre> <p>NaN returns an IEEE 754 “not-a-number” value. </p>
+<h2 id="Nextafter">func <span>Nextafter</span> </h2> <pre data-language="go">func Nextafter(x, y float64) (r float64)</pre> <p>Nextafter returns the next representable float64 value after x towards y. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Nextafter(x, x) = x
+Nextafter(NaN, y) = NaN
+Nextafter(x, NaN) = NaN
+</pre> <h2 id="Nextafter32">func <span>Nextafter32</span> <span title="Added in Go 1.4">1.4</span> </h2> <pre data-language="go">func Nextafter32(x, y float32) (r float32)</pre> <p>Nextafter32 returns the next representable float32 value after x towards y. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Nextafter32(x, x) = x
+Nextafter32(NaN, y) = NaN
+Nextafter32(x, NaN) = NaN
+</pre> <h2 id="Pow">func <span>Pow</span> </h2> <pre data-language="go">func Pow(x, y float64) float64</pre> <p>Pow returns x**y, the base-x exponential of y. </p>
+<p>Special cases are (in order): </p>
+<pre data-language="go">Pow(x, ±0) = 1 for any x
+Pow(1, y) = 1 for any y
+Pow(x, 1) = x for any x
+Pow(NaN, y) = NaN
+Pow(x, NaN) = NaN
+Pow(±0, y) = ±Inf for y an odd integer &lt; 0
+Pow(±0, -Inf) = +Inf
+Pow(±0, +Inf) = +0
+Pow(±0, y) = +Inf for finite y &lt; 0 and not an odd integer
+Pow(±0, y) = ±0 for y an odd integer &gt; 0
+Pow(±0, y) = +0 for finite y &gt; 0 and not an odd integer
+Pow(-1, ±Inf) = 1
+Pow(x, +Inf) = +Inf for |x| &gt; 1
+Pow(x, -Inf) = +0 for |x| &gt; 1
+Pow(x, +Inf) = +0 for |x| &lt; 1
+Pow(x, -Inf) = +Inf for |x| &lt; 1
+Pow(+Inf, y) = +Inf for y &gt; 0
+Pow(+Inf, y) = +0 for y &lt; 0
+Pow(-Inf, y) = Pow(-0, -y)
+Pow(x, y) = NaN for finite x &lt; 0 and finite non-integer y
+</pre> <h4 id="example_Pow"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">c := math.Pow(2, 3)
+fmt.Printf("%.1f", c)
+</pre> <p>Output:</p> <pre class="output" data-language="go">8.0
+</pre> <h2 id="Pow10">func <span>Pow10</span> </h2> <pre data-language="go">func Pow10(n int) float64</pre> <p>Pow10 returns 10**n, the base-10 exponential of n. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Pow10(n) = 0 for n &lt; -323
+Pow10(n) = +Inf for n &gt; 308
+</pre> <h4 id="example_Pow10"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">c := math.Pow10(2)
+fmt.Printf("%.1f", c)
+</pre> <p>Output:</p> <pre class="output" data-language="go">100.0
+</pre> <h2 id="Remainder">func <span>Remainder</span> </h2> <pre data-language="go">func Remainder(x, y float64) float64</pre> <p>Remainder returns the IEEE 754 floating-point remainder of x/y. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Remainder(±Inf, y) = NaN
+Remainder(NaN, y) = NaN
+Remainder(x, 0) = NaN
+Remainder(x, ±Inf) = x
+Remainder(x, NaN) = NaN
+</pre> <h4 id="example_Remainder"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.1f", math.Remainder(100, 30))
+</pre> <p>Output:</p> <pre class="output" data-language="go">10.0
+</pre> <h2 id="Round">func <span>Round</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func Round(x float64) float64</pre> <p>Round returns the nearest integer, rounding half away from zero. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Round(±0) = ±0
+Round(±Inf) = ±Inf
+Round(NaN) = NaN
+</pre> <h4 id="example_Round"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">p := math.Round(10.5)
+fmt.Printf("%.1f\n", p)
+
+n := math.Round(-10.5)
+fmt.Printf("%.1f\n", n)
+</pre> <p>Output:</p> <pre class="output" data-language="go">11.0
+-11.0
+</pre> <h2 id="RoundToEven">func <span>RoundToEven</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func RoundToEven(x float64) float64</pre> <p>RoundToEven returns the nearest integer, rounding ties to even. </p>
+<p>Special cases are: </p>
+<pre data-language="go">RoundToEven(±0) = ±0
+RoundToEven(±Inf) = ±Inf
+RoundToEven(NaN) = NaN
+</pre> <h4 id="example_RoundToEven"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u := math.RoundToEven(11.5)
+fmt.Printf("%.1f\n", u)
+
+d := math.RoundToEven(12.5)
+fmt.Printf("%.1f\n", d)
+</pre> <p>Output:</p> <pre class="output" data-language="go">12.0
+12.0
+</pre> <h2 id="Signbit">func <span>Signbit</span> </h2> <pre data-language="go">func Signbit(x float64) bool</pre> <p>Signbit reports whether x is negative or negative zero. </p>
+<h2 id="Sin">func <span>Sin</span> </h2> <pre data-language="go">func Sin(x float64) float64</pre> <p>Sin returns the sine of the radian argument x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Sin(±0) = ±0
+Sin(±Inf) = NaN
+Sin(NaN) = NaN
+</pre> <h4 id="example_Sin"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Sin(math.Pi))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Sincos">func <span>Sincos</span> </h2> <pre data-language="go">func Sincos(x float64) (sin, cos float64)</pre> <p>Sincos returns Sin(x), Cos(x). </p>
+<p>Special cases are: </p>
+<pre data-language="go">Sincos(±0) = ±0, 1
+Sincos(±Inf) = NaN, NaN
+Sincos(NaN) = NaN, NaN
+</pre> <h4 id="example_Sincos"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">sin, cos := math.Sincos(0)
+fmt.Printf("%.2f, %.2f", sin, cos)
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00, 1.00
+</pre> <h2 id="Sinh">func <span>Sinh</span> </h2> <pre data-language="go">func Sinh(x float64) float64</pre> <p>Sinh returns the hyperbolic sine of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Sinh(±0) = ±0
+Sinh(±Inf) = ±Inf
+Sinh(NaN) = NaN
+</pre> <h4 id="example_Sinh"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Sinh(0))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Sqrt">func <span>Sqrt</span> </h2> <pre data-language="go">func Sqrt(x float64) float64</pre> <p>Sqrt returns the square root of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Sqrt(+Inf) = +Inf
+Sqrt(±0) = ±0
+Sqrt(x &lt; 0) = NaN
+Sqrt(NaN) = NaN
+</pre> <h4 id="example_Sqrt"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const (
+ a = 3
+ b = 4
+)
+c := math.Sqrt(a*a + b*b)
+fmt.Printf("%.1f", c)
+</pre> <p>Output:</p> <pre class="output" data-language="go">5.0
+</pre> <h2 id="Tan">func <span>Tan</span> </h2> <pre data-language="go">func Tan(x float64) float64</pre> <p>Tan returns the tangent of the radian argument x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Tan(±0) = ±0
+Tan(±Inf) = NaN
+Tan(NaN) = NaN
+</pre> <h4 id="example_Tan"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Tan(0))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Tanh">func <span>Tanh</span> </h2> <pre data-language="go">func Tanh(x float64) float64</pre> <p>Tanh returns the hyperbolic tangent of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Tanh(±0) = ±0
+Tanh(±Inf) = ±1
+Tanh(NaN) = NaN
+</pre> <h4 id="example_Tanh"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f", math.Tanh(0))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0.00
+</pre> <h2 id="Trunc">func <span>Trunc</span> </h2> <pre data-language="go">func Trunc(x float64) float64</pre> <p>Trunc returns the integer value of x. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Trunc(±0) = ±0
+Trunc(±Inf) = ±Inf
+Trunc(NaN) = NaN
+</pre> <h4 id="example_Trunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%.2f\n", math.Trunc(math.Pi))
+fmt.Printf("%.2f\n", math.Trunc(-1.2345))
+</pre> <p>Output:</p> <pre class="output" data-language="go">3.00
+-1.00
+</pre> <h2 id="Y0">func <span>Y0</span> </h2> <pre data-language="go">func Y0(x float64) float64</pre> <p>Y0 returns the order-zero Bessel function of the second kind. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Y0(+Inf) = 0
+Y0(0) = -Inf
+Y0(x &lt; 0) = NaN
+Y0(NaN) = NaN
+</pre> <h2 id="Y1">func <span>Y1</span> </h2> <pre data-language="go">func Y1(x float64) float64</pre> <p>Y1 returns the order-one Bessel function of the second kind. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Y1(+Inf) = 0
+Y1(0) = -Inf
+Y1(x &lt; 0) = NaN
+Y1(NaN) = NaN
+</pre> <h2 id="Yn">func <span>Yn</span> </h2> <pre data-language="go">func Yn(n int, x float64) float64</pre> <p>Yn returns the order-n Bessel function of the second kind. </p>
+<p>Special cases are: </p>
+<pre data-language="go">Yn(n, +Inf) = 0
+Yn(n ≥ 0, 0) = -Inf
+Yn(n &lt; 0, 0) = +Inf if n is odd, -Inf if n is even
+Yn(n, x &lt; 0) = NaN
+Yn(n, NaN) = NaN
+</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="big/index">big</a> </td> <td class="pkg-synopsis"> Package big implements arbitrary-precision arithmetic (big numbers). </td> </tr> <tr> <td class="pkg-name"> <a href="bits/index">bits</a> </td> <td class="pkg-synopsis"> Package bits implements bit counting and manipulation functions for the predeclared unsigned integer types. </td> </tr> <tr> <td class="pkg-name"> <a href="cmplx/index">cmplx</a> </td> <td class="pkg-synopsis"> Package cmplx provides basic constants and mathematical functions for complex numbers. </td> </tr> <tr> <td class="pkg-name"> <a href="rand/index">rand</a> </td> <td class="pkg-synopsis"> Package rand implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work. </td> </tr> <tr> <td class="pkg-name"> <a href="rand/v2/index">v2</a> </td> <td class="pkg-synopsis"> Package rand implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/math/" class="_attribution-link">http://golang.org/pkg/math/</a>
+ </p>
+</div>
diff --git a/devdocs/go/math%2Frand%2Findex.html b/devdocs/go/math%2Frand%2Findex.html
new file mode 100644
index 00000000..17d714f2
--- /dev/null
+++ b/devdocs/go/math%2Frand%2Findex.html
@@ -0,0 +1,240 @@
+<h1> Package rand </h1> <ul id="short-nav">
+<li><code>import "math/rand"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package rand implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work. </p>
+<p>Random numbers are generated by a <a href="#Source">Source</a>, usually wrapped in a <a href="#Rand">Rand</a>. Both types should be used by a single goroutine at a time: sharing among multiple goroutines requires some kind of synchronization. </p>
+<p>Top-level functions, such as <a href="#Float64">Float64</a> and <a href="#Int">Int</a>, are safe for concurrent use by multiple goroutines. </p>
+<p>This package's outputs might be easily predictable regardless of how it's seeded. For random numbers suitable for security-sensitive work, see the crypto/rand package. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+answers := []string{
+ "It is certain",
+ "It is decidedly so",
+ "Without a doubt",
+ "Yes definitely",
+ "You may rely on it",
+ "As I see it yes",
+ "Most likely",
+ "Outlook good",
+ "Yes",
+ "Signs point to yes",
+ "Reply hazy try again",
+ "Ask again later",
+ "Better not tell you now",
+ "Cannot predict now",
+ "Concentrate and ask again",
+ "Don't count on it",
+ "My reply is no",
+ "My sources say no",
+ "Outlook not so good",
+ "Very doubtful",
+}
+fmt.Println("Magic 8-Ball says:", answers[rand.Intn(len(answers))])
+</pre> <h4 id="example__rand"> <span class="text">Example (Rand)</span>
+</h4> <p>This example shows the use of each of the methods on a *Rand. The use of the global functions is the same, without the receiver. </p> <p>Code:</p> <pre class="code" data-language="go">// Create and seed the generator.
+// Typically a non-fixed seed should be used, such as time.Now().UnixNano().
+// Using a fixed seed will produce the same output on every run.
+r := rand.New(rand.NewSource(99))
+
+// The tabwriter here helps us generate aligned output.
+w := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0)
+defer w.Flush()
+show := func(name string, v1, v2, v3 any) {
+ fmt.Fprintf(w, "%s\t%v\t%v\t%v\n", name, v1, v2, v3)
+}
+
+// Float32 and Float64 values are in [0, 1).
+show("Float32", r.Float32(), r.Float32(), r.Float32())
+show("Float64", r.Float64(), r.Float64(), r.Float64())
+
+// ExpFloat64 values have an average of 1 but decay exponentially.
+show("ExpFloat64", r.ExpFloat64(), r.ExpFloat64(), r.ExpFloat64())
+
+// NormFloat64 values have an average of 0 and a standard deviation of 1.
+show("NormFloat64", r.NormFloat64(), r.NormFloat64(), r.NormFloat64())
+
+// Int31, Int63, and Uint32 generate values of the given width.
+// The Int method (not shown) is like either Int31 or Int63
+// depending on the size of 'int'.
+show("Int31", r.Int31(), r.Int31(), r.Int31())
+show("Int63", r.Int63(), r.Int63(), r.Int63())
+show("Uint32", r.Uint32(), r.Uint32(), r.Uint32())
+
+// Intn, Int31n, and Int63n limit their output to be &lt; n.
+// They do so more carefully than using r.Int()%n.
+show("Intn(10)", r.Intn(10), r.Intn(10), r.Intn(10))
+show("Int31n(10)", r.Int31n(10), r.Int31n(10), r.Int31n(10))
+show("Int63n(10)", r.Int63n(10), r.Int63n(10), r.Int63n(10))
+
+// Perm generates a random permutation of the numbers [0, n).
+show("Perm", r.Perm(5), r.Perm(5), r.Perm(5))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Float32 0.2635776 0.6358173 0.6718283
+Float64 0.628605430454327 0.4504798828572669 0.9562755949377957
+ExpFloat64 0.3362240648200941 1.4256072328483647 0.24354758816173044
+NormFloat64 0.17233959114940064 1.577014951434847 0.04259129641113857
+Int31 1501292890 1486668269 182840835
+Int63 3546343826724305832 5724354148158589552 5239846799706671610
+Uint32 2760229429 296659907 1922395059
+Intn(10) 1 2 5
+Int31n(10) 4 7 8
+Int63n(10) 7 6 3
+Perm [1 4 2 3 0] [4 2 1 3 0] [1 2 4 0 3]
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#ExpFloat64">func ExpFloat64() float64</a></li>
+<li><a href="#Float32">func Float32() float32</a></li>
+<li><a href="#Float64">func Float64() float64</a></li>
+<li><a href="#Int">func Int() int</a></li>
+<li><a href="#Int31">func Int31() int32</a></li>
+<li><a href="#Int31n">func Int31n(n int32) int32</a></li>
+<li><a href="#Int63">func Int63() int64</a></li>
+<li><a href="#Int63n">func Int63n(n int64) int64</a></li>
+<li><a href="#Intn">func Intn(n int) int</a></li>
+<li><a href="#NormFloat64">func NormFloat64() float64</a></li>
+<li><a href="#Perm">func Perm(n int) []int</a></li>
+<li><a href="#Read">func Read(p []byte) (n int, err error)</a></li>
+<li><a href="#Seed">func Seed(seed int64)</a></li>
+<li><a href="#Shuffle">func Shuffle(n int, swap func(i, j int))</a></li>
+<li><a href="#Uint32">func Uint32() uint32</a></li>
+<li><a href="#Uint64">func Uint64() uint64</a></li>
+<li><a href="#Rand">type Rand</a></li>
+<li> <a href="#New">func New(src Source) *Rand</a>
+</li>
+<li> <a href="#Rand.ExpFloat64">func (r *Rand) ExpFloat64() float64</a>
+</li>
+<li> <a href="#Rand.Float32">func (r *Rand) Float32() float32</a>
+</li>
+<li> <a href="#Rand.Float64">func (r *Rand) Float64() float64</a>
+</li>
+<li> <a href="#Rand.Int">func (r *Rand) Int() int</a>
+</li>
+<li> <a href="#Rand.Int31">func (r *Rand) Int31() int32</a>
+</li>
+<li> <a href="#Rand.Int31n">func (r *Rand) Int31n(n int32) int32</a>
+</li>
+<li> <a href="#Rand.Int63">func (r *Rand) Int63() int64</a>
+</li>
+<li> <a href="#Rand.Int63n">func (r *Rand) Int63n(n int64) int64</a>
+</li>
+<li> <a href="#Rand.Intn">func (r *Rand) Intn(n int) int</a>
+</li>
+<li> <a href="#Rand.NormFloat64">func (r *Rand) NormFloat64() float64</a>
+</li>
+<li> <a href="#Rand.Perm">func (r *Rand) Perm(n int) []int</a>
+</li>
+<li> <a href="#Rand.Read">func (r *Rand) Read(p []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Rand.Seed">func (r *Rand) Seed(seed int64)</a>
+</li>
+<li> <a href="#Rand.Shuffle">func (r *Rand) Shuffle(n int, swap func(i, j int))</a>
+</li>
+<li> <a href="#Rand.Uint32">func (r *Rand) Uint32() uint32</a>
+</li>
+<li> <a href="#Rand.Uint64">func (r *Rand) Uint64() uint64</a>
+</li>
+<li><a href="#Source">type Source</a></li>
+<li> <a href="#NewSource">func NewSource(seed int64) Source</a>
+</li>
+<li><a href="#Source64">type Source64</a></li>
+<li><a href="#Zipf">type Zipf</a></li>
+<li> <a href="#NewZipf">func NewZipf(r *Rand, s float64, v float64, imax uint64) *Zipf</a>
+</li>
+<li> <a href="#Zipf.Uint64">func (z *Zipf) Uint64() uint64</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example_Intn">Intn</a></dd> <dd><a class="exampleLink" href="#example_Perm">Perm</a></dd> <dd><a class="exampleLink" href="#example_Shuffle">Shuffle</a></dd> <dd><a class="exampleLink" href="#example_Shuffle_slicesInUnison">Shuffle (SlicesInUnison)</a></dd> <dd><a class="exampleLink" href="#example__rand">Package (Rand)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>exp.go</span> <span>normal.go</span> <span>rand.go</span> <span>rng.go</span> <span>zipf.go</span> </p> <h2 id="ExpFloat64">func <span>ExpFloat64</span> </h2> <pre data-language="go">func ExpFloat64() float64</pre> <p>ExpFloat64 returns an exponentially distributed float64 in the range (0, +[math.MaxFloat64]] with an exponential distribution whose rate parameter (lambda) is 1 and whose mean is 1/lambda (1) from the default <a href="#Source">Source</a>. To produce a distribution with a different rate parameter, callers can adjust the output using: </p>
+<pre data-language="go">sample = ExpFloat64() / desiredRateParameter
+</pre> <h2 id="Float32">func <span>Float32</span> </h2> <pre data-language="go">func Float32() float32</pre> <p>Float32 returns, as a float32, a pseudo-random number in the half-open interval [0.0,1.0) from the default <a href="#Source">Source</a>. </p>
+<h2 id="Float64">func <span>Float64</span> </h2> <pre data-language="go">func Float64() float64</pre> <p>Float64 returns, as a float64, a pseudo-random number in the half-open interval [0.0,1.0) from the default <a href="#Source">Source</a>. </p>
+<h2 id="Int">func <span>Int</span> </h2> <pre data-language="go">func Int() int</pre> <p>Int returns a non-negative pseudo-random int from the default <a href="#Source">Source</a>. </p>
+<h2 id="Int31">func <span>Int31</span> </h2> <pre data-language="go">func Int31() int32</pre> <p>Int31 returns a non-negative pseudo-random 31-bit integer as an int32 from the default <a href="#Source">Source</a>. </p>
+<h2 id="Int31n">func <span>Int31n</span> </h2> <pre data-language="go">func Int31n(n int32) int32</pre> <p>Int31n returns, as an int32, a non-negative pseudo-random number in the half-open interval [0,n) from the default <a href="#Source">Source</a>. It panics if n &lt;= 0. </p>
+<h2 id="Int63">func <span>Int63</span> </h2> <pre data-language="go">func Int63() int64</pre> <p>Int63 returns a non-negative pseudo-random 63-bit integer as an int64 from the default <a href="#Source">Source</a>. </p>
+<h2 id="Int63n">func <span>Int63n</span> </h2> <pre data-language="go">func Int63n(n int64) int64</pre> <p>Int63n returns, as an int64, a non-negative pseudo-random number in the half-open interval [0,n) from the default <a href="#Source">Source</a>. It panics if n &lt;= 0. </p>
+<h2 id="Intn">func <span>Intn</span> </h2> <pre data-language="go">func Intn(n int) int</pre> <p>Intn returns, as an int, a non-negative pseudo-random number in the half-open interval [0,n) from the default <a href="#Source">Source</a>. It panics if n &lt;= 0. </p> <h4 id="example_Intn"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+fmt.Println(rand.Intn(100))
+fmt.Println(rand.Intn(100))
+fmt.Println(rand.Intn(100))
+</pre> <h2 id="NormFloat64">func <span>NormFloat64</span> </h2> <pre data-language="go">func NormFloat64() float64</pre> <p>NormFloat64 returns a normally distributed float64 in the range [-<span>math.MaxFloat64</span>, +[math.MaxFloat64]] with standard normal distribution (mean = 0, stddev = 1) from the default <a href="#Source">Source</a>. To produce a different normal distribution, callers can adjust the output using: </p>
+<pre data-language="go">sample = NormFloat64() * desiredStdDev + desiredMean
+</pre> <h2 id="Perm">func <span>Perm</span> </h2> <pre data-language="go">func Perm(n int) []int</pre> <p>Perm returns, as a slice of n ints, a pseudo-random permutation of the integers in the half-open interval [0,n) from the default <a href="#Source">Source</a>. </p> <h4 id="example_Perm"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">for _, value := range rand.Perm(3) {
+ fmt.Println(value)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1
+2
+0
+</pre> <h2 id="Read">func <span>Read</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">func Read(p []byte) (n int, err error)</pre> <p>Read generates len(p) random bytes from the default <a href="#Source">Source</a> and writes them into p. It always returns len(p) and a nil error. Read, unlike the <a href="#Rand.Read">Rand.Read</a> method, is safe for concurrent use. </p>
+<p>Deprecated: For almost all use cases, <span>crypto/rand.Read</span> is more appropriate. </p>
+<h2 id="Seed">func <span>Seed</span> </h2> <pre data-language="go">func Seed(seed int64)</pre> <p>Seed uses the provided seed value to initialize the default Source to a deterministic state. Seed values that have the same remainder when divided by 2³¹-1 generate the same pseudo-random sequence. Seed, unlike the <a href="#Rand.Seed">Rand.Seed</a> method, is safe for concurrent use. </p>
+<p>If Seed is not called, the generator is seeded randomly at program startup. </p>
+<p>Prior to Go 1.20, the generator was seeded like Seed(1) at program startup. To force the old behavior, call Seed(1) at program startup. Alternately, set GODEBUG=randautoseed=0 in the environment before making any calls to functions in this package. </p>
+<p>Deprecated: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. </p>
+<h2 id="Shuffle">func <span>Shuffle</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func Shuffle(n int, swap func(i, j int))</pre> <p>Shuffle pseudo-randomizes the order of elements using the default <a href="#Source">Source</a>. n is the number of elements. Shuffle panics if n &lt; 0. swap swaps the elements with indexes i and j. </p> <h4 id="example_Shuffle"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+words := strings.Fields("ink runs from the corners of my mouth")
+rand.Shuffle(len(words), func(i, j int) {
+ words[i], words[j] = words[j], words[i]
+})
+fmt.Println(words)
+</pre> <h4 id="example_Shuffle_slicesInUnison"> <span class="text">Example (SlicesInUnison)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+numbers := []byte("12345")
+letters := []byte("ABCDE")
+// Shuffle numbers, swapping corresponding entries in letters at the same time.
+rand.Shuffle(len(numbers), func(i, j int) {
+ numbers[i], numbers[j] = numbers[j], numbers[i]
+ letters[i], letters[j] = letters[j], letters[i]
+})
+for i := range numbers {
+ fmt.Printf("%c: %c\n", letters[i], numbers[i])
+}
+</pre> <h2 id="Uint32">func <span>Uint32</span> </h2> <pre data-language="go">func Uint32() uint32</pre> <p>Uint32 returns a pseudo-random 32-bit value as a uint32 from the default <a href="#Source">Source</a>. </p>
+<h2 id="Uint64">func <span>Uint64</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func Uint64() uint64</pre> <p>Uint64 returns a pseudo-random 64-bit value as a uint64 from the default <a href="#Source">Source</a>. </p>
+<h2 id="Rand">type <span>Rand</span> </h2> <p>A Rand is a source of random numbers. </p>
+<pre data-language="go">type Rand struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(src Source) *Rand</pre> <p>New returns a new <a href="#Rand">Rand</a> that uses random values from src to generate other random values. </p>
+<h3 id="Rand.ExpFloat64">func (*Rand) <span>ExpFloat64</span> </h3> <pre data-language="go">func (r *Rand) ExpFloat64() float64</pre> <p>ExpFloat64 returns an exponentially distributed float64 in the range (0, +[math.MaxFloat64]] with an exponential distribution whose rate parameter (lambda) is 1 and whose mean is 1/lambda (1). To produce a distribution with a different rate parameter, callers can adjust the output using: </p>
+<pre data-language="go">sample = ExpFloat64() / desiredRateParameter
+</pre> <h3 id="Rand.Float32">func (*Rand) <span>Float32</span> </h3> <pre data-language="go">func (r *Rand) Float32() float32</pre> <p>Float32 returns, as a float32, a pseudo-random number in the half-open interval [0.0,1.0). </p>
+<h3 id="Rand.Float64">func (*Rand) <span>Float64</span> </h3> <pre data-language="go">func (r *Rand) Float64() float64</pre> <p>Float64 returns, as a float64, a pseudo-random number in the half-open interval [0.0,1.0). </p>
+<h3 id="Rand.Int">func (*Rand) <span>Int</span> </h3> <pre data-language="go">func (r *Rand) Int() int</pre> <p>Int returns a non-negative pseudo-random int. </p>
+<h3 id="Rand.Int31">func (*Rand) <span>Int31</span> </h3> <pre data-language="go">func (r *Rand) Int31() int32</pre> <p>Int31 returns a non-negative pseudo-random 31-bit integer as an int32. </p>
+<h3 id="Rand.Int31n">func (*Rand) <span>Int31n</span> </h3> <pre data-language="go">func (r *Rand) Int31n(n int32) int32</pre> <p>Int31n returns, as an int32, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n &lt;= 0. </p>
+<h3 id="Rand.Int63">func (*Rand) <span>Int63</span> </h3> <pre data-language="go">func (r *Rand) Int63() int64</pre> <p>Int63 returns a non-negative pseudo-random 63-bit integer as an int64. </p>
+<h3 id="Rand.Int63n">func (*Rand) <span>Int63n</span> </h3> <pre data-language="go">func (r *Rand) Int63n(n int64) int64</pre> <p>Int63n returns, as an int64, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n &lt;= 0. </p>
+<h3 id="Rand.Intn">func (*Rand) <span>Intn</span> </h3> <pre data-language="go">func (r *Rand) Intn(n int) int</pre> <p>Intn returns, as an int, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n &lt;= 0. </p>
+<h3 id="Rand.NormFloat64">func (*Rand) <span>NormFloat64</span> </h3> <pre data-language="go">func (r *Rand) NormFloat64() float64</pre> <p>NormFloat64 returns a normally distributed float64 in the range -<span>math.MaxFloat64</span> through +[math.MaxFloat64] inclusive, with standard normal distribution (mean = 0, stddev = 1). To produce a different normal distribution, callers can adjust the output using: </p>
+<pre data-language="go">sample = NormFloat64() * desiredStdDev + desiredMean
+</pre> <h3 id="Rand.Perm">func (*Rand) <span>Perm</span> </h3> <pre data-language="go">func (r *Rand) Perm(n int) []int</pre> <p>Perm returns, as a slice of n ints, a pseudo-random permutation of the integers in the half-open interval [0,n). </p>
+<h3 id="Rand.Read">func (*Rand) <span>Read</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (r *Rand) Read(p []byte) (n int, err error)</pre> <p>Read generates len(p) random bytes and writes them into p. It always returns len(p) and a nil error. Read should not be called concurrently with any other Rand method. </p>
+<h3 id="Rand.Seed">func (*Rand) <span>Seed</span> </h3> <pre data-language="go">func (r *Rand) Seed(seed int64)</pre> <p>Seed uses the provided seed value to initialize the generator to a deterministic state. Seed should not be called concurrently with any other <a href="#Rand">Rand</a> method. </p>
+<h3 id="Rand.Shuffle">func (*Rand) <span>Shuffle</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (r *Rand) Shuffle(n int, swap func(i, j int))</pre> <p>Shuffle pseudo-randomizes the order of elements. n is the number of elements. Shuffle panics if n &lt; 0. swap swaps the elements with indexes i and j. </p>
+<h3 id="Rand.Uint32">func (*Rand) <span>Uint32</span> </h3> <pre data-language="go">func (r *Rand) Uint32() uint32</pre> <p>Uint32 returns a pseudo-random 32-bit value as a uint32. </p>
+<h3 id="Rand.Uint64">func (*Rand) <span>Uint64</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Rand) Uint64() uint64</pre> <p>Uint64 returns a pseudo-random 64-bit value as a uint64. </p>
+<h2 id="Source">type <span>Source</span> </h2> <p>A Source represents a source of uniformly-distributed pseudo-random int64 values in the range [0, 1&lt;&lt;63). </p>
+<p>A Source is not safe for concurrent use by multiple goroutines. </p>
+<pre data-language="go">type Source interface {
+ Int63() int64
+ Seed(seed int64)
+}</pre> <h3 id="NewSource">func <span>NewSource</span> </h3> <pre data-language="go">func NewSource(seed int64) Source</pre> <p>NewSource returns a new pseudo-random <a href="#Source">Source</a> seeded with the given value. Unlike the default <a href="#Source">Source</a> used by top-level functions, this source is not safe for concurrent use by multiple goroutines. The returned <a href="#Source">Source</a> implements <a href="#Source64">Source64</a>. </p>
+<h2 id="Source64">type <span>Source64</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>A Source64 is a <a href="#Source">Source</a> that can also generate uniformly-distributed pseudo-random uint64 values in the range [0, 1&lt;&lt;64) directly. If a <a href="#Rand">Rand</a> r's underlying <a href="#Source">Source</a> s implements Source64, then r.Uint64 returns the result of one call to s.Uint64 instead of making two calls to s.Int63. </p>
+<pre data-language="go">type Source64 interface {
+ Source
+ Uint64() uint64
+}</pre> <h2 id="Zipf">type <span>Zipf</span> </h2> <p>A Zipf generates Zipf distributed variates. </p>
+<pre data-language="go">type Zipf struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewZipf">func <span>NewZipf</span> </h3> <pre data-language="go">func NewZipf(r *Rand, s float64, v float64, imax uint64) *Zipf</pre> <p>NewZipf returns a <a href="#Zipf">Zipf</a> variate generator. The generator generates values k ∈ [0, imax] such that P(k) is proportional to (v + k) ** (-s). Requirements: s &gt; 1 and v &gt;= 1. </p>
+<h3 id="Zipf.Uint64">func (*Zipf) <span>Uint64</span> </h3> <pre data-language="go">func (z *Zipf) Uint64() uint64</pre> <p>Uint64 returns a value drawn from the <a href="#Zipf">Zipf</a> distribution described by the <a href="#Zipf">Zipf</a> object. </p>
+<h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="v2/index">v2</a> </td> <td class="pkg-synopsis"> Package rand implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/math/rand/" class="_attribution-link">http://golang.org/pkg/math/rand/</a>
+ </p>
+</div>
diff --git a/devdocs/go/math%2Frand%2Fv2%2Findex.html b/devdocs/go/math%2Frand%2Fv2%2Findex.html
new file mode 100644
index 00000000..79488bd9
--- /dev/null
+++ b/devdocs/go/math%2Frand%2Fv2%2Findex.html
@@ -0,0 +1,278 @@
+<h1> Package rand </h1> <ul id="short-nav">
+<li><code>import "math/rand/v2"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package rand implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work. </p>
+<p>Random numbers are generated by a <a href="#Source">Source</a>, usually wrapped in a <a href="#Rand">Rand</a>. Both types should be used by a single goroutine at a time: sharing among multiple goroutines requires some kind of synchronization. </p>
+<p>Top-level functions, such as <a href="#Float64">Float64</a> and <a href="#Int">Int</a>, are safe for concurrent use by multiple goroutines. </p>
+<p>This package's outputs might be easily predictable regardless of how it's seeded. For random numbers suitable for security-sensitive work, see the crypto/rand package. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+answers := []string{
+ "It is certain",
+ "It is decidedly so",
+ "Without a doubt",
+ "Yes definitely",
+ "You may rely on it",
+ "As I see it yes",
+ "Most likely",
+ "Outlook good",
+ "Yes",
+ "Signs point to yes",
+ "Reply hazy try again",
+ "Ask again later",
+ "Better not tell you now",
+ "Cannot predict now",
+ "Concentrate and ask again",
+ "Don't count on it",
+ "My reply is no",
+ "My sources say no",
+ "Outlook not so good",
+ "Very doubtful",
+}
+fmt.Println("Magic 8-Ball says:", answers[rand.IntN(len(answers))])
+</pre> <h4 id="example__rand"> <span class="text">Example (Rand)</span>
+</h4> <p>This example shows the use of each of the methods on a *Rand. The use of the global functions is the same, without the receiver. </p> <p>Code:</p> <pre class="code" data-language="go">// Create and seed the generator.
+// Typically a non-fixed seed should be used, such as Uint64(), Uint64().
+// Using a fixed seed will produce the same output on every run.
+r := rand.New(rand.NewPCG(1, 2))
+
+// The tabwriter here helps us generate aligned output.
+w := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0)
+defer w.Flush()
+show := func(name string, v1, v2, v3 any) {
+ fmt.Fprintf(w, "%s\t%v\t%v\t%v\n", name, v1, v2, v3)
+}
+
+// Float32 and Float64 values are in [0, 1).
+show("Float32", r.Float32(), r.Float32(), r.Float32())
+show("Float64", r.Float64(), r.Float64(), r.Float64())
+
+// ExpFloat64 values have an average of 1 but decay exponentially.
+show("ExpFloat64", r.ExpFloat64(), r.ExpFloat64(), r.ExpFloat64())
+
+// NormFloat64 values have an average of 0 and a standard deviation of 1.
+show("NormFloat64", r.NormFloat64(), r.NormFloat64(), r.NormFloat64())
+
+// Int32, Int64, and Uint32 generate values of the given width.
+// The Int method (not shown) is like either Int32 or Int64
+// depending on the size of 'int'.
+show("Int32", r.Int32(), r.Int32(), r.Int32())
+show("Int64", r.Int64(), r.Int64(), r.Int64())
+show("Uint32", r.Uint32(), r.Uint32(), r.Uint32())
+
+// IntN, Int32N, and Int64N limit their output to be &lt; n.
+// They do so more carefully than using r.Int()%n.
+show("IntN(10)", r.IntN(10), r.IntN(10), r.IntN(10))
+show("Int32N(10)", r.Int32N(10), r.Int32N(10), r.Int32N(10))
+show("Int64N(10)", r.Int64N(10), r.Int64N(10), r.Int64N(10))
+
+// Perm generates a random permutation of the numbers [0, n).
+show("Perm", r.Perm(5), r.Perm(5), r.Perm(5))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Float32 0.95955694 0.8076733 0.8135684
+Float64 0.4297927436037299 0.797802349388613 0.3883664855410056
+ExpFloat64 0.43463410545541104 0.5513632046504593 0.7426404617374481
+NormFloat64 -0.9303318111676635 -0.04750789419852852 0.22248301107582735
+Int32 2020777787 260808523 851126509
+Int64 5231057920893523323 4257872588489500903 158397175702351138
+Uint32 314478343 1418758728 208955345
+IntN(10) 6 2 0
+Int32N(10) 3 7 7
+Int64N(10) 8 9 4
+Perm [0 3 1 4 2] [4 1 2 0 3] [4 3 2 0 1]
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#ExpFloat64">func ExpFloat64() float64</a></li>
+<li><a href="#Float32">func Float32() float32</a></li>
+<li><a href="#Float64">func Float64() float64</a></li>
+<li><a href="#Int">func Int() int</a></li>
+<li><a href="#Int32">func Int32() int32</a></li>
+<li><a href="#Int32N">func Int32N(n int32) int32</a></li>
+<li><a href="#Int64">func Int64() int64</a></li>
+<li><a href="#Int64N">func Int64N(n int64) int64</a></li>
+<li><a href="#IntN">func IntN(n int) int</a></li>
+<li><a href="#N">func N[Int intType](n Int) Int</a></li>
+<li><a href="#NormFloat64">func NormFloat64() float64</a></li>
+<li><a href="#Perm">func Perm(n int) []int</a></li>
+<li><a href="#Shuffle">func Shuffle(n int, swap func(i, j int))</a></li>
+<li><a href="#Uint32">func Uint32() uint32</a></li>
+<li><a href="#Uint32N">func Uint32N(n uint32) uint32</a></li>
+<li><a href="#Uint64">func Uint64() uint64</a></li>
+<li><a href="#Uint64N">func Uint64N(n uint64) uint64</a></li>
+<li><a href="#UintN">func UintN(n uint) uint</a></li>
+<li><a href="#ChaCha8">type ChaCha8</a></li>
+<li> <a href="#NewChaCha8">func NewChaCha8(seed [32]byte) *ChaCha8</a>
+</li>
+<li> <a href="#ChaCha8.MarshalBinary">func (c *ChaCha8) MarshalBinary() ([]byte, error)</a>
+</li>
+<li> <a href="#ChaCha8.Seed">func (c *ChaCha8) Seed(seed [32]byte)</a>
+</li>
+<li> <a href="#ChaCha8.Uint64">func (c *ChaCha8) Uint64() uint64</a>
+</li>
+<li> <a href="#ChaCha8.UnmarshalBinary">func (c *ChaCha8) UnmarshalBinary(data []byte) error</a>
+</li>
+<li><a href="#PCG">type PCG</a></li>
+<li> <a href="#NewPCG">func NewPCG(seed1, seed2 uint64) *PCG</a>
+</li>
+<li> <a href="#PCG.MarshalBinary">func (p *PCG) MarshalBinary() ([]byte, error)</a>
+</li>
+<li> <a href="#PCG.Seed">func (p *PCG) Seed(seed1, seed2 uint64)</a>
+</li>
+<li> <a href="#PCG.Uint64">func (p *PCG) Uint64() uint64</a>
+</li>
+<li> <a href="#PCG.UnmarshalBinary">func (p *PCG) UnmarshalBinary(data []byte) error</a>
+</li>
+<li><a href="#Rand">type Rand</a></li>
+<li> <a href="#New">func New(src Source) *Rand</a>
+</li>
+<li> <a href="#Rand.ExpFloat64">func (r *Rand) ExpFloat64() float64</a>
+</li>
+<li> <a href="#Rand.Float32">func (r *Rand) Float32() float32</a>
+</li>
+<li> <a href="#Rand.Float64">func (r *Rand) Float64() float64</a>
+</li>
+<li> <a href="#Rand.Int">func (r *Rand) Int() int</a>
+</li>
+<li> <a href="#Rand.Int32">func (r *Rand) Int32() int32</a>
+</li>
+<li> <a href="#Rand.Int32N">func (r *Rand) Int32N(n int32) int32</a>
+</li>
+<li> <a href="#Rand.Int64">func (r *Rand) Int64() int64</a>
+</li>
+<li> <a href="#Rand.Int64N">func (r *Rand) Int64N(n int64) int64</a>
+</li>
+<li> <a href="#Rand.IntN">func (r *Rand) IntN(n int) int</a>
+</li>
+<li> <a href="#Rand.NormFloat64">func (r *Rand) NormFloat64() float64</a>
+</li>
+<li> <a href="#Rand.Perm">func (r *Rand) Perm(n int) []int</a>
+</li>
+<li> <a href="#Rand.Shuffle">func (r *Rand) Shuffle(n int, swap func(i, j int))</a>
+</li>
+<li> <a href="#Rand.Uint32">func (r *Rand) Uint32() uint32</a>
+</li>
+<li> <a href="#Rand.Uint32N">func (r *Rand) Uint32N(n uint32) uint32</a>
+</li>
+<li> <a href="#Rand.Uint64">func (r *Rand) Uint64() uint64</a>
+</li>
+<li> <a href="#Rand.Uint64N">func (r *Rand) Uint64N(n uint64) uint64</a>
+</li>
+<li> <a href="#Rand.UintN">func (r *Rand) UintN(n uint) uint</a>
+</li>
+<li><a href="#Source">type Source</a></li>
+<li><a href="#Zipf">type Zipf</a></li>
+<li> <a href="#NewZipf">func NewZipf(r *Rand, s float64, v float64, imax uint64) *Zipf</a>
+</li>
+<li> <a href="#Zipf.Uint64">func (z *Zipf) Uint64() uint64</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example_IntN">IntN</a></dd> <dd><a class="exampleLink" href="#example_N">N</a></dd> <dd><a class="exampleLink" href="#example_Perm">Perm</a></dd> <dd><a class="exampleLink" href="#example_Shuffle">Shuffle</a></dd> <dd><a class="exampleLink" href="#example_Shuffle_slicesInUnison">Shuffle (SlicesInUnison)</a></dd> <dd><a class="exampleLink" href="#example__rand">Package (Rand)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>chacha8.go</span> <span>exp.go</span> <span>normal.go</span> <span>pcg.go</span> <span>rand.go</span> <span>zipf.go</span> </p> <h2 id="ExpFloat64">func <span>ExpFloat64</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func ExpFloat64() float64</pre> <p>ExpFloat64 returns an exponentially distributed float64 in the range (0, +math.MaxFloat64] with an exponential distribution whose rate parameter (lambda) is 1 and whose mean is 1/lambda (1) from the default Source. To produce a distribution with a different rate parameter, callers can adjust the output using: </p>
+<pre data-language="go">sample = ExpFloat64() / desiredRateParameter
+</pre> <h2 id="Float32">func <span>Float32</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Float32() float32</pre> <p>Float32 returns, as a float32, a pseudo-random number in the half-open interval [0.0,1.0) from the default Source. </p>
+<h2 id="Float64">func <span>Float64</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Float64() float64</pre> <p>Float64 returns, as a float64, a pseudo-random number in the half-open interval [0.0,1.0) from the default Source. </p>
+<h2 id="Int">func <span>Int</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Int() int</pre> <p>Int returns a non-negative pseudo-random int from the default Source. </p>
+<h2 id="Int32">func <span>Int32</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Int32() int32</pre> <p>Int32 returns a non-negative pseudo-random 31-bit integer as an int32 from the default Source. </p>
+<h2 id="Int32N">func <span>Int32N</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Int32N(n int32) int32</pre> <p>Int32N returns, as an int32, a pseudo-random number in the half-open interval [0,n) from the default Source. It panics if n &lt;= 0. </p>
+<h2 id="Int64">func <span>Int64</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Int64() int64</pre> <p>Int64 returns a non-negative pseudo-random 63-bit integer as an int64 from the default Source. </p>
+<h2 id="Int64N">func <span>Int64N</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Int64N(n int64) int64</pre> <p>Int64N returns, as an int64, a pseudo-random number in the half-open interval [0,n) from the default Source. It panics if n &lt;= 0. </p>
+<h2 id="IntN">func <span>IntN</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func IntN(n int) int</pre> <p>IntN returns, as an int, a pseudo-random number in the half-open interval [0,n) from the default Source. It panics if n &lt;= 0. </p> <h4 id="example_IntN"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+fmt.Println(rand.IntN(100))
+fmt.Println(rand.IntN(100))
+fmt.Println(rand.IntN(100))
+</pre> <h2 id="N">func <span>N</span> </h2> <pre data-language="go">func N[Int intType](n Int) Int</pre> <p>N returns a pseudo-random number in the half-open interval [0,n) from the default Source. The type parameter Int can be any integer type. It panics if n &lt;= 0. </p> <h4 id="example_N"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Print an int64 in the half-open interval [0, 100).
+fmt.Println(rand.N(int64(100)))
+
+// Sleep for a random duration between 0 and 100 milliseconds.
+time.Sleep(rand.N(100 * time.Millisecond))
+</pre> <h2 id="NormFloat64">func <span>NormFloat64</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func NormFloat64() float64</pre> <p>NormFloat64 returns a normally distributed float64 in the range [-math.MaxFloat64, +math.MaxFloat64] with standard normal distribution (mean = 0, stddev = 1) from the default Source. To produce a different normal distribution, callers can adjust the output using: </p>
+<pre data-language="go">sample = NormFloat64() * desiredStdDev + desiredMean
+</pre> <h2 id="Perm">func <span>Perm</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Perm(n int) []int</pre> <p>Perm returns, as a slice of n ints, a pseudo-random permutation of the integers in the half-open interval [0,n) from the default Source. </p> <h4 id="example_Perm"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">for _, value := range rand.Perm(3) {
+ fmt.Println(value)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1
+2
+0
+</pre> <h2 id="Shuffle">func <span>Shuffle</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Shuffle(n int, swap func(i, j int))</pre> <p>Shuffle pseudo-randomizes the order of elements using the default Source. n is the number of elements. Shuffle panics if n &lt; 0. swap swaps the elements with indexes i and j. </p> <h4 id="example_Shuffle"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+words := strings.Fields("ink runs from the corners of my mouth")
+rand.Shuffle(len(words), func(i, j int) {
+ words[i], words[j] = words[j], words[i]
+})
+fmt.Println(words)
+</pre> <h4 id="example_Shuffle_slicesInUnison"> <span class="text">Example (SlicesInUnison)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+numbers := []byte("12345")
+letters := []byte("ABCDE")
+// Shuffle numbers, swapping corresponding entries in letters at the same time.
+rand.Shuffle(len(numbers), func(i, j int) {
+ numbers[i], numbers[j] = numbers[j], numbers[i]
+ letters[i], letters[j] = letters[j], letters[i]
+})
+for i := range numbers {
+ fmt.Printf("%c: %c\n", letters[i], numbers[i])
+}
+</pre> <h2 id="Uint32">func <span>Uint32</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Uint32() uint32</pre> <p>Uint32 returns a pseudo-random 32-bit value as a uint32 from the default Source. </p>
+<h2 id="Uint32N">func <span>Uint32N</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Uint32N(n uint32) uint32</pre> <p>Uint32N returns, as a uint32, a pseudo-random number in the half-open interval [0,n) from the default Source. It panics if n &lt;= 0. </p>
+<h2 id="Uint64">func <span>Uint64</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Uint64() uint64</pre> <p>Uint64 returns a pseudo-random 64-bit value as a uint64 from the default Source. </p>
+<h2 id="Uint64N">func <span>Uint64N</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Uint64N(n uint64) uint64</pre> <p>Uint64N returns, as a uint64, a pseudo-random number in the half-open interval [0,n) from the default Source. It panics if n &lt;= 0. </p>
+<h2 id="UintN">func <span>UintN</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func UintN(n uint) uint</pre> <p>UintN returns, as a uint, a pseudo-random number in the half-open interval [0,n) from the default Source. It panics if n &lt;= 0. </p>
+<h2 id="ChaCha8">type <span>ChaCha8</span> <span title="Added in Go 1.22">1.22</span> </h2> <p>A ChaCha8 is a ChaCha8-based cryptographically strong random number generator. </p>
+<pre data-language="go">type ChaCha8 struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewChaCha8">func <span>NewChaCha8</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func NewChaCha8(seed [32]byte) *ChaCha8</pre> <p>NewChaCha8 returns a new ChaCha8 seeded with the given seed. </p>
+<h3 id="ChaCha8.MarshalBinary">func (*ChaCha8) <span>MarshalBinary</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (c *ChaCha8) MarshalBinary() ([]byte, error)</pre> <p>MarshalBinary implements the encoding.BinaryMarshaler interface. </p>
+<h3 id="ChaCha8.Seed">func (*ChaCha8) <span>Seed</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (c *ChaCha8) Seed(seed [32]byte)</pre> <p>Seed resets the ChaCha8 to behave the same way as NewChaCha8(seed). </p>
+<h3 id="ChaCha8.Uint64">func (*ChaCha8) <span>Uint64</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (c *ChaCha8) Uint64() uint64</pre> <p>Uint64 returns a uniformly distributed random uint64 value. </p>
+<h3 id="ChaCha8.UnmarshalBinary">func (*ChaCha8) <span>UnmarshalBinary</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (c *ChaCha8) UnmarshalBinary(data []byte) error</pre> <p>UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. </p>
+<h2 id="PCG">type <span>PCG</span> <span title="Added in Go 1.22">1.22</span> </h2> <p>A PCG is a PCG generator with 128 bits of internal state. A zero PCG is equivalent to NewPCG(0, 0). </p>
+<pre data-language="go">type PCG struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewPCG">func <span>NewPCG</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func NewPCG(seed1, seed2 uint64) *PCG</pre> <p>NewPCG returns a new PCG seeded with the given values. </p>
+<h3 id="PCG.MarshalBinary">func (*PCG) <span>MarshalBinary</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (p *PCG) MarshalBinary() ([]byte, error)</pre> <p>MarshalBinary implements the encoding.BinaryMarshaler interface. </p>
+<h3 id="PCG.Seed">func (*PCG) <span>Seed</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (p *PCG) Seed(seed1, seed2 uint64)</pre> <p>Seed resets the PCG to behave the same way as NewPCG(seed1, seed2). </p>
+<h3 id="PCG.Uint64">func (*PCG) <span>Uint64</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (p *PCG) Uint64() uint64</pre> <p>Uint64 return a uniformly-distributed random uint64 value. </p>
+<h3 id="PCG.UnmarshalBinary">func (*PCG) <span>UnmarshalBinary</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (p *PCG) UnmarshalBinary(data []byte) error</pre> <p>UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. </p>
+<h2 id="Rand">type <span>Rand</span> <span title="Added in Go 1.22">1.22</span> </h2> <p>A Rand is a source of random numbers. </p>
+<pre data-language="go">type Rand struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="New">func <span>New</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func New(src Source) *Rand</pre> <p>New returns a new Rand that uses random values from src to generate other random values. </p>
+<h3 id="Rand.ExpFloat64">func (*Rand) <span>ExpFloat64</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) ExpFloat64() float64</pre> <p>ExpFloat64 returns an exponentially distributed float64 in the range (0, +math.MaxFloat64] with an exponential distribution whose rate parameter (lambda) is 1 and whose mean is 1/lambda (1). To produce a distribution with a different rate parameter, callers can adjust the output using: </p>
+<pre data-language="go">sample = ExpFloat64() / desiredRateParameter
+</pre> <h3 id="Rand.Float32">func (*Rand) <span>Float32</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Float32() float32</pre> <p>Float32 returns, as a float32, a pseudo-random number in the half-open interval [0.0,1.0). </p>
+<h3 id="Rand.Float64">func (*Rand) <span>Float64</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Float64() float64</pre> <p>Float64 returns, as a float64, a pseudo-random number in the half-open interval [0.0,1.0). </p>
+<h3 id="Rand.Int">func (*Rand) <span>Int</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Int() int</pre> <p>Int returns a non-negative pseudo-random int. </p>
+<h3 id="Rand.Int32">func (*Rand) <span>Int32</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Int32() int32</pre> <p>Int32 returns a non-negative pseudo-random 31-bit integer as an int32. </p>
+<h3 id="Rand.Int32N">func (*Rand) <span>Int32N</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Int32N(n int32) int32</pre> <p>Int32N returns, as an int32, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n &lt;= 0. </p>
+<h3 id="Rand.Int64">func (*Rand) <span>Int64</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Int64() int64</pre> <p>Int64 returns a non-negative pseudo-random 63-bit integer as an int64. </p>
+<h3 id="Rand.Int64N">func (*Rand) <span>Int64N</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Int64N(n int64) int64</pre> <p>Int64N returns, as an int64, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n &lt;= 0. </p>
+<h3 id="Rand.IntN">func (*Rand) <span>IntN</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) IntN(n int) int</pre> <p>IntN returns, as an int, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n &lt;= 0. </p>
+<h3 id="Rand.NormFloat64">func (*Rand) <span>NormFloat64</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) NormFloat64() float64</pre> <p>NormFloat64 returns a normally distributed float64 in the range -math.MaxFloat64 through +math.MaxFloat64 inclusive, with standard normal distribution (mean = 0, stddev = 1). To produce a different normal distribution, callers can adjust the output using: </p>
+<pre data-language="go">sample = NormFloat64() * desiredStdDev + desiredMean
+</pre> <h3 id="Rand.Perm">func (*Rand) <span>Perm</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Perm(n int) []int</pre> <p>Perm returns, as a slice of n ints, a pseudo-random permutation of the integers in the half-open interval [0,n). </p>
+<h3 id="Rand.Shuffle">func (*Rand) <span>Shuffle</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Shuffle(n int, swap func(i, j int))</pre> <p>Shuffle pseudo-randomizes the order of elements. n is the number of elements. Shuffle panics if n &lt; 0. swap swaps the elements with indexes i and j. </p>
+<h3 id="Rand.Uint32">func (*Rand) <span>Uint32</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Uint32() uint32</pre> <p>Uint32 returns a pseudo-random 32-bit value as a uint32. </p>
+<h3 id="Rand.Uint32N">func (*Rand) <span>Uint32N</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Uint32N(n uint32) uint32</pre> <p>Uint32N returns, as a uint32, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n == 0. </p>
+<h3 id="Rand.Uint64">func (*Rand) <span>Uint64</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Uint64() uint64</pre> <p>Uint64 returns a pseudo-random 64-bit value as a uint64. </p>
+<h3 id="Rand.Uint64N">func (*Rand) <span>Uint64N</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) Uint64N(n uint64) uint64</pre> <p>Uint64N returns, as a uint64, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n == 0. </p>
+<h3 id="Rand.UintN">func (*Rand) <span>UintN</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Rand) UintN(n uint) uint</pre> <p>UintN returns, as a uint, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n == 0. </p>
+<h2 id="Source">type <span>Source</span> <span title="Added in Go 1.22">1.22</span> </h2> <p>A Source is a source of uniformly-distributed pseudo-random uint64 values in the range [0, 1&lt;&lt;64). </p>
+<p>A Source is not safe for concurrent use by multiple goroutines. </p>
+<pre data-language="go">type Source interface {
+ Uint64() uint64
+}</pre> <h2 id="Zipf">type <span>Zipf</span> <span title="Added in Go 1.22">1.22</span> </h2> <p>A Zipf generates Zipf distributed variates. </p>
+<pre data-language="go">type Zipf struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewZipf">func <span>NewZipf</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func NewZipf(r *Rand, s float64, v float64, imax uint64) *Zipf</pre> <p>NewZipf returns a Zipf variate generator. The generator generates values k ∈ [0, imax] such that P(k) is proportional to (v + k) ** (-s). Requirements: s &gt; 1 and v &gt;= 1. </p>
+<h3 id="Zipf.Uint64">func (*Zipf) <span>Uint64</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (z *Zipf) Uint64() uint64</pre> <p>Uint64 returns a value drawn from the Zipf distribution described by the Zipf object. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/math/rand/v2/" class="_attribution-link">http://golang.org/pkg/math/rand/v2/</a>
+ </p>
+</div>
diff --git a/devdocs/go/metadata b/devdocs/go/metadata
new file mode 100644
index 00000000..b93cacdd
--- /dev/null
+++ b/devdocs/go/metadata
@@ -0,0 +1,2 @@
+(1 (name . "Go") (slug . "go") (type . "go") (links (home . "https://golang.org/") (code . "https://go.googlesource.com/go")) (release . "1.22.0") (mtime . 1707337494) (db_size . 4222945) (attribution . "&copy; Google, Inc.<br>
+ Licensed under the Creative Commons Attribution License 3.0.")) \ No newline at end of file
diff --git a/devdocs/go/mime%2Findex.html b/devdocs/go/mime%2Findex.html
new file mode 100644
index 00000000..aa865152
--- /dev/null
+++ b/devdocs/go/mime%2Findex.html
@@ -0,0 +1,153 @@
+<h1> Package mime </h1> <ul id="short-nav">
+<li><code>import "mime"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package mime implements parts of the MIME spec. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#AddExtensionType">func AddExtensionType(ext, typ string) error</a></li>
+<li><a href="#ExtensionsByType">func ExtensionsByType(typ string) ([]string, error)</a></li>
+<li><a href="#FormatMediaType">func FormatMediaType(t string, param map[string]string) string</a></li>
+<li><a href="#ParseMediaType">func ParseMediaType(v string) (mediatype string, params map[string]string, err error)</a></li>
+<li><a href="#TypeByExtension">func TypeByExtension(ext string) string</a></li>
+<li><a href="#WordDecoder">type WordDecoder</a></li>
+<li> <a href="#WordDecoder.Decode">func (d *WordDecoder) Decode(word string) (string, error)</a>
+</li>
+<li> <a href="#WordDecoder.DecodeHeader">func (d *WordDecoder) DecodeHeader(header string) (string, error)</a>
+</li>
+<li><a href="#WordEncoder">type WordEncoder</a></li>
+<li> <a href="#WordEncoder.Encode">func (e WordEncoder) Encode(charset, s string) string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_FormatMediaType">FormatMediaType</a></dd> <dd><a class="exampleLink" href="#example_ParseMediaType">ParseMediaType</a></dd> <dd><a class="exampleLink" href="#example_WordDecoder_Decode">WordDecoder.Decode</a></dd> <dd><a class="exampleLink" href="#example_WordDecoder_DecodeHeader">WordDecoder.DecodeHeader</a></dd> <dd><a class="exampleLink" href="#example_WordEncoder_Encode">WordEncoder.Encode</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>encodedword.go</span> <span>grammar.go</span> <span>mediatype.go</span> <span>type.go</span> <span>type_unix.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ // BEncoding represents Base64 encoding scheme as defined by RFC 2045.
+ BEncoding = WordEncoder('b')
+ // QEncoding represents the Q-encoding scheme as defined by RFC 2047.
+ QEncoding = WordEncoder('q')
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>ErrInvalidMediaParameter is returned by ParseMediaType if the media type value was found but there was an error parsing the optional parameters </p>
+<pre data-language="go">var ErrInvalidMediaParameter = errors.New("mime: invalid media parameter")</pre> <h2 id="AddExtensionType">func <span>AddExtensionType</span> </h2> <pre data-language="go">func AddExtensionType(ext, typ string) error</pre> <p>AddExtensionType sets the MIME type associated with the extension ext to typ. The extension should begin with a leading dot, as in ".html". </p>
+<h2 id="ExtensionsByType">func <span>ExtensionsByType</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func ExtensionsByType(typ string) ([]string, error)</pre> <p>ExtensionsByType returns the extensions known to be associated with the MIME type typ. The returned extensions will each begin with a leading dot, as in ".html". When typ has no associated extensions, ExtensionsByType returns an nil slice. </p>
+<h2 id="FormatMediaType">func <span>FormatMediaType</span> </h2> <pre data-language="go">func FormatMediaType(t string, param map[string]string) string</pre> <p>FormatMediaType serializes mediatype t and the parameters param as a media type conforming to RFC 2045 and RFC 2616. The type and parameter names are written in lower-case. When any of the arguments result in a standard violation then FormatMediaType returns the empty string. </p> <h4 id="example_FormatMediaType"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">mediatype := "text/html"
+params := map[string]string{
+ "charset": "utf-8",
+}
+
+result := mime.FormatMediaType(mediatype, params)
+
+fmt.Println("result:", result)
+</pre> <p>Output:</p> <pre class="output" data-language="go">result: text/html; charset=utf-8
+</pre> <h2 id="ParseMediaType">func <span>ParseMediaType</span> </h2> <pre data-language="go">func ParseMediaType(v string) (mediatype string, params map[string]string, err error)</pre> <p>ParseMediaType parses a media type value and any optional parameters, per RFC 1521. Media types are the values in Content-Type and Content-Disposition headers (RFC 2183). On success, ParseMediaType returns the media type converted to lowercase and trimmed of white space and a non-nil map. If there is an error parsing the optional parameter, the media type will be returned along with the error ErrInvalidMediaParameter. The returned map, params, maps from the lowercase attribute to the attribute value with its case preserved. </p> <h4 id="example_ParseMediaType"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">mediatype, params, err := mime.ParseMediaType("text/html; charset=utf-8")
+if err != nil {
+ panic(err)
+}
+
+fmt.Println("type:", mediatype)
+fmt.Println("charset:", params["charset"])
+</pre> <p>Output:</p> <pre class="output" data-language="go">type: text/html
+charset: utf-8
+</pre> <h2 id="TypeByExtension">func <span>TypeByExtension</span> </h2> <pre data-language="go">func TypeByExtension(ext string) string</pre> <p>TypeByExtension returns the MIME type associated with the file extension ext. The extension ext should begin with a leading dot, as in ".html". When ext has no associated type, TypeByExtension returns "". </p>
+<p>Extensions are looked up first case-sensitively, then case-insensitively. </p>
+<p>The built-in table is small but on unix it is augmented by the local system's MIME-info database or mime.types file(s) if available under one or more of these names: </p>
+<pre data-language="go">/usr/local/share/mime/globs2
+/usr/share/mime/globs2
+/etc/mime.types
+/etc/apache2/mime.types
+/etc/apache/mime.types
+</pre> <p>On Windows, MIME types are extracted from the registry. </p>
+<p>Text types have the charset parameter set to "utf-8" by default. </p>
+<h2 id="WordDecoder">type <span>WordDecoder</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A WordDecoder decodes MIME headers containing RFC 2047 encoded-words. </p>
+<pre data-language="go">type WordDecoder struct {
+ // CharsetReader, if non-nil, defines a function to generate
+ // charset-conversion readers, converting from the provided
+ // charset into UTF-8.
+ // Charsets are always lower-case. utf-8, iso-8859-1 and us-ascii charsets
+ // are handled by default.
+ // One of the CharsetReader's result values must be non-nil.
+ CharsetReader func(charset string, input io.Reader) (io.Reader, error)
+}
+</pre> <h3 id="WordDecoder.Decode">func (*WordDecoder) <span>Decode</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (d *WordDecoder) Decode(word string) (string, error)</pre> <p>Decode decodes an RFC 2047 encoded-word. </p> <h4 id="example_WordDecoder_Decode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">dec := new(mime.WordDecoder)
+header, err := dec.Decode("=?utf-8?q?=C2=A1Hola,_se=C3=B1or!?=")
+if err != nil {
+ panic(err)
+}
+fmt.Println(header)
+
+dec.CharsetReader = func(charset string, input io.Reader) (io.Reader, error) {
+ switch charset {
+ case "x-case":
+ // Fake character set for example.
+ // Real use would integrate with packages such
+ // as code.google.com/p/go-charset
+ content, err := io.ReadAll(input)
+ if err != nil {
+ return nil, err
+ }
+ return bytes.NewReader(bytes.ToUpper(content)), nil
+ default:
+ return nil, fmt.Errorf("unhandled charset %q", charset)
+ }
+}
+header, err = dec.Decode("=?x-case?q?hello!?=")
+if err != nil {
+ panic(err)
+}
+fmt.Println(header)
+</pre> <p>Output:</p> <pre class="output" data-language="go">¡Hola, señor!
+HELLO!
+</pre> <h3 id="WordDecoder.DecodeHeader">func (*WordDecoder) <span>DecodeHeader</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (d *WordDecoder) DecodeHeader(header string) (string, error)</pre> <p>DecodeHeader decodes all encoded-words of the given string. It returns an error if and only if CharsetReader of d returns an error. </p> <h4 id="example_WordDecoder_DecodeHeader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">dec := new(mime.WordDecoder)
+header, err := dec.DecodeHeader("=?utf-8?q?=C3=89ric?= &lt;eric@example.org&gt;, =?utf-8?q?Ana=C3=AFs?= &lt;anais@example.org&gt;")
+if err != nil {
+ panic(err)
+}
+fmt.Println(header)
+
+header, err = dec.DecodeHeader("=?utf-8?q?=C2=A1Hola,?= =?utf-8?q?_se=C3=B1or!?=")
+if err != nil {
+ panic(err)
+}
+fmt.Println(header)
+
+dec.CharsetReader = func(charset string, input io.Reader) (io.Reader, error) {
+ switch charset {
+ case "x-case":
+ // Fake character set for example.
+ // Real use would integrate with packages such
+ // as code.google.com/p/go-charset
+ content, err := io.ReadAll(input)
+ if err != nil {
+ return nil, err
+ }
+ return bytes.NewReader(bytes.ToUpper(content)), nil
+ default:
+ return nil, fmt.Errorf("unhandled charset %q", charset)
+ }
+}
+header, err = dec.DecodeHeader("=?x-case?q?hello_?= =?x-case?q?world!?=")
+if err != nil {
+ panic(err)
+}
+fmt.Println(header)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Éric &lt;eric@example.org&gt;, Anaïs &lt;anais@example.org&gt;
+¡Hola, señor!
+HELLO WORLD!
+</pre> <h2 id="WordEncoder">type <span>WordEncoder</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A WordEncoder is an RFC 2047 encoded-word encoder. </p>
+<pre data-language="go">type WordEncoder byte</pre> <h3 id="WordEncoder.Encode">func (WordEncoder) <span>Encode</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (e WordEncoder) Encode(charset, s string) string</pre> <p>Encode returns the encoded-word form of s. If s is ASCII without special characters, it is returned unchanged. The provided charset is the IANA charset name of s. It is case insensitive. </p> <h4 id="example_WordEncoder_Encode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(mime.QEncoding.Encode("utf-8", "¡Hola, señor!"))
+fmt.Println(mime.QEncoding.Encode("utf-8", "Hello!"))
+fmt.Println(mime.BEncoding.Encode("UTF-8", "¡Hola, señor!"))
+fmt.Println(mime.QEncoding.Encode("ISO-8859-1", "Caf\xE9"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">=?utf-8?q?=C2=A1Hola,_se=C3=B1or!?=
+Hello!
+=?UTF-8?b?wqFIb2xhLCBzZcOxb3Ih?=
+=?ISO-8859-1?q?Caf=E9?=
+</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="multipart/index">multipart</a> </td> <td class="pkg-synopsis"> Package multipart implements MIME multipart parsing, as defined in RFC 2046. </td> </tr> <tr> <td class="pkg-name"> <a href="quotedprintable/index">quotedprintable</a> </td> <td class="pkg-synopsis"> Package quotedprintable implements quoted-printable encoding as specified by RFC 2045. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/mime/" class="_attribution-link">http://golang.org/pkg/mime/</a>
+ </p>
+</div>
diff --git a/devdocs/go/mime%2Fmultipart%2Findex.html b/devdocs/go/mime%2Fmultipart%2Findex.html
new file mode 100644
index 00000000..25e5e1fe
--- /dev/null
+++ b/devdocs/go/mime%2Fmultipart%2Findex.html
@@ -0,0 +1,151 @@
+<h1> Package multipart </h1> <ul id="short-nav">
+<li><code>import "mime/multipart"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package multipart implements MIME multipart parsing, as defined in RFC 2046. </p>
+<p>The implementation is sufficient for HTTP (RFC 2388) and the multipart bodies generated by popular browsers. </p>
+<h3 id="hdr-Limits">Limits</h3> <p>To protect against malicious inputs, this package sets limits on the size of the MIME data it processes. </p>
+<p>Reader.NextPart and Reader.NextRawPart limit the number of headers in a part to 10000 and Reader.ReadForm limits the total number of headers in all FileHeaders to 10000. These limits may be adjusted with the GODEBUG=multipartmaxheaders=&lt;values&gt; setting. </p>
+<p>Reader.ReadForm further limits the number of parts in a form to 1000. This limit may be adjusted with the GODEBUG=multipartmaxparts=&lt;value&gt; setting. </p>
+<p>Copyright 2023 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. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#File">type File</a></li>
+<li><a href="#FileHeader">type FileHeader</a></li>
+<li> <a href="#FileHeader.Open">func (fh *FileHeader) Open() (File, error)</a>
+</li>
+<li><a href="#Form">type Form</a></li>
+<li> <a href="#Form.RemoveAll">func (f *Form) RemoveAll() error</a>
+</li>
+<li><a href="#Part">type Part</a></li>
+<li> <a href="#Part.Close">func (p *Part) Close() error</a>
+</li>
+<li> <a href="#Part.FileName">func (p *Part) FileName() string</a>
+</li>
+<li> <a href="#Part.FormName">func (p *Part) FormName() string</a>
+</li>
+<li> <a href="#Part.Read">func (p *Part) Read(d []byte) (n int, err error)</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(r io.Reader, boundary string) *Reader</a>
+</li>
+<li> <a href="#Reader.NextPart">func (r *Reader) NextPart() (*Part, error)</a>
+</li>
+<li> <a href="#Reader.NextRawPart">func (r *Reader) NextRawPart() (*Part, error)</a>
+</li>
+<li> <a href="#Reader.ReadForm">func (r *Reader) ReadForm(maxMemory int64) (*Form, error)</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w io.Writer) *Writer</a>
+</li>
+<li> <a href="#Writer.Boundary">func (w *Writer) Boundary() string</a>
+</li>
+<li> <a href="#Writer.Close">func (w *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.CreateFormField">func (w *Writer) CreateFormField(fieldname string) (io.Writer, error)</a>
+</li>
+<li> <a href="#Writer.CreateFormFile">func (w *Writer) CreateFormFile(fieldname, filename string) (io.Writer, error)</a>
+</li>
+<li> <a href="#Writer.CreatePart">func (w *Writer) CreatePart(header textproto.MIMEHeader) (io.Writer, error)</a>
+</li>
+<li> <a href="#Writer.FormDataContentType">func (w *Writer) FormDataContentType() string</a>
+</li>
+<li> <a href="#Writer.SetBoundary">func (w *Writer) SetBoundary(boundary string) error</a>
+</li>
+<li> <a href="#Writer.WriteField">func (w *Writer) WriteField(fieldname, value string) error</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_NewReader">NewReader</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>formdata.go</span> <span>multipart.go</span> <span>readmimeheader.go</span> <span>writer.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrMessageTooLarge is returned by ReadForm if the message form data is too large to be processed. </p>
+<pre data-language="go">var ErrMessageTooLarge = errors.New("multipart: message too large")</pre> <h2 id="File">type <span>File</span> </h2> <p>File is an interface to access the file part of a multipart message. Its contents may be either stored in memory or on disk. If stored on disk, the File's underlying concrete type will be an *os.File. </p>
+<pre data-language="go">type File interface {
+ io.Reader
+ io.ReaderAt
+ io.Seeker
+ io.Closer
+}</pre> <h2 id="FileHeader">type <span>FileHeader</span> </h2> <p>A FileHeader describes a file part of a multipart request. </p>
+<pre data-language="go">type FileHeader struct {
+ Filename string
+ Header textproto.MIMEHeader
+ Size int64 // Go 1.9
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="FileHeader.Open">func (*FileHeader) <span>Open</span> </h3> <pre data-language="go">func (fh *FileHeader) Open() (File, error)</pre> <p>Open opens and returns the FileHeader's associated File. </p>
+<h2 id="Form">type <span>Form</span> </h2> <p>Form is a parsed multipart form. Its File parts are stored either in memory or on disk, and are accessible via the *FileHeader's Open method. Its Value parts are stored as strings. Both are keyed by field name. </p>
+<pre data-language="go">type Form struct {
+ Value map[string][]string
+ File map[string][]*FileHeader
+}
+</pre> <h3 id="Form.RemoveAll">func (*Form) <span>RemoveAll</span> </h3> <pre data-language="go">func (f *Form) RemoveAll() error</pre> <p>RemoveAll removes any temporary files associated with a Form. </p>
+<h2 id="Part">type <span>Part</span> </h2> <p>A Part represents a single part in a multipart body. </p>
+<pre data-language="go">type Part struct {
+ // The headers of the body, if any, with the keys canonicalized
+ // in the same fashion that the Go http.Request headers are.
+ // For example, "foo-bar" changes case to "Foo-Bar"
+ Header textproto.MIMEHeader
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Part.Close">func (*Part) <span>Close</span> </h3> <pre data-language="go">func (p *Part) Close() error</pre> <h3 id="Part.FileName">func (*Part) <span>FileName</span> </h3> <pre data-language="go">func (p *Part) FileName() string</pre> <p>FileName returns the filename parameter of the Part's Content-Disposition header. If not empty, the filename is passed through filepath.Base (which is platform dependent) before being returned. </p>
+<h3 id="Part.FormName">func (*Part) <span>FormName</span> </h3> <pre data-language="go">func (p *Part) FormName() string</pre> <p>FormName returns the name parameter if p has a Content-Disposition of type "form-data". Otherwise it returns the empty string. </p>
+<h3 id="Part.Read">func (*Part) <span>Read</span> </h3> <pre data-language="go">func (p *Part) Read(d []byte) (n int, err error)</pre> <p>Read reads the body of a part, after its headers and before the next part (if any) begins. </p>
+<h2 id="Reader">type <span>Reader</span> </h2> <p>Reader is an iterator over parts in a MIME multipart body. Reader's underlying parser consumes its input as needed. Seeking isn't supported. </p>
+<pre data-language="go">type Reader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewReader">func <span>NewReader</span> </h3> <pre data-language="go">func NewReader(r io.Reader, boundary string) *Reader</pre> <p>NewReader creates a new multipart Reader reading from r using the given MIME boundary. </p>
+<p>The boundary is usually obtained from the "boundary" parameter of the message's "Content-Type" header. Use mime.ParseMediaType to parse such headers. </p> <h4 id="example_NewReader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">msg := &amp;mail.Message{
+ Header: map[string][]string{
+ "Content-Type": {"multipart/mixed; boundary=foo"},
+ },
+ Body: strings.NewReader(
+ "--foo\r\nFoo: one\r\n\r\nA section\r\n" +
+ "--foo\r\nFoo: two\r\n\r\nAnd another\r\n" +
+ "--foo--\r\n"),
+}
+mediaType, params, err := mime.ParseMediaType(msg.Header.Get("Content-Type"))
+if err != nil {
+ log.Fatal(err)
+}
+if strings.HasPrefix(mediaType, "multipart/") {
+ mr := multipart.NewReader(msg.Body, params["boundary"])
+ for {
+ p, err := mr.NextPart()
+ if err == io.EOF {
+ return
+ }
+ if err != nil {
+ log.Fatal(err)
+ }
+ slurp, err := io.ReadAll(p)
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("Part %q: %q\n", p.Header.Get("Foo"), slurp)
+ }
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Part "one": "A section"
+Part "two": "And another"
+</pre> <h3 id="Reader.NextPart">func (*Reader) <span>NextPart</span> </h3> <pre data-language="go">func (r *Reader) NextPart() (*Part, error)</pre> <p>NextPart returns the next part in the multipart or an error. When there are no more parts, the error io.EOF is returned. </p>
+<p>As a special case, if the "Content-Transfer-Encoding" header has a value of "quoted-printable", that header is instead hidden and the body is transparently decoded during Read calls. </p>
+<h3 id="Reader.NextRawPart">func (*Reader) <span>NextRawPart</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (r *Reader) NextRawPart() (*Part, error)</pre> <p>NextRawPart returns the next part in the multipart or an error. When there are no more parts, the error io.EOF is returned. </p>
+<p>Unlike NextPart, it does not have special handling for "Content-Transfer-Encoding: quoted-printable". </p>
+<h3 id="Reader.ReadForm">func (*Reader) <span>ReadForm</span> </h3> <pre data-language="go">func (r *Reader) ReadForm(maxMemory int64) (*Form, error)</pre> <p>ReadForm parses an entire multipart message whose parts have a Content-Disposition of "form-data". It stores up to maxMemory bytes + 10MB (reserved for non-file parts) in memory. File parts which can't be stored in memory will be stored on disk in temporary files. It returns ErrMessageTooLarge if all non-file parts can't be stored in memory. </p>
+<h2 id="Writer">type <span>Writer</span> </h2> <p>A Writer generates multipart messages. </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(w io.Writer) *Writer</pre> <p>NewWriter returns a new multipart Writer with a random boundary, writing to w. </p>
+<h3 id="Writer.Boundary">func (*Writer) <span>Boundary</span> </h3> <pre data-language="go">func (w *Writer) Boundary() string</pre> <p>Boundary returns the Writer's boundary. </p>
+<h3 id="Writer.Close">func (*Writer) <span>Close</span> </h3> <pre data-language="go">func (w *Writer) Close() error</pre> <p>Close finishes the multipart message and writes the trailing boundary end line to the output. </p>
+<h3 id="Writer.CreateFormField">func (*Writer) <span>CreateFormField</span> </h3> <pre data-language="go">func (w *Writer) CreateFormField(fieldname string) (io.Writer, error)</pre> <p>CreateFormField calls CreatePart with a header using the given field name. </p>
+<h3 id="Writer.CreateFormFile">func (*Writer) <span>CreateFormFile</span> </h3> <pre data-language="go">func (w *Writer) CreateFormFile(fieldname, filename string) (io.Writer, error)</pre> <p>CreateFormFile is a convenience wrapper around CreatePart. It creates a new form-data header with the provided field name and file name. </p>
+<h3 id="Writer.CreatePart">func (*Writer) <span>CreatePart</span> </h3> <pre data-language="go">func (w *Writer) CreatePart(header textproto.MIMEHeader) (io.Writer, error)</pre> <p>CreatePart creates a new multipart section with the provided header. The body of the part should be written to the returned Writer. After calling CreatePart, any previous part may no longer be written to. </p>
+<h3 id="Writer.FormDataContentType">func (*Writer) <span>FormDataContentType</span> </h3> <pre data-language="go">func (w *Writer) FormDataContentType() string</pre> <p>FormDataContentType returns the Content-Type for an HTTP multipart/form-data with this Writer's Boundary. </p>
+<h3 id="Writer.SetBoundary">func (*Writer) <span>SetBoundary</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (w *Writer) SetBoundary(boundary string) error</pre> <p>SetBoundary overrides the Writer's default randomly-generated boundary separator with an explicit value. </p>
+<p>SetBoundary must be called before any parts are created, may only contain certain ASCII characters, and must be non-empty and at most 70 bytes long. </p>
+<h3 id="Writer.WriteField">func (*Writer) <span>WriteField</span> </h3> <pre data-language="go">func (w *Writer) WriteField(fieldname, value string) error</pre> <p>WriteField calls CreateFormField and then writes the given value. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/mime/multipart/" class="_attribution-link">http://golang.org/pkg/mime/multipart/</a>
+ </p>
+</div>
diff --git a/devdocs/go/mime%2Fquotedprintable%2Findex.html b/devdocs/go/mime%2Fquotedprintable%2Findex.html
new file mode 100644
index 00000000..9ca17762
--- /dev/null
+++ b/devdocs/go/mime%2Fquotedprintable%2Findex.html
@@ -0,0 +1,55 @@
+<h1> Package quotedprintable </h1> <ul id="short-nav">
+<li><code>import "mime/quotedprintable"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package quotedprintable implements quoted-printable encoding as specified by RFC 2045. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(r io.Reader) *Reader</a>
+</li>
+<li> <a href="#Reader.Read">func (r *Reader) Read(p []byte) (n int, err error)</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w io.Writer) *Writer</a>
+</li>
+<li> <a href="#Writer.Close">func (w *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.Write">func (w *Writer) Write(p []byte) (n int, err error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_NewReader">NewReader</a></dd> <dd><a class="exampleLink" href="#example_NewWriter">NewWriter</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>reader.go</span> <span>writer.go</span> </p> <h2 id="Reader">type <span>Reader</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>Reader is a quoted-printable decoder. </p>
+<pre data-language="go">type Reader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewReader">func <span>NewReader</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewReader(r io.Reader) *Reader</pre> <p>NewReader returns a quoted-printable reader, decoding from r. </p> <h4 id="example_NewReader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">for _, s := range []string{
+ `=48=65=6C=6C=6F=2C=20=47=6F=70=68=65=72=73=21`,
+ `invalid escape: &lt;b style="font-size: 200%"&gt;hello&lt;/b&gt;`,
+ "Hello, Gophers! This symbol will be unescaped: =3D and this will be written in =\r\none line.",
+} {
+ b, err := io.ReadAll(quotedprintable.NewReader(strings.NewReader(s)))
+ fmt.Printf("%s %v\n", b, err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, Gophers! &lt;nil&gt;
+invalid escape: &lt;b style="font-size: 200%"&gt;hello&lt;/b&gt; &lt;nil&gt;
+Hello, Gophers! This symbol will be unescaped: = and this will be written in one line. &lt;nil&gt;
+</pre> <h3 id="Reader.Read">func (*Reader) <span>Read</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r *Reader) Read(p []byte) (n int, err error)</pre> <p>Read reads and decodes quoted-printable data from the underlying reader. </p>
+<h2 id="Writer">type <span>Writer</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>A Writer is a quoted-printable writer that implements io.WriteCloser. </p>
+<pre data-language="go">type Writer struct {
+ // Binary mode treats the writer's input as pure binary and processes end of
+ // line bytes as binary data.
+ Binary bool
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func NewWriter(w io.Writer) *Writer</pre> <p>NewWriter returns a new Writer that writes to w. </p> <h4 id="example_NewWriter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">w := quotedprintable.NewWriter(os.Stdout)
+w.Write([]byte("These symbols will be escaped: = \t"))
+w.Close()
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">These symbols will be escaped: =3D =09
+</pre> <h3 id="Writer.Close">func (*Writer) <span>Close</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (w *Writer) Close() error</pre> <p>Close closes the Writer, flushing any unwritten data to the underlying io.Writer, but does not close the underlying io.Writer. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (w *Writer) Write(p []byte) (n int, err error)</pre> <p>Write encodes p using quoted-printable encoding and writes it to the underlying io.Writer. It limits line length to 76 characters. The encoded bytes are not necessarily flushed until the Writer is closed. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/mime/quotedprintable/" class="_attribution-link">http://golang.org/pkg/mime/quotedprintable/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fhttp%2Fcgi%2Findex.html b/devdocs/go/net%2Fhttp%2Fcgi%2Findex.html
new file mode 100644
index 00000000..c401bc1c
--- /dev/null
+++ b/devdocs/go/net%2Fhttp%2Fcgi%2Findex.html
@@ -0,0 +1,48 @@
+<h1> Package cgi </h1> <ul id="short-nav">
+<li><code>import "net/http/cgi"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875. </p>
+<p>Note that using CGI means starting a new process to handle each request, which is typically less efficient than using a long-running server. This package is intended primarily for compatibility with existing systems. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Request">func Request() (*http.Request, error)</a></li>
+<li><a href="#RequestFromMap">func RequestFromMap(params map[string]string) (*http.Request, error)</a></li>
+<li><a href="#Serve">func Serve(handler http.Handler) error</a></li>
+<li><a href="#Handler">type Handler</a></li>
+<li> <a href="#Handler.ServeHTTP">func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request)</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>cgi_main.go</span> <span>child.go</span> <span>host.go</span> </p> <h2 id="Request">func <span>Request</span> </h2> <pre data-language="go">func Request() (*http.Request, error)</pre> <p>Request returns the HTTP request as represented in the current environment. This assumes the current program is being run by a web server in a CGI environment. The returned Request's Body is populated, if applicable. </p>
+<h2 id="RequestFromMap">func <span>RequestFromMap</span> </h2> <pre data-language="go">func RequestFromMap(params map[string]string) (*http.Request, error)</pre> <p>RequestFromMap creates an <span>http.Request</span> from CGI variables. The returned Request's Body field is not populated. </p>
+<h2 id="Serve">func <span>Serve</span> </h2> <pre data-language="go">func Serve(handler http.Handler) error</pre> <p>Serve executes the provided <a href="#Handler">Handler</a> on the currently active CGI request, if any. If there's no current CGI environment an error is returned. The provided handler may be nil to use <span>http.DefaultServeMux</span>. </p>
+<h2 id="Handler">type <span>Handler</span> </h2> <p>Handler runs an executable in a subprocess with a CGI environment. </p>
+<pre data-language="go">type Handler struct {
+ Path string // path to the CGI executable
+ Root string // root URI prefix of handler or empty for "/"
+
+ // Dir specifies the CGI executable's working directory.
+ // If Dir is empty, the base directory of Path is used.
+ // If Path has no base directory, the current working
+ // directory is used.
+ Dir string
+
+ Env []string // extra environment variables to set, if any, as "key=value"
+ InheritEnv []string // environment variables to inherit from host, as "key"
+ Logger *log.Logger // optional log for errors or nil to use log.Print
+ Args []string // optional arguments to pass to child process
+ Stderr io.Writer // optional stderr for the child process; nil means os.Stderr; added in Go 1.7
+
+ // PathLocationHandler specifies the root http Handler that
+ // should handle internal redirects when the CGI process
+ // returns a Location header value starting with a "/", as
+ // specified in RFC 3875 § 6.3.2. This will likely be
+ // http.DefaultServeMux.
+ //
+ // If nil, a CGI response with a local URI path is instead sent
+ // back to the client and not redirected internally.
+ PathLocationHandler http.Handler
+}
+</pre> <h3 id="Handler.ServeHTTP">func (*Handler) <span>ServeHTTP</span> </h3> <pre data-language="go">func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request)</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/http/cgi/" class="_attribution-link">http://golang.org/pkg/net/http/cgi/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fhttp%2Fcookiejar%2Findex.html b/devdocs/go/net%2Fhttp%2Fcookiejar%2Findex.html
new file mode 100644
index 00000000..68b22eea
--- /dev/null
+++ b/devdocs/go/net%2Fhttp%2Fcookiejar%2Findex.html
@@ -0,0 +1,106 @@
+<h1> Package cookiejar </h1> <ul id="short-nav">
+<li><code>import "net/http/cookiejar"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Jar">type Jar</a></li>
+<li> <a href="#New">func New(o *Options) (*Jar, error)</a>
+</li>
+<li> <a href="#Jar.Cookies">func (j *Jar) Cookies(u *url.URL) (cookies []*http.Cookie)</a>
+</li>
+<li> <a href="#Jar.SetCookies">func (j *Jar) SetCookies(u *url.URL, cookies []*http.Cookie)</a>
+</li>
+<li><a href="#Options">type Options</a></li>
+<li><a href="#PublicSuffixList">type PublicSuffixList</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_New">New</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>jar.go</span> <span>punycode.go</span> </p> <h2 id="Jar">type <span>Jar</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>Jar implements the http.CookieJar interface from the net/http package. </p>
+<pre data-language="go">type Jar struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="New">func <span>New</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func New(o *Options) (*Jar, error)</pre> <p>New returns a new cookie jar. A nil <a href="#Options">*Options</a> is equivalent to a zero Options. </p> <h4 id="example_New"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Start a server to give us cookies.
+ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if cookie, err := r.Cookie("Flavor"); err != nil {
+ http.SetCookie(w, &amp;http.Cookie{Name: "Flavor", Value: "Chocolate Chip"})
+ } else {
+ cookie.Value = "Oatmeal Raisin"
+ http.SetCookie(w, cookie)
+ }
+}))
+defer ts.Close()
+
+u, err := url.Parse(ts.URL)
+if err != nil {
+ log.Fatal(err)
+}
+
+// All users of cookiejar should import "golang.org/x/net/publicsuffix"
+jar, err := cookiejar.New(&amp;cookiejar.Options{PublicSuffixList: publicsuffix.List})
+if err != nil {
+ log.Fatal(err)
+}
+
+client := &amp;http.Client{
+ Jar: jar,
+}
+
+if _, err = client.Get(u.String()); err != nil {
+ log.Fatal(err)
+}
+
+fmt.Println("After 1st request:")
+for _, cookie := range jar.Cookies(u) {
+ fmt.Printf(" %s: %s\n", cookie.Name, cookie.Value)
+}
+
+if _, err = client.Get(u.String()); err != nil {
+ log.Fatal(err)
+}
+
+fmt.Println("After 2nd request:")
+for _, cookie := range jar.Cookies(u) {
+ fmt.Printf(" %s: %s\n", cookie.Name, cookie.Value)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">After 1st request:
+ Flavor: Chocolate Chip
+After 2nd request:
+ Flavor: Oatmeal Raisin
+</pre> <h3 id="Jar.Cookies">func (*Jar) <span>Cookies</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (j *Jar) Cookies(u *url.URL) (cookies []*http.Cookie)</pre> <p>Cookies implements the Cookies method of the <span>http.CookieJar</span> interface. </p>
+<p>It returns an empty slice if the URL's scheme is not HTTP or HTTPS. </p>
+<h3 id="Jar.SetCookies">func (*Jar) <span>SetCookies</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (j *Jar) SetCookies(u *url.URL, cookies []*http.Cookie)</pre> <p>SetCookies implements the SetCookies method of the <span>http.CookieJar</span> interface. </p>
+<p>It does nothing if the URL's scheme is not HTTP or HTTPS. </p>
+<h2 id="Options">type <span>Options</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>Options are the options for creating a new Jar. </p>
+<pre data-language="go">type Options struct {
+ // PublicSuffixList is the public suffix list that determines whether
+ // an HTTP server can set a cookie for a domain.
+ //
+ // A nil value is valid and may be useful for testing but it is not
+ // secure: it means that the HTTP server for foo.co.uk can set a cookie
+ // for bar.co.uk.
+ PublicSuffixList PublicSuffixList
+}
+</pre> <h2 id="PublicSuffixList">type <span>PublicSuffixList</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>PublicSuffixList provides the public suffix of a domain. For example: </p>
+<ul> <li>the public suffix of "example.com" is "com", </li>
+<li>the public suffix of "foo1.foo2.foo3.co.uk" is "co.uk", and </li>
+<li>the public suffix of "bar.pvt.k12.ma.us" is "pvt.k12.ma.us". </li>
+</ul> <p>Implementations of PublicSuffixList must be safe for concurrent use by multiple goroutines. </p>
+<p>An implementation that always returns "" is valid and may be useful for testing but it is not secure: it means that the HTTP server for foo.com can set a cookie for bar.com. </p>
+<p>A public suffix list implementation is in the package golang.org/x/net/publicsuffix. </p>
+<pre data-language="go">type PublicSuffixList interface {
+ // PublicSuffix returns the public suffix of domain.
+ //
+ // TODO: specify which of the caller and callee is responsible for IP
+ // addresses, for leading and trailing dots, for case sensitivity, and
+ // for IDN/Punycode.
+ PublicSuffix(domain string) string
+
+ // String returns a description of the source of this public suffix
+ // list. The description will typically contain something like a time
+ // stamp or version number.
+ String() string
+}</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/http/cookiejar/" class="_attribution-link">http://golang.org/pkg/net/http/cookiejar/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fhttp%2Ffcgi%2Findex.html b/devdocs/go/net%2Fhttp%2Ffcgi%2Findex.html
new file mode 100644
index 00000000..521fefbb
--- /dev/null
+++ b/devdocs/go/net%2Fhttp%2Ffcgi%2Findex.html
@@ -0,0 +1,19 @@
+<h1> Package fcgi </h1> <ul id="short-nav">
+<li><code>import "net/http/fcgi"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package fcgi implements the FastCGI protocol. </p>
+<p>See <a href="https://fast-cgi.github.io/">https://fast-cgi.github.io/</a> for an unofficial mirror of the original documentation. </p>
+<p>Currently only the responder role is supported. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#ProcessEnv">func ProcessEnv(r *http.Request) map[string]string</a></li>
+<li><a href="#Serve">func Serve(l net.Listener, handler http.Handler) error</a></li>
+</ul> <h3>Package files</h3> <p> <span>child.go</span> <span>fcgi.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrConnClosed is returned by Read when a handler attempts to read the body of a request after the connection to the web server has been closed. </p>
+<pre data-language="go">var ErrConnClosed = errors.New("fcgi: connection to web server closed")</pre> <p>ErrRequestAborted is returned by Read when a handler attempts to read the body of a request that has been aborted by the web server. </p>
+<pre data-language="go">var ErrRequestAborted = errors.New("fcgi: request aborted by web server")</pre> <h2 id="ProcessEnv">func <span>ProcessEnv</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func ProcessEnv(r *http.Request) map[string]string</pre> <p>ProcessEnv returns FastCGI environment variables associated with the request r for which no effort was made to be included in the request itself - the data is hidden in the request's context. As an example, if REMOTE_USER is set for a request, it will not be found anywhere in r, but it will be included in ProcessEnv's response (via r's context). </p>
+<h2 id="Serve">func <span>Serve</span> </h2> <pre data-language="go">func Serve(l net.Listener, handler http.Handler) error</pre> <p>Serve accepts incoming FastCGI connections on the listener l, creating a new goroutine for each. The goroutine reads requests and then calls handler to reply to them. If l is nil, Serve accepts connections from os.Stdin. If handler is nil, <span>http.DefaultServeMux</span> is used. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/http/fcgi/" class="_attribution-link">http://golang.org/pkg/net/http/fcgi/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fhttp%2Fhttptest%2Findex.html b/devdocs/go/net%2Fhttp%2Fhttptest%2Findex.html
new file mode 100644
index 00000000..46304728
--- /dev/null
+++ b/devdocs/go/net%2Fhttp%2Fhttptest%2Findex.html
@@ -0,0 +1,200 @@
+<h1> Package httptest </h1> <ul id="short-nav">
+<li><code>import "net/http/httptest"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package httptest provides utilities for HTTP testing. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#NewRequest">func NewRequest(method, target string, body io.Reader) *http.Request</a></li>
+<li><a href="#ResponseRecorder">type ResponseRecorder</a></li>
+<li> <a href="#NewRecorder">func NewRecorder() *ResponseRecorder</a>
+</li>
+<li> <a href="#ResponseRecorder.Flush">func (rw *ResponseRecorder) Flush()</a>
+</li>
+<li> <a href="#ResponseRecorder.Header">func (rw *ResponseRecorder) Header() http.Header</a>
+</li>
+<li> <a href="#ResponseRecorder.Result">func (rw *ResponseRecorder) Result() *http.Response</a>
+</li>
+<li> <a href="#ResponseRecorder.Write">func (rw *ResponseRecorder) Write(buf []byte) (int, error)</a>
+</li>
+<li> <a href="#ResponseRecorder.WriteHeader">func (rw *ResponseRecorder) WriteHeader(code int)</a>
+</li>
+<li> <a href="#ResponseRecorder.WriteString">func (rw *ResponseRecorder) WriteString(str string) (int, error)</a>
+</li>
+<li><a href="#Server">type Server</a></li>
+<li> <a href="#NewServer">func NewServer(handler http.Handler) *Server</a>
+</li>
+<li> <a href="#NewTLSServer">func NewTLSServer(handler http.Handler) *Server</a>
+</li>
+<li> <a href="#NewUnstartedServer">func NewUnstartedServer(handler http.Handler) *Server</a>
+</li>
+<li> <a href="#Server.Certificate">func (s *Server) Certificate() *x509.Certificate</a>
+</li>
+<li> <a href="#Server.Client">func (s *Server) Client() *http.Client</a>
+</li>
+<li> <a href="#Server.Close">func (s *Server) Close()</a>
+</li>
+<li> <a href="#Server.CloseClientConnections">func (s *Server) CloseClientConnections()</a>
+</li>
+<li> <a href="#Server.Start">func (s *Server) Start()</a>
+</li>
+<li> <a href="#Server.StartTLS">func (s *Server) StartTLS()</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_NewTLSServer">NewTLSServer</a></dd> <dd><a class="exampleLink" href="#example_ResponseRecorder">ResponseRecorder</a></dd> <dd><a class="exampleLink" href="#example_Server">Server</a></dd> <dd><a class="exampleLink" href="#example_Server_hTTP2">Server (HTTP2)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>httptest.go</span> <span>recorder.go</span> <span>server.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>DefaultRemoteAddr is the default remote address to return in RemoteAddr if an explicit DefaultRemoteAddr isn't set on <a href="#ResponseRecorder">ResponseRecorder</a>. </p>
+<pre data-language="go">const DefaultRemoteAddr = "1.2.3.4"</pre> <h2 id="NewRequest">func <span>NewRequest</span> <span title="Added in Go 1.7">1.7</span> </h2> <pre data-language="go">func NewRequest(method, target string, body io.Reader) *http.Request</pre> <p>NewRequest returns a new incoming server Request, suitable for passing to an <span>http.Handler</span> for testing. </p>
+<p>The target is the RFC 7230 "request-target": it may be either a path or an absolute URL. If target is an absolute URL, the host name from the URL is used. Otherwise, "example.com" is used. </p>
+<p>The TLS field is set to a non-nil dummy value if target has scheme "https". </p>
+<p>The Request.Proto is always HTTP/1.1. </p>
+<p>An empty method means "GET". </p>
+<p>The provided body may be nil. If the body is of type *bytes.Reader, *strings.Reader, or *bytes.Buffer, the Request.ContentLength is set. </p>
+<p>NewRequest panics on error for ease of use in testing, where a panic is acceptable. </p>
+<p>To generate a client HTTP request instead of a server request, see the NewRequest function in the net/http package. </p>
+<h2 id="ResponseRecorder">type <span>ResponseRecorder</span> </h2> <p>ResponseRecorder is an implementation of <span>http.ResponseWriter</span> that records its mutations for later inspection in tests. </p>
+<pre data-language="go">type ResponseRecorder struct {
+ // Code is the HTTP response code set by WriteHeader.
+ //
+ // Note that if a Handler never calls WriteHeader or Write,
+ // this might end up being 0, rather than the implicit
+ // http.StatusOK. To get the implicit value, use the Result
+ // method.
+ Code int
+
+ // HeaderMap contains the headers explicitly set by the Handler.
+ // It is an internal detail.
+ //
+ // Deprecated: HeaderMap exists for historical compatibility
+ // and should not be used. To access the headers returned by a handler,
+ // use the Response.Header map as returned by the Result method.
+ HeaderMap http.Header
+
+ // Body is the buffer to which the Handler's Write calls are sent.
+ // If nil, the Writes are silently discarded.
+ Body *bytes.Buffer
+
+ // Flushed is whether the Handler called Flush.
+ Flushed bool
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_ResponseRecorder"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">handler := func(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "&lt;html&gt;&lt;body&gt;Hello World!&lt;/body&gt;&lt;/html&gt;")
+}
+
+req := httptest.NewRequest("GET", "http://example.com/foo", nil)
+w := httptest.NewRecorder()
+handler(w, req)
+
+resp := w.Result()
+body, _ := io.ReadAll(resp.Body)
+
+fmt.Println(resp.StatusCode)
+fmt.Println(resp.Header.Get("Content-Type"))
+fmt.Println(string(body))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">200
+text/html; charset=utf-8
+&lt;html&gt;&lt;body&gt;Hello World!&lt;/body&gt;&lt;/html&gt;
+</pre> <h3 id="NewRecorder">func <span>NewRecorder</span> </h3> <pre data-language="go">func NewRecorder() *ResponseRecorder</pre> <p>NewRecorder returns an initialized <a href="#ResponseRecorder">ResponseRecorder</a>. </p>
+<h3 id="ResponseRecorder.Flush">func (*ResponseRecorder) <span>Flush</span> </h3> <pre data-language="go">func (rw *ResponseRecorder) Flush()</pre> <p>Flush implements <span>http.Flusher</span>. To test whether Flush was called, see rw.Flushed. </p>
+<h3 id="ResponseRecorder.Header">func (*ResponseRecorder) <span>Header</span> </h3> <pre data-language="go">func (rw *ResponseRecorder) Header() http.Header</pre> <p>Header implements <span>http.ResponseWriter</span>. It returns the response headers to mutate within a handler. To test the headers that were written after a handler completes, use the <a href="#ResponseRecorder.Result">ResponseRecorder.Result</a> method and see the returned Response value's Header. </p>
+<h3 id="ResponseRecorder.Result">func (*ResponseRecorder) <span>Result</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (rw *ResponseRecorder) Result() *http.Response</pre> <p>Result returns the response generated by the handler. </p>
+<p>The returned Response will have at least its StatusCode, Header, Body, and optionally Trailer populated. More fields may be populated in the future, so callers should not DeepEqual the result in tests. </p>
+<p>The Response.Header is a snapshot of the headers at the time of the first write call, or at the time of this call, if the handler never did a write. </p>
+<p>The Response.Body is guaranteed to be non-nil and Body.Read call is guaranteed to not return any error other than <span>io.EOF</span>. </p>
+<p>Result must only be called after the handler has finished running. </p>
+<h3 id="ResponseRecorder.Write">func (*ResponseRecorder) <span>Write</span> </h3> <pre data-language="go">func (rw *ResponseRecorder) Write(buf []byte) (int, error)</pre> <p>Write implements http.ResponseWriter. The data in buf is written to rw.Body, if not nil. </p>
+<h3 id="ResponseRecorder.WriteHeader">func (*ResponseRecorder) <span>WriteHeader</span> </h3> <pre data-language="go">func (rw *ResponseRecorder) WriteHeader(code int)</pre> <p>WriteHeader implements <span>http.ResponseWriter</span>. </p>
+<h3 id="ResponseRecorder.WriteString">func (*ResponseRecorder) <span>WriteString</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (rw *ResponseRecorder) WriteString(str string) (int, error)</pre> <p>WriteString implements <span>io.StringWriter</span>. The data in str is written to rw.Body, if not nil. </p>
+<h2 id="Server">type <span>Server</span> </h2> <p>A Server is an HTTP server listening on a system-chosen port on the local loopback interface, for use in end-to-end HTTP tests. </p>
+<pre data-language="go">type Server struct {
+ URL string // base URL of form http://ipaddr:port with no trailing slash
+ Listener net.Listener
+
+ // EnableHTTP2 controls whether HTTP/2 is enabled
+ // on the server. It must be set between calling
+ // NewUnstartedServer and calling Server.StartTLS.
+ EnableHTTP2 bool // Go 1.14
+
+ // TLS is the optional TLS configuration, populated with a new config
+ // after TLS is started. If set on an unstarted server before StartTLS
+ // is called, existing fields are copied into the new config.
+ TLS *tls.Config
+
+ // Config may be changed after calling NewUnstartedServer and
+ // before Start or StartTLS.
+ Config *http.Server
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Server"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintln(w, "Hello, client")
+}))
+defer ts.Close()
+
+res, err := http.Get(ts.URL)
+if err != nil {
+ log.Fatal(err)
+}
+greeting, err := io.ReadAll(res.Body)
+res.Body.Close()
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s", greeting)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, client
+</pre> <h4 id="example_Server_hTTP2"> <span class="text">Example (HTTP2)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintf(w, "Hello, %s", r.Proto)
+}))
+ts.EnableHTTP2 = true
+ts.StartTLS()
+defer ts.Close()
+
+res, err := ts.Client().Get(ts.URL)
+if err != nil {
+ log.Fatal(err)
+}
+greeting, err := io.ReadAll(res.Body)
+res.Body.Close()
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s", greeting)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, HTTP/2.0
+</pre> <h3 id="NewServer">func <span>NewServer</span> </h3> <pre data-language="go">func NewServer(handler http.Handler) *Server</pre> <p>NewServer starts and returns a new <a href="#Server">Server</a>. The caller should call Close when finished, to shut it down. </p>
+<h3 id="NewTLSServer">func <span>NewTLSServer</span> </h3> <pre data-language="go">func NewTLSServer(handler http.Handler) *Server</pre> <p>NewTLSServer starts and returns a new <a href="#Server">Server</a> using TLS. The caller should call Close when finished, to shut it down. </p> <h4 id="example_NewTLSServer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintln(w, "Hello, client")
+}))
+defer ts.Close()
+
+client := ts.Client()
+res, err := client.Get(ts.URL)
+if err != nil {
+ log.Fatal(err)
+}
+
+greeting, err := io.ReadAll(res.Body)
+res.Body.Close()
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s", greeting)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, client
+</pre> <h3 id="NewUnstartedServer">func <span>NewUnstartedServer</span> </h3> <pre data-language="go">func NewUnstartedServer(handler http.Handler) *Server</pre> <p>NewUnstartedServer returns a new <a href="#Server">Server</a> but doesn't start it. </p>
+<p>After changing its configuration, the caller should call Start or StartTLS. </p>
+<p>The caller should call Close when finished, to shut it down. </p>
+<h3 id="Server.Certificate">func (*Server) <span>Certificate</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (s *Server) Certificate() *x509.Certificate</pre> <p>Certificate returns the certificate used by the server, or nil if the server doesn't use TLS. </p>
+<h3 id="Server.Client">func (*Server) <span>Client</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (s *Server) Client() *http.Client</pre> <p>Client returns an HTTP client configured for making requests to the server. It is configured to trust the server's TLS test certificate and will close its idle connections on <a href="#Server.Close">Server.Close</a>. </p>
+<h3 id="Server.Close">func (*Server) <span>Close</span> </h3> <pre data-language="go">func (s *Server) Close()</pre> <p>Close shuts down the server and blocks until all outstanding requests on this server have completed. </p>
+<h3 id="Server.CloseClientConnections">func (*Server) <span>CloseClientConnections</span> </h3> <pre data-language="go">func (s *Server) CloseClientConnections()</pre> <p>CloseClientConnections closes any open HTTP connections to the test Server. </p>
+<h3 id="Server.Start">func (*Server) <span>Start</span> </h3> <pre data-language="go">func (s *Server) Start()</pre> <p>Start starts a server from NewUnstartedServer. </p>
+<h3 id="Server.StartTLS">func (*Server) <span>StartTLS</span> </h3> <pre data-language="go">func (s *Server) StartTLS()</pre> <p>StartTLS starts TLS on a server from NewUnstartedServer. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/http/httptest/" class="_attribution-link">http://golang.org/pkg/net/http/httptest/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fhttp%2Fhttptrace%2Findex.html b/devdocs/go/net%2Fhttp%2Fhttptrace%2Findex.html
new file mode 100644
index 00000000..f81e7f0c
--- /dev/null
+++ b/devdocs/go/net%2Fhttp%2Fhttptrace%2Findex.html
@@ -0,0 +1,167 @@
+<h1> Package httptrace </h1> <ul id="short-nav">
+<li><code>import "net/http/httptrace"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package httptrace provides mechanisms to trace the events within HTTP client requests. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+req, _ := http.NewRequest("GET", "http://example.com", nil)
+trace := &amp;httptrace.ClientTrace{
+ GotConn: func(connInfo httptrace.GotConnInfo) {
+ fmt.Printf("Got Conn: %+v\n", connInfo)
+ },
+ DNSDone: func(dnsInfo httptrace.DNSDoneInfo) {
+ fmt.Printf("DNS Info: %+v\n", dnsInfo)
+ },
+}
+req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace))
+_, err := http.DefaultTransport.RoundTrip(req)
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#WithClientTrace">func WithClientTrace(ctx context.Context, trace *ClientTrace) context.Context</a></li>
+<li><a href="#ClientTrace">type ClientTrace</a></li>
+<li> <a href="#ContextClientTrace">func ContextClientTrace(ctx context.Context) *ClientTrace</a>
+</li>
+<li><a href="#DNSDoneInfo">type DNSDoneInfo</a></li>
+<li><a href="#DNSStartInfo">type DNSStartInfo</a></li>
+<li><a href="#GotConnInfo">type GotConnInfo</a></li>
+<li><a href="#WroteRequestInfo">type WroteRequestInfo</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>trace.go</span> </p> <h2 id="WithClientTrace">func <span>WithClientTrace</span> <span title="Added in Go 1.7">1.7</span> </h2> <pre data-language="go">func WithClientTrace(ctx context.Context, trace *ClientTrace) context.Context</pre> <p>WithClientTrace returns a new context based on the provided parent ctx. HTTP client requests made with the returned context will use the provided trace hooks, in addition to any previous hooks registered with ctx. Any hooks defined in the provided trace will be called first. </p>
+<h2 id="ClientTrace">type <span>ClientTrace</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>ClientTrace is a set of hooks to run at various stages of an outgoing HTTP request. Any particular hook may be nil. Functions may be called concurrently from different goroutines and some may be called after the request has completed or failed. </p>
+<p>ClientTrace currently traces a single HTTP request &amp; response during a single round trip and has no hooks that span a series of redirected requests. </p>
+<p>See <a href="https://blog.golang.org/http-tracing">https://blog.golang.org/http-tracing</a> for more. </p>
+<pre data-language="go">type ClientTrace struct {
+ // GetConn is called before a connection is created or
+ // retrieved from an idle pool. The hostPort is the
+ // "host:port" of the target or proxy. GetConn is called even
+ // if there's already an idle cached connection available.
+ GetConn func(hostPort string)
+
+ // GotConn is called after a successful connection is
+ // obtained. There is no hook for failure to obtain a
+ // connection; instead, use the error from
+ // Transport.RoundTrip.
+ GotConn func(GotConnInfo)
+
+ // PutIdleConn is called when the connection is returned to
+ // the idle pool. If err is nil, the connection was
+ // successfully returned to the idle pool. If err is non-nil,
+ // it describes why not. PutIdleConn is not called if
+ // connection reuse is disabled via Transport.DisableKeepAlives.
+ // PutIdleConn is called before the caller's Response.Body.Close
+ // call returns.
+ // For HTTP/2, this hook is not currently used.
+ PutIdleConn func(err error)
+
+ // GotFirstResponseByte is called when the first byte of the response
+ // headers is available.
+ GotFirstResponseByte func()
+
+ // Got100Continue is called if the server replies with a "100
+ // Continue" response.
+ Got100Continue func()
+
+ // Got1xxResponse is called for each 1xx informational response header
+ // returned before the final non-1xx response. Got1xxResponse is called
+ // for "100 Continue" responses, even if Got100Continue is also defined.
+ // If it returns an error, the client request is aborted with that error value.
+ Got1xxResponse func(code int, header textproto.MIMEHeader) error // Go 1.11
+
+ // DNSStart is called when a DNS lookup begins.
+ DNSStart func(DNSStartInfo)
+
+ // DNSDone is called when a DNS lookup ends.
+ DNSDone func(DNSDoneInfo)
+
+ // ConnectStart is called when a new connection's Dial begins.
+ // If net.Dialer.DualStack (IPv6 "Happy Eyeballs") support is
+ // enabled, this may be called multiple times.
+ ConnectStart func(network, addr string)
+
+ // ConnectDone is called when a new connection's Dial
+ // completes. The provided err indicates whether the
+ // connection completed successfully.
+ // If net.Dialer.DualStack ("Happy Eyeballs") support is
+ // enabled, this may be called multiple times.
+ ConnectDone func(network, addr string, err error)
+
+ // TLSHandshakeStart is called when the TLS handshake is started. When
+ // connecting to an HTTPS site via an HTTP proxy, the handshake happens
+ // after the CONNECT request is processed by the proxy.
+ TLSHandshakeStart func() // Go 1.8
+
+ // TLSHandshakeDone is called after the TLS handshake with either the
+ // successful handshake's connection state, or a non-nil error on handshake
+ // failure.
+ TLSHandshakeDone func(tls.ConnectionState, error) // Go 1.8
+
+ // WroteHeaderField is called after the Transport has written
+ // each request header. At the time of this call the values
+ // might be buffered and not yet written to the network.
+ WroteHeaderField func(key string, value []string) // Go 1.11
+
+ // WroteHeaders is called after the Transport has written
+ // all request headers.
+ WroteHeaders func()
+
+ // Wait100Continue is called if the Request specified
+ // "Expect: 100-continue" and the Transport has written the
+ // request headers but is waiting for "100 Continue" from the
+ // server before writing the request body.
+ Wait100Continue func()
+
+ // WroteRequest is called with the result of writing the
+ // request and any body. It may be called multiple times
+ // in the case of retried requests.
+ WroteRequest func(WroteRequestInfo)
+}
+</pre> <h3 id="ContextClientTrace">func <span>ContextClientTrace</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func ContextClientTrace(ctx context.Context) *ClientTrace</pre> <p>ContextClientTrace returns the <a href="#ClientTrace">ClientTrace</a> associated with the provided context. If none, it returns nil. </p>
+<h2 id="DNSDoneInfo">type <span>DNSDoneInfo</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>DNSDoneInfo contains information about the results of a DNS lookup. </p>
+<pre data-language="go">type DNSDoneInfo struct {
+ // Addrs are the IPv4 and/or IPv6 addresses found in the DNS
+ // lookup. The contents of the slice should not be mutated.
+ Addrs []net.IPAddr
+
+ // Err is any error that occurred during the DNS lookup.
+ Err error
+
+ // Coalesced is whether the Addrs were shared with another
+ // caller who was doing the same DNS lookup concurrently.
+ Coalesced bool
+}
+</pre> <h2 id="DNSStartInfo">type <span>DNSStartInfo</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>DNSStartInfo contains information about a DNS request. </p>
+<pre data-language="go">type DNSStartInfo struct {
+ Host string
+}
+</pre> <h2 id="GotConnInfo">type <span>GotConnInfo</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>GotConnInfo is the argument to the [ClientTrace.GotConn] function and contains information about the obtained connection. </p>
+<pre data-language="go">type GotConnInfo struct {
+ // Conn is the connection that was obtained. It is owned by
+ // the http.Transport and should not be read, written or
+ // closed by users of ClientTrace.
+ Conn net.Conn
+
+ // Reused is whether this connection has been previously
+ // used for another HTTP request.
+ Reused bool
+
+ // WasIdle is whether this connection was obtained from an
+ // idle pool.
+ WasIdle bool
+
+ // IdleTime reports how long the connection was previously
+ // idle, if WasIdle is true.
+ IdleTime time.Duration
+}
+</pre> <h2 id="WroteRequestInfo">type <span>WroteRequestInfo</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>WroteRequestInfo contains information provided to the WroteRequest hook. </p>
+<pre data-language="go">type WroteRequestInfo struct {
+ // Err is any error encountered while writing the Request.
+ Err error
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/http/httptrace/" class="_attribution-link">http://golang.org/pkg/net/http/httptrace/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fhttp%2Fhttputil%2Findex.html b/devdocs/go/net%2Fhttp%2Fhttputil%2Findex.html
new file mode 100644
index 00000000..8b319ab3
--- /dev/null
+++ b/devdocs/go/net%2Fhttp%2Fhttputil%2Findex.html
@@ -0,0 +1,341 @@
+<h1> Package httputil </h1> <ul id="short-nav">
+<li><code>import "net/http/httputil"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#DumpRequest">func DumpRequest(req *http.Request, body bool) ([]byte, error)</a></li>
+<li><a href="#DumpRequestOut">func DumpRequestOut(req *http.Request, body bool) ([]byte, error)</a></li>
+<li><a href="#DumpResponse">func DumpResponse(resp *http.Response, body bool) ([]byte, error)</a></li>
+<li><a href="#NewChunkedReader">func NewChunkedReader(r io.Reader) io.Reader</a></li>
+<li><a href="#NewChunkedWriter">func NewChunkedWriter(w io.Writer) io.WriteCloser</a></li>
+<li><a href="#BufferPool">type BufferPool</a></li>
+<li><a href="#ClientConn">type ClientConn</a></li>
+<li> <a href="#NewClientConn">func NewClientConn(c net.Conn, r *bufio.Reader) *ClientConn</a>
+</li>
+<li> <a href="#NewProxyClientConn">func NewProxyClientConn(c net.Conn, r *bufio.Reader) *ClientConn</a>
+</li>
+<li> <a href="#ClientConn.Close">func (cc *ClientConn) Close() error</a>
+</li>
+<li> <a href="#ClientConn.Do">func (cc *ClientConn) Do(req *http.Request) (*http.Response, error)</a>
+</li>
+<li> <a href="#ClientConn.Hijack">func (cc *ClientConn) Hijack() (c net.Conn, r *bufio.Reader)</a>
+</li>
+<li> <a href="#ClientConn.Pending">func (cc *ClientConn) Pending() int</a>
+</li>
+<li> <a href="#ClientConn.Read">func (cc *ClientConn) Read(req *http.Request) (resp *http.Response, err error)</a>
+</li>
+<li> <a href="#ClientConn.Write">func (cc *ClientConn) Write(req *http.Request) error</a>
+</li>
+<li><a href="#ProxyRequest">type ProxyRequest</a></li>
+<li> <a href="#ProxyRequest.SetURL">func (r *ProxyRequest) SetURL(target *url.URL)</a>
+</li>
+<li> <a href="#ProxyRequest.SetXForwarded">func (r *ProxyRequest) SetXForwarded()</a>
+</li>
+<li><a href="#ReverseProxy">type ReverseProxy</a></li>
+<li> <a href="#NewSingleHostReverseProxy">func NewSingleHostReverseProxy(target *url.URL) *ReverseProxy</a>
+</li>
+<li> <a href="#ReverseProxy.ServeHTTP">func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)</a>
+</li>
+<li><a href="#ServerConn">type ServerConn</a></li>
+<li> <a href="#NewServerConn">func NewServerConn(c net.Conn, r *bufio.Reader) *ServerConn</a>
+</li>
+<li> <a href="#ServerConn.Close">func (sc *ServerConn) Close() error</a>
+</li>
+<li> <a href="#ServerConn.Hijack">func (sc *ServerConn) Hijack() (net.Conn, *bufio.Reader)</a>
+</li>
+<li> <a href="#ServerConn.Pending">func (sc *ServerConn) Pending() int</a>
+</li>
+<li> <a href="#ServerConn.Read">func (sc *ServerConn) Read() (*http.Request, error)</a>
+</li>
+<li> <a href="#ServerConn.Write">func (sc *ServerConn) Write(req *http.Request, resp *http.Response) error</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_DumpRequest">DumpRequest</a></dd> <dd><a class="exampleLink" href="#example_DumpRequestOut">DumpRequestOut</a></dd> <dd><a class="exampleLink" href="#example_DumpResponse">DumpResponse</a></dd> <dd><a class="exampleLink" href="#example_ReverseProxy">ReverseProxy</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>dump.go</span> <span>httputil.go</span> <span>persist.go</span> <span>reverseproxy.go</span> </p> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var (
+ // Deprecated: No longer used.
+ ErrPersistEOF = &amp;http.ProtocolError{ErrorString: "persistent connection closed"}
+
+ // Deprecated: No longer used.
+ ErrClosed = &amp;http.ProtocolError{ErrorString: "connection closed by user"}
+
+ // Deprecated: No longer used.
+ ErrPipeline = &amp;http.ProtocolError{ErrorString: "pipeline error"}
+)</pre> <p>ErrLineTooLong is returned when reading malformed chunked data with lines that are too long. </p>
+<pre data-language="go">var ErrLineTooLong = internal.ErrLineTooLong</pre> <h2 id="DumpRequest">func <span>DumpRequest</span> </h2> <pre data-language="go">func DumpRequest(req *http.Request, body bool) ([]byte, error)</pre> <p>DumpRequest returns the given request in its HTTP/1.x wire representation. It should only be used by servers to debug client requests. The returned representation is an approximation only; some details of the initial request are lost while parsing it into an <span>http.Request</span>. In particular, the order and case of header field names are lost. The order of values in multi-valued headers is kept intact. HTTP/2 requests are dumped in HTTP/1.x form, not in their original binary representations. </p>
+<p>If body is true, DumpRequest also returns the body. To do so, it consumes req.Body and then replaces it with a new <span>io.ReadCloser</span> that yields the same bytes. If DumpRequest returns an error, the state of req is undefined. </p>
+<p>The documentation for <span>http.Request.Write</span> details which fields of req are included in the dump. </p> <h4 id="example_DumpRequest"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ dump, err := httputil.DumpRequest(r, true)
+ if err != nil {
+ http.Error(w, fmt.Sprint(err), http.StatusInternalServerError)
+ return
+ }
+
+ fmt.Fprintf(w, "%q", dump)
+}))
+defer ts.Close()
+
+const body = "Go is a general-purpose language designed with systems programming in mind."
+req, err := http.NewRequest("POST", ts.URL, strings.NewReader(body))
+if err != nil {
+ log.Fatal(err)
+}
+req.Host = "www.example.org"
+resp, err := http.DefaultClient.Do(req)
+if err != nil {
+ log.Fatal(err)
+}
+defer resp.Body.Close()
+
+b, err := io.ReadAll(resp.Body)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s", b)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"POST / HTTP/1.1\r\nHost: www.example.org\r\nAccept-Encoding: gzip\r\nContent-Length: 75\r\nUser-Agent: Go-http-client/1.1\r\n\r\nGo is a general-purpose language designed with systems programming in mind."
+</pre> <h2 id="DumpRequestOut">func <span>DumpRequestOut</span> </h2> <pre data-language="go">func DumpRequestOut(req *http.Request, body bool) ([]byte, error)</pre> <p>DumpRequestOut is like <a href="#DumpRequest">DumpRequest</a> but for outgoing client requests. It includes any headers that the standard <span>http.Transport</span> adds, such as User-Agent. </p> <h4 id="example_DumpRequestOut"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const body = "Go is a general-purpose language designed with systems programming in mind."
+req, err := http.NewRequest("PUT", "http://www.example.org", strings.NewReader(body))
+if err != nil {
+ log.Fatal(err)
+}
+
+dump, err := httputil.DumpRequestOut(req, true)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%q", dump)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"PUT / HTTP/1.1\r\nHost: www.example.org\r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 75\r\nAccept-Encoding: gzip\r\n\r\nGo is a general-purpose language designed with systems programming in mind."
+</pre> <h2 id="DumpResponse">func <span>DumpResponse</span> </h2> <pre data-language="go">func DumpResponse(resp *http.Response, body bool) ([]byte, error)</pre> <p>DumpResponse is like DumpRequest but dumps a response. </p> <h4 id="example_DumpResponse"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const body = "Go is a general-purpose language designed with systems programming in mind."
+ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Date", "Wed, 19 Jul 1972 19:00:00 GMT")
+ fmt.Fprintln(w, body)
+}))
+defer ts.Close()
+
+resp, err := http.Get(ts.URL)
+if err != nil {
+ log.Fatal(err)
+}
+defer resp.Body.Close()
+
+dump, err := httputil.DumpResponse(resp, true)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%q", dump)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"HTTP/1.1 200 OK\r\nContent-Length: 76\r\nContent-Type: text/plain; charset=utf-8\r\nDate: Wed, 19 Jul 1972 19:00:00 GMT\r\n\r\nGo is a general-purpose language designed with systems programming in mind.\n"
+</pre> <h2 id="NewChunkedReader">func <span>NewChunkedReader</span> </h2> <pre data-language="go">func NewChunkedReader(r io.Reader) io.Reader</pre> <p>NewChunkedReader returns a new chunkedReader that translates the data read from r out of HTTP "chunked" format before returning it. The chunkedReader returns <span>io.EOF</span> when the final 0-length chunk is read. </p>
+<p>NewChunkedReader is not needed by normal applications. The http package automatically decodes chunking when reading response bodies. </p>
+<h2 id="NewChunkedWriter">func <span>NewChunkedWriter</span> </h2> <pre data-language="go">func NewChunkedWriter(w io.Writer) io.WriteCloser</pre> <p>NewChunkedWriter returns a new chunkedWriter that translates writes into HTTP "chunked" format before writing them to w. Closing the returned chunkedWriter sends the final 0-length chunk that marks the end of the stream but does not send the final CRLF that appears after trailers; trailers and the last CRLF must be written separately. </p>
+<p>NewChunkedWriter is not needed by normal applications. The http package adds chunking automatically if handlers don't set a Content-Length header. Using NewChunkedWriter inside a handler would result in double chunking or chunking with a Content-Length length, both of which are wrong. </p>
+<h2 id="BufferPool">type <span>BufferPool</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>A BufferPool is an interface for getting and returning temporary byte slices for use by <span>io.CopyBuffer</span>. </p>
+<pre data-language="go">type BufferPool interface {
+ Get() []byte
+ Put([]byte)
+}</pre> <h2 id="ClientConn">type <span>ClientConn</span> </h2> <p>ClientConn is an artifact of Go's early HTTP implementation. It is low-level, old, and unused by Go's current HTTP stack. We should have deleted it before Go 1. </p>
+<p>Deprecated: Use Client or Transport in package <span>net/http</span> instead. </p>
+<pre data-language="go">type ClientConn struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewClientConn">func <span>NewClientConn</span> </h3> <pre data-language="go">func NewClientConn(c net.Conn, r *bufio.Reader) *ClientConn</pre> <p>NewClientConn is an artifact of Go's early HTTP implementation. It is low-level, old, and unused by Go's current HTTP stack. We should have deleted it before Go 1. </p>
+<p>Deprecated: Use the Client or Transport in package <span>net/http</span> instead. </p>
+<h3 id="NewProxyClientConn">func <span>NewProxyClientConn</span> </h3> <pre data-language="go">func NewProxyClientConn(c net.Conn, r *bufio.Reader) *ClientConn</pre> <p>NewProxyClientConn is an artifact of Go's early HTTP implementation. It is low-level, old, and unused by Go's current HTTP stack. We should have deleted it before Go 1. </p>
+<p>Deprecated: Use the Client or Transport in package <span>net/http</span> instead. </p>
+<h3 id="ClientConn.Close">func (*ClientConn) <span>Close</span> </h3> <pre data-language="go">func (cc *ClientConn) Close() error</pre> <p>Close calls <a href="#ClientConn.Hijack">ClientConn.Hijack</a> and then also closes the underlying connection. </p>
+<h3 id="ClientConn.Do">func (*ClientConn) <span>Do</span> </h3> <pre data-language="go">func (cc *ClientConn) Do(req *http.Request) (*http.Response, error)</pre> <p>Do is convenience method that writes a request and reads a response. </p>
+<h3 id="ClientConn.Hijack">func (*ClientConn) <span>Hijack</span> </h3> <pre data-language="go">func (cc *ClientConn) Hijack() (c net.Conn, r *bufio.Reader)</pre> <p>Hijack detaches the <a href="#ClientConn">ClientConn</a> and returns the underlying connection as well as the read-side bufio which may have some left over data. Hijack may be called before the user or Read have signaled the end of the keep-alive logic. The user should not call Hijack while <a href="#ClientConn.Read">ClientConn.Read</a> or ClientConn.Write is in progress. </p>
+<h3 id="ClientConn.Pending">func (*ClientConn) <span>Pending</span> </h3> <pre data-language="go">func (cc *ClientConn) Pending() int</pre> <p>Pending returns the number of unanswered requests that have been sent on the connection. </p>
+<h3 id="ClientConn.Read">func (*ClientConn) <span>Read</span> </h3> <pre data-language="go">func (cc *ClientConn) Read(req *http.Request) (resp *http.Response, err error)</pre> <p>Read reads the next response from the wire. A valid response might be returned together with an <a href="#ErrPersistEOF">ErrPersistEOF</a>, which means that the remote requested that this be the last request serviced. Read can be called concurrently with <a href="#ClientConn.Write">ClientConn.Write</a>, but not with another Read. </p>
+<h3 id="ClientConn.Write">func (*ClientConn) <span>Write</span> </h3> <pre data-language="go">func (cc *ClientConn) Write(req *http.Request) error</pre> <p>Write writes a request. An <a href="#ErrPersistEOF">ErrPersistEOF</a> error is returned if the connection has been closed in an HTTP keep-alive sense. If req.Close equals true, the keep-alive connection is logically closed after this request and the opposing server is informed. An ErrUnexpectedEOF indicates the remote closed the underlying TCP connection, which is usually considered as graceful close. </p>
+<h2 id="ProxyRequest">type <span>ProxyRequest</span> <span title="Added in Go 1.20">1.20</span> </h2> <p>A ProxyRequest contains a request to be rewritten by a <a href="#ReverseProxy">ReverseProxy</a>. </p>
+<pre data-language="go">type ProxyRequest struct {
+ // In is the request received by the proxy.
+ // The Rewrite function must not modify In.
+ In *http.Request
+
+ // Out is the request which will be sent by the proxy.
+ // The Rewrite function may modify or replace this request.
+ // Hop-by-hop headers are removed from this request
+ // before Rewrite is called.
+ Out *http.Request
+}
+</pre> <h3 id="ProxyRequest.SetURL">func (*ProxyRequest) <span>SetURL</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (r *ProxyRequest) SetURL(target *url.URL)</pre> <p>SetURL routes the outbound request to the scheme, host, and base path provided in target. If the target's path is "/base" and the incoming request was for "/dir", the target request will be for "/base/dir". </p>
+<p>SetURL rewrites the outbound Host header to match the target's host. To preserve the inbound request's Host header (the default behavior of <a href="#NewSingleHostReverseProxy">NewSingleHostReverseProxy</a>): </p>
+<pre data-language="go">rewriteFunc := func(r *httputil.ProxyRequest) {
+ r.SetURL(url)
+ r.Out.Host = r.In.Host
+}
+</pre> <h3 id="ProxyRequest.SetXForwarded">func (*ProxyRequest) <span>SetXForwarded</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (r *ProxyRequest) SetXForwarded()</pre> <p>SetXForwarded sets the X-Forwarded-For, X-Forwarded-Host, and X-Forwarded-Proto headers of the outbound request. </p>
+<ul> <li>The X-Forwarded-For header is set to the client IP address. </li>
+<li>The X-Forwarded-Host header is set to the host name requested by the client. </li>
+<li>The X-Forwarded-Proto header is set to "http" or "https", depending on whether the inbound request was made on a TLS-enabled connection. </li>
+</ul> <p>If the outbound request contains an existing X-Forwarded-For header, SetXForwarded appends the client IP address to it. To append to the inbound request's X-Forwarded-For header (the default behavior of <a href="#ReverseProxy">ReverseProxy</a> when using a Director function), copy the header from the inbound request before calling SetXForwarded: </p>
+<pre data-language="go">rewriteFunc := func(r *httputil.ProxyRequest) {
+ r.Out.Header["X-Forwarded-For"] = r.In.Header["X-Forwarded-For"]
+ r.SetXForwarded()
+}
+</pre> <h2 id="ReverseProxy">type <span>ReverseProxy</span> </h2> <p>ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client. </p>
+<p>1xx responses are forwarded to the client if the underlying transport supports ClientTrace.Got1xxResponse. </p>
+<pre data-language="go">type ReverseProxy struct {
+ // Rewrite must be a function which modifies
+ // the request into a new request to be sent
+ // using Transport. Its response is then copied
+ // back to the original client unmodified.
+ // Rewrite must not access the provided ProxyRequest
+ // or its contents after returning.
+ //
+ // The Forwarded, X-Forwarded, X-Forwarded-Host,
+ // and X-Forwarded-Proto headers are removed from the
+ // outbound request before Rewrite is called. See also
+ // the ProxyRequest.SetXForwarded method.
+ //
+ // Unparsable query parameters are removed from the
+ // outbound request before Rewrite is called.
+ // The Rewrite function may copy the inbound URL's
+ // RawQuery to the outbound URL to preserve the original
+ // parameter string. Note that this can lead to security
+ // issues if the proxy's interpretation of query parameters
+ // does not match that of the downstream server.
+ //
+ // At most one of Rewrite or Director may be set.
+ Rewrite func(*ProxyRequest) // Go 1.20
+
+ // Director is a function which modifies
+ // the request into a new request to be sent
+ // using Transport. Its response is then copied
+ // back to the original client unmodified.
+ // Director must not access the provided Request
+ // after returning.
+ //
+ // By default, the X-Forwarded-For header is set to the
+ // value of the client IP address. If an X-Forwarded-For
+ // header already exists, the client IP is appended to the
+ // existing values. As a special case, if the header
+ // exists in the Request.Header map but has a nil value
+ // (such as when set by the Director func), the X-Forwarded-For
+ // header is not modified.
+ //
+ // To prevent IP spoofing, be sure to delete any pre-existing
+ // X-Forwarded-For header coming from the client or
+ // an untrusted proxy.
+ //
+ // Hop-by-hop headers are removed from the request after
+ // Director returns, which can remove headers added by
+ // Director. Use a Rewrite function instead to ensure
+ // modifications to the request are preserved.
+ //
+ // Unparsable query parameters are removed from the outbound
+ // request if Request.Form is set after Director returns.
+ //
+ // At most one of Rewrite or Director may be set.
+ Director func(*http.Request)
+
+ // The transport used to perform proxy requests.
+ // If nil, http.DefaultTransport is used.
+ Transport http.RoundTripper
+
+ // FlushInterval specifies the flush interval
+ // to flush to the client while copying the
+ // response body.
+ // If zero, no periodic flushing is done.
+ // A negative value means to flush immediately
+ // after each write to the client.
+ // The FlushInterval is ignored when ReverseProxy
+ // recognizes a response as a streaming response, or
+ // if its ContentLength is -1; for such responses, writes
+ // are flushed to the client immediately.
+ FlushInterval time.Duration
+
+ // ErrorLog specifies an optional logger for errors
+ // that occur when attempting to proxy the request.
+ // If nil, logging is done via the log package's standard logger.
+ ErrorLog *log.Logger // Go 1.4
+
+ // BufferPool optionally specifies a buffer pool to
+ // get byte slices for use by io.CopyBuffer when
+ // copying HTTP response bodies.
+ BufferPool BufferPool // Go 1.6
+
+ // ModifyResponse is an optional function that modifies the
+ // Response from the backend. It is called if the backend
+ // returns a response at all, with any HTTP status code.
+ // If the backend is unreachable, the optional ErrorHandler is
+ // called without any call to ModifyResponse.
+ //
+ // If ModifyResponse returns an error, ErrorHandler is called
+ // with its error value. If ErrorHandler is nil, its default
+ // implementation is used.
+ ModifyResponse func(*http.Response) error // Go 1.8
+
+ // ErrorHandler is an optional function that handles errors
+ // reaching the backend or errors from ModifyResponse.
+ //
+ // If nil, the default is to log the provided error and return
+ // a 502 Status Bad Gateway response.
+ ErrorHandler func(http.ResponseWriter, *http.Request, error) // Go 1.11
+}
+</pre> <h4 id="example_ReverseProxy"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">backendServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintln(w, "this call was relayed by the reverse proxy")
+}))
+defer backendServer.Close()
+
+rpURL, err := url.Parse(backendServer.URL)
+if err != nil {
+ log.Fatal(err)
+}
+frontendProxy := httptest.NewServer(&amp;httputil.ReverseProxy{
+ Rewrite: func(r *httputil.ProxyRequest) {
+ r.SetXForwarded()
+ r.SetURL(rpURL)
+ },
+})
+defer frontendProxy.Close()
+
+resp, err := http.Get(frontendProxy.URL)
+if err != nil {
+ log.Fatal(err)
+}
+
+b, err := io.ReadAll(resp.Body)
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s", b)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">this call was relayed by the reverse proxy
+</pre> <h3 id="NewSingleHostReverseProxy">func <span>NewSingleHostReverseProxy</span> </h3> <pre data-language="go">func NewSingleHostReverseProxy(target *url.URL) *ReverseProxy</pre> <p>NewSingleHostReverseProxy returns a new <a href="#ReverseProxy">ReverseProxy</a> that routes URLs to the scheme, host, and base path provided in target. If the target's path is "/base" and the incoming request was for "/dir", the target request will be for /base/dir. </p>
+<p>NewSingleHostReverseProxy does not rewrite the Host header. </p>
+<p>To customize the ReverseProxy behavior beyond what NewSingleHostReverseProxy provides, use ReverseProxy directly with a Rewrite function. The ProxyRequest SetURL method may be used to route the outbound request. (Note that SetURL, unlike NewSingleHostReverseProxy, rewrites the Host header of the outbound request by default.) </p>
+<pre data-language="go">proxy := &amp;ReverseProxy{
+ Rewrite: func(r *ProxyRequest) {
+ r.SetURL(target)
+ r.Out.Host = r.In.Host // if desired
+ },
+}
+</pre> <h3 id="ReverseProxy.ServeHTTP">func (*ReverseProxy) <span>ServeHTTP</span> </h3> <pre data-language="go">func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)</pre> <h2 id="ServerConn">type <span>ServerConn</span> </h2> <p>ServerConn is an artifact of Go's early HTTP implementation. It is low-level, old, and unused by Go's current HTTP stack. We should have deleted it before Go 1. </p>
+<p>Deprecated: Use the Server in package <span>net/http</span> instead. </p>
+<pre data-language="go">type ServerConn struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewServerConn">func <span>NewServerConn</span> </h3> <pre data-language="go">func NewServerConn(c net.Conn, r *bufio.Reader) *ServerConn</pre> <p>NewServerConn is an artifact of Go's early HTTP implementation. It is low-level, old, and unused by Go's current HTTP stack. We should have deleted it before Go 1. </p>
+<p>Deprecated: Use the Server in package <span>net/http</span> instead. </p>
+<h3 id="ServerConn.Close">func (*ServerConn) <span>Close</span> </h3> <pre data-language="go">func (sc *ServerConn) Close() error</pre> <p>Close calls <a href="#ServerConn.Hijack">ServerConn.Hijack</a> and then also closes the underlying connection. </p>
+<h3 id="ServerConn.Hijack">func (*ServerConn) <span>Hijack</span> </h3> <pre data-language="go">func (sc *ServerConn) Hijack() (net.Conn, *bufio.Reader)</pre> <p>Hijack detaches the <a href="#ServerConn">ServerConn</a> and returns the underlying connection as well as the read-side bufio which may have some left over data. Hijack may be called before Read has signaled the end of the keep-alive logic. The user should not call Hijack while <a href="#ServerConn.Read">ServerConn.Read</a> or <a href="#ServerConn.Write">ServerConn.Write</a> is in progress. </p>
+<h3 id="ServerConn.Pending">func (*ServerConn) <span>Pending</span> </h3> <pre data-language="go">func (sc *ServerConn) Pending() int</pre> <p>Pending returns the number of unanswered requests that have been received on the connection. </p>
+<h3 id="ServerConn.Read">func (*ServerConn) <span>Read</span> </h3> <pre data-language="go">func (sc *ServerConn) Read() (*http.Request, error)</pre> <p>Read returns the next request on the wire. An <a href="#ErrPersistEOF">ErrPersistEOF</a> is returned if it is gracefully determined that there are no more requests (e.g. after the first request on an HTTP/1.0 connection, or after a Connection:close on a HTTP/1.1 connection). </p>
+<h3 id="ServerConn.Write">func (*ServerConn) <span>Write</span> </h3> <pre data-language="go">func (sc *ServerConn) Write(req *http.Request, resp *http.Response) error</pre> <p>Write writes resp in response to req. To close the connection gracefully, set the Response.Close field to true. Write should be considered operational until it returns an error, regardless of any errors returned on the <a href="#ServerConn.Read">ServerConn.Read</a> side. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/http/httputil/" class="_attribution-link">http://golang.org/pkg/net/http/httputil/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fhttp%2Findex.html b/devdocs/go/net%2Fhttp%2Findex.html
new file mode 100644
index 00000000..c5ca9625
--- /dev/null
+++ b/devdocs/go/net%2Fhttp%2Findex.html
@@ -0,0 +1,2003 @@
+<h1> Package http </h1> <ul id="short-nav">
+<li><code>import "net/http"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package http provides HTTP client and server implementations. </p>
+<p><a href="#Get">Get</a>, <a href="#Head">Head</a>, <a href="#Post">Post</a>, and <a href="#PostForm">PostForm</a> make HTTP (or HTTPS) requests: </p>
+<pre data-language="go">resp, err := http.Get("http://example.com/")
+...
+resp, err := http.Post("http://example.com/upload", "image/jpeg", &amp;buf)
+...
+resp, err := http.PostForm("http://example.com/form",
+ url.Values{"key": {"Value"}, "id": {"123"}})
+</pre> <p>The caller must close the response body when finished with it: </p>
+<pre data-language="go">resp, err := http.Get("http://example.com/")
+if err != nil {
+ // handle error
+}
+defer resp.Body.Close()
+body, err := io.ReadAll(resp.Body)
+// ...
+</pre> <h3 id="hdr-Clients_and_Transports">Clients and Transports</h3> <p>For control over HTTP client headers, redirect policy, and other settings, create a <a href="#Client">Client</a>: </p>
+<pre data-language="go">client := &amp;http.Client{
+ CheckRedirect: redirectPolicyFunc,
+}
+
+resp, err := client.Get("http://example.com")
+// ...
+
+req, err := http.NewRequest("GET", "http://example.com", nil)
+// ...
+req.Header.Add("If-None-Match", `W/"wyzzy"`)
+resp, err := client.Do(req)
+// ...
+</pre> <p>For control over proxies, TLS configuration, keep-alives, compression, and other settings, create a <a href="#Transport">Transport</a>: </p>
+<pre data-language="go">tr := &amp;http.Transport{
+ MaxIdleConns: 10,
+ IdleConnTimeout: 30 * time.Second,
+ DisableCompression: true,
+}
+client := &amp;http.Client{Transport: tr}
+resp, err := client.Get("https://example.com")
+</pre> <p>Clients and Transports are safe for concurrent use by multiple goroutines and for efficiency should only be created once and re-used. </p>
+<h3 id="hdr-Servers">Servers</h3> <p>ListenAndServe starts an HTTP server with a given address and handler. The handler is usually nil, which means to use <a href="#DefaultServeMux">DefaultServeMux</a>. <a href="#Handle">Handle</a> and <a href="#HandleFunc">HandleFunc</a> add handlers to <a href="#DefaultServeMux">DefaultServeMux</a>: </p>
+<pre data-language="go">http.Handle("/foo", fooHandler)
+
+http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
+})
+
+log.Fatal(http.ListenAndServe(":8080", nil))
+</pre> <p>More control over the server's behavior is available by creating a custom Server: </p>
+<pre data-language="go">s := &amp;http.Server{
+ Addr: ":8080",
+ Handler: myHandler,
+ ReadTimeout: 10 * time.Second,
+ WriteTimeout: 10 * time.Second,
+ MaxHeaderBytes: 1 &lt;&lt; 20,
+}
+log.Fatal(s.ListenAndServe())
+</pre> <h3 id="hdr-HTTP_2">HTTP/2</h3> <p>Starting with Go 1.6, the http package has transparent support for the HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 can do so by setting [Transport.TLSNextProto] (for clients) or [Server.TLSNextProto] (for servers) to a non-nil, empty map. Alternatively, the following GODEBUG settings are currently supported: </p>
+<pre data-language="go">GODEBUG=http2client=0 # disable HTTP/2 client support
+GODEBUG=http2server=0 # disable HTTP/2 server support
+GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs
+GODEBUG=http2debug=2 # ... even more verbose, with frame dumps
+</pre> <p>Please report any issues before disabling HTTP/2 support: <a href="https://golang.org/s/http2bug">https://golang.org/s/http2bug</a> </p>
+<p>The http package's <a href="#Transport">Transport</a> and <a href="#Server">Server</a> both automatically enable HTTP/2 support for simple configurations. To enable HTTP/2 for more complex configurations, to use lower-level HTTP/2 features, or to use a newer version of Go's http2 package, import "golang.org/x/net/http2" directly and use its ConfigureTransport and/or ConfigureServer functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 package takes precedence over the net/http package's built-in HTTP/2 support. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#CanonicalHeaderKey">func CanonicalHeaderKey(s string) string</a></li>
+<li><a href="#DetectContentType">func DetectContentType(data []byte) string</a></li>
+<li><a href="#Error">func Error(w ResponseWriter, error string, code int)</a></li>
+<li><a href="#Handle">func Handle(pattern string, handler Handler)</a></li>
+<li><a href="#HandleFunc">func HandleFunc(pattern string, handler func(ResponseWriter, *Request))</a></li>
+<li><a href="#ListenAndServe">func ListenAndServe(addr string, handler Handler) error</a></li>
+<li><a href="#ListenAndServeTLS">func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error</a></li>
+<li><a href="#MaxBytesReader">func MaxBytesReader(w ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser</a></li>
+<li><a href="#NotFound">func NotFound(w ResponseWriter, r *Request)</a></li>
+<li><a href="#ParseHTTPVersion">func ParseHTTPVersion(vers string) (major, minor int, ok bool)</a></li>
+<li><a href="#ParseTime">func ParseTime(text string) (t time.Time, err error)</a></li>
+<li><a href="#ProxyFromEnvironment">func ProxyFromEnvironment(req *Request) (*url.URL, error)</a></li>
+<li><a href="#ProxyURL">func ProxyURL(fixedURL *url.URL) func(*Request) (*url.URL, error)</a></li>
+<li><a href="#Redirect">func Redirect(w ResponseWriter, r *Request, url string, code int)</a></li>
+<li><a href="#Serve">func Serve(l net.Listener, handler Handler) error</a></li>
+<li><a href="#ServeContent">func ServeContent(w ResponseWriter, req *Request, name string, modtime time.Time, content io.ReadSeeker)</a></li>
+<li><a href="#ServeFile">func ServeFile(w ResponseWriter, r *Request, name string)</a></li>
+<li><a href="#ServeFileFS">func ServeFileFS(w ResponseWriter, r *Request, fsys fs.FS, name string)</a></li>
+<li><a href="#ServeTLS">func ServeTLS(l net.Listener, handler Handler, certFile, keyFile string) error</a></li>
+<li><a href="#SetCookie">func SetCookie(w ResponseWriter, cookie *Cookie)</a></li>
+<li><a href="#StatusText">func StatusText(code int) string</a></li>
+<li><a href="#Client">type Client</a></li>
+<li> <a href="#Client.CloseIdleConnections">func (c *Client) CloseIdleConnections()</a>
+</li>
+<li> <a href="#Client.Do">func (c *Client) Do(req *Request) (*Response, error)</a>
+</li>
+<li> <a href="#Client.Get">func (c *Client) Get(url string) (resp *Response, err error)</a>
+</li>
+<li> <a href="#Client.Head">func (c *Client) Head(url string) (resp *Response, err error)</a>
+</li>
+<li> <a href="#Client.Post">func (c *Client) Post(url, contentType string, body io.Reader) (resp *Response, err error)</a>
+</li>
+<li> <a href="#Client.PostForm">func (c *Client) PostForm(url string, data url.Values) (resp *Response, err error)</a>
+</li>
+<li><a href="#CloseNotifier">type CloseNotifier</a></li>
+<li><a href="#ConnState">type ConnState</a></li>
+<li> <a href="#ConnState.String">func (c ConnState) String() string</a>
+</li>
+<li><a href="#Cookie">type Cookie</a></li>
+<li> <a href="#Cookie.String">func (c *Cookie) String() string</a>
+</li>
+<li> <a href="#Cookie.Valid">func (c *Cookie) Valid() error</a>
+</li>
+<li><a href="#CookieJar">type CookieJar</a></li>
+<li><a href="#Dir">type Dir</a></li>
+<li> <a href="#Dir.Open">func (d Dir) Open(name string) (File, error)</a>
+</li>
+<li><a href="#File">type File</a></li>
+<li><a href="#FileSystem">type FileSystem</a></li>
+<li> <a href="#FS">func FS(fsys fs.FS) FileSystem</a>
+</li>
+<li><a href="#Flusher">type Flusher</a></li>
+<li><a href="#Handler">type Handler</a></li>
+<li> <a href="#AllowQuerySemicolons">func AllowQuerySemicolons(h Handler) Handler</a>
+</li>
+<li> <a href="#FileServer">func FileServer(root FileSystem) Handler</a>
+</li>
+<li> <a href="#FileServerFS">func FileServerFS(root fs.FS) Handler</a>
+</li>
+<li> <a href="#MaxBytesHandler">func MaxBytesHandler(h Handler, n int64) Handler</a>
+</li>
+<li> <a href="#NotFoundHandler">func NotFoundHandler() Handler</a>
+</li>
+<li> <a href="#RedirectHandler">func RedirectHandler(url string, code int) Handler</a>
+</li>
+<li> <a href="#StripPrefix">func StripPrefix(prefix string, h Handler) Handler</a>
+</li>
+<li> <a href="#TimeoutHandler">func TimeoutHandler(h Handler, dt time.Duration, msg string) Handler</a>
+</li>
+<li><a href="#HandlerFunc">type HandlerFunc</a></li>
+<li> <a href="#HandlerFunc.ServeHTTP">func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request)</a>
+</li>
+<li><a href="#Header">type Header</a></li>
+<li> <a href="#Header.Add">func (h Header) Add(key, value string)</a>
+</li>
+<li> <a href="#Header.Clone">func (h Header) Clone() Header</a>
+</li>
+<li> <a href="#Header.Del">func (h Header) Del(key string)</a>
+</li>
+<li> <a href="#Header.Get">func (h Header) Get(key string) string</a>
+</li>
+<li> <a href="#Header.Set">func (h Header) Set(key, value string)</a>
+</li>
+<li> <a href="#Header.Values">func (h Header) Values(key string) []string</a>
+</li>
+<li> <a href="#Header.Write">func (h Header) Write(w io.Writer) error</a>
+</li>
+<li> <a href="#Header.WriteSubset">func (h Header) WriteSubset(w io.Writer, exclude map[string]bool) error</a>
+</li>
+<li><a href="#Hijacker">type Hijacker</a></li>
+<li><a href="#MaxBytesError">type MaxBytesError</a></li>
+<li> <a href="#MaxBytesError.Error">func (e *MaxBytesError) Error() string</a>
+</li>
+<li><a href="#ProtocolError">type ProtocolError</a></li>
+<li> <a href="#ProtocolError.Error">func (pe *ProtocolError) Error() string</a>
+</li>
+<li> <a href="#ProtocolError.Is">func (pe *ProtocolError) Is(err error) bool</a>
+</li>
+<li><a href="#PushOptions">type PushOptions</a></li>
+<li><a href="#Pusher">type Pusher</a></li>
+<li><a href="#Request">type Request</a></li>
+<li> <a href="#NewRequest">func NewRequest(method, url string, body io.Reader) (*Request, error)</a>
+</li>
+<li> <a href="#NewRequestWithContext">func NewRequestWithContext(ctx context.Context, method, url string, body io.Reader) (*Request, error)</a>
+</li>
+<li> <a href="#ReadRequest">func ReadRequest(b *bufio.Reader) (*Request, error)</a>
+</li>
+<li> <a href="#Request.AddCookie">func (r *Request) AddCookie(c *Cookie)</a>
+</li>
+<li> <a href="#Request.BasicAuth">func (r *Request) BasicAuth() (username, password string, ok bool)</a>
+</li>
+<li> <a href="#Request.Clone">func (r *Request) Clone(ctx context.Context) *Request</a>
+</li>
+<li> <a href="#Request.Context">func (r *Request) Context() context.Context</a>
+</li>
+<li> <a href="#Request.Cookie">func (r *Request) Cookie(name string) (*Cookie, error)</a>
+</li>
+<li> <a href="#Request.Cookies">func (r *Request) Cookies() []*Cookie</a>
+</li>
+<li> <a href="#Request.FormFile">func (r *Request) FormFile(key string) (multipart.File, *multipart.FileHeader, error)</a>
+</li>
+<li> <a href="#Request.FormValue">func (r *Request) FormValue(key string) string</a>
+</li>
+<li> <a href="#Request.MultipartReader">func (r *Request) MultipartReader() (*multipart.Reader, error)</a>
+</li>
+<li> <a href="#Request.ParseForm">func (r *Request) ParseForm() error</a>
+</li>
+<li> <a href="#Request.ParseMultipartForm">func (r *Request) ParseMultipartForm(maxMemory int64) error</a>
+</li>
+<li> <a href="#Request.PathValue">func (r *Request) PathValue(name string) string</a>
+</li>
+<li> <a href="#Request.PostFormValue">func (r *Request) PostFormValue(key string) string</a>
+</li>
+<li> <a href="#Request.ProtoAtLeast">func (r *Request) ProtoAtLeast(major, minor int) bool</a>
+</li>
+<li> <a href="#Request.Referer">func (r *Request) Referer() string</a>
+</li>
+<li> <a href="#Request.SetBasicAuth">func (r *Request) SetBasicAuth(username, password string)</a>
+</li>
+<li> <a href="#Request.SetPathValue">func (r *Request) SetPathValue(name, value string)</a>
+</li>
+<li> <a href="#Request.UserAgent">func (r *Request) UserAgent() string</a>
+</li>
+<li> <a href="#Request.WithContext">func (r *Request) WithContext(ctx context.Context) *Request</a>
+</li>
+<li> <a href="#Request.Write">func (r *Request) Write(w io.Writer) error</a>
+</li>
+<li> <a href="#Request.WriteProxy">func (r *Request) WriteProxy(w io.Writer) error</a>
+</li>
+<li><a href="#Response">type Response</a></li>
+<li> <a href="#Get">func Get(url string) (resp *Response, err error)</a>
+</li>
+<li> <a href="#Head">func Head(url string) (resp *Response, err error)</a>
+</li>
+<li> <a href="#Post">func Post(url, contentType string, body io.Reader) (resp *Response, err error)</a>
+</li>
+<li> <a href="#PostForm">func PostForm(url string, data url.Values) (resp *Response, err error)</a>
+</li>
+<li> <a href="#ReadResponse">func ReadResponse(r *bufio.Reader, req *Request) (*Response, error)</a>
+</li>
+<li> <a href="#Response.Cookies">func (r *Response) Cookies() []*Cookie</a>
+</li>
+<li> <a href="#Response.Location">func (r *Response) Location() (*url.URL, error)</a>
+</li>
+<li> <a href="#Response.ProtoAtLeast">func (r *Response) ProtoAtLeast(major, minor int) bool</a>
+</li>
+<li> <a href="#Response.Write">func (r *Response) Write(w io.Writer) error</a>
+</li>
+<li><a href="#ResponseController">type ResponseController</a></li>
+<li> <a href="#NewResponseController">func NewResponseController(rw ResponseWriter) *ResponseController</a>
+</li>
+<li> <a href="#ResponseController.EnableFullDuplex">func (c *ResponseController) EnableFullDuplex() error</a>
+</li>
+<li> <a href="#ResponseController.Flush">func (c *ResponseController) Flush() error</a>
+</li>
+<li> <a href="#ResponseController.Hijack">func (c *ResponseController) Hijack() (net.Conn, *bufio.ReadWriter, error)</a>
+</li>
+<li> <a href="#ResponseController.SetReadDeadline">func (c *ResponseController) SetReadDeadline(deadline time.Time) error</a>
+</li>
+<li> <a href="#ResponseController.SetWriteDeadline">func (c *ResponseController) SetWriteDeadline(deadline time.Time) error</a>
+</li>
+<li><a href="#ResponseWriter">type ResponseWriter</a></li>
+<li><a href="#RoundTripper">type RoundTripper</a></li>
+<li> <a href="#NewFileTransport">func NewFileTransport(fs FileSystem) RoundTripper</a>
+</li>
+<li> <a href="#NewFileTransportFS">func NewFileTransportFS(fsys fs.FS) RoundTripper</a>
+</li>
+<li><a href="#SameSite">type SameSite</a></li>
+<li><a href="#ServeMux">type ServeMux</a></li>
+<li> <a href="#NewServeMux">func NewServeMux() *ServeMux</a>
+</li>
+<li> <a href="#ServeMux.Handle">func (mux *ServeMux) Handle(pattern string, handler Handler)</a>
+</li>
+<li> <a href="#ServeMux.HandleFunc">func (mux *ServeMux) HandleFunc(pattern string, handler func(ResponseWriter, *Request))</a>
+</li>
+<li> <a href="#ServeMux.Handler">func (mux *ServeMux) Handler(r *Request) (h Handler, pattern string)</a>
+</li>
+<li> <a href="#ServeMux.ServeHTTP">func (mux *ServeMux) ServeHTTP(w ResponseWriter, r *Request)</a>
+</li>
+<li><a href="#Server">type Server</a></li>
+<li> <a href="#Server.Close">func (srv *Server) Close() error</a>
+</li>
+<li> <a href="#Server.ListenAndServe">func (srv *Server) ListenAndServe() error</a>
+</li>
+<li> <a href="#Server.ListenAndServeTLS">func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error</a>
+</li>
+<li> <a href="#Server.RegisterOnShutdown">func (srv *Server) RegisterOnShutdown(f func())</a>
+</li>
+<li> <a href="#Server.Serve">func (srv *Server) Serve(l net.Listener) error</a>
+</li>
+<li> <a href="#Server.ServeTLS">func (srv *Server) ServeTLS(l net.Listener, certFile, keyFile string) error</a>
+</li>
+<li> <a href="#Server.SetKeepAlivesEnabled">func (srv *Server) SetKeepAlivesEnabled(v bool)</a>
+</li>
+<li> <a href="#Server.Shutdown">func (srv *Server) Shutdown(ctx context.Context) error</a>
+</li>
+<li><a href="#Transport">type Transport</a></li>
+<li> <a href="#Transport.CancelRequest">func (t *Transport) CancelRequest(req *Request)</a>
+</li>
+<li> <a href="#Transport.Clone">func (t *Transport) Clone() *Transport</a>
+</li>
+<li> <a href="#Transport.CloseIdleConnections">func (t *Transport) CloseIdleConnections()</a>
+</li>
+<li> <a href="#Transport.RegisterProtocol">func (t *Transport) RegisterProtocol(scheme string, rt RoundTripper)</a>
+</li>
+<li> <a href="#Transport.RoundTrip">func (t *Transport) RoundTrip(req *Request) (*Response, error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_FileServer">FileServer</a></dd> <dd><a class="exampleLink" href="#example_FileServer_dotFileHiding">FileServer (DotFileHiding)</a></dd> <dd><a class="exampleLink" href="#example_FileServer_stripPrefix">FileServer (StripPrefix)</a></dd> <dd><a class="exampleLink" href="#example_Get">Get</a></dd> <dd><a class="exampleLink" href="#example_Handle">Handle</a></dd> <dd><a class="exampleLink" href="#example_HandleFunc">HandleFunc</a></dd> <dd><a class="exampleLink" href="#example_Hijacker">Hijacker</a></dd> <dd><a class="exampleLink" href="#example_ListenAndServe">ListenAndServe</a></dd> <dd><a class="exampleLink" href="#example_ListenAndServeTLS">ListenAndServeTLS</a></dd> <dd><a class="exampleLink" href="#example_NotFoundHandler">NotFoundHandler</a></dd> <dd><a class="exampleLink" href="#example_ResponseWriter_trailers">ResponseWriter (Trailers)</a></dd> <dd><a class="exampleLink" href="#example_ServeMux_Handle">ServeMux.Handle</a></dd> <dd><a class="exampleLink" href="#example_Server_Shutdown">Server.Shutdown</a></dd> <dd><a class="exampleLink" href="#example_StripPrefix">StripPrefix</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>client.go</span> <span>clone.go</span> <span>cookie.go</span> <span>doc.go</span> <span>filetransport.go</span> <span>fs.go</span> <span>h2_bundle.go</span> <span>h2_error.go</span> <span>header.go</span> <span>http.go</span> <span>jar.go</span> <span>mapping.go</span> <span>method.go</span> <span>pattern.go</span> <span>request.go</span> <span>response.go</span> <span>responsecontroller.go</span> <span>roundtrip.go</span> <span>routing_index.go</span> <span>routing_tree.go</span> <span>servemux121.go</span> <span>server.go</span> <span>sniff.go</span> <span>socks_bundle.go</span> <span>status.go</span> <span>transfer.go</span> <span>transport.go</span> <span>transport_default_other.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Common HTTP methods. </p>
+<p>Unless otherwise noted, these are defined in RFC 7231 section 4.3. </p>
+<pre data-language="go">const (
+ MethodGet = "GET"
+ MethodHead = "HEAD"
+ MethodPost = "POST"
+ MethodPut = "PUT"
+ MethodPatch = "PATCH" // RFC 5789
+ MethodDelete = "DELETE"
+ MethodConnect = "CONNECT"
+ MethodOptions = "OPTIONS"
+ MethodTrace = "TRACE"
+)</pre> <p>HTTP status codes as registered with IANA. See: <a href="https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml">https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml</a> </p>
+<pre data-language="go">const (
+ StatusContinue = 100 // RFC 9110, 15.2.1
+ StatusSwitchingProtocols = 101 // RFC 9110, 15.2.2
+ StatusProcessing = 102 // RFC 2518, 10.1
+ StatusEarlyHints = 103 // RFC 8297
+
+ StatusOK = 200 // RFC 9110, 15.3.1
+ StatusCreated = 201 // RFC 9110, 15.3.2
+ StatusAccepted = 202 // RFC 9110, 15.3.3
+ StatusNonAuthoritativeInfo = 203 // RFC 9110, 15.3.4
+ StatusNoContent = 204 // RFC 9110, 15.3.5
+ StatusResetContent = 205 // RFC 9110, 15.3.6
+ StatusPartialContent = 206 // RFC 9110, 15.3.7
+ StatusMultiStatus = 207 // RFC 4918, 11.1
+ StatusAlreadyReported = 208 // RFC 5842, 7.1
+ StatusIMUsed = 226 // RFC 3229, 10.4.1
+
+ StatusMultipleChoices = 300 // RFC 9110, 15.4.1
+ StatusMovedPermanently = 301 // RFC 9110, 15.4.2
+ StatusFound = 302 // RFC 9110, 15.4.3
+ StatusSeeOther = 303 // RFC 9110, 15.4.4
+ StatusNotModified = 304 // RFC 9110, 15.4.5
+ StatusUseProxy = 305 // RFC 9110, 15.4.6
+
+ StatusTemporaryRedirect = 307 // RFC 9110, 15.4.8
+ StatusPermanentRedirect = 308 // RFC 9110, 15.4.9
+
+ StatusBadRequest = 400 // RFC 9110, 15.5.1
+ StatusUnauthorized = 401 // RFC 9110, 15.5.2
+ StatusPaymentRequired = 402 // RFC 9110, 15.5.3
+ StatusForbidden = 403 // RFC 9110, 15.5.4
+ StatusNotFound = 404 // RFC 9110, 15.5.5
+ StatusMethodNotAllowed = 405 // RFC 9110, 15.5.6
+ StatusNotAcceptable = 406 // RFC 9110, 15.5.7
+ StatusProxyAuthRequired = 407 // RFC 9110, 15.5.8
+ StatusRequestTimeout = 408 // RFC 9110, 15.5.9
+ StatusConflict = 409 // RFC 9110, 15.5.10
+ StatusGone = 410 // RFC 9110, 15.5.11
+ StatusLengthRequired = 411 // RFC 9110, 15.5.12
+ StatusPreconditionFailed = 412 // RFC 9110, 15.5.13
+ StatusRequestEntityTooLarge = 413 // RFC 9110, 15.5.14
+ StatusRequestURITooLong = 414 // RFC 9110, 15.5.15
+ StatusUnsupportedMediaType = 415 // RFC 9110, 15.5.16
+ StatusRequestedRangeNotSatisfiable = 416 // RFC 9110, 15.5.17
+ StatusExpectationFailed = 417 // RFC 9110, 15.5.18
+ StatusTeapot = 418 // RFC 9110, 15.5.19 (Unused)
+ StatusMisdirectedRequest = 421 // RFC 9110, 15.5.20
+ StatusUnprocessableEntity = 422 // RFC 9110, 15.5.21
+ StatusLocked = 423 // RFC 4918, 11.3
+ StatusFailedDependency = 424 // RFC 4918, 11.4
+ StatusTooEarly = 425 // RFC 8470, 5.2.
+ StatusUpgradeRequired = 426 // RFC 9110, 15.5.22
+ StatusPreconditionRequired = 428 // RFC 6585, 3
+ StatusTooManyRequests = 429 // RFC 6585, 4
+ StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5
+ StatusUnavailableForLegalReasons = 451 // RFC 7725, 3
+
+ StatusInternalServerError = 500 // RFC 9110, 15.6.1
+ StatusNotImplemented = 501 // RFC 9110, 15.6.2
+ StatusBadGateway = 502 // RFC 9110, 15.6.3
+ StatusServiceUnavailable = 503 // RFC 9110, 15.6.4
+ StatusGatewayTimeout = 504 // RFC 9110, 15.6.5
+ StatusHTTPVersionNotSupported = 505 // RFC 9110, 15.6.6
+ StatusVariantAlsoNegotiates = 506 // RFC 2295, 8.1
+ StatusInsufficientStorage = 507 // RFC 4918, 11.5
+ StatusLoopDetected = 508 // RFC 5842, 7.2
+ StatusNotExtended = 510 // RFC 2774, 7
+ StatusNetworkAuthenticationRequired = 511 // RFC 6585, 6
+)</pre> <p>DefaultMaxHeaderBytes is the maximum permitted size of the headers in an HTTP request. This can be overridden by setting [Server.MaxHeaderBytes]. </p>
+<pre data-language="go">const DefaultMaxHeaderBytes = 1 &lt;&lt; 20 // 1 MB
+</pre> <p>DefaultMaxIdleConnsPerHost is the default value of <a href="#Transport">Transport</a>'s MaxIdleConnsPerHost. </p>
+<pre data-language="go">const DefaultMaxIdleConnsPerHost = 2</pre> <p>TimeFormat is the time format to use when generating times in HTTP headers. It is like <span>time.RFC1123</span> but hard-codes GMT as the time zone. The time being formatted must be in UTC for Format to generate the correct format. </p>
+<p>For parsing this time format, see <a href="#ParseTime">ParseTime</a>. </p>
+<pre data-language="go">const TimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT"</pre> <p>TrailerPrefix is a magic prefix for [ResponseWriter.Header] map keys that, if present, signals that the map entry is actually for the response trailers, and not the response headers. The prefix is stripped after the ServeHTTP call finishes and the values are sent in the trailers. </p>
+<p>This mechanism is intended only for trailers that are not known prior to the headers being written. If the set of trailers is fixed or known before the header is written, the normal Go trailers mechanism is preferred: </p>
+<pre data-language="go">https://pkg.go.dev/net/http#ResponseWriter
+https://pkg.go.dev/net/http#example-ResponseWriter-Trailers
+</pre> <pre data-language="go">const TrailerPrefix = "Trailer:"</pre> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var (
+ // ErrNotSupported indicates that a feature is not supported.
+ //
+ // It is returned by ResponseController methods to indicate that
+ // the handler does not support the method, and by the Push method
+ // of Pusher implementations to indicate that HTTP/2 Push support
+ // is not available.
+ ErrNotSupported = &amp;ProtocolError{"feature not supported"}
+
+ // Deprecated: ErrUnexpectedTrailer is no longer returned by
+ // anything in the net/http package. Callers should not
+ // compare errors against this variable.
+ ErrUnexpectedTrailer = &amp;ProtocolError{"trailer header without chunked transfer encoding"}
+
+ // ErrMissingBoundary is returned by Request.MultipartReader when the
+ // request's Content-Type does not include a "boundary" parameter.
+ ErrMissingBoundary = &amp;ProtocolError{"no multipart boundary param in Content-Type"}
+
+ // ErrNotMultipart is returned by Request.MultipartReader when the
+ // request's Content-Type is not multipart/form-data.
+ ErrNotMultipart = &amp;ProtocolError{"request Content-Type isn't multipart/form-data"}
+
+ // Deprecated: ErrHeaderTooLong is no longer returned by
+ // anything in the net/http package. Callers should not
+ // compare errors against this variable.
+ ErrHeaderTooLong = &amp;ProtocolError{"header too long"}
+
+ // Deprecated: ErrShortBody is no longer returned by
+ // anything in the net/http package. Callers should not
+ // compare errors against this variable.
+ ErrShortBody = &amp;ProtocolError{"entity body too short"}
+
+ // Deprecated: ErrMissingContentLength is no longer returned by
+ // anything in the net/http package. Callers should not
+ // compare errors against this variable.
+ ErrMissingContentLength = &amp;ProtocolError{"missing ContentLength in HEAD response"}
+)</pre> <p>Errors used by the HTTP server. </p>
+<pre data-language="go">var (
+ // ErrBodyNotAllowed is returned by ResponseWriter.Write calls
+ // when the HTTP method or response code does not permit a
+ // body.
+ ErrBodyNotAllowed = errors.New("http: request method or response status code does not allow body")
+
+ // ErrHijacked is returned by ResponseWriter.Write calls when
+ // the underlying connection has been hijacked using the
+ // Hijacker interface. A zero-byte write on a hijacked
+ // connection will return ErrHijacked without any other side
+ // effects.
+ ErrHijacked = errors.New("http: connection has been hijacked")
+
+ // ErrContentLength is returned by ResponseWriter.Write calls
+ // when a Handler set a Content-Length response header with a
+ // declared size and then attempted to write more bytes than
+ // declared.
+ ErrContentLength = errors.New("http: wrote more than the declared Content-Length")
+
+ // Deprecated: ErrWriteAfterFlush is no longer returned by
+ // anything in the net/http package. Callers should not
+ // compare errors against this variable.
+ ErrWriteAfterFlush = errors.New("unused")
+)</pre> <pre data-language="go">var (
+ // ServerContextKey is a context key. It can be used in HTTP
+ // handlers with Context.Value to access the server that
+ // started the handler. The associated value will be of
+ // type *Server.
+ ServerContextKey = &amp;contextKey{"http-server"}
+
+ // LocalAddrContextKey is a context key. It can be used in
+ // HTTP handlers with Context.Value to access the local
+ // address the connection arrived on.
+ // The associated value will be of type net.Addr.
+ LocalAddrContextKey = &amp;contextKey{"local-addr"}
+)</pre> <p>DefaultClient is the default <a href="#Client">Client</a> and is used by <a href="#Get">Get</a>, <a href="#Head">Head</a>, and <a href="#Post">Post</a>. </p>
+<pre data-language="go">var DefaultClient = &amp;Client{}</pre> <p>DefaultServeMux is the default <a href="#ServeMux">ServeMux</a> used by <a href="#Serve">Serve</a>. </p>
+<pre data-language="go">var DefaultServeMux = &amp;defaultServeMux</pre> <p>ErrAbortHandler is a sentinel panic value to abort a handler. While any panic from ServeHTTP aborts the response to the client, panicking with ErrAbortHandler also suppresses logging of a stack trace to the server's error log. </p>
+<pre data-language="go">var ErrAbortHandler = errors.New("net/http: abort Handler")</pre> <p>ErrBodyReadAfterClose is returned when reading a <a href="#Request">Request</a> or <a href="#Response">Response</a> Body after the body has been closed. This typically happens when the body is read after an HTTP <a href="#Handler">Handler</a> calls WriteHeader or Write on its <a href="#ResponseWriter">ResponseWriter</a>. </p>
+<pre data-language="go">var ErrBodyReadAfterClose = errors.New("http: invalid Read on closed Body")</pre> <p>ErrHandlerTimeout is returned on <a href="#ResponseWriter">ResponseWriter</a> Write calls in handlers which have timed out. </p>
+<pre data-language="go">var ErrHandlerTimeout = errors.New("http: Handler timeout")</pre> <p>ErrLineTooLong is returned when reading request or response bodies with malformed chunked encoding. </p>
+<pre data-language="go">var ErrLineTooLong = internal.ErrLineTooLong</pre> <p>ErrMissingFile is returned by FormFile when the provided file field name is either not present in the request or not a file field. </p>
+<pre data-language="go">var ErrMissingFile = errors.New("http: no such file")</pre> <p>ErrNoCookie is returned by Request's Cookie method when a cookie is not found. </p>
+<pre data-language="go">var ErrNoCookie = errors.New("http: named cookie not present")</pre> <p>ErrNoLocation is returned by the <a href="#Response.Location">Response.Location</a> method when no Location header is present. </p>
+<pre data-language="go">var ErrNoLocation = errors.New("http: no Location header in response")</pre> <p>ErrSchemeMismatch is returned when a server returns an HTTP response to an HTTPS client. </p>
+<pre data-language="go">var ErrSchemeMismatch = errors.New("http: server gave HTTP response to HTTPS client")</pre> <p>ErrServerClosed is returned by the <a href="#Server.Serve">Server.Serve</a>, <a href="#ServeTLS">ServeTLS</a>, <a href="#ListenAndServe">ListenAndServe</a>, and <a href="#ListenAndServeTLS">ListenAndServeTLS</a> methods after a call to <a href="#Server.Shutdown">Server.Shutdown</a> or <a href="#Server.Close">Server.Close</a>. </p>
+<pre data-language="go">var ErrServerClosed = errors.New("http: Server closed")</pre> <p>ErrSkipAltProtocol is a sentinel error value defined by Transport.RegisterProtocol. </p>
+<pre data-language="go">var ErrSkipAltProtocol = errors.New("net/http: skip alternate protocol")</pre> <p>ErrUseLastResponse can be returned by Client.CheckRedirect hooks to control how redirects are processed. If returned, the next request is not sent and the most recent response is returned with its body unclosed. </p>
+<pre data-language="go">var ErrUseLastResponse = errors.New("net/http: use last response")</pre> <p>NoBody is an <span>io.ReadCloser</span> with no bytes. Read always returns EOF and Close always returns nil. It can be used in an outgoing client request to explicitly signal that a request has zero bytes. An alternative, however, is to simply set [Request.Body] to nil. </p>
+<pre data-language="go">var NoBody = noBody{}</pre> <h2 id="CanonicalHeaderKey">func <span>CanonicalHeaderKey</span> </h2> <pre data-language="go">func CanonicalHeaderKey(s string) string</pre> <p>CanonicalHeaderKey returns the canonical format of the header key s. The canonicalization converts the first letter and any letter following a hyphen to upper case; the rest are converted to lowercase. For example, the canonical key for "accept-encoding" is "Accept-Encoding". If s contains a space or invalid header field bytes, it is returned without modifications. </p>
+<h2 id="DetectContentType">func <span>DetectContentType</span> </h2> <pre data-language="go">func DetectContentType(data []byte) string</pre> <p>DetectContentType implements the algorithm described at <a href="https://mimesniff.spec.whatwg.org/">https://mimesniff.spec.whatwg.org/</a> to determine the Content-Type of the given data. It considers at most the first 512 bytes of data. DetectContentType always returns a valid MIME type: if it cannot determine a more specific one, it returns "application/octet-stream". </p>
+<h2 id="Error">func <span>Error</span> </h2> <pre data-language="go">func Error(w ResponseWriter, error string, code int)</pre> <p>Error replies to the request with the specified error message and HTTP code. It does not otherwise end the request; the caller should ensure no further writes are done to w. The error message should be plain text. </p>
+<h2 id="Handle">func <span>Handle</span> </h2> <pre data-language="go">func Handle(pattern string, handler Handler)</pre> <p>Handle registers the handler for the given pattern in <a href="#DefaultServeMux">DefaultServeMux</a>. The documentation for <a href="#ServeMux">ServeMux</a> explains how patterns are matched. </p> <h4 id="example_Handle"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package http_test
+
+import (
+ "fmt"
+ "log"
+ "net/http"
+ "sync"
+)
+
+type countHandler struct {
+ mu sync.Mutex // guards n
+ n int
+}
+
+func (h *countHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ h.mu.Lock()
+ defer h.mu.Unlock()
+ h.n++
+ fmt.Fprintf(w, "count is %d\n", h.n)
+}
+
+func ExampleHandle() {
+ http.Handle("/count", new(countHandler))
+ log.Fatal(http.ListenAndServe(":8080", nil))
+}
+</pre> <h2 id="HandleFunc">func <span>HandleFunc</span> </h2> <pre data-language="go">func HandleFunc(pattern string, handler func(ResponseWriter, *Request))</pre> <p>HandleFunc registers the handler function for the given pattern in <a href="#DefaultServeMux">DefaultServeMux</a>. The documentation for <a href="#ServeMux">ServeMux</a> explains how patterns are matched. </p> <h4 id="example_HandleFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+h1 := func(w http.ResponseWriter, _ *http.Request) {
+ io.WriteString(w, "Hello from a HandleFunc #1!\n")
+}
+h2 := func(w http.ResponseWriter, _ *http.Request) {
+ io.WriteString(w, "Hello from a HandleFunc #2!\n")
+}
+
+http.HandleFunc("/", h1)
+http.HandleFunc("/endpoint", h2)
+
+log.Fatal(http.ListenAndServe(":8080", nil))
+</pre> <h2 id="ListenAndServe">func <span>ListenAndServe</span> </h2> <pre data-language="go">func ListenAndServe(addr string, handler Handler) error</pre> <p>ListenAndServe listens on the TCP network address addr and then calls <a href="#Serve">Serve</a> with handler to handle requests on incoming connections. Accepted connections are configured to enable TCP keep-alives. </p>
+<p>The handler is typically nil, in which case <a href="#DefaultServeMux">DefaultServeMux</a> is used. </p>
+<p>ListenAndServe always returns a non-nil error. </p> <h4 id="example_ListenAndServe"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Hello world, the web server
+
+helloHandler := func(w http.ResponseWriter, req *http.Request) {
+ io.WriteString(w, "Hello, world!\n")
+}
+
+http.HandleFunc("/hello", helloHandler)
+log.Fatal(http.ListenAndServe(":8080", nil))
+</pre> <h2 id="ListenAndServeTLS">func <span>ListenAndServeTLS</span> </h2> <pre data-language="go">func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error</pre> <p>ListenAndServeTLS acts identically to <a href="#ListenAndServe">ListenAndServe</a>, except that it expects HTTPS connections. Additionally, files containing a certificate and matching private key for the server must be provided. If the certificate is signed by a certificate authority, the certFile should be the concatenation of the server's certificate, any intermediates, and the CA's certificate. </p> <h4 id="example_ListenAndServeTLS"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
+ io.WriteString(w, "Hello, TLS!\n")
+})
+
+// One can use generate_cert.go in crypto/tls to generate cert.pem and key.pem.
+log.Printf("About to listen on 8443. Go to https://127.0.0.1:8443/")
+err := http.ListenAndServeTLS(":8443", "cert.pem", "key.pem", nil)
+log.Fatal(err)
+</pre> <h2 id="MaxBytesReader">func <span>MaxBytesReader</span> </h2> <pre data-language="go">func MaxBytesReader(w ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser</pre> <p>MaxBytesReader is similar to <span>io.LimitReader</span> but is intended for limiting the size of incoming request bodies. In contrast to io.LimitReader, MaxBytesReader's result is a ReadCloser, returns a non-nil error of type <a href="#MaxBytesError">*MaxBytesError</a> for a Read beyond the limit, and closes the underlying reader when its Close method is called. </p>
+<p>MaxBytesReader prevents clients from accidentally or maliciously sending a large request and wasting server resources. If possible, it tells the <a href="#ResponseWriter">ResponseWriter</a> to close the connection after the limit has been reached. </p>
+<h2 id="NotFound">func <span>NotFound</span> </h2> <pre data-language="go">func NotFound(w ResponseWriter, r *Request)</pre> <p>NotFound replies to the request with an HTTP 404 not found error. </p>
+<h2 id="ParseHTTPVersion">func <span>ParseHTTPVersion</span> </h2> <pre data-language="go">func ParseHTTPVersion(vers string) (major, minor int, ok bool)</pre> <p>ParseHTTPVersion parses an HTTP version string according to RFC 7230, section 2.6. "HTTP/1.0" returns (1, 0, true). Note that strings without a minor version, such as "HTTP/2", are not valid. </p>
+<h2 id="ParseTime">func <span>ParseTime</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func ParseTime(text string) (t time.Time, err error)</pre> <p>ParseTime parses a time header (such as the Date: header), trying each of the three formats allowed by HTTP/1.1: <a href="#TimeFormat">TimeFormat</a>, <span>time.RFC850</span>, and <span>time.ANSIC</span>. </p>
+<h2 id="ProxyFromEnvironment">func <span>ProxyFromEnvironment</span> </h2> <pre data-language="go">func ProxyFromEnvironment(req *Request) (*url.URL, error)</pre> <p>ProxyFromEnvironment returns the URL of the proxy to use for a given request, as indicated by the environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions thereof). Requests use the proxy from the environment variable matching their scheme, unless excluded by NO_PROXY. </p>
+<p>The environment values may be either a complete URL or a "host[:port]", in which case the "http" scheme is assumed. The schemes "http", "https", and "socks5" are supported. An error is returned if the value is a different form. </p>
+<p>A nil URL and nil error are returned if no proxy is defined in the environment, or a proxy should not be used for the given request, as defined by NO_PROXY. </p>
+<p>As a special case, if req.URL.Host is "localhost" (with or without a port number), then a nil URL and nil error will be returned. </p>
+<h2 id="ProxyURL">func <span>ProxyURL</span> </h2> <pre data-language="go">func ProxyURL(fixedURL *url.URL) func(*Request) (*url.URL, error)</pre> <p>ProxyURL returns a proxy function (for use in a <a href="#Transport">Transport</a>) that always returns the same URL. </p>
+<h2 id="Redirect">func <span>Redirect</span> </h2> <pre data-language="go">func Redirect(w ResponseWriter, r *Request, url string, code int)</pre> <p>Redirect replies to the request with a redirect to url, which may be a path relative to the request path. </p>
+<p>The provided code should be in the 3xx range and is usually <a href="#StatusMovedPermanently">StatusMovedPermanently</a>, <a href="#StatusFound">StatusFound</a> or <a href="#StatusSeeOther">StatusSeeOther</a>. </p>
+<p>If the Content-Type header has not been set, <a href="#Redirect">Redirect</a> sets it to "text/html; charset=utf-8" and writes a small HTML body. Setting the Content-Type header to any value, including nil, disables that behavior. </p>
+<h2 id="Serve">func <span>Serve</span> </h2> <pre data-language="go">func Serve(l net.Listener, handler Handler) error</pre> <p>Serve accepts incoming HTTP connections on the listener l, creating a new service goroutine for each. The service goroutines read requests and then call handler to reply to them. </p>
+<p>The handler is typically nil, in which case <a href="#DefaultServeMux">DefaultServeMux</a> is used. </p>
+<p>HTTP/2 support is only enabled if the Listener returns <span>*tls.Conn</span> connections and they were configured with "h2" in the TLS Config.NextProtos. </p>
+<p>Serve always returns a non-nil error. </p>
+<h2 id="ServeContent">func <span>ServeContent</span> </h2> <pre data-language="go">func ServeContent(w ResponseWriter, req *Request, name string, modtime time.Time, content io.ReadSeeker)</pre> <p>ServeContent replies to the request using the content in the provided ReadSeeker. The main benefit of ServeContent over <span>io.Copy</span> is that it handles Range requests properly, sets the MIME type, and handles If-Match, If-Unmodified-Since, If-None-Match, If-Modified-Since, and If-Range requests. </p>
+<p>If the response's Content-Type header is not set, ServeContent first tries to deduce the type from name's file extension and, if that fails, falls back to reading the first block of the content and passing it to <a href="#DetectContentType">DetectContentType</a>. The name is otherwise unused; in particular it can be empty and is never sent in the response. </p>
+<p>If modtime is not the zero time or Unix epoch, ServeContent includes it in a Last-Modified header in the response. If the request includes an If-Modified-Since header, ServeContent uses modtime to decide whether the content needs to be sent at all. </p>
+<p>The content's Seek method must work: ServeContent uses a seek to the end of the content to determine its size. </p>
+<p>If the caller has set w's ETag header formatted per RFC 7232, section 2.3, ServeContent uses it to handle requests using If-Match, If-None-Match, or If-Range. </p>
+<p>Note that <span>*os.File</span> implements the <span>io.ReadSeeker</span> interface. </p>
+<h2 id="ServeFile">func <span>ServeFile</span> </h2> <pre data-language="go">func ServeFile(w ResponseWriter, r *Request, name string)</pre> <p>ServeFile replies to the request with the contents of the named file or directory. </p>
+<p>If the provided file or directory name is a relative path, it is interpreted relative to the current directory and may ascend to parent directories. If the provided name is constructed from user input, it should be sanitized before calling ServeFile. </p>
+<p>As a precaution, ServeFile will reject requests where r.URL.Path contains a ".." path element; this protects against callers who might unsafely use <span>filepath.Join</span> on r.URL.Path without sanitizing it and then use that filepath.Join result as the name argument. </p>
+<p>As another special case, ServeFile redirects any request where r.URL.Path ends in "/index.html" to the same path, without the final "index.html". To avoid such redirects either modify the path or use <a href="#ServeContent">ServeContent</a>. </p>
+<p>Outside of those two special cases, ServeFile does not use r.URL.Path for selecting the file or directory to serve; only the file or directory provided in the name argument is used. </p>
+<h2 id="ServeFileFS">func <span>ServeFileFS</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func ServeFileFS(w ResponseWriter, r *Request, fsys fs.FS, name string)</pre> <p>ServeFileFS replies to the request with the contents of the named file or directory from the file system fsys. </p>
+<p>If the provided file or directory name is a relative path, it is interpreted relative to the current directory and may ascend to parent directories. If the provided name is constructed from user input, it should be sanitized before calling <a href="#ServeFile">ServeFile</a>. </p>
+<p>As a precaution, ServeFile will reject requests where r.URL.Path contains a ".." path element; this protects against callers who might unsafely use <span>filepath.Join</span> on r.URL.Path without sanitizing it and then use that filepath.Join result as the name argument. </p>
+<p>As another special case, ServeFile redirects any request where r.URL.Path ends in "/index.html" to the same path, without the final "index.html". To avoid such redirects either modify the path or use ServeContent. </p>
+<p>Outside of those two special cases, ServeFile does not use r.URL.Path for selecting the file or directory to serve; only the file or directory provided in the name argument is used. </p>
+<h2 id="ServeTLS">func <span>ServeTLS</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func ServeTLS(l net.Listener, handler Handler, certFile, keyFile string) error</pre> <p>ServeTLS accepts incoming HTTPS connections on the listener l, creating a new service goroutine for each. The service goroutines read requests and then call handler to reply to them. </p>
+<p>The handler is typically nil, in which case <a href="#DefaultServeMux">DefaultServeMux</a> is used. </p>
+<p>Additionally, files containing a certificate and matching private key for the server must be provided. If the certificate is signed by a certificate authority, the certFile should be the concatenation of the server's certificate, any intermediates, and the CA's certificate. </p>
+<p>ServeTLS always returns a non-nil error. </p>
+<h2 id="SetCookie">func <span>SetCookie</span> </h2> <pre data-language="go">func SetCookie(w ResponseWriter, cookie *Cookie)</pre> <p>SetCookie adds a Set-Cookie header to the provided <a href="#ResponseWriter">ResponseWriter</a>'s headers. The provided cookie must have a valid Name. Invalid cookies may be silently dropped. </p>
+<h2 id="StatusText">func <span>StatusText</span> </h2> <pre data-language="go">func StatusText(code int) string</pre> <p>StatusText returns a text for the HTTP status code. It returns the empty string if the code is unknown. </p>
+<h2 id="Client">type <span>Client</span> </h2> <p>A Client is an HTTP client. Its zero value (<a href="#DefaultClient">DefaultClient</a>) is a usable client that uses <a href="#DefaultTransport">DefaultTransport</a>. </p>
+<p>The [Client.Transport] typically has internal state (cached TCP connections), so Clients should be reused instead of created as needed. Clients are safe for concurrent use by multiple goroutines. </p>
+<p>A Client is higher-level than a <a href="#RoundTripper">RoundTripper</a> (such as <a href="#Transport">Transport</a>) and additionally handles HTTP details such as cookies and redirects. </p>
+<p>When following redirects, the Client will forward all headers set on the initial <a href="#Request">Request</a> except: </p>
+<ul> <li>when forwarding sensitive headers like "Authorization", "WWW-Authenticate", and "Cookie" to untrusted targets. These headers will be ignored when following a redirect to a domain that is not a subdomain match or exact match of the initial domain. For example, a redirect from "foo.com" to either "foo.com" or "sub.foo.com" will forward the sensitive headers, but a redirect to "bar.com" will not. </li>
+<li>when forwarding the "Cookie" header with a non-nil cookie Jar. Since each redirect may mutate the state of the cookie jar, a redirect may possibly alter a cookie set in the initial request. When forwarding the "Cookie" header, any mutated cookies will be omitted, with the expectation that the Jar will insert those mutated cookies with the updated values (assuming the origin matches). If Jar is nil, the initial cookies are forwarded without change. </li>
+</ul> <pre data-language="go">type Client struct {
+ // Transport specifies the mechanism by which individual
+ // HTTP requests are made.
+ // If nil, DefaultTransport is used.
+ Transport RoundTripper
+
+ // CheckRedirect specifies the policy for handling redirects.
+ // If CheckRedirect is not nil, the client calls it before
+ // following an HTTP redirect. The arguments req and via are
+ // the upcoming request and the requests made already, oldest
+ // first. If CheckRedirect returns an error, the Client's Get
+ // method returns both the previous Response (with its Body
+ // closed) and CheckRedirect's error (wrapped in a url.Error)
+ // instead of issuing the Request req.
+ // As a special case, if CheckRedirect returns ErrUseLastResponse,
+ // then the most recent response is returned with its body
+ // unclosed, along with a nil error.
+ //
+ // If CheckRedirect is nil, the Client uses its default policy,
+ // which is to stop after 10 consecutive requests.
+ CheckRedirect func(req *Request, via []*Request) error
+
+ // Jar specifies the cookie jar.
+ //
+ // The Jar is used to insert relevant cookies into every
+ // outbound Request and is updated with the cookie values
+ // of every inbound Response. The Jar is consulted for every
+ // redirect that the Client follows.
+ //
+ // If Jar is nil, cookies are only sent if they are explicitly
+ // set on the Request.
+ Jar CookieJar
+
+ // Timeout specifies a time limit for requests made by this
+ // Client. The timeout includes connection time, any
+ // redirects, and reading the response body. The timer remains
+ // running after Get, Head, Post, or Do return and will
+ // interrupt reading of the Response.Body.
+ //
+ // A Timeout of zero means no timeout.
+ //
+ // The Client cancels requests to the underlying Transport
+ // as if the Request's Context ended.
+ //
+ // For compatibility, the Client will also use the deprecated
+ // CancelRequest method on Transport if found. New
+ // RoundTripper implementations should use the Request's Context
+ // for cancellation instead of implementing CancelRequest.
+ Timeout time.Duration // Go 1.3
+}
+</pre> <h3 id="Client.CloseIdleConnections">func (*Client) <span>CloseIdleConnections</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (c *Client) CloseIdleConnections()</pre> <p>CloseIdleConnections closes any connections on its <a href="#Transport">Transport</a> which were previously connected from previous requests but are now sitting idle in a "keep-alive" state. It does not interrupt any connections currently in use. </p>
+<p>If [Client.Transport] does not have a <a href="#Client.CloseIdleConnections">Client.CloseIdleConnections</a> method then this method does nothing. </p>
+<h3 id="Client.Do">func (*Client) <span>Do</span> </h3> <pre data-language="go">func (c *Client) Do(req *Request) (*Response, error)</pre> <p>Do sends an HTTP request and returns an HTTP response, following policy (such as redirects, cookies, auth) as configured on the client. </p>
+<p>An error is returned if caused by client policy (such as CheckRedirect), or failure to speak HTTP (such as a network connectivity problem). A non-2xx status code doesn't cause an error. </p>
+<p>If the returned error is nil, the <a href="#Response">Response</a> will contain a non-nil Body which the user is expected to close. If the Body is not both read to EOF and closed, the <a href="#Client">Client</a>'s underlying <a href="#RoundTripper">RoundTripper</a> (typically <a href="#Transport">Transport</a>) may not be able to re-use a persistent TCP connection to the server for a subsequent "keep-alive" request. </p>
+<p>The request Body, if non-nil, will be closed by the underlying Transport, even on errors. The Body may be closed asynchronously after Do returns. </p>
+<p>On error, any Response can be ignored. A non-nil Response with a non-nil error only occurs when CheckRedirect fails, and even then the returned [Response.Body] is already closed. </p>
+<p>Generally <a href="#Get">Get</a>, <a href="#Post">Post</a>, or <a href="#PostForm">PostForm</a> will be used instead of Do. </p>
+<p>If the server replies with a redirect, the Client first uses the CheckRedirect function to determine whether the redirect should be followed. If permitted, a 301, 302, or 303 redirect causes subsequent requests to use HTTP method GET (or HEAD if the original request was HEAD), with no body. A 307 or 308 redirect preserves the original HTTP method and body, provided that the [Request.GetBody] function is defined. The <a href="#NewRequest">NewRequest</a> function automatically sets GetBody for common standard library body types. </p>
+<p>Any returned error will be of type <span>*url.Error</span>. The url.Error value's Timeout method will report true if the request timed out. </p>
+<h3 id="Client.Get">func (*Client) <span>Get</span> </h3> <pre data-language="go">func (c *Client) Get(url string) (resp *Response, err error)</pre> <p>Get issues a GET to the specified URL. If the response is one of the following redirect codes, Get follows the redirect after calling the [Client.CheckRedirect] function: </p>
+<pre data-language="go">301 (Moved Permanently)
+302 (Found)
+303 (See Other)
+307 (Temporary Redirect)
+308 (Permanent Redirect)
+</pre> <p>An error is returned if the [Client.CheckRedirect] function fails or if there was an HTTP protocol error. A non-2xx response doesn't cause an error. Any returned error will be of type <span>*url.Error</span>. The url.Error value's Timeout method will report true if the request timed out. </p>
+<p>When err is nil, resp always contains a non-nil resp.Body. Caller should close resp.Body when done reading from it. </p>
+<p>To make a request with custom headers, use <a href="#NewRequest">NewRequest</a> and <a href="#Client.Do">Client.Do</a>. </p>
+<p>To make a request with a specified context.Context, use <a href="#NewRequestWithContext">NewRequestWithContext</a> and Client.Do. </p>
+<h3 id="Client.Head">func (*Client) <span>Head</span> </h3> <pre data-language="go">func (c *Client) Head(url string) (resp *Response, err error)</pre> <p>Head issues a HEAD to the specified URL. If the response is one of the following redirect codes, Head follows the redirect after calling the [Client.CheckRedirect] function: </p>
+<pre data-language="go">301 (Moved Permanently)
+302 (Found)
+303 (See Other)
+307 (Temporary Redirect)
+308 (Permanent Redirect)
+</pre> <p>To make a request with a specified <span>context.Context</span>, use <a href="#NewRequestWithContext">NewRequestWithContext</a> and <a href="#Client.Do">Client.Do</a>. </p>
+<h3 id="Client.Post">func (*Client) <span>Post</span> </h3> <pre data-language="go">func (c *Client) Post(url, contentType string, body io.Reader) (resp *Response, err error)</pre> <p>Post issues a POST to the specified URL. </p>
+<p>Caller should close resp.Body when done reading from it. </p>
+<p>If the provided body is an <span>io.Closer</span>, it is closed after the request. </p>
+<p>To set custom headers, use <a href="#NewRequest">NewRequest</a> and <a href="#Client.Do">Client.Do</a>. </p>
+<p>To make a request with a specified context.Context, use <a href="#NewRequestWithContext">NewRequestWithContext</a> and <a href="#Client.Do">Client.Do</a>. </p>
+<p>See the Client.Do method documentation for details on how redirects are handled. </p>
+<h3 id="Client.PostForm">func (*Client) <span>PostForm</span> </h3> <pre data-language="go">func (c *Client) PostForm(url string, data url.Values) (resp *Response, err error)</pre> <p>PostForm issues a POST to the specified URL, with data's keys and values URL-encoded as the request body. </p>
+<p>The Content-Type header is set to application/x-www-form-urlencoded. To set other headers, use <a href="#NewRequest">NewRequest</a> and <a href="#Client.Do">Client.Do</a>. </p>
+<p>When err is nil, resp always contains a non-nil resp.Body. Caller should close resp.Body when done reading from it. </p>
+<p>See the Client.Do method documentation for details on how redirects are handled. </p>
+<p>To make a request with a specified context.Context, use <a href="#NewRequestWithContext">NewRequestWithContext</a> and Client.Do. </p>
+<h2 id="CloseNotifier">type <span>CloseNotifier</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>The CloseNotifier interface is implemented by ResponseWriters which allow detecting when the underlying connection has gone away. </p>
+<p>This mechanism can be used to cancel long operations on the server if the client has disconnected before the response is ready. </p>
+<p>Deprecated: the CloseNotifier interface predates Go's context package. New code should use <a href="#Request.Context">Request.Context</a> instead. </p>
+<pre data-language="go">type CloseNotifier interface {
+ // CloseNotify returns a channel that receives at most a
+ // single value (true) when the client connection has gone
+ // away.
+ //
+ // CloseNotify may wait to notify until Request.Body has been
+ // fully read.
+ //
+ // After the Handler has returned, there is no guarantee
+ // that the channel receives a value.
+ //
+ // If the protocol is HTTP/1.1 and CloseNotify is called while
+ // processing an idempotent request (such a GET) while
+ // HTTP/1.1 pipelining is in use, the arrival of a subsequent
+ // pipelined request may cause a value to be sent on the
+ // returned channel. In practice HTTP/1.1 pipelining is not
+ // enabled in browsers and not seen often in the wild. If this
+ // is a problem, use HTTP/2 or only use CloseNotify on methods
+ // such as POST.
+ CloseNotify() &lt;-chan bool
+}</pre> <h2 id="ConnState">type <span>ConnState</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A ConnState represents the state of a client connection to a server. It's used by the optional [Server.ConnState] hook. </p>
+<pre data-language="go">type ConnState int</pre> <pre data-language="go">const (
+ // StateNew represents a new connection that is expected to
+ // send a request immediately. Connections begin at this
+ // state and then transition to either StateActive or
+ // StateClosed.
+ StateNew ConnState = iota
+
+ // StateActive represents a connection that has read 1 or more
+ // bytes of a request. The Server.ConnState hook for
+ // StateActive fires before the request has entered a handler
+ // and doesn't fire again until the request has been
+ // handled. After the request is handled, the state
+ // transitions to StateClosed, StateHijacked, or StateIdle.
+ // For HTTP/2, StateActive fires on the transition from zero
+ // to one active request, and only transitions away once all
+ // active requests are complete. That means that ConnState
+ // cannot be used to do per-request work; ConnState only notes
+ // the overall state of the connection.
+ StateActive
+
+ // StateIdle represents a connection that has finished
+ // handling a request and is in the keep-alive state, waiting
+ // for a new request. Connections transition from StateIdle
+ // to either StateActive or StateClosed.
+ StateIdle
+
+ // StateHijacked represents a hijacked connection.
+ // This is a terminal state. It does not transition to StateClosed.
+ StateHijacked
+
+ // StateClosed represents a closed connection.
+ // This is a terminal state. Hijacked connections do not
+ // transition to StateClosed.
+ StateClosed
+)</pre> <h3 id="ConnState.String">func (ConnState) <span>String</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (c ConnState) String() string</pre> <h2 id="Cookie">type <span>Cookie</span> </h2> <p>A Cookie represents an HTTP cookie as sent in the Set-Cookie header of an HTTP response or the Cookie header of an HTTP request. </p>
+<p>See <a href="https://tools.ietf.org/html/rfc6265">https://tools.ietf.org/html/rfc6265</a> for details. </p>
+<pre data-language="go">type Cookie struct {
+ Name string
+ Value string
+
+ Path string // optional
+ Domain string // optional
+ Expires time.Time // optional
+ RawExpires string // for reading cookies only
+
+ // MaxAge=0 means no 'Max-Age' attribute specified.
+ // MaxAge&lt;0 means delete cookie now, equivalently 'Max-Age: 0'
+ // MaxAge&gt;0 means Max-Age attribute present and given in seconds
+ MaxAge int
+ Secure bool
+ HttpOnly bool
+ SameSite SameSite // Go 1.11
+ Raw string
+ Unparsed []string // Raw text of unparsed attribute-value pairs
+}
+</pre> <h3 id="Cookie.String">func (*Cookie) <span>String</span> </h3> <pre data-language="go">func (c *Cookie) String() string</pre> <p>String returns the serialization of the cookie for use in a <a href="#Cookie">Cookie</a> header (if only Name and Value are set) or a Set-Cookie response header (if other fields are set). If c is nil or c.Name is invalid, the empty string is returned. </p>
+<h3 id="Cookie.Valid">func (*Cookie) <span>Valid</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *Cookie) Valid() error</pre> <p>Valid reports whether the cookie is valid. </p>
+<h2 id="CookieJar">type <span>CookieJar</span> </h2> <p>A CookieJar manages storage and use of cookies in HTTP requests. </p>
+<p>Implementations of CookieJar must be safe for concurrent use by multiple goroutines. </p>
+<p>The net/http/cookiejar package provides a CookieJar implementation. </p>
+<pre data-language="go">type CookieJar interface {
+ // SetCookies handles the receipt of the cookies in a reply for the
+ // given URL. It may or may not choose to save the cookies, depending
+ // on the jar's policy and implementation.
+ SetCookies(u *url.URL, cookies []*Cookie)
+
+ // Cookies returns the cookies to send in a request for the given URL.
+ // It is up to the implementation to honor the standard cookie use
+ // restrictions such as in RFC 6265.
+ Cookies(u *url.URL) []*Cookie
+}</pre> <h2 id="Dir">type <span>Dir</span> </h2> <p>A Dir implements <a href="#FileSystem">FileSystem</a> using the native file system restricted to a specific directory tree. </p>
+<p>While the [FileSystem.Open] method takes '/'-separated paths, a Dir's string value is a filename on the native file system, not a URL, so it is separated by <span>filepath.Separator</span>, which isn't necessarily '/'. </p>
+<p>Note that Dir could expose sensitive files and directories. Dir will follow symlinks pointing out of the directory tree, which can be especially dangerous if serving from a directory in which users are able to create arbitrary symlinks. Dir will also allow access to files and directories starting with a period, which could expose sensitive directories like .git or sensitive files like .htpasswd. To exclude files with a leading period, remove the files/directories from the server or create a custom FileSystem implementation. </p>
+<p>An empty Dir is treated as ".". </p>
+<pre data-language="go">type Dir string</pre> <h3 id="Dir.Open">func (Dir) <span>Open</span> </h3> <pre data-language="go">func (d Dir) Open(name string) (File, error)</pre> <p>Open implements <a href="#FileSystem">FileSystem</a> using <span>os.Open</span>, opening files for reading rooted and relative to the directory d. </p>
+<h2 id="File">type <span>File</span> </h2> <p>A File is returned by a <a href="#FileSystem">FileSystem</a>'s Open method and can be served by the <a href="#FileServer">FileServer</a> implementation. </p>
+<p>The methods should behave the same as those on an <span>*os.File</span>. </p>
+<pre data-language="go">type File interface {
+ io.Closer
+ io.Reader
+ io.Seeker
+ Readdir(count int) ([]fs.FileInfo, error)
+ Stat() (fs.FileInfo, error)
+}</pre> <h2 id="FileSystem">type <span>FileSystem</span> </h2> <p>A FileSystem implements access to a collection of named files. The elements in a file path are separated by slash ('/', U+002F) characters, regardless of host operating system convention. See the <a href="#FileServer">FileServer</a> function to convert a FileSystem to a <a href="#Handler">Handler</a>. </p>
+<p>This interface predates the <span>fs.FS</span> interface, which can be used instead: the <a href="#FS">FS</a> adapter function converts an fs.FS to a FileSystem. </p>
+<pre data-language="go">type FileSystem interface {
+ Open(name string) (File, error)
+}</pre> <h3 id="FS">func <span>FS</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func FS(fsys fs.FS) FileSystem</pre> <p>FS converts fsys to a <a href="#FileSystem">FileSystem</a> implementation, for use with <a href="#FileServer">FileServer</a> and <a href="#NewFileTransport">NewFileTransport</a>. The files provided by fsys must implement <span>io.Seeker</span>. </p>
+<h2 id="Flusher">type <span>Flusher</span> </h2> <p>The Flusher interface is implemented by ResponseWriters that allow an HTTP handler to flush buffered data to the client. </p>
+<p>The default HTTP/1.x and HTTP/2 <a href="#ResponseWriter">ResponseWriter</a> implementations support <a href="#Flusher">Flusher</a>, but ResponseWriter wrappers may not. Handlers should always test for this ability at runtime. </p>
+<p>Note that even for ResponseWriters that support Flush, if the client is connected through an HTTP proxy, the buffered data may not reach the client until the response completes. </p>
+<pre data-language="go">type Flusher interface {
+ // Flush sends any buffered data to the client.
+ Flush()
+}</pre> <h2 id="Handler">type <span>Handler</span> </h2> <p>A Handler responds to an HTTP request. </p>
+<p>[Handler.ServeHTTP] should write reply headers and data to the <a href="#ResponseWriter">ResponseWriter</a> and then return. Returning signals that the request is finished; it is not valid to use the <a href="#ResponseWriter">ResponseWriter</a> or read from the [Request.Body] after or concurrently with the completion of the ServeHTTP call. </p>
+<p>Depending on the HTTP client software, HTTP protocol version, and any intermediaries between the client and the Go server, it may not be possible to read from the [Request.Body] after writing to the <a href="#ResponseWriter">ResponseWriter</a>. Cautious handlers should read the [Request.Body] first, and then reply. </p>
+<p>Except for reading the body, handlers should not modify the provided Request. </p>
+<p>If ServeHTTP panics, the server (the caller of ServeHTTP) assumes that the effect of the panic was isolated to the active request. It recovers the panic, logs a stack trace to the server error log, and either closes the network connection or sends an HTTP/2 RST_STREAM, depending on the HTTP protocol. To abort a handler so the client sees an interrupted response but the server doesn't log an error, panic with the value <a href="#ErrAbortHandler">ErrAbortHandler</a>. </p>
+<pre data-language="go">type Handler interface {
+ ServeHTTP(ResponseWriter, *Request)
+}</pre> <h3 id="AllowQuerySemicolons">func <span>AllowQuerySemicolons</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func AllowQuerySemicolons(h Handler) Handler</pre> <p>AllowQuerySemicolons returns a handler that serves requests by converting any unescaped semicolons in the URL query to ampersands, and invoking the handler h. </p>
+<p>This restores the pre-Go 1.17 behavior of splitting query parameters on both semicolons and ampersands. (See golang.org/issue/25192). Note that this behavior doesn't match that of many proxies, and the mismatch can lead to security issues. </p>
+<p>AllowQuerySemicolons should be invoked before <a href="#Request.ParseForm">Request.ParseForm</a> is called. </p>
+<h3 id="FileServer">func <span>FileServer</span> </h3> <pre data-language="go">func FileServer(root FileSystem) Handler</pre> <p>FileServer returns a handler that serves HTTP requests with the contents of the file system rooted at root. </p>
+<p>As a special case, the returned file server redirects any request ending in "/index.html" to the same path, without the final "index.html". </p>
+<p>To use the operating system's file system implementation, use <a href="#Dir">http.Dir</a>: </p>
+<pre data-language="go">http.Handle("/", http.FileServer(http.Dir("/tmp")))
+</pre> <p>To use an <span>fs.FS</span> implementation, use <a href="#FileServerFS">http.FileServerFS</a> instead. </p> <h4 id="example_FileServer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Simple static webserver:
+log.Fatal(http.ListenAndServe(":8080", http.FileServer(http.Dir("/usr/share/doc"))))
+</pre> <h4 id="example_FileServer_dotFileHiding"> <span class="text">Example (DotFileHiding)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package http_test
+
+import (
+ "io/fs"
+ "log"
+ "net/http"
+ "strings"
+)
+
+// containsDotFile reports whether name contains a path element starting with a period.
+// The name is assumed to be a delimited by forward slashes, as guaranteed
+// by the http.FileSystem interface.
+func containsDotFile(name string) bool {
+ parts := strings.Split(name, "/")
+ for _, part := range parts {
+ if strings.HasPrefix(part, ".") {
+ return true
+ }
+ }
+ return false
+}
+
+// dotFileHidingFile is the http.File use in dotFileHidingFileSystem.
+// It is used to wrap the Readdir method of http.File so that we can
+// remove files and directories that start with a period from its output.
+type dotFileHidingFile struct {
+ http.File
+}
+
+// Readdir is a wrapper around the Readdir method of the embedded File
+// that filters out all files that start with a period in their name.
+func (f dotFileHidingFile) Readdir(n int) (fis []fs.FileInfo, err error) {
+ files, err := f.File.Readdir(n)
+ for _, file := range files { // Filters out the dot files
+ if !strings.HasPrefix(file.Name(), ".") {
+ fis = append(fis, file)
+ }
+ }
+ return
+}
+
+// dotFileHidingFileSystem is an http.FileSystem that hides
+// hidden "dot files" from being served.
+type dotFileHidingFileSystem struct {
+ http.FileSystem
+}
+
+// Open is a wrapper around the Open method of the embedded FileSystem
+// that serves a 403 permission error when name has a file or directory
+// with whose name starts with a period in its path.
+func (fsys dotFileHidingFileSystem) Open(name string) (http.File, error) {
+ if containsDotFile(name) { // If dot file, return 403 response
+ return nil, fs.ErrPermission
+ }
+
+ file, err := fsys.FileSystem.Open(name)
+ if err != nil {
+ return nil, err
+ }
+ return dotFileHidingFile{file}, err
+}
+
+func ExampleFileServer_dotFileHiding() {
+ fsys := dotFileHidingFileSystem{http.Dir(".")}
+ http.Handle("/", http.FileServer(fsys))
+ log.Fatal(http.ListenAndServe(":8080", nil))
+}
+</pre> <h4 id="example_FileServer_stripPrefix"> <span class="text">Example (StripPrefix)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// To serve a directory on disk (/tmp) under an alternate URL
+// path (/tmpfiles/), use StripPrefix to modify the request
+// URL's path before the FileServer sees it:
+http.Handle("/tmpfiles/", http.StripPrefix("/tmpfiles/", http.FileServer(http.Dir("/tmp"))))
+</pre> <h3 id="FileServerFS">func <span>FileServerFS</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func FileServerFS(root fs.FS) Handler</pre> <p>FileServerFS returns a handler that serves HTTP requests with the contents of the file system fsys. </p>
+<p>As a special case, the returned file server redirects any request ending in "/index.html" to the same path, without the final "index.html". </p>
+<pre data-language="go">http.Handle("/", http.FileServerFS(fsys))
+</pre> <h3 id="MaxBytesHandler">func <span>MaxBytesHandler</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func MaxBytesHandler(h Handler, n int64) Handler</pre> <p>MaxBytesHandler returns a <a href="#Handler">Handler</a> that runs h with its <a href="#ResponseWriter">ResponseWriter</a> and [Request.Body] wrapped by a MaxBytesReader. </p>
+<h3 id="NotFoundHandler">func <span>NotFoundHandler</span> </h3> <pre data-language="go">func NotFoundHandler() Handler</pre> <p>NotFoundHandler returns a simple request handler that replies to each request with a “404 page not found” reply. </p> <h4 id="example_NotFoundHandler"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+mux := http.NewServeMux()
+
+// Create sample handler to returns 404
+mux.Handle("/resources", http.NotFoundHandler())
+
+// Create sample handler that returns 200
+mux.Handle("/resources/people/", newPeopleHandler())
+
+log.Fatal(http.ListenAndServe(":8080", mux))
+</pre> <h3 id="RedirectHandler">func <span>RedirectHandler</span> </h3> <pre data-language="go">func RedirectHandler(url string, code int) Handler</pre> <p>RedirectHandler returns a request handler that redirects each request it receives to the given url using the given status code. </p>
+<p>The provided code should be in the 3xx range and is usually <a href="#StatusMovedPermanently">StatusMovedPermanently</a>, <a href="#StatusFound">StatusFound</a> or <a href="#StatusSeeOther">StatusSeeOther</a>. </p>
+<h3 id="StripPrefix">func <span>StripPrefix</span> </h3> <pre data-language="go">func StripPrefix(prefix string, h Handler) Handler</pre> <p>StripPrefix returns a handler that serves HTTP requests by removing the given prefix from the request URL's Path (and RawPath if set) and invoking the handler h. StripPrefix handles a request for a path that doesn't begin with prefix by replying with an HTTP 404 not found error. The prefix must match exactly: if the prefix in the request contains escaped characters the reply is also an HTTP 404 not found error. </p> <h4 id="example_StripPrefix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// To serve a directory on disk (/tmp) under an alternate URL
+// path (/tmpfiles/), use StripPrefix to modify the request
+// URL's path before the FileServer sees it:
+http.Handle("/tmpfiles/", http.StripPrefix("/tmpfiles/", http.FileServer(http.Dir("/tmp"))))
+</pre> <h3 id="TimeoutHandler">func <span>TimeoutHandler</span> </h3> <pre data-language="go">func TimeoutHandler(h Handler, dt time.Duration, msg string) Handler</pre> <p>TimeoutHandler returns a <a href="#Handler">Handler</a> that runs h with the given time limit. </p>
+<p>The new Handler calls h.ServeHTTP to handle each request, but if a call runs for longer than its time limit, the handler responds with a 503 Service Unavailable error and the given message in its body. (If msg is empty, a suitable default message will be sent.) After such a timeout, writes by h to its <a href="#ResponseWriter">ResponseWriter</a> will return <a href="#ErrHandlerTimeout">ErrHandlerTimeout</a>. </p>
+<p>TimeoutHandler supports the <a href="#Pusher">Pusher</a> interface but does not support the <a href="#Hijacker">Hijacker</a> or <a href="#Flusher">Flusher</a> interfaces. </p>
+<h2 id="HandlerFunc">type <span>HandlerFunc</span> </h2> <p>The HandlerFunc type is an adapter to allow the use of ordinary functions as HTTP handlers. If f is a function with the appropriate signature, HandlerFunc(f) is a <a href="#Handler">Handler</a> that calls f. </p>
+<pre data-language="go">type HandlerFunc func(ResponseWriter, *Request)</pre> <h3 id="HandlerFunc.ServeHTTP">func (HandlerFunc) <span>ServeHTTP</span> </h3> <pre data-language="go">func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request)</pre> <p>ServeHTTP calls f(w, r). </p>
+<h2 id="Header">type <span>Header</span> </h2> <p>A Header represents the key-value pairs in an HTTP header. </p>
+<p>The keys should be in canonical form, as returned by <a href="#CanonicalHeaderKey">CanonicalHeaderKey</a>. </p>
+<pre data-language="go">type Header map[string][]string</pre> <h3 id="Header.Add">func (Header) <span>Add</span> </h3> <pre data-language="go">func (h Header) Add(key, value string)</pre> <p>Add adds the key, value pair to the header. It appends to any existing values associated with key. The key is case insensitive; it is canonicalized by <a href="#CanonicalHeaderKey">CanonicalHeaderKey</a>. </p>
+<h3 id="Header.Clone">func (Header) <span>Clone</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (h Header) Clone() Header</pre> <p>Clone returns a copy of h or nil if h is nil. </p>
+<h3 id="Header.Del">func (Header) <span>Del</span> </h3> <pre data-language="go">func (h Header) Del(key string)</pre> <p>Del deletes the values associated with key. The key is case insensitive; it is canonicalized by <a href="#CanonicalHeaderKey">CanonicalHeaderKey</a>. </p>
+<h3 id="Header.Get">func (Header) <span>Get</span> </h3> <pre data-language="go">func (h Header) Get(key string) string</pre> <p>Get gets the first value associated with the given key. If there are no values associated with the key, Get returns "". It is case insensitive; <span>textproto.CanonicalMIMEHeaderKey</span> is used to canonicalize the provided key. Get assumes that all keys are stored in canonical form. To use non-canonical keys, access the map directly. </p>
+<h3 id="Header.Set">func (Header) <span>Set</span> </h3> <pre data-language="go">func (h Header) Set(key, value string)</pre> <p>Set sets the header entries associated with key to the single element value. It replaces any existing values associated with key. The key is case insensitive; it is canonicalized by <span>textproto.CanonicalMIMEHeaderKey</span>. To use non-canonical keys, assign to the map directly. </p>
+<h3 id="Header.Values">func (Header) <span>Values</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h Header) Values(key string) []string</pre> <p>Values returns all values associated with the given key. It is case insensitive; <span>textproto.CanonicalMIMEHeaderKey</span> is used to canonicalize the provided key. To use non-canonical keys, access the map directly. The returned slice is not a copy. </p>
+<h3 id="Header.Write">func (Header) <span>Write</span> </h3> <pre data-language="go">func (h Header) Write(w io.Writer) error</pre> <p>Write writes a header in wire format. </p>
+<h3 id="Header.WriteSubset">func (Header) <span>WriteSubset</span> </h3> <pre data-language="go">func (h Header) WriteSubset(w io.Writer, exclude map[string]bool) error</pre> <p>WriteSubset writes a header in wire format. If exclude is not nil, keys where exclude[key] == true are not written. Keys are not canonicalized before checking the exclude map. </p>
+<h2 id="Hijacker">type <span>Hijacker</span> </h2> <p>The Hijacker interface is implemented by ResponseWriters that allow an HTTP handler to take over the connection. </p>
+<p>The default <a href="#ResponseWriter">ResponseWriter</a> for HTTP/1.x connections supports Hijacker, but HTTP/2 connections intentionally do not. ResponseWriter wrappers may also not support Hijacker. Handlers should always test for this ability at runtime. </p>
+<pre data-language="go">type Hijacker interface {
+ // Hijack lets the caller take over the connection.
+ // After a call to Hijack the HTTP server library
+ // will not do anything else with the connection.
+ //
+ // It becomes the caller's responsibility to manage
+ // and close the connection.
+ //
+ // The returned net.Conn may have read or write deadlines
+ // already set, depending on the configuration of the
+ // Server. It is the caller's responsibility to set
+ // or clear those deadlines as needed.
+ //
+ // The returned bufio.Reader may contain unprocessed buffered
+ // data from the client.
+ //
+ // After a call to Hijack, the original Request.Body must not
+ // be used. The original Request's Context remains valid and
+ // is not canceled until the Request's ServeHTTP method
+ // returns.
+ Hijack() (net.Conn, *bufio.ReadWriter, error)
+}</pre> <h4 id="example_Hijacker"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+http.HandleFunc("/hijack", func(w http.ResponseWriter, r *http.Request) {
+ hj, ok := w.(http.Hijacker)
+ if !ok {
+ http.Error(w, "webserver doesn't support hijacking", http.StatusInternalServerError)
+ return
+ }
+ conn, bufrw, err := hj.Hijack()
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ // Don't forget to close the connection:
+ defer conn.Close()
+ bufrw.WriteString("Now we're speaking raw TCP. Say hi: ")
+ bufrw.Flush()
+ s, err := bufrw.ReadString('\n')
+ if err != nil {
+ log.Printf("error reading string: %v", err)
+ return
+ }
+ fmt.Fprintf(bufrw, "You said: %q\nBye.\n", s)
+ bufrw.Flush()
+})
+</pre> <h2 id="MaxBytesError">type <span>MaxBytesError</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>MaxBytesError is returned by <a href="#MaxBytesReader">MaxBytesReader</a> when its read limit is exceeded. </p>
+<pre data-language="go">type MaxBytesError struct {
+ Limit int64
+}
+</pre> <h3 id="MaxBytesError.Error">func (*MaxBytesError) <span>Error</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (e *MaxBytesError) Error() string</pre> <h2 id="ProtocolError">type <span>ProtocolError</span> </h2> <p>ProtocolError represents an HTTP protocol error. </p>
+<p>Deprecated: Not all errors in the http package related to protocol errors are of type ProtocolError. </p>
+<pre data-language="go">type ProtocolError struct {
+ ErrorString string
+}
+</pre> <h3 id="ProtocolError.Error">func (*ProtocolError) <span>Error</span> </h3> <pre data-language="go">func (pe *ProtocolError) Error() string</pre> <h3 id="ProtocolError.Is">func (*ProtocolError) <span>Is</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (pe *ProtocolError) Is(err error) bool</pre> <p>Is lets http.ErrNotSupported match errors.ErrUnsupported. </p>
+<h2 id="PushOptions">type <span>PushOptions</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>PushOptions describes options for [Pusher.Push]. </p>
+<pre data-language="go">type PushOptions struct {
+ // Method specifies the HTTP method for the promised request.
+ // If set, it must be "GET" or "HEAD". Empty means "GET".
+ Method string
+
+ // Header specifies additional promised request headers. This cannot
+ // include HTTP/2 pseudo header fields like ":path" and ":scheme",
+ // which will be added automatically.
+ Header Header
+}
+</pre> <h2 id="Pusher">type <span>Pusher</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>Pusher is the interface implemented by ResponseWriters that support HTTP/2 server push. For more background, see <a href="https://tools.ietf.org/html/rfc7540#section-8.2">https://tools.ietf.org/html/rfc7540#section-8.2</a>. </p>
+<pre data-language="go">type Pusher interface {
+ // Push initiates an HTTP/2 server push. This constructs a synthetic
+ // request using the given target and options, serializes that request
+ // into a PUSH_PROMISE frame, then dispatches that request using the
+ // server's request handler. If opts is nil, default options are used.
+ //
+ // The target must either be an absolute path (like "/path") or an absolute
+ // URL that contains a valid host and the same scheme as the parent request.
+ // If the target is a path, it will inherit the scheme and host of the
+ // parent request.
+ //
+ // The HTTP/2 spec disallows recursive pushes and cross-authority pushes.
+ // Push may or may not detect these invalid pushes; however, invalid
+ // pushes will be detected and canceled by conforming clients.
+ //
+ // Handlers that wish to push URL X should call Push before sending any
+ // data that may trigger a request for URL X. This avoids a race where the
+ // client issues requests for X before receiving the PUSH_PROMISE for X.
+ //
+ // Push will run in a separate goroutine making the order of arrival
+ // non-deterministic. Any required synchronization needs to be implemented
+ // by the caller.
+ //
+ // Push returns ErrNotSupported if the client has disabled push or if push
+ // is not supported on the underlying connection.
+ Push(target string, opts *PushOptions) error
+}</pre> <h2 id="Request">type <span>Request</span> </h2> <p>A Request represents an HTTP request received by a server or to be sent by a client. </p>
+<p>The field semantics differ slightly between client and server usage. In addition to the notes on the fields below, see the documentation for <a href="#Request.Write">Request.Write</a> and <a href="#RoundTripper">RoundTripper</a>. </p>
+<pre data-language="go">type Request struct {
+ // Method specifies the HTTP method (GET, POST, PUT, etc.).
+ // For client requests, an empty string means GET.
+ Method string
+
+ // URL specifies either the URI being requested (for server
+ // requests) or the URL to access (for client requests).
+ //
+ // For server requests, the URL is parsed from the URI
+ // supplied on the Request-Line as stored in RequestURI. For
+ // most requests, fields other than Path and RawQuery will be
+ // empty. (See RFC 7230, Section 5.3)
+ //
+ // For client requests, the URL's Host specifies the server to
+ // connect to, while the Request's Host field optionally
+ // specifies the Host header value to send in the HTTP
+ // request.
+ URL *url.URL
+
+ // The protocol version for incoming server requests.
+ //
+ // For client requests, these fields are ignored. The HTTP
+ // client code always uses either HTTP/1.1 or HTTP/2.
+ // See the docs on Transport for details.
+ Proto string // "HTTP/1.0"
+ ProtoMajor int // 1
+ ProtoMinor int // 0
+
+ // Header contains the request header fields either received
+ // by the server or to be sent by the client.
+ //
+ // If a server received a request with header lines,
+ //
+ // Host: example.com
+ // accept-encoding: gzip, deflate
+ // Accept-Language: en-us
+ // fOO: Bar
+ // foo: two
+ //
+ // then
+ //
+ // Header = map[string][]string{
+ // "Accept-Encoding": {"gzip, deflate"},
+ // "Accept-Language": {"en-us"},
+ // "Foo": {"Bar", "two"},
+ // }
+ //
+ // For incoming requests, the Host header is promoted to the
+ // Request.Host field and removed from the Header map.
+ //
+ // HTTP defines that header names are case-insensitive. The
+ // request parser implements this by using CanonicalHeaderKey,
+ // making the first character and any characters following a
+ // hyphen uppercase and the rest lowercase.
+ //
+ // For client requests, certain headers such as Content-Length
+ // and Connection are automatically written when needed and
+ // values in Header may be ignored. See the documentation
+ // for the Request.Write method.
+ Header Header
+
+ // Body is the request's body.
+ //
+ // For client requests, a nil body means the request has no
+ // body, such as a GET request. The HTTP Client's Transport
+ // is responsible for calling the Close method.
+ //
+ // For server requests, the Request Body is always non-nil
+ // but will return EOF immediately when no body is present.
+ // The Server will close the request body. The ServeHTTP
+ // Handler does not need to.
+ //
+ // Body must allow Read to be called concurrently with Close.
+ // In particular, calling Close should unblock a Read waiting
+ // for input.
+ Body io.ReadCloser
+
+ // GetBody defines an optional func to return a new copy of
+ // Body. It is used for client requests when a redirect requires
+ // reading the body more than once. Use of GetBody still
+ // requires setting Body.
+ //
+ // For server requests, it is unused.
+ GetBody func() (io.ReadCloser, error) // Go 1.8
+
+ // ContentLength records the length of the associated content.
+ // The value -1 indicates that the length is unknown.
+ // Values &gt;= 0 indicate that the given number of bytes may
+ // be read from Body.
+ //
+ // For client requests, a value of 0 with a non-nil Body is
+ // also treated as unknown.
+ ContentLength int64
+
+ // TransferEncoding lists the transfer encodings from outermost to
+ // innermost. An empty list denotes the "identity" encoding.
+ // TransferEncoding can usually be ignored; chunked encoding is
+ // automatically added and removed as necessary when sending and
+ // receiving requests.
+ TransferEncoding []string
+
+ // Close indicates whether to close the connection after
+ // replying to this request (for servers) or after sending this
+ // request and reading its response (for clients).
+ //
+ // For server requests, the HTTP server handles this automatically
+ // and this field is not needed by Handlers.
+ //
+ // For client requests, setting this field prevents re-use of
+ // TCP connections between requests to the same hosts, as if
+ // Transport.DisableKeepAlives were set.
+ Close bool
+
+ // For server requests, Host specifies the host on which the
+ // URL is sought. For HTTP/1 (per RFC 7230, section 5.4), this
+ // is either the value of the "Host" header or the host name
+ // given in the URL itself. For HTTP/2, it is the value of the
+ // ":authority" pseudo-header field.
+ // It may be of the form "host:port". For international domain
+ // names, Host may be in Punycode or Unicode form. Use
+ // golang.org/x/net/idna to convert it to either format if
+ // needed.
+ // To prevent DNS rebinding attacks, server Handlers should
+ // validate that the Host header has a value for which the
+ // Handler considers itself authoritative. The included
+ // ServeMux supports patterns registered to particular host
+ // names and thus protects its registered Handlers.
+ //
+ // For client requests, Host optionally overrides the Host
+ // header to send. If empty, the Request.Write method uses
+ // the value of URL.Host. Host may contain an international
+ // domain name.
+ Host string
+
+ // Form contains the parsed form data, including both the URL
+ // field's query parameters and the PATCH, POST, or PUT form data.
+ // This field is only available after ParseForm is called.
+ // The HTTP client ignores Form and uses Body instead.
+ Form url.Values
+
+ // PostForm contains the parsed form data from PATCH, POST
+ // or PUT body parameters.
+ //
+ // This field is only available after ParseForm is called.
+ // The HTTP client ignores PostForm and uses Body instead.
+ PostForm url.Values // Go 1.1
+
+ // MultipartForm is the parsed multipart form, including file uploads.
+ // This field is only available after ParseMultipartForm is called.
+ // The HTTP client ignores MultipartForm and uses Body instead.
+ MultipartForm *multipart.Form
+
+ // Trailer specifies additional headers that are sent after the request
+ // body.
+ //
+ // For server requests, the Trailer map initially contains only the
+ // trailer keys, with nil values. (The client declares which trailers it
+ // will later send.) While the handler is reading from Body, it must
+ // not reference Trailer. After reading from Body returns EOF, Trailer
+ // can be read again and will contain non-nil values, if they were sent
+ // by the client.
+ //
+ // For client requests, Trailer must be initialized to a map containing
+ // the trailer keys to later send. The values may be nil or their final
+ // values. The ContentLength must be 0 or -1, to send a chunked request.
+ // After the HTTP request is sent the map values can be updated while
+ // the request body is read. Once the body returns EOF, the caller must
+ // not mutate Trailer.
+ //
+ // Few HTTP clients, servers, or proxies support HTTP trailers.
+ Trailer Header
+
+ // RemoteAddr allows HTTP servers and other software to record
+ // the network address that sent the request, usually for
+ // logging. This field is not filled in by ReadRequest and
+ // has no defined format. The HTTP server in this package
+ // sets RemoteAddr to an "IP:port" address before invoking a
+ // handler.
+ // This field is ignored by the HTTP client.
+ RemoteAddr string
+
+ // RequestURI is the unmodified request-target of the
+ // Request-Line (RFC 7230, Section 3.1.1) as sent by the client
+ // to a server. Usually the URL field should be used instead.
+ // It is an error to set this field in an HTTP client request.
+ RequestURI string
+
+ // TLS allows HTTP servers and other software to record
+ // information about the TLS connection on which the request
+ // was received. This field is not filled in by ReadRequest.
+ // The HTTP server in this package sets the field for
+ // TLS-enabled connections before invoking a handler;
+ // otherwise it leaves the field nil.
+ // This field is ignored by the HTTP client.
+ TLS *tls.ConnectionState
+
+ // Cancel is an optional channel whose closure indicates that the client
+ // request should be regarded as canceled. Not all implementations of
+ // RoundTripper may support Cancel.
+ //
+ // For server requests, this field is not applicable.
+ //
+ // Deprecated: Set the Request's context with NewRequestWithContext
+ // instead. If a Request's Cancel field and context are both
+ // set, it is undefined whether Cancel is respected.
+ Cancel &lt;-chan struct{} // Go 1.5
+
+ // Response is the redirect response which caused this request
+ // to be created. This field is only populated during client
+ // redirects.
+ Response *Response // Go 1.7
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewRequest">func <span>NewRequest</span> </h3> <pre data-language="go">func NewRequest(method, url string, body io.Reader) (*Request, error)</pre> <p>NewRequest wraps <a href="#NewRequestWithContext">NewRequestWithContext</a> using <span>context.Background</span>. </p>
+<h3 id="NewRequestWithContext">func <span>NewRequestWithContext</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func NewRequestWithContext(ctx context.Context, method, url string, body io.Reader) (*Request, error)</pre> <p>NewRequestWithContext returns a new <a href="#Request">Request</a> given a method, URL, and optional body. </p>
+<p>If the provided body is also an <span>io.Closer</span>, the returned [Request.Body] is set to body and will be closed (possibly asynchronously) by the Client methods Do, Post, and PostForm, and <a href="#Transport.RoundTrip">Transport.RoundTrip</a>. </p>
+<p>NewRequestWithContext returns a Request suitable for use with <a href="#Client.Do">Client.Do</a> or <a href="#Transport.RoundTrip">Transport.RoundTrip</a>. To create a request for use with testing a Server Handler, either use the <a href="#NewRequest">NewRequest</a> function in the net/http/httptest package, use <a href="#ReadRequest">ReadRequest</a>, or manually update the Request fields. For an outgoing client request, the context controls the entire lifetime of a request and its response: obtaining a connection, sending the request, and reading the response headers and body. See the Request type's documentation for the difference between inbound and outbound request fields. </p>
+<p>If body is of type <span>*bytes.Buffer</span>, <span>*bytes.Reader</span>, or <span>*strings.Reader</span>, the returned request's ContentLength is set to its exact value (instead of -1), GetBody is populated (so 307 and 308 redirects can replay the body), and Body is set to <a href="#NoBody">NoBody</a> if the ContentLength is 0. </p>
+<h3 id="ReadRequest">func <span>ReadRequest</span> </h3> <pre data-language="go">func ReadRequest(b *bufio.Reader) (*Request, error)</pre> <p>ReadRequest reads and parses an incoming request from b. </p>
+<p>ReadRequest is a low-level function and should only be used for specialized applications; most code should use the <a href="#Server">Server</a> to read requests and handle them via the <a href="#Handler">Handler</a> interface. ReadRequest only supports HTTP/1.x requests. For HTTP/2, use golang.org/x/net/http2. </p>
+<h3 id="Request.AddCookie">func (*Request) <span>AddCookie</span> </h3> <pre data-language="go">func (r *Request) AddCookie(c *Cookie)</pre> <p>AddCookie adds a cookie to the request. Per RFC 6265 section 5.4, AddCookie does not attach more than one <a href="#Cookie">Cookie</a> header field. That means all cookies, if any, are written into the same line, separated by semicolon. AddCookie only sanitizes c's name and value, and does not sanitize a Cookie header already present in the request. </p>
+<h3 id="Request.BasicAuth">func (*Request) <span>BasicAuth</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (r *Request) BasicAuth() (username, password string, ok bool)</pre> <p>BasicAuth returns the username and password provided in the request's Authorization header, if the request uses HTTP Basic Authentication. See RFC 2617, Section 2. </p>
+<h3 id="Request.Clone">func (*Request) <span>Clone</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (r *Request) Clone(ctx context.Context) *Request</pre> <p>Clone returns a deep copy of r with its context changed to ctx. The provided ctx must be non-nil. </p>
+<p>For an outgoing client request, the context controls the entire lifetime of a request and its response: obtaining a connection, sending the request, and reading the response headers and body. </p>
+<h3 id="Request.Context">func (*Request) <span>Context</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (r *Request) Context() context.Context</pre> <p>Context returns the request's context. To change the context, use <a href="#Request.Clone">Request.Clone</a> or <a href="#Request.WithContext">Request.WithContext</a>. </p>
+<p>The returned context is always non-nil; it defaults to the background context. </p>
+<p>For outgoing client requests, the context controls cancellation. </p>
+<p>For incoming server requests, the context is canceled when the client's connection closes, the request is canceled (with HTTP/2), or when the ServeHTTP method returns. </p>
+<h3 id="Request.Cookie">func (*Request) <span>Cookie</span> </h3> <pre data-language="go">func (r *Request) Cookie(name string) (*Cookie, error)</pre> <p>Cookie returns the named cookie provided in the request or <a href="#ErrNoCookie">ErrNoCookie</a> if not found. If multiple cookies match the given name, only one cookie will be returned. </p>
+<h3 id="Request.Cookies">func (*Request) <span>Cookies</span> </h3> <pre data-language="go">func (r *Request) Cookies() []*Cookie</pre> <p>Cookies parses and returns the HTTP cookies sent with the request. </p>
+<h3 id="Request.FormFile">func (*Request) <span>FormFile</span> </h3> <pre data-language="go">func (r *Request) FormFile(key string) (multipart.File, *multipart.FileHeader, error)</pre> <p>FormFile returns the first file for the provided form key. FormFile calls <a href="#Request.ParseMultipartForm">Request.ParseMultipartForm</a> and <a href="#Request.ParseForm">Request.ParseForm</a> if necessary. </p>
+<h3 id="Request.FormValue">func (*Request) <span>FormValue</span> </h3> <pre data-language="go">func (r *Request) FormValue(key string) string</pre> <p>FormValue returns the first value for the named component of the query. The precedence order: </p>
+<ol> <li>application/x-www-form-urlencoded form body (POST, PUT, PATCH only) </li>
+<li>query parameters (always) </li>
+<li>multipart/form-data form body (always) </li>
+</ol> <p>FormValue calls <a href="#Request.ParseMultipartForm">Request.ParseMultipartForm</a> and <a href="#Request.ParseForm">Request.ParseForm</a> if necessary and ignores any errors returned by these functions. If key is not present, FormValue returns the empty string. To access multiple values of the same key, call ParseForm and then inspect [Request.Form] directly. </p>
+<h3 id="Request.MultipartReader">func (*Request) <span>MultipartReader</span> </h3> <pre data-language="go">func (r *Request) MultipartReader() (*multipart.Reader, error)</pre> <p>MultipartReader returns a MIME multipart reader if this is a multipart/form-data or a multipart/mixed POST request, else returns nil and an error. Use this function instead of <a href="#Request.ParseMultipartForm">Request.ParseMultipartForm</a> to process the request body as a stream. </p>
+<h3 id="Request.ParseForm">func (*Request) <span>ParseForm</span> </h3> <pre data-language="go">func (r *Request) ParseForm() error</pre> <p>ParseForm populates r.Form and r.PostForm. </p>
+<p>For all requests, ParseForm parses the raw query from the URL and updates r.Form. </p>
+<p>For POST, PUT, and PATCH requests, it also reads the request body, parses it as a form and puts the results into both r.PostForm and r.Form. Request body parameters take precedence over URL query string values in r.Form. </p>
+<p>If the request Body's size has not already been limited by <a href="#MaxBytesReader">MaxBytesReader</a>, the size is capped at 10MB. </p>
+<p>For other HTTP methods, or when the Content-Type is not application/x-www-form-urlencoded, the request Body is not read, and r.PostForm is initialized to a non-nil, empty value. </p>
+<p><a href="#Request.ParseMultipartForm">Request.ParseMultipartForm</a> calls ParseForm automatically. ParseForm is idempotent. </p>
+<h3 id="Request.ParseMultipartForm">func (*Request) <span>ParseMultipartForm</span> </h3> <pre data-language="go">func (r *Request) ParseMultipartForm(maxMemory int64) error</pre> <p>ParseMultipartForm parses a request body as multipart/form-data. The whole request body is parsed and up to a total of maxMemory bytes of its file parts are stored in memory, with the remainder stored on disk in temporary files. ParseMultipartForm calls <a href="#Request.ParseForm">Request.ParseForm</a> if necessary. If ParseForm returns an error, ParseMultipartForm returns it but also continues parsing the request body. After one call to ParseMultipartForm, subsequent calls have no effect. </p>
+<h3 id="Request.PathValue">func (*Request) <span>PathValue</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Request) PathValue(name string) string</pre> <p>PathValue returns the value for the named path wildcard in the <a href="#ServeMux">ServeMux</a> pattern that matched the request. It returns the empty string if the request was not matched against a pattern or there is no such wildcard in the pattern. </p>
+<h3 id="Request.PostFormValue">func (*Request) <span>PostFormValue</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (r *Request) PostFormValue(key string) string</pre> <p>PostFormValue returns the first value for the named component of the POST, PUT, or PATCH request body. URL query parameters are ignored. PostFormValue calls <a href="#Request.ParseMultipartForm">Request.ParseMultipartForm</a> and <a href="#Request.ParseForm">Request.ParseForm</a> if necessary and ignores any errors returned by these functions. If key is not present, PostFormValue returns the empty string. </p>
+<h3 id="Request.ProtoAtLeast">func (*Request) <span>ProtoAtLeast</span> </h3> <pre data-language="go">func (r *Request) ProtoAtLeast(major, minor int) bool</pre> <p>ProtoAtLeast reports whether the HTTP protocol used in the request is at least major.minor. </p>
+<h3 id="Request.Referer">func (*Request) <span>Referer</span> </h3> <pre data-language="go">func (r *Request) Referer() string</pre> <p>Referer returns the referring URL, if sent in the request. </p>
+<p>Referer is misspelled as in the request itself, a mistake from the earliest days of HTTP. This value can also be fetched from the <a href="#Header">Header</a> map as Header["Referer"]; the benefit of making it available as a method is that the compiler can diagnose programs that use the alternate (correct English) spelling req.Referrer() but cannot diagnose programs that use Header["Referrer"]. </p>
+<h3 id="Request.SetBasicAuth">func (*Request) <span>SetBasicAuth</span> </h3> <pre data-language="go">func (r *Request) SetBasicAuth(username, password string)</pre> <p>SetBasicAuth sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password. </p>
+<p>With HTTP Basic Authentication the provided username and password are not encrypted. It should generally only be used in an HTTPS request. </p>
+<p>The username may not contain a colon. Some protocols may impose additional requirements on pre-escaping the username and password. For instance, when used with OAuth2, both arguments must be URL encoded first with <span>url.QueryEscape</span>. </p>
+<h3 id="Request.SetPathValue">func (*Request) <span>SetPathValue</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (r *Request) SetPathValue(name, value string)</pre> <p>SetPathValue sets name to value, so that subsequent calls to r.PathValue(name) return value. </p>
+<h3 id="Request.UserAgent">func (*Request) <span>UserAgent</span> </h3> <pre data-language="go">func (r *Request) UserAgent() string</pre> <p>UserAgent returns the client's User-Agent, if sent in the request. </p>
+<h3 id="Request.WithContext">func (*Request) <span>WithContext</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (r *Request) WithContext(ctx context.Context) *Request</pre> <p>WithContext returns a shallow copy of r with its context changed to ctx. The provided ctx must be non-nil. </p>
+<p>For outgoing client request, the context controls the entire lifetime of a request and its response: obtaining a connection, sending the request, and reading the response headers and body. </p>
+<p>To create a new request with a context, use <a href="#NewRequestWithContext">NewRequestWithContext</a>. To make a deep copy of a request with a new context, use <a href="#Request.Clone">Request.Clone</a>. </p>
+<h3 id="Request.Write">func (*Request) <span>Write</span> </h3> <pre data-language="go">func (r *Request) Write(w io.Writer) error</pre> <p>Write writes an HTTP/1.1 request, which is the header and body, in wire format. This method consults the following fields of the request: </p>
+<pre data-language="go">Host
+URL
+Method (defaults to "GET")
+Header
+ContentLength
+TransferEncoding
+Body
+</pre> <p>If Body is present, Content-Length is &lt;= 0 and [Request.TransferEncoding] hasn't been set to "identity", Write adds "Transfer-Encoding: chunked" to the header. Body is closed after it is sent. </p>
+<h3 id="Request.WriteProxy">func (*Request) <span>WriteProxy</span> </h3> <pre data-language="go">func (r *Request) WriteProxy(w io.Writer) error</pre> <p>WriteProxy is like <a href="#Request.Write">Request.Write</a> but writes the request in the form expected by an HTTP proxy. In particular, <a href="#Request.WriteProxy">Request.WriteProxy</a> writes the initial Request-URI line of the request with an absolute URI, per section 5.3 of RFC 7230, including the scheme and host. In either case, WriteProxy also writes a Host header, using either r.Host or r.URL.Host. </p>
+<h2 id="Response">type <span>Response</span> </h2> <p>Response represents the response from an HTTP request. </p>
+<p>The <a href="#Client">Client</a> and <a href="#Transport">Transport</a> return Responses from servers once the response headers have been received. The response body is streamed on demand as the Body field is read. </p>
+<pre data-language="go">type Response struct {
+ Status string // e.g. "200 OK"
+ StatusCode int // e.g. 200
+ Proto string // e.g. "HTTP/1.0"
+ ProtoMajor int // e.g. 1
+ ProtoMinor int // e.g. 0
+
+ // Header maps header keys to values. If the response had multiple
+ // headers with the same key, they may be concatenated, with comma
+ // delimiters. (RFC 7230, section 3.2.2 requires that multiple headers
+ // be semantically equivalent to a comma-delimited sequence.) When
+ // Header values are duplicated by other fields in this struct (e.g.,
+ // ContentLength, TransferEncoding, Trailer), the field values are
+ // authoritative.
+ //
+ // Keys in the map are canonicalized (see CanonicalHeaderKey).
+ Header Header
+
+ // Body represents the response body.
+ //
+ // The response body is streamed on demand as the Body field
+ // is read. If the network connection fails or the server
+ // terminates the response, Body.Read calls return an error.
+ //
+ // The http Client and Transport guarantee that Body is always
+ // non-nil, even on responses without a body or responses with
+ // a zero-length body. It is the caller's responsibility to
+ // close Body. The default HTTP client's Transport may not
+ // reuse HTTP/1.x "keep-alive" TCP connections if the Body is
+ // not read to completion and closed.
+ //
+ // The Body is automatically dechunked if the server replied
+ // with a "chunked" Transfer-Encoding.
+ //
+ // As of Go 1.12, the Body will also implement io.Writer
+ // on a successful "101 Switching Protocols" response,
+ // as used by WebSockets and HTTP/2's "h2c" mode.
+ Body io.ReadCloser
+
+ // ContentLength records the length of the associated content. The
+ // value -1 indicates that the length is unknown. Unless Request.Method
+ // is "HEAD", values &gt;= 0 indicate that the given number of bytes may
+ // be read from Body.
+ ContentLength int64
+
+ // Contains transfer encodings from outer-most to inner-most. Value is
+ // nil, means that "identity" encoding is used.
+ TransferEncoding []string
+
+ // Close records whether the header directed that the connection be
+ // closed after reading Body. The value is advice for clients: neither
+ // ReadResponse nor Response.Write ever closes a connection.
+ Close bool
+
+ // Uncompressed reports whether the response was sent compressed but
+ // was decompressed by the http package. When true, reading from
+ // Body yields the uncompressed content instead of the compressed
+ // content actually set from the server, ContentLength is set to -1,
+ // and the "Content-Length" and "Content-Encoding" fields are deleted
+ // from the responseHeader. To get the original response from
+ // the server, set Transport.DisableCompression to true.
+ Uncompressed bool // Go 1.7
+
+ // Trailer maps trailer keys to values in the same
+ // format as Header.
+ //
+ // The Trailer initially contains only nil values, one for
+ // each key specified in the server's "Trailer" header
+ // value. Those values are not added to Header.
+ //
+ // Trailer must not be accessed concurrently with Read calls
+ // on the Body.
+ //
+ // After Body.Read has returned io.EOF, Trailer will contain
+ // any trailer values sent by the server.
+ Trailer Header
+
+ // Request is the request that was sent to obtain this Response.
+ // Request's Body is nil (having already been consumed).
+ // This is only populated for Client requests.
+ Request *Request
+
+ // TLS contains information about the TLS connection on which the
+ // response was received. It is nil for unencrypted responses.
+ // The pointer is shared between responses and should not be
+ // modified.
+ TLS *tls.ConnectionState // Go 1.3
+}
+</pre> <h3 id="Get">func <span>Get</span> </h3> <pre data-language="go">func Get(url string) (resp *Response, err error)</pre> <p>Get issues a GET to the specified URL. If the response is one of the following redirect codes, Get follows the redirect, up to a maximum of 10 redirects: </p>
+<pre data-language="go">301 (Moved Permanently)
+302 (Found)
+303 (See Other)
+307 (Temporary Redirect)
+308 (Permanent Redirect)
+</pre> <p>An error is returned if there were too many redirects or if there was an HTTP protocol error. A non-2xx response doesn't cause an error. Any returned error will be of type <span>*url.Error</span>. The url.Error value's Timeout method will report true if the request timed out. </p>
+<p>When err is nil, resp always contains a non-nil resp.Body. Caller should close resp.Body when done reading from it. </p>
+<p>Get is a wrapper around DefaultClient.Get. </p>
+<p>To make a request with custom headers, use <a href="#NewRequest">NewRequest</a> and DefaultClient.Do. </p>
+<p>To make a request with a specified context.Context, use <a href="#NewRequestWithContext">NewRequestWithContext</a> and DefaultClient.Do. </p> <h4 id="example_Get"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+res, err := http.Get("http://www.google.com/robots.txt")
+if err != nil {
+ log.Fatal(err)
+}
+body, err := io.ReadAll(res.Body)
+res.Body.Close()
+if res.StatusCode &gt; 299 {
+ log.Fatalf("Response failed with status code: %d and\nbody: %s\n", res.StatusCode, body)
+}
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s", body)
+</pre> <h3 id="Head">func <span>Head</span> </h3> <pre data-language="go">func Head(url string) (resp *Response, err error)</pre> <p>Head issues a HEAD to the specified URL. If the response is one of the following redirect codes, Head follows the redirect, up to a maximum of 10 redirects: </p>
+<pre data-language="go">301 (Moved Permanently)
+302 (Found)
+303 (See Other)
+307 (Temporary Redirect)
+308 (Permanent Redirect)
+</pre> <p>Head is a wrapper around DefaultClient.Head. </p>
+<p>To make a request with a specified <span>context.Context</span>, use <a href="#NewRequestWithContext">NewRequestWithContext</a> and DefaultClient.Do. </p>
+<h3 id="Post">func <span>Post</span> </h3> <pre data-language="go">func Post(url, contentType string, body io.Reader) (resp *Response, err error)</pre> <p>Post issues a POST to the specified URL. </p>
+<p>Caller should close resp.Body when done reading from it. </p>
+<p>If the provided body is an <span>io.Closer</span>, it is closed after the request. </p>
+<p>Post is a wrapper around DefaultClient.Post. </p>
+<p>To set custom headers, use <a href="#NewRequest">NewRequest</a> and DefaultClient.Do. </p>
+<p>See the <a href="#Client.Do">Client.Do</a> method documentation for details on how redirects are handled. </p>
+<p>To make a request with a specified context.Context, use <a href="#NewRequestWithContext">NewRequestWithContext</a> and DefaultClient.Do. </p>
+<h3 id="PostForm">func <span>PostForm</span> </h3> <pre data-language="go">func PostForm(url string, data url.Values) (resp *Response, err error)</pre> <p>PostForm issues a POST to the specified URL, with data's keys and values URL-encoded as the request body. </p>
+<p>The Content-Type header is set to application/x-www-form-urlencoded. To set other headers, use <a href="#NewRequest">NewRequest</a> and DefaultClient.Do. </p>
+<p>When err is nil, resp always contains a non-nil resp.Body. Caller should close resp.Body when done reading from it. </p>
+<p>PostForm is a wrapper around DefaultClient.PostForm. </p>
+<p>See the <a href="#Client.Do">Client.Do</a> method documentation for details on how redirects are handled. </p>
+<p>To make a request with a specified <span>context.Context</span>, use <a href="#NewRequestWithContext">NewRequestWithContext</a> and DefaultClient.Do. </p>
+<h3 id="ReadResponse">func <span>ReadResponse</span> </h3> <pre data-language="go">func ReadResponse(r *bufio.Reader, req *Request) (*Response, error)</pre> <p>ReadResponse reads and returns an HTTP response from r. The req parameter optionally specifies the <a href="#Request">Request</a> that corresponds to this <a href="#Response">Response</a>. If nil, a GET request is assumed. Clients must call resp.Body.Close when finished reading resp.Body. After that call, clients can inspect resp.Trailer to find key/value pairs included in the response trailer. </p>
+<h3 id="Response.Cookies">func (*Response) <span>Cookies</span> </h3> <pre data-language="go">func (r *Response) Cookies() []*Cookie</pre> <p>Cookies parses and returns the cookies set in the Set-Cookie headers. </p>
+<h3 id="Response.Location">func (*Response) <span>Location</span> </h3> <pre data-language="go">func (r *Response) Location() (*url.URL, error)</pre> <p>Location returns the URL of the response's "Location" header, if present. Relative redirects are resolved relative to [Response.Request]. <a href="#ErrNoLocation">ErrNoLocation</a> is returned if no Location header is present. </p>
+<h3 id="Response.ProtoAtLeast">func (*Response) <span>ProtoAtLeast</span> </h3> <pre data-language="go">func (r *Response) ProtoAtLeast(major, minor int) bool</pre> <p>ProtoAtLeast reports whether the HTTP protocol used in the response is at least major.minor. </p>
+<h3 id="Response.Write">func (*Response) <span>Write</span> </h3> <pre data-language="go">func (r *Response) Write(w io.Writer) error</pre> <p>Write writes r to w in the HTTP/1.x server response format, including the status line, headers, body, and optional trailer. </p>
+<p>This method consults the following fields of the response r: </p>
+<pre data-language="go">StatusCode
+ProtoMajor
+ProtoMinor
+Request.Method
+TransferEncoding
+Trailer
+Body
+ContentLength
+Header, values for non-canonical keys will have unpredictable behavior
+</pre> <p>The Response Body is closed after it is sent. </p>
+<h2 id="ResponseController">type <span>ResponseController</span> <span title="Added in Go 1.20">1.20</span> </h2> <p>A ResponseController is used by an HTTP handler to control the response. </p>
+<p>A ResponseController may not be used after the [Handler.ServeHTTP] method has returned. </p>
+<pre data-language="go">type ResponseController struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewResponseController">func <span>NewResponseController</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func NewResponseController(rw ResponseWriter) *ResponseController</pre> <p>NewResponseController creates a <a href="#ResponseController">ResponseController</a> for a request. </p>
+<p>The ResponseWriter should be the original value passed to the [Handler.ServeHTTP] method, or have an Unwrap method returning the original ResponseWriter. </p>
+<p>If the ResponseWriter implements any of the following methods, the ResponseController will call them as appropriate: </p>
+<pre data-language="go">Flush()
+FlushError() error // alternative Flush returning an error
+Hijack() (net.Conn, *bufio.ReadWriter, error)
+SetReadDeadline(deadline time.Time) error
+SetWriteDeadline(deadline time.Time) error
+EnableFullDuplex() error
+</pre> <p>If the ResponseWriter does not support a method, ResponseController returns an error matching <a href="#ErrNotSupported">ErrNotSupported</a>. </p>
+<h3 id="ResponseController.EnableFullDuplex">func (*ResponseController) <span>EnableFullDuplex</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (c *ResponseController) EnableFullDuplex() error</pre> <p>EnableFullDuplex indicates that the request handler will interleave reads from [Request.Body] with writes to the <a href="#ResponseWriter">ResponseWriter</a>. </p>
+<p>For HTTP/1 requests, the Go HTTP server by default consumes any unread portion of the request body before beginning to write the response, preventing handlers from concurrently reading from the request and writing the response. Calling EnableFullDuplex disables this behavior and permits handlers to continue to read from the request while concurrently writing the response. </p>
+<p>For HTTP/2 requests, the Go HTTP server always permits concurrent reads and responses. </p>
+<h3 id="ResponseController.Flush">func (*ResponseController) <span>Flush</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (c *ResponseController) Flush() error</pre> <p>Flush flushes buffered data to the client. </p>
+<h3 id="ResponseController.Hijack">func (*ResponseController) <span>Hijack</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (c *ResponseController) Hijack() (net.Conn, *bufio.ReadWriter, error)</pre> <p>Hijack lets the caller take over the connection. See the Hijacker interface for details. </p>
+<h3 id="ResponseController.SetReadDeadline">func (*ResponseController) <span>SetReadDeadline</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (c *ResponseController) SetReadDeadline(deadline time.Time) error</pre> <p>SetReadDeadline sets the deadline for reading the entire request, including the body. Reads from the request body after the deadline has been exceeded will return an error. A zero value means no deadline. </p>
+<p>Setting the read deadline after it has been exceeded will not extend it. </p>
+<h3 id="ResponseController.SetWriteDeadline">func (*ResponseController) <span>SetWriteDeadline</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (c *ResponseController) SetWriteDeadline(deadline time.Time) error</pre> <p>SetWriteDeadline sets the deadline for writing the response. Writes to the response body after the deadline has been exceeded will not block, but may succeed if the data has been buffered. A zero value means no deadline. </p>
+<p>Setting the write deadline after it has been exceeded will not extend it. </p>
+<h2 id="ResponseWriter">type <span>ResponseWriter</span> </h2> <p>A ResponseWriter interface is used by an HTTP handler to construct an HTTP response. </p>
+<p>A ResponseWriter may not be used after [Handler.ServeHTTP] has returned. </p>
+<pre data-language="go">type ResponseWriter interface {
+ // Header returns the header map that will be sent by
+ // [ResponseWriter.WriteHeader]. The [Header] map also is the mechanism with which
+ // [Handler] implementations can set HTTP trailers.
+ //
+ // Changing the header map after a call to [ResponseWriter.WriteHeader] (or
+ // [ResponseWriter.Write]) has no effect unless the HTTP status code was of the
+ // 1xx class or the modified headers are trailers.
+ //
+ // There are two ways to set Trailers. The preferred way is to
+ // predeclare in the headers which trailers you will later
+ // send by setting the "Trailer" header to the names of the
+ // trailer keys which will come later. In this case, those
+ // keys of the Header map are treated as if they were
+ // trailers. See the example. The second way, for trailer
+ // keys not known to the [Handler] until after the first [ResponseWriter.Write],
+ // is to prefix the [Header] map keys with the [TrailerPrefix]
+ // constant value.
+ //
+ // To suppress automatic response headers (such as "Date"), set
+ // their value to nil.
+ Header() Header
+
+ // Write writes the data to the connection as part of an HTTP reply.
+ //
+ // If [ResponseWriter.WriteHeader] has not yet been called, Write calls
+ // WriteHeader(http.StatusOK) before writing the data. If the Header
+ // does not contain a Content-Type line, Write adds a Content-Type set
+ // to the result of passing the initial 512 bytes of written data to
+ // [DetectContentType]. Additionally, if the total size of all written
+ // data is under a few KB and there are no Flush calls, the
+ // Content-Length header is added automatically.
+ //
+ // Depending on the HTTP protocol version and the client, calling
+ // Write or WriteHeader may prevent future reads on the
+ // Request.Body. For HTTP/1.x requests, handlers should read any
+ // needed request body data before writing the response. Once the
+ // headers have been flushed (due to either an explicit Flusher.Flush
+ // call or writing enough data to trigger a flush), the request body
+ // may be unavailable. For HTTP/2 requests, the Go HTTP server permits
+ // handlers to continue to read the request body while concurrently
+ // writing the response. However, such behavior may not be supported
+ // by all HTTP/2 clients. Handlers should read before writing if
+ // possible to maximize compatibility.
+ Write([]byte) (int, error)
+
+ // WriteHeader sends an HTTP response header with the provided
+ // status code.
+ //
+ // If WriteHeader is not called explicitly, the first call to Write
+ // will trigger an implicit WriteHeader(http.StatusOK).
+ // Thus explicit calls to WriteHeader are mainly used to
+ // send error codes or 1xx informational responses.
+ //
+ // The provided code must be a valid HTTP 1xx-5xx status code.
+ // Any number of 1xx headers may be written, followed by at most
+ // one 2xx-5xx header. 1xx headers are sent immediately, but 2xx-5xx
+ // headers may be buffered. Use the Flusher interface to send
+ // buffered data. The header map is cleared when 2xx-5xx headers are
+ // sent, but not with 1xx headers.
+ //
+ // The server will automatically send a 100 (Continue) header
+ // on the first read from the request body if the request has
+ // an "Expect: 100-continue" header.
+ WriteHeader(statusCode int)
+}</pre> <h4 id="example_ResponseWriter_trailers"> <span class="text">Example (Trailers)</span>
+</h4> <p>HTTP Trailers are a set of key/value pairs like headers that come after the HTTP response, instead of before. </p> <p>Code:</p> <pre class="code" data-language="go">
+mux := http.NewServeMux()
+mux.HandleFunc("/sendstrailers", func(w http.ResponseWriter, req *http.Request) {
+ // Before any call to WriteHeader or Write, declare
+ // the trailers you will set during the HTTP
+ // response. These three headers are actually sent in
+ // the trailer.
+ w.Header().Set("Trailer", "AtEnd1, AtEnd2")
+ w.Header().Add("Trailer", "AtEnd3")
+
+ w.Header().Set("Content-Type", "text/plain; charset=utf-8") // normal header
+ w.WriteHeader(http.StatusOK)
+
+ w.Header().Set("AtEnd1", "value 1")
+ io.WriteString(w, "This HTTP response has both headers before this text and trailers at the end.\n")
+ w.Header().Set("AtEnd2", "value 2")
+ w.Header().Set("AtEnd3", "value 3") // These will appear as trailers.
+})
+</pre> <h2 id="RoundTripper">type <span>RoundTripper</span> </h2> <p>RoundTripper is an interface representing the ability to execute a single HTTP transaction, obtaining the <a href="#Response">Response</a> for a given <a href="#Request">Request</a>. </p>
+<p>A RoundTripper must be safe for concurrent use by multiple goroutines. </p>
+<pre data-language="go">type RoundTripper interface {
+ // RoundTrip executes a single HTTP transaction, returning
+ // a Response for the provided Request.
+ //
+ // RoundTrip should not attempt to interpret the response. In
+ // particular, RoundTrip must return err == nil if it obtained
+ // a response, regardless of the response's HTTP status code.
+ // A non-nil err should be reserved for failure to obtain a
+ // response. Similarly, RoundTrip should not attempt to
+ // handle higher-level protocol details such as redirects,
+ // authentication, or cookies.
+ //
+ // RoundTrip should not modify the request, except for
+ // consuming and closing the Request's Body. RoundTrip may
+ // read fields of the request in a separate goroutine. Callers
+ // should not mutate or reuse the request until the Response's
+ // Body has been closed.
+ //
+ // RoundTrip must always close the body, including on errors,
+ // but depending on the implementation may do so in a separate
+ // goroutine even after RoundTrip returns. This means that
+ // callers wanting to reuse the body for subsequent requests
+ // must arrange to wait for the Close call before doing so.
+ //
+ // The Request's URL and Header fields must be initialized.
+ RoundTrip(*Request) (*Response, error)
+}</pre> <p>DefaultTransport is the default implementation of <a href="#Transport">Transport</a> and is used by <a href="#DefaultClient">DefaultClient</a>. It establishes network connections as needed and caches them for reuse by subsequent calls. It uses HTTP proxies as directed by the environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions thereof). </p>
+<pre data-language="go">var DefaultTransport RoundTripper = &amp;Transport{
+ Proxy: ProxyFromEnvironment,
+ DialContext: defaultTransportDialContext(&amp;net.Dialer{
+ Timeout: 30 * time.Second,
+ KeepAlive: 30 * time.Second,
+ }),
+ ForceAttemptHTTP2: true,
+ MaxIdleConns: 100,
+ IdleConnTimeout: 90 * time.Second,
+ TLSHandshakeTimeout: 10 * time.Second,
+ ExpectContinueTimeout: 1 * time.Second,
+}</pre> <h3 id="NewFileTransport">func <span>NewFileTransport</span> </h3> <pre data-language="go">func NewFileTransport(fs FileSystem) RoundTripper</pre> <p>NewFileTransport returns a new <a href="#RoundTripper">RoundTripper</a>, serving the provided <a href="#FileSystem">FileSystem</a>. The returned RoundTripper ignores the URL host in its incoming requests, as well as most other properties of the request. </p>
+<p>The typical use case for NewFileTransport is to register the "file" protocol with a <a href="#Transport">Transport</a>, as in: </p>
+<pre data-language="go">t := &amp;http.Transport{}
+t.RegisterProtocol("file", http.NewFileTransport(http.Dir("/")))
+c := &amp;http.Client{Transport: t}
+res, err := c.Get("file:///etc/passwd")
+...
+</pre> <h3 id="NewFileTransportFS">func <span>NewFileTransportFS</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func NewFileTransportFS(fsys fs.FS) RoundTripper</pre> <p>NewFileTransportFS returns a new <a href="#RoundTripper">RoundTripper</a>, serving the provided file system fsys. The returned RoundTripper ignores the URL host in its incoming requests, as well as most other properties of the request. </p>
+<p>The typical use case for NewFileTransportFS is to register the "file" protocol with a <a href="#Transport">Transport</a>, as in: </p>
+<pre data-language="go">fsys := os.DirFS("/")
+t := &amp;http.Transport{}
+t.RegisterProtocol("file", http.NewFileTransportFS(fsys))
+c := &amp;http.Client{Transport: t}
+res, err := c.Get("file:///etc/passwd")
+...
+</pre> <h2 id="SameSite">type <span>SameSite</span> <span title="Added in Go 1.11">1.11</span> </h2> <p>SameSite allows a server to define a cookie attribute making it impossible for the browser to send this cookie along with cross-site requests. The main goal is to mitigate the risk of cross-origin information leakage, and provide some protection against cross-site request forgery attacks. </p>
+<p>See <a href="https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00">https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00</a> for details. </p>
+<pre data-language="go">type SameSite int</pre> <pre data-language="go">const (
+ SameSiteDefaultMode SameSite = iota + 1
+ SameSiteLaxMode
+ SameSiteStrictMode
+ SameSiteNoneMode
+)</pre> <h2 id="ServeMux">type <span>ServeMux</span> </h2> <p>ServeMux is an HTTP request multiplexer. It matches the URL of each incoming request against a list of registered patterns and calls the handler for the pattern that most closely matches the URL. </p>
+<h3 id="hdr-Patterns">Patterns</h3> <p>Patterns can match the method, host and path of a request. Some examples: </p>
+<ul> <li>"/index.html" matches the path "/index.html" for any host and method. </li>
+<li>"GET /static/" matches a GET request whose path begins with "/static/". </li>
+<li>"example.com/" matches any request to the host "example.com". </li>
+<li>"example.com/{$}" matches requests with host "example.com" and path "/". </li>
+<li>"/b/{bucket}/o/{objectname...}" matches paths whose first segment is "b" and whose third segment is "o". The name "bucket" denotes the second segment and "objectname" denotes the remainder of the path. </li>
+</ul> <p>In general, a pattern looks like </p>
+<pre data-language="go">[METHOD ][HOST]/[PATH]
+</pre> <p>All three parts are optional; "/" is a valid pattern. If METHOD is present, it must be followed by a single space. </p>
+<p>Literal (that is, non-wildcard) parts of a pattern match the corresponding parts of a request case-sensitively. </p>
+<p>A pattern with no method matches every method. A pattern with the method GET matches both GET and HEAD requests. Otherwise, the method must match exactly. </p>
+<p>A pattern with no host matches every host. A pattern with a host matches URLs on that host only. </p>
+<p>A path can include wildcard segments of the form {NAME} or {NAME...}. For example, "/b/{bucket}/o/{objectname...}". The wildcard name must be a valid Go identifier. Wildcards must be full path segments: they must be preceded by a slash and followed by either a slash or the end of the string. For example, "/b_{bucket}" is not a valid pattern. </p>
+<p>Normally a wildcard matches only a single path segment, ending at the next literal slash (not %2F) in the request URL. But if the "..." is present, then the wildcard matches the remainder of the URL path, including slashes. (Therefore it is invalid for a "..." wildcard to appear anywhere but at the end of a pattern.) The match for a wildcard can be obtained by calling <a href="#Request.PathValue">Request.PathValue</a> with the wildcard's name. A trailing slash in a path acts as an anonymous "..." wildcard. </p>
+<p>The special wildcard {$} matches only the end of the URL. For example, the pattern "/{$}" matches only the path "/", whereas the pattern "/" matches every path. </p>
+<p>For matching, both pattern paths and incoming request paths are unescaped segment by segment. So, for example, the path "/a%2Fb/100%25" is treated as having two segments, "a/b" and "100%". The pattern "/a%2fb/" matches it, but the pattern "/a/b/" does not. </p>
+<h3 id="hdr-Precedence">Precedence</h3> <p>If two or more patterns match a request, then the most specific pattern takes precedence. A pattern P1 is more specific than P2 if P1 matches a strict subset of P2’s requests; that is, if P2 matches all the requests of P1 and more. If neither is more specific, then the patterns conflict. There is one exception to this rule, for backwards compatibility: if two patterns would otherwise conflict and one has a host while the other does not, then the pattern with the host takes precedence. If a pattern passed <a href="#ServeMux.Handle">ServeMux.Handle</a> or <a href="#ServeMux.HandleFunc">ServeMux.HandleFunc</a> conflicts with another pattern that is already registered, those functions panic. </p>
+<p>As an example of the general rule, "/images/thumbnails/" is more specific than "/images/", so both can be registered. The former matches paths beginning with "/images/thumbnails/" and the latter will match any other path in the "/images/" subtree. </p>
+<p>As another example, consider the patterns "GET /" and "/index.html": both match a GET request for "/index.html", but the former pattern matches all other GET and HEAD requests, while the latter matches any request for "/index.html" that uses a different method. The patterns conflict. </p>
+<h3 id="hdr-Trailing_slash_redirection">Trailing-slash redirection</h3> <p>Consider a <a href="#ServeMux">ServeMux</a> with a handler for a subtree, registered using a trailing slash or "..." wildcard. If the ServeMux receives a request for the subtree root without a trailing slash, it redirects the request by adding the trailing slash. This behavior can be overridden with a separate registration for the path without the trailing slash or "..." wildcard. For example, registering "/images/" causes ServeMux to redirect a request for "/images" to "/images/", unless "/images" has been registered separately. </p>
+<h3 id="hdr-Request_sanitizing">Request sanitizing</h3> <p>ServeMux also takes care of sanitizing the URL request path and the Host header, stripping the port number and redirecting any request containing . or .. segments or repeated slashes to an equivalent, cleaner URL. </p>
+<h3 id="hdr-Compatibility">Compatibility</h3> <p>The pattern syntax and matching behavior of ServeMux changed significantly in Go 1.22. To restore the old behavior, set the GODEBUG environment variable to "httpmuxgo121=1". This setting is read once, at program startup; changes during execution will be ignored. </p>
+<p>The backwards-incompatible changes include: </p>
+<ul> <li>Wildcards are just ordinary literal path segments in 1.21. For example, the pattern "/{x}" will match only that path in 1.21, but will match any one-segment path in 1.22. </li>
+<li>In 1.21, no pattern was rejected, unless it was empty or conflicted with an existing pattern. In 1.22, syntactically invalid patterns will cause <a href="#ServeMux.Handle">ServeMux.Handle</a> and <a href="#ServeMux.HandleFunc">ServeMux.HandleFunc</a> to panic. For example, in 1.21, the patterns "/{" and "/a{x}" match themselves, but in 1.22 they are invalid and will cause a panic when registered. </li>
+<li>In 1.22, each segment of a pattern is unescaped; this was not done in 1.21. For example, in 1.22 the pattern "/%61" matches the path "/a" ("%61" being the URL escape sequence for "a"), but in 1.21 it would match only the path "/%2561" (where "%25" is the escape for the percent sign). </li>
+<li>When matching patterns to paths, in 1.22 each segment of the path is unescaped; in 1.21, the entire path is unescaped. This change mostly affects how paths with %2F escapes adjacent to slashes are treated. See <a href="https://go.dev/issue/21955">https://go.dev/issue/21955</a> for details. </li>
+</ul> <pre data-language="go">type ServeMux struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewServeMux">func <span>NewServeMux</span> </h3> <pre data-language="go">func NewServeMux() *ServeMux</pre> <p>NewServeMux allocates and returns a new <a href="#ServeMux">ServeMux</a>. </p>
+<h3 id="ServeMux.Handle">func (*ServeMux) <span>Handle</span> </h3> <pre data-language="go">func (mux *ServeMux) Handle(pattern string, handler Handler)</pre> <p>Handle registers the handler for the given pattern. If the given pattern conflicts, with one that is already registered, Handle panics. </p> <h4 id="example_ServeMux_Handle"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+mux := http.NewServeMux()
+mux.Handle("/api/", apiHandler{})
+mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
+ // The "/" pattern matches everything, so we need to check
+ // that we're at the root here.
+ if req.URL.Path != "/" {
+ http.NotFound(w, req)
+ return
+ }
+ fmt.Fprintf(w, "Welcome to the home page!")
+})
+</pre> <h3 id="ServeMux.HandleFunc">func (*ServeMux) <span>HandleFunc</span> </h3> <pre data-language="go">func (mux *ServeMux) HandleFunc(pattern string, handler func(ResponseWriter, *Request))</pre> <p>HandleFunc registers the handler function for the given pattern. If the given pattern conflicts, with one that is already registered, HandleFunc panics. </p>
+<h3 id="ServeMux.Handler">func (*ServeMux) <span>Handler</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (mux *ServeMux) Handler(r *Request) (h Handler, pattern string)</pre> <p>Handler returns the handler to use for the given request, consulting r.Method, r.Host, and r.URL.Path. It always returns a non-nil handler. If the path is not in its canonical form, the handler will be an internally-generated handler that redirects to the canonical path. If the host contains a port, it is ignored when matching handlers. </p>
+<p>The path and host are used unchanged for CONNECT requests. </p>
+<p>Handler also returns the registered pattern that matches the request or, in the case of internally-generated redirects, the path that will match after following the redirect. </p>
+<p>If there is no registered handler that applies to the request, Handler returns a “page not found” handler and an empty pattern. </p>
+<h3 id="ServeMux.ServeHTTP">func (*ServeMux) <span>ServeHTTP</span> </h3> <pre data-language="go">func (mux *ServeMux) ServeHTTP(w ResponseWriter, r *Request)</pre> <p>ServeHTTP dispatches the request to the handler whose pattern most closely matches the request URL. </p>
+<h2 id="Server">type <span>Server</span> </h2> <p>A Server defines parameters for running an HTTP server. The zero value for Server is a valid configuration. </p>
+<pre data-language="go">type Server struct {
+ // Addr optionally specifies the TCP address for the server to listen on,
+ // in the form "host:port". If empty, ":http" (port 80) is used.
+ // The service names are defined in RFC 6335 and assigned by IANA.
+ // See net.Dial for details of the address format.
+ Addr string
+
+ Handler Handler // handler to invoke, http.DefaultServeMux if nil
+
+ // DisableGeneralOptionsHandler, if true, passes "OPTIONS *" requests to the Handler,
+ // otherwise responds with 200 OK and Content-Length: 0.
+ DisableGeneralOptionsHandler bool // Go 1.20
+
+ // TLSConfig optionally provides a TLS configuration for use
+ // by ServeTLS and ListenAndServeTLS. Note that this value is
+ // cloned by ServeTLS and ListenAndServeTLS, so it's not
+ // possible to modify the configuration with methods like
+ // tls.Config.SetSessionTicketKeys. To use
+ // SetSessionTicketKeys, use Server.Serve with a TLS Listener
+ // instead.
+ TLSConfig *tls.Config
+
+ // ReadTimeout is the maximum duration for reading the entire
+ // request, including the body. A zero or negative value means
+ // there will be no timeout.
+ //
+ // Because ReadTimeout does not let Handlers make per-request
+ // decisions on each request body's acceptable deadline or
+ // upload rate, most users will prefer to use
+ // ReadHeaderTimeout. It is valid to use them both.
+ ReadTimeout time.Duration
+
+ // ReadHeaderTimeout is the amount of time allowed to read
+ // request headers. The connection's read deadline is reset
+ // after reading the headers and the Handler can decide what
+ // is considered too slow for the body. If ReadHeaderTimeout
+ // is zero, the value of ReadTimeout is used. If both are
+ // zero, there is no timeout.
+ ReadHeaderTimeout time.Duration // Go 1.8
+
+ // WriteTimeout is the maximum duration before timing out
+ // writes of the response. It is reset whenever a new
+ // request's header is read. Like ReadTimeout, it does not
+ // let Handlers make decisions on a per-request basis.
+ // A zero or negative value means there will be no timeout.
+ WriteTimeout time.Duration
+
+ // IdleTimeout is the maximum amount of time to wait for the
+ // next request when keep-alives are enabled. If IdleTimeout
+ // is zero, the value of ReadTimeout is used. If both are
+ // zero, there is no timeout.
+ IdleTimeout time.Duration // Go 1.8
+
+ // MaxHeaderBytes controls the maximum number of bytes the
+ // server will read parsing the request header's keys and
+ // values, including the request line. It does not limit the
+ // size of the request body.
+ // If zero, DefaultMaxHeaderBytes is used.
+ MaxHeaderBytes int
+
+ // TLSNextProto optionally specifies a function to take over
+ // ownership of the provided TLS connection when an ALPN
+ // protocol upgrade has occurred. The map key is the protocol
+ // name negotiated. The Handler argument should be used to
+ // handle HTTP requests and will initialize the Request's TLS
+ // and RemoteAddr if not already set. The connection is
+ // automatically closed when the function returns.
+ // If TLSNextProto is not nil, HTTP/2 support is not enabled
+ // automatically.
+ TLSNextProto map[string]func(*Server, *tls.Conn, Handler) // Go 1.1
+
+ // ConnState specifies an optional callback function that is
+ // called when a client connection changes state. See the
+ // ConnState type and associated constants for details.
+ ConnState func(net.Conn, ConnState) // Go 1.3
+
+ // ErrorLog specifies an optional logger for errors accepting
+ // connections, unexpected behavior from handlers, and
+ // underlying FileSystem errors.
+ // If nil, logging is done via the log package's standard logger.
+ ErrorLog *log.Logger // Go 1.3
+
+ // BaseContext optionally specifies a function that returns
+ // the base context for incoming requests on this server.
+ // The provided Listener is the specific Listener that's
+ // about to start accepting requests.
+ // If BaseContext is nil, the default is context.Background().
+ // If non-nil, it must return a non-nil context.
+ BaseContext func(net.Listener) context.Context // Go 1.13
+
+ // ConnContext optionally specifies a function that modifies
+ // the context used for a new connection c. The provided ctx
+ // is derived from the base context and has a ServerContextKey
+ // value.
+ ConnContext func(ctx context.Context, c net.Conn) context.Context // Go 1.13
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Server.Close">func (*Server) <span>Close</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (srv *Server) Close() error</pre> <p>Close immediately closes all active net.Listeners and any connections in state <a href="#StateNew">StateNew</a>, <a href="#StateActive">StateActive</a>, or <a href="#StateIdle">StateIdle</a>. For a graceful shutdown, use <a href="#Server.Shutdown">Server.Shutdown</a>. </p>
+<p>Close does not attempt to close (and does not even know about) any hijacked connections, such as WebSockets. </p>
+<p>Close returns any error returned from closing the <a href="#Server">Server</a>'s underlying Listener(s). </p>
+<h3 id="Server.ListenAndServe">func (*Server) <span>ListenAndServe</span> </h3> <pre data-language="go">func (srv *Server) ListenAndServe() error</pre> <p>ListenAndServe listens on the TCP network address srv.Addr and then calls <a href="#Serve">Serve</a> to handle requests on incoming connections. Accepted connections are configured to enable TCP keep-alives. </p>
+<p>If srv.Addr is blank, ":http" is used. </p>
+<p>ListenAndServe always returns a non-nil error. After <a href="#Server.Shutdown">Server.Shutdown</a> or <a href="#Server.Close">Server.Close</a>, the returned error is <a href="#ErrServerClosed">ErrServerClosed</a>. </p>
+<h3 id="Server.ListenAndServeTLS">func (*Server) <span>ListenAndServeTLS</span> </h3> <pre data-language="go">func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error</pre> <p>ListenAndServeTLS listens on the TCP network address srv.Addr and then calls <a href="#ServeTLS">ServeTLS</a> to handle requests on incoming TLS connections. Accepted connections are configured to enable TCP keep-alives. </p>
+<p>Filenames containing a certificate and matching private key for the server must be provided if neither the <a href="#Server">Server</a>'s TLSConfig.Certificates nor TLSConfig.GetCertificate are populated. If the certificate is signed by a certificate authority, the certFile should be the concatenation of the server's certificate, any intermediates, and the CA's certificate. </p>
+<p>If srv.Addr is blank, ":https" is used. </p>
+<p>ListenAndServeTLS always returns a non-nil error. After <a href="#Server.Shutdown">Server.Shutdown</a> or <a href="#Server.Close">Server.Close</a>, the returned error is <a href="#ErrServerClosed">ErrServerClosed</a>. </p>
+<h3 id="Server.RegisterOnShutdown">func (*Server) <span>RegisterOnShutdown</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (srv *Server) RegisterOnShutdown(f func())</pre> <p>RegisterOnShutdown registers a function to call on <a href="#Server.Shutdown">Server.Shutdown</a>. This can be used to gracefully shutdown connections that have undergone ALPN protocol upgrade or that have been hijacked. This function should start protocol-specific graceful shutdown, but should not wait for shutdown to complete. </p>
+<h3 id="Server.Serve">func (*Server) <span>Serve</span> </h3> <pre data-language="go">func (srv *Server) Serve(l net.Listener) error</pre> <p>Serve accepts incoming connections on the Listener l, creating a new service goroutine for each. The service goroutines read requests and then call srv.Handler to reply to them. </p>
+<p>HTTP/2 support is only enabled if the Listener returns <span>*tls.Conn</span> connections and they were configured with "h2" in the TLS Config.NextProtos. </p>
+<p>Serve always returns a non-nil error and closes l. After <a href="#Server.Shutdown">Server.Shutdown</a> or <a href="#Server.Close">Server.Close</a>, the returned error is <a href="#ErrServerClosed">ErrServerClosed</a>. </p>
+<h3 id="Server.ServeTLS">func (*Server) <span>ServeTLS</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (srv *Server) ServeTLS(l net.Listener, certFile, keyFile string) error</pre> <p>ServeTLS accepts incoming connections on the Listener l, creating a new service goroutine for each. The service goroutines perform TLS setup and then read requests, calling srv.Handler to reply to them. </p>
+<p>Files containing a certificate and matching private key for the server must be provided if neither the <a href="#Server">Server</a>'s TLSConfig.Certificates nor TLSConfig.GetCertificate are populated. If the certificate is signed by a certificate authority, the certFile should be the concatenation of the server's certificate, any intermediates, and the CA's certificate. </p>
+<p>ServeTLS always returns a non-nil error. After <a href="#Server.Shutdown">Server.Shutdown</a> or <a href="#Server.Close">Server.Close</a>, the returned error is <a href="#ErrServerClosed">ErrServerClosed</a>. </p>
+<h3 id="Server.SetKeepAlivesEnabled">func (*Server) <span>SetKeepAlivesEnabled</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (srv *Server) SetKeepAlivesEnabled(v bool)</pre> <p>SetKeepAlivesEnabled controls whether HTTP keep-alives are enabled. By default, keep-alives are always enabled. Only very resource-constrained environments or servers in the process of shutting down should disable them. </p>
+<h3 id="Server.Shutdown">func (*Server) <span>Shutdown</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (srv *Server) Shutdown(ctx context.Context) error</pre> <p>Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners, then closing all idle connections, and then waiting indefinitely for connections to return to idle and then shut down. If the provided context expires before the shutdown is complete, Shutdown returns the context's error, otherwise it returns any error returned from closing the <a href="#Server">Server</a>'s underlying Listener(s). </p>
+<p>When Shutdown is called, <a href="#Serve">Serve</a>, <a href="#ListenAndServe">ListenAndServe</a>, and <a href="#ListenAndServeTLS">ListenAndServeTLS</a> immediately return <a href="#ErrServerClosed">ErrServerClosed</a>. Make sure the program doesn't exit and waits instead for Shutdown to return. </p>
+<p>Shutdown does not attempt to close nor wait for hijacked connections such as WebSockets. The caller of Shutdown should separately notify such long-lived connections of shutdown and wait for them to close, if desired. See <a href="#Server.RegisterOnShutdown">Server.RegisterOnShutdown</a> for a way to register shutdown notification functions. </p>
+<p>Once Shutdown has been called on a server, it may not be reused; future calls to methods such as Serve will return ErrServerClosed. </p> <h4 id="example_Server_Shutdown"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+var srv http.Server
+
+idleConnsClosed := make(chan struct{})
+go func() {
+ sigint := make(chan os.Signal, 1)
+ signal.Notify(sigint, os.Interrupt)
+ &lt;-sigint
+
+ // We received an interrupt signal, shut down.
+ if err := srv.Shutdown(context.Background()); err != nil {
+ // Error from closing listeners, or context timeout:
+ log.Printf("HTTP server Shutdown: %v", err)
+ }
+ close(idleConnsClosed)
+}()
+
+if err := srv.ListenAndServe(); err != http.ErrServerClosed {
+ // Error starting or closing listener:
+ log.Fatalf("HTTP server ListenAndServe: %v", err)
+}
+
+&lt;-idleConnsClosed
+</pre> <h2 id="Transport">type <span>Transport</span> </h2> <p>Transport is an implementation of <a href="#RoundTripper">RoundTripper</a> that supports HTTP, HTTPS, and HTTP proxies (for either HTTP or HTTPS with CONNECT). </p>
+<p>By default, Transport caches connections for future re-use. This may leave many open connections when accessing many hosts. This behavior can be managed using <a href="#Transport.CloseIdleConnections">Transport.CloseIdleConnections</a> method and the [Transport.MaxIdleConnsPerHost] and [Transport.DisableKeepAlives] fields. </p>
+<p>Transports should be reused instead of created as needed. Transports are safe for concurrent use by multiple goroutines. </p>
+<p>A Transport is a low-level primitive for making HTTP and HTTPS requests. For high-level functionality, such as cookies and redirects, see <a href="#Client">Client</a>. </p>
+<p>Transport uses HTTP/1.1 for HTTP URLs and either HTTP/1.1 or HTTP/2 for HTTPS URLs, depending on whether the server supports HTTP/2, and how the Transport is configured. The <a href="#DefaultTransport">DefaultTransport</a> supports HTTP/2. To explicitly enable HTTP/2 on a transport, use golang.org/x/net/http2 and call ConfigureTransport. See the package docs for more about HTTP/2. </p>
+<p>Responses with status codes in the 1xx range are either handled automatically (100 expect-continue) or ignored. The one exception is HTTP status code 101 (Switching Protocols), which is considered a terminal status and returned by <a href="#Transport.RoundTrip">Transport.RoundTrip</a>. To see the ignored 1xx responses, use the httptrace trace package's ClientTrace.Got1xxResponse. </p>
+<p>Transport only retries a request upon encountering a network error if the connection has been already been used successfully and if the request is idempotent and either has no body or has its [Request.GetBody] defined. HTTP requests are considered idempotent if they have HTTP methods GET, HEAD, OPTIONS, or TRACE; or if their <a href="#Header">Header</a> map contains an "Idempotency-Key" or "X-Idempotency-Key" entry. If the idempotency key value is a zero-length slice, the request is treated as idempotent but the header is not sent on the wire. </p>
+<pre data-language="go">type Transport struct {
+
+ // Proxy specifies a function to return a proxy for a given
+ // Request. If the function returns a non-nil error, the
+ // request is aborted with the provided error.
+ //
+ // The proxy type is determined by the URL scheme. "http",
+ // "https", and "socks5" are supported. If the scheme is empty,
+ // "http" is assumed.
+ //
+ // If the proxy URL contains a userinfo subcomponent,
+ // the proxy request will pass the username and password
+ // in a Proxy-Authorization header.
+ //
+ // If Proxy is nil or returns a nil *URL, no proxy is used.
+ Proxy func(*Request) (*url.URL, error)
+
+ // OnProxyConnectResponse is called when the Transport gets an HTTP response from
+ // a proxy for a CONNECT request. It's called before the check for a 200 OK response.
+ // If it returns an error, the request fails with that error.
+ OnProxyConnectResponse func(ctx context.Context, proxyURL *url.URL, connectReq *Request, connectRes *Response) error // Go 1.20
+
+ // DialContext specifies the dial function for creating unencrypted TCP connections.
+ // If DialContext is nil (and the deprecated Dial below is also nil),
+ // then the transport dials using package net.
+ //
+ // DialContext runs concurrently with calls to RoundTrip.
+ // A RoundTrip call that initiates a dial may end up using
+ // a connection dialed previously when the earlier connection
+ // becomes idle before the later DialContext completes.
+ DialContext func(ctx context.Context, network, addr string) (net.Conn, error) // Go 1.7
+
+ // Dial specifies the dial function for creating unencrypted TCP connections.
+ //
+ // Dial runs concurrently with calls to RoundTrip.
+ // A RoundTrip call that initiates a dial may end up using
+ // a connection dialed previously when the earlier connection
+ // becomes idle before the later Dial completes.
+ //
+ // Deprecated: Use DialContext instead, which allows the transport
+ // to cancel dials as soon as they are no longer needed.
+ // If both are set, DialContext takes priority.
+ Dial func(network, addr string) (net.Conn, error)
+
+ // DialTLSContext specifies an optional dial function for creating
+ // TLS connections for non-proxied HTTPS requests.
+ //
+ // If DialTLSContext is nil (and the deprecated DialTLS below is also nil),
+ // DialContext and TLSClientConfig are used.
+ //
+ // If DialTLSContext is set, the Dial and DialContext hooks are not used for HTTPS
+ // requests and the TLSClientConfig and TLSHandshakeTimeout
+ // are ignored. The returned net.Conn is assumed to already be
+ // past the TLS handshake.
+ DialTLSContext func(ctx context.Context, network, addr string) (net.Conn, error) // Go 1.14
+
+ // DialTLS specifies an optional dial function for creating
+ // TLS connections for non-proxied HTTPS requests.
+ //
+ // Deprecated: Use DialTLSContext instead, which allows the transport
+ // to cancel dials as soon as they are no longer needed.
+ // If both are set, DialTLSContext takes priority.
+ DialTLS func(network, addr string) (net.Conn, error) // Go 1.4
+
+ // TLSClientConfig specifies the TLS configuration to use with
+ // tls.Client.
+ // If nil, the default configuration is used.
+ // If non-nil, HTTP/2 support may not be enabled by default.
+ TLSClientConfig *tls.Config
+
+ // TLSHandshakeTimeout specifies the maximum amount of time to
+ // wait for a TLS handshake. Zero means no timeout.
+ TLSHandshakeTimeout time.Duration // Go 1.3
+
+ // DisableKeepAlives, if true, disables HTTP keep-alives and
+ // will only use the connection to the server for a single
+ // HTTP request.
+ //
+ // This is unrelated to the similarly named TCP keep-alives.
+ DisableKeepAlives bool
+
+ // DisableCompression, if true, prevents the Transport from
+ // requesting compression with an "Accept-Encoding: gzip"
+ // request header when the Request contains no existing
+ // Accept-Encoding value. If the Transport requests gzip on
+ // its own and gets a gzipped response, it's transparently
+ // decoded in the Response.Body. However, if the user
+ // explicitly requested gzip it is not automatically
+ // uncompressed.
+ DisableCompression bool
+
+ // MaxIdleConns controls the maximum number of idle (keep-alive)
+ // connections across all hosts. Zero means no limit.
+ MaxIdleConns int // Go 1.7
+
+ // MaxIdleConnsPerHost, if non-zero, controls the maximum idle
+ // (keep-alive) connections to keep per-host. If zero,
+ // DefaultMaxIdleConnsPerHost is used.
+ MaxIdleConnsPerHost int
+
+ // MaxConnsPerHost optionally limits the total number of
+ // connections per host, including connections in the dialing,
+ // active, and idle states. On limit violation, dials will block.
+ //
+ // Zero means no limit.
+ MaxConnsPerHost int // Go 1.11
+
+ // IdleConnTimeout is the maximum amount of time an idle
+ // (keep-alive) connection will remain idle before closing
+ // itself.
+ // Zero means no limit.
+ IdleConnTimeout time.Duration // Go 1.7
+
+ // ResponseHeaderTimeout, if non-zero, specifies the amount of
+ // time to wait for a server's response headers after fully
+ // writing the request (including its body, if any). This
+ // time does not include the time to read the response body.
+ ResponseHeaderTimeout time.Duration // Go 1.1
+
+ // ExpectContinueTimeout, if non-zero, specifies the amount of
+ // time to wait for a server's first response headers after fully
+ // writing the request headers if the request has an
+ // "Expect: 100-continue" header. Zero means no timeout and
+ // causes the body to be sent immediately, without
+ // waiting for the server to approve.
+ // This time does not include the time to send the request header.
+ ExpectContinueTimeout time.Duration // Go 1.6
+
+ // TLSNextProto specifies how the Transport switches to an
+ // alternate protocol (such as HTTP/2) after a TLS ALPN
+ // protocol negotiation. If Transport dials a TLS connection
+ // with a non-empty protocol name and TLSNextProto contains a
+ // map entry for that key (such as "h2"), then the func is
+ // called with the request's authority (such as "example.com"
+ // or "example.com:1234") and the TLS connection. The function
+ // must return a RoundTripper that then handles the request.
+ // If TLSNextProto is not nil, HTTP/2 support is not enabled
+ // automatically.
+ TLSNextProto map[string]func(authority string, c *tls.Conn) RoundTripper // Go 1.6
+
+ // ProxyConnectHeader optionally specifies headers to send to
+ // proxies during CONNECT requests.
+ // To set the header dynamically, see GetProxyConnectHeader.
+ ProxyConnectHeader Header // Go 1.8
+
+ // GetProxyConnectHeader optionally specifies a func to return
+ // headers to send to proxyURL during a CONNECT request to the
+ // ip:port target.
+ // If it returns an error, the Transport's RoundTrip fails with
+ // that error. It can return (nil, nil) to not add headers.
+ // If GetProxyConnectHeader is non-nil, ProxyConnectHeader is
+ // ignored.
+ GetProxyConnectHeader func(ctx context.Context, proxyURL *url.URL, target string) (Header, error) // Go 1.16
+
+ // MaxResponseHeaderBytes specifies a limit on how many
+ // response bytes are allowed in the server's response
+ // header.
+ //
+ // Zero means to use a default limit.
+ MaxResponseHeaderBytes int64 // Go 1.7
+
+ // WriteBufferSize specifies the size of the write buffer used
+ // when writing to the transport.
+ // If zero, a default (currently 4KB) is used.
+ WriteBufferSize int // Go 1.13
+
+ // ReadBufferSize specifies the size of the read buffer used
+ // when reading from the transport.
+ // If zero, a default (currently 4KB) is used.
+ ReadBufferSize int // Go 1.13
+
+ // ForceAttemptHTTP2 controls whether HTTP/2 is enabled when a non-zero
+ // Dial, DialTLS, or DialContext func or TLSClientConfig is provided.
+ // By default, use of any those fields conservatively disables HTTP/2.
+ // To use a custom dialer or TLS config and still attempt HTTP/2
+ // upgrades, set this to true.
+ ForceAttemptHTTP2 bool // Go 1.13
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Transport.CancelRequest">func (*Transport) <span>CancelRequest</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (t *Transport) CancelRequest(req *Request)</pre> <p>CancelRequest cancels an in-flight request by closing its connection. CancelRequest should only be called after <a href="#Transport.RoundTrip">Transport.RoundTrip</a> has returned. </p>
+<p>Deprecated: Use <a href="#Request.WithContext">Request.WithContext</a> to create a request with a cancelable context instead. CancelRequest cannot cancel HTTP/2 requests. </p>
+<h3 id="Transport.Clone">func (*Transport) <span>Clone</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (t *Transport) Clone() *Transport</pre> <p>Clone returns a deep copy of t's exported fields. </p>
+<h3 id="Transport.CloseIdleConnections">func (*Transport) <span>CloseIdleConnections</span> </h3> <pre data-language="go">func (t *Transport) CloseIdleConnections()</pre> <p>CloseIdleConnections closes any connections which were previously connected from previous requests but are now sitting idle in a "keep-alive" state. It does not interrupt any connections currently in use. </p>
+<h3 id="Transport.RegisterProtocol">func (*Transport) <span>RegisterProtocol</span> </h3> <pre data-language="go">func (t *Transport) RegisterProtocol(scheme string, rt RoundTripper)</pre> <p>RegisterProtocol registers a new protocol with scheme. The <a href="#Transport">Transport</a> will pass requests using the given scheme to rt. It is rt's responsibility to simulate HTTP request semantics. </p>
+<p>RegisterProtocol can be used by other packages to provide implementations of protocol schemes like "ftp" or "file". </p>
+<p>If rt.RoundTrip returns <a href="#ErrSkipAltProtocol">ErrSkipAltProtocol</a>, the Transport will handle the <a href="#Transport.RoundTrip">Transport.RoundTrip</a> itself for that one request, as if the protocol were not registered. </p>
+<h3 id="Transport.RoundTrip">func (*Transport) <span>RoundTrip</span> </h3> <pre data-language="go">func (t *Transport) RoundTrip(req *Request) (*Response, error)</pre> <p>RoundTrip implements the <a href="#RoundTripper">RoundTripper</a> interface. </p>
+<p>For higher-level HTTP client support (such as handling of cookies and redirects), see <a href="#Get">Get</a>, <a href="#Post">Post</a>, and the <a href="#Client">Client</a> type. </p>
+<p>Like the RoundTripper interface, the error types returned by RoundTrip are unspecified. </p>
+<h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="cgi/index">cgi</a> </td> <td class="pkg-synopsis"> Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875. </td> </tr> <tr> <td class="pkg-name"> <a href="cookiejar/index">cookiejar</a> </td> <td class="pkg-synopsis"> Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar. </td> </tr> <tr> <td class="pkg-name"> <a href="fcgi/index">fcgi</a> </td> <td class="pkg-synopsis"> Package fcgi implements the FastCGI protocol. </td> </tr> <tr> <td class="pkg-name"> <a href="httptest/index">httptest</a> </td> <td class="pkg-synopsis"> Package httptest provides utilities for HTTP testing. </td> </tr> <tr> <td class="pkg-name"> <a href="httptrace/index">httptrace</a> </td> <td class="pkg-synopsis"> Package httptrace provides mechanisms to trace the events within HTTP client requests. </td> </tr> <tr> <td class="pkg-name"> <a href="httputil/index">httputil</a> </td> <td class="pkg-synopsis"> Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package. </td> </tr> <tr> <td class="pkg-name"> <a href="pprof/index">pprof</a> </td> <td class="pkg-synopsis"> Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/http/" class="_attribution-link">http://golang.org/pkg/net/http/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fhttp%2Finternal%2Findex.html b/devdocs/go/net%2Fhttp%2Finternal%2Findex.html
new file mode 100644
index 00000000..9903dd5b
--- /dev/null
+++ b/devdocs/go/net%2Fhttp%2Finternal%2Findex.html
@@ -0,0 +1,24 @@
+<h1> Package internal </h1> <ul id="short-nav">
+<li><code>import "net/http/internal"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package internal contains HTTP internals shared by net/http and net/http/httputil. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#NewChunkedReader">func NewChunkedReader(r io.Reader) io.Reader</a></li>
+<li><a href="#NewChunkedWriter">func NewChunkedWriter(w io.Writer) io.WriteCloser</a></li>
+<li><a href="#FlushAfterChunkWriter">type FlushAfterChunkWriter</a></li>
+</ul> <h3>Package files</h3> <p> <span>chunked.go</span> </p> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var ErrLineTooLong = errors.New("header line too long")</pre> <h2 id="NewChunkedReader">func <span>NewChunkedReader</span> </h2> <pre data-language="go">func NewChunkedReader(r io.Reader) io.Reader</pre> <p>NewChunkedReader returns a new chunkedReader that translates the data read from r out of HTTP "chunked" format before returning it. The chunkedReader returns <span>io.EOF</span> when the final 0-length chunk is read. </p>
+<p>NewChunkedReader is not needed by normal applications. The http package automatically decodes chunking when reading response bodies. </p>
+<h2 id="NewChunkedWriter">func <span>NewChunkedWriter</span> </h2> <pre data-language="go">func NewChunkedWriter(w io.Writer) io.WriteCloser</pre> <p>NewChunkedWriter returns a new chunkedWriter that translates writes into HTTP "chunked" format before writing them to w. Closing the returned chunkedWriter sends the final 0-length chunk that marks the end of the stream but does not send the final CRLF that appears after trailers; trailers and the last CRLF must be written separately. </p>
+<p>NewChunkedWriter is not needed by normal applications. The http package adds chunking automatically if handlers don't set a Content-Length header. Using newChunkedWriter inside a handler would result in double chunking or chunking with a Content-Length length, both of which are wrong. </p>
+<h2 id="FlushAfterChunkWriter">type <span>FlushAfterChunkWriter</span> </h2> <p>FlushAfterChunkWriter signals from the caller of <a href="#NewChunkedWriter">NewChunkedWriter</a> that each chunk should be followed by a flush. It is used by the <span>net/http.Transport</span> code to keep the buffering behavior for headers and trailers, but flush out chunks aggressively in the middle for request bodies which may be generated slowly. See Issue 6574. </p>
+<pre data-language="go">type FlushAfterChunkWriter struct {
+ *bufio.Writer
+}
+</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/http/internal/" class="_attribution-link">http://golang.org/pkg/net/http/internal/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fhttp%2Fpprof%2Findex.html b/devdocs/go/net%2Fhttp%2Fpprof%2Findex.html
new file mode 100644
index 00000000..552a61c3
--- /dev/null
+++ b/devdocs/go/net%2Fhttp%2Fpprof%2Findex.html
@@ -0,0 +1,48 @@
+<h1> Package pprof </h1> <ul id="short-nav">
+<li><code>import "net/http/pprof"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. </p>
+<p>The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/. </p>
+<p>To use pprof, link this package into your program: </p>
+<pre data-language="go">import _ "net/http/pprof"
+</pre> <p>If your application is not already running an http server, you need to start one. Add "net/http" and "log" to your imports and the following code to your main function: </p>
+<pre data-language="go">go func() {
+ log.Println(http.ListenAndServe("localhost:6060", nil))
+}()
+</pre> <p>By default, all the profiles listed in <span>runtime/pprof.Profile</span> are available (via <a href="#Handler">Handler</a>), in addition to the <a href="#Cmdline">Cmdline</a>, <a href="#Profile">Profile</a>, <a href="#Symbol">Symbol</a>, and <a href="#Trace">Trace</a> profiles defined in this package. If you are not using DefaultServeMux, you will have to register handlers with the mux you are using. </p>
+<h3 id="hdr-Parameters">Parameters</h3> <p>Parameters can be passed via GET query params: </p>
+<ul> <li>debug=N (all profiles): response format: N = 0: binary (default), N &gt; 0: plaintext </li>
+<li>gc=N (heap profile): N &gt; 0: run a garbage collection cycle before profiling </li>
+<li>seconds=N (allocs, block, goroutine, heap, mutex, threadcreate profiles): return a delta profile </li>
+<li>seconds=N (cpu (profile), trace profiles): profile for the given duration </li>
+</ul> <h3 id="hdr-Usage_examples">Usage examples</h3> <p>Use the pprof tool to look at the heap profile: </p>
+<pre data-language="go">go tool pprof http://localhost:6060/debug/pprof/heap
+</pre> <p>Or to look at a 30-second CPU profile: </p>
+<pre data-language="go">go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30
+</pre> <p>Or to look at the goroutine blocking profile, after calling <span>runtime.SetBlockProfileRate</span> in your program: </p>
+<pre data-language="go">go tool pprof http://localhost:6060/debug/pprof/block
+</pre> <p>Or to look at the holders of contended mutexes, after calling <span>runtime.SetMutexProfileFraction</span> in your program: </p>
+<pre data-language="go">go tool pprof http://localhost:6060/debug/pprof/mutex
+</pre> <p>The package also exports a handler that serves execution trace data for the "go tool trace" command. To collect a 5-second execution trace: </p>
+<pre data-language="go">curl -o trace.out http://localhost:6060/debug/pprof/trace?seconds=5
+go tool trace trace.out
+</pre> <p>To view all available profiles, open <span>http://localhost:6060/debug/pprof/</span> in your browser. </p>
+<p>For a study of the facility in action, visit <a href="https://blog.golang.org/2011/06/profiling-go-programs.html">https://blog.golang.org/2011/06/profiling-go-programs.html</a>. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Cmdline">func Cmdline(w http.ResponseWriter, r *http.Request)</a></li>
+<li><a href="#Handler">func Handler(name string) http.Handler</a></li>
+<li><a href="#Index">func Index(w http.ResponseWriter, r *http.Request)</a></li>
+<li><a href="#Profile">func Profile(w http.ResponseWriter, r *http.Request)</a></li>
+<li><a href="#Symbol">func Symbol(w http.ResponseWriter, r *http.Request)</a></li>
+<li><a href="#Trace">func Trace(w http.ResponseWriter, r *http.Request)</a></li>
+</ul> <h3>Package files</h3> <p> <span>pprof.go</span> </p> <h2 id="Cmdline">func <span>Cmdline</span> </h2> <pre data-language="go">func Cmdline(w http.ResponseWriter, r *http.Request)</pre> <p>Cmdline responds with the running program's command line, with arguments separated by NUL bytes. The package initialization registers it as /debug/pprof/cmdline. </p>
+<h2 id="Handler">func <span>Handler</span> </h2> <pre data-language="go">func Handler(name string) http.Handler</pre> <p>Handler returns an HTTP handler that serves the named profile. Available profiles can be found in <span>runtime/pprof.Profile</span>. </p>
+<h2 id="Index">func <span>Index</span> </h2> <pre data-language="go">func Index(w http.ResponseWriter, r *http.Request)</pre> <p>Index responds with the pprof-formatted profile named by the request. For example, "/debug/pprof/heap" serves the "heap" profile. Index responds to a request for "/debug/pprof/" with an HTML page listing the available profiles. </p>
+<h2 id="Profile">func <span>Profile</span> </h2> <pre data-language="go">func Profile(w http.ResponseWriter, r *http.Request)</pre> <p>Profile responds with the pprof-formatted cpu profile. Profiling lasts for duration specified in seconds GET parameter, or for 30 seconds if not specified. The package initialization registers it as /debug/pprof/profile. </p>
+<h2 id="Symbol">func <span>Symbol</span> </h2> <pre data-language="go">func Symbol(w http.ResponseWriter, r *http.Request)</pre> <p>Symbol looks up the program counters listed in the request, responding with a table mapping program counters to function names. The package initialization registers it as /debug/pprof/symbol. </p>
+<h2 id="Trace">func <span>Trace</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Trace(w http.ResponseWriter, r *http.Request)</pre> <p>Trace responds with the execution trace in binary form. Tracing lasts for duration specified in seconds GET parameter, or for 1 second if not specified. The package initialization registers it as /debug/pprof/trace. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/http/pprof/" class="_attribution-link">http://golang.org/pkg/net/http/pprof/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Findex.html b/devdocs/go/net%2Findex.html
new file mode 100644
index 00000000..3ef06794
--- /dev/null
+++ b/devdocs/go/net%2Findex.html
@@ -0,0 +1,1610 @@
+<h1> Package net </h1> <ul id="short-nav">
+<li><code>import "net"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package net provides a portable interface for network I/O, including TCP/IP, UDP, domain name resolution, and Unix domain sockets. </p>
+<p>Although the package provides access to low-level networking primitives, most clients will need only the basic interface provided by the <a href="#Dial">Dial</a>, <a href="#Listen">Listen</a>, and Accept functions and the associated <a href="#Conn">Conn</a> and <a href="#Listener">Listener</a> interfaces. The crypto/tls package uses the same interfaces and similar Dial and Listen functions. </p>
+<p>The Dial function connects to a server: </p>
+<pre data-language="go">conn, err := net.Dial("tcp", "golang.org:80")
+if err != nil {
+ // handle error
+}
+fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n")
+status, err := bufio.NewReader(conn).ReadString('\n')
+// ...
+</pre> <p>The Listen function creates servers: </p>
+<pre data-language="go">ln, err := net.Listen("tcp", ":8080")
+if err != nil {
+ // handle error
+}
+for {
+ conn, err := ln.Accept()
+ if err != nil {
+ // handle error
+ }
+ go handleConnection(conn)
+}
+</pre> <h3 id="hdr-Name_Resolution">Name Resolution</h3> <p>The method for resolving domain names, whether indirectly with functions like Dial or directly with functions like <a href="#LookupHost">LookupHost</a> and <a href="#LookupAddr">LookupAddr</a>, varies by operating system. </p>
+<p>On Unix systems, the resolver has two options for resolving names. It can use a pure Go resolver that sends DNS requests directly to the servers listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C library routines such as getaddrinfo and getnameinfo. </p>
+<p>By default the pure Go resolver is used, because a blocked DNS request consumes only a goroutine, while a blocked C call consumes an operating system thread. When cgo is available, the cgo-based resolver is used instead under a variety of conditions: on systems that do not let programs make direct DNS requests (OS X), when the LOCALDOMAIN environment variable is present (even if empty), when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, when the ASR_CONFIG environment variable is non-empty (OpenBSD only), when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the Go resolver does not implement, and when the name being looked up ends in .local or is an mDNS name. </p>
+<p>The resolver decision can be overridden by setting the netdns value of the GODEBUG environment variable (see package runtime) to go or cgo, as in: </p>
+<pre data-language="go">export GODEBUG=netdns=go # force pure Go resolver
+export GODEBUG=netdns=cgo # force native resolver (cgo, win32)
+</pre> <p>The decision can also be forced while building the Go source tree by setting the netgo or netcgo build tag. </p>
+<p>A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver to print debugging information about its decisions. To force a particular resolver while also printing debugging information, join the two settings by a plus sign, as in GODEBUG=netdns=go+1. </p>
+<p>On macOS, if Go code that uses the net package is built with -buildmode=c-archive, linking the resulting archive into a C program requires passing -lresolv when linking the C code. </p>
+<p>On Plan 9, the resolver always accesses /net/cs and /net/dns. </p>
+<p>On Windows, in Go 1.18.x and earlier, the resolver always used C library functions, such as GetAddrInfo and DnsQuery. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#JoinHostPort">func JoinHostPort(host, port string) string</a></li>
+<li><a href="#LookupAddr">func LookupAddr(addr string) (names []string, err error)</a></li>
+<li><a href="#LookupCNAME">func LookupCNAME(host string) (cname string, err error)</a></li>
+<li><a href="#LookupHost">func LookupHost(host string) (addrs []string, err error)</a></li>
+<li><a href="#LookupPort">func LookupPort(network, service string) (port int, err error)</a></li>
+<li><a href="#LookupTXT">func LookupTXT(name string) ([]string, error)</a></li>
+<li><a href="#ParseCIDR">func ParseCIDR(s string) (IP, *IPNet, error)</a></li>
+<li><a href="#Pipe">func Pipe() (Conn, Conn)</a></li>
+<li><a href="#SplitHostPort">func SplitHostPort(hostport string) (host, port string, err error)</a></li>
+<li><a href="#Addr">type Addr</a></li>
+<li> <a href="#InterfaceAddrs">func InterfaceAddrs() ([]Addr, error)</a>
+</li>
+<li><a href="#AddrError">type AddrError</a></li>
+<li> <a href="#AddrError.Error">func (e *AddrError) Error() string</a>
+</li>
+<li> <a href="#AddrError.Temporary">func (e *AddrError) Temporary() bool</a>
+</li>
+<li> <a href="#AddrError.Timeout">func (e *AddrError) Timeout() bool</a>
+</li>
+<li><a href="#Buffers">type Buffers</a></li>
+<li> <a href="#Buffers.Read">func (v *Buffers) Read(p []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Buffers.WriteTo">func (v *Buffers) WriteTo(w io.Writer) (n int64, err error)</a>
+</li>
+<li><a href="#Conn">type Conn</a></li>
+<li> <a href="#Dial">func Dial(network, address string) (Conn, error)</a>
+</li>
+<li> <a href="#DialTimeout">func DialTimeout(network, address string, timeout time.Duration) (Conn, error)</a>
+</li>
+<li> <a href="#FileConn">func FileConn(f *os.File) (c Conn, err error)</a>
+</li>
+<li><a href="#DNSConfigError">type DNSConfigError</a></li>
+<li> <a href="#DNSConfigError.Error">func (e *DNSConfigError) Error() string</a>
+</li>
+<li> <a href="#DNSConfigError.Temporary">func (e *DNSConfigError) Temporary() bool</a>
+</li>
+<li> <a href="#DNSConfigError.Timeout">func (e *DNSConfigError) Timeout() bool</a>
+</li>
+<li> <a href="#DNSConfigError.Unwrap">func (e *DNSConfigError) Unwrap() error</a>
+</li>
+<li><a href="#DNSError">type DNSError</a></li>
+<li> <a href="#DNSError.Error">func (e *DNSError) Error() string</a>
+</li>
+<li> <a href="#DNSError.Temporary">func (e *DNSError) Temporary() bool</a>
+</li>
+<li> <a href="#DNSError.Timeout">func (e *DNSError) Timeout() bool</a>
+</li>
+<li><a href="#Dialer">type Dialer</a></li>
+<li> <a href="#Dialer.Dial">func (d *Dialer) Dial(network, address string) (Conn, error)</a>
+</li>
+<li> <a href="#Dialer.DialContext">func (d *Dialer) DialContext(ctx context.Context, network, address string) (Conn, error)</a>
+</li>
+<li> <a href="#Dialer.MultipathTCP">func (d *Dialer) MultipathTCP() bool</a>
+</li>
+<li> <a href="#Dialer.SetMultipathTCP">func (d *Dialer) SetMultipathTCP(use bool)</a>
+</li>
+<li><a href="#Error">type Error</a></li>
+<li><a href="#Flags">type Flags</a></li>
+<li> <a href="#Flags.String">func (f Flags) String() string</a>
+</li>
+<li><a href="#HardwareAddr">type HardwareAddr</a></li>
+<li> <a href="#ParseMAC">func ParseMAC(s string) (hw HardwareAddr, err error)</a>
+</li>
+<li> <a href="#HardwareAddr.String">func (a HardwareAddr) String() string</a>
+</li>
+<li><a href="#IP">type IP</a></li>
+<li> <a href="#IPv4">func IPv4(a, b, c, d byte) IP</a>
+</li>
+<li> <a href="#LookupIP">func LookupIP(host string) ([]IP, error)</a>
+</li>
+<li> <a href="#ParseIP">func ParseIP(s string) IP</a>
+</li>
+<li> <a href="#IP.DefaultMask">func (ip IP) DefaultMask() IPMask</a>
+</li>
+<li> <a href="#IP.Equal">func (ip IP) Equal(x IP) bool</a>
+</li>
+<li> <a href="#IP.IsGlobalUnicast">func (ip IP) IsGlobalUnicast() bool</a>
+</li>
+<li> <a href="#IP.IsInterfaceLocalMulticast">func (ip IP) IsInterfaceLocalMulticast() bool</a>
+</li>
+<li> <a href="#IP.IsLinkLocalMulticast">func (ip IP) IsLinkLocalMulticast() bool</a>
+</li>
+<li> <a href="#IP.IsLinkLocalUnicast">func (ip IP) IsLinkLocalUnicast() bool</a>
+</li>
+<li> <a href="#IP.IsLoopback">func (ip IP) IsLoopback() bool</a>
+</li>
+<li> <a href="#IP.IsMulticast">func (ip IP) IsMulticast() bool</a>
+</li>
+<li> <a href="#IP.IsPrivate">func (ip IP) IsPrivate() bool</a>
+</li>
+<li> <a href="#IP.IsUnspecified">func (ip IP) IsUnspecified() bool</a>
+</li>
+<li> <a href="#IP.MarshalText">func (ip IP) MarshalText() ([]byte, error)</a>
+</li>
+<li> <a href="#IP.Mask">func (ip IP) Mask(mask IPMask) IP</a>
+</li>
+<li> <a href="#IP.String">func (ip IP) String() string</a>
+</li>
+<li> <a href="#IP.To16">func (ip IP) To16() IP</a>
+</li>
+<li> <a href="#IP.To4">func (ip IP) To4() IP</a>
+</li>
+<li> <a href="#IP.UnmarshalText">func (ip *IP) UnmarshalText(text []byte) error</a>
+</li>
+<li><a href="#IPAddr">type IPAddr</a></li>
+<li> <a href="#ResolveIPAddr">func ResolveIPAddr(network, address string) (*IPAddr, error)</a>
+</li>
+<li> <a href="#IPAddr.Network">func (a *IPAddr) Network() string</a>
+</li>
+<li> <a href="#IPAddr.String">func (a *IPAddr) String() string</a>
+</li>
+<li><a href="#IPConn">type IPConn</a></li>
+<li> <a href="#DialIP">func DialIP(network string, laddr, raddr *IPAddr) (*IPConn, error)</a>
+</li>
+<li> <a href="#ListenIP">func ListenIP(network string, laddr *IPAddr) (*IPConn, error)</a>
+</li>
+<li> <a href="#IPConn.Close">func (c *IPConn) Close() error</a>
+</li>
+<li> <a href="#IPConn.File">func (c *IPConn) File() (f *os.File, err error)</a>
+</li>
+<li> <a href="#IPConn.LocalAddr">func (c *IPConn) LocalAddr() Addr</a>
+</li>
+<li> <a href="#IPConn.Read">func (c *IPConn) Read(b []byte) (int, error)</a>
+</li>
+<li> <a href="#IPConn.ReadFrom">func (c *IPConn) ReadFrom(b []byte) (int, Addr, error)</a>
+</li>
+<li> <a href="#IPConn.ReadFromIP">func (c *IPConn) ReadFromIP(b []byte) (int, *IPAddr, error)</a>
+</li>
+<li> <a href="#IPConn.ReadMsgIP">func (c *IPConn) ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *IPAddr, err error)</a>
+</li>
+<li> <a href="#IPConn.RemoteAddr">func (c *IPConn) RemoteAddr() Addr</a>
+</li>
+<li> <a href="#IPConn.SetDeadline">func (c *IPConn) SetDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#IPConn.SetReadBuffer">func (c *IPConn) SetReadBuffer(bytes int) error</a>
+</li>
+<li> <a href="#IPConn.SetReadDeadline">func (c *IPConn) SetReadDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#IPConn.SetWriteBuffer">func (c *IPConn) SetWriteBuffer(bytes int) error</a>
+</li>
+<li> <a href="#IPConn.SetWriteDeadline">func (c *IPConn) SetWriteDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#IPConn.SyscallConn">func (c *IPConn) SyscallConn() (syscall.RawConn, error)</a>
+</li>
+<li> <a href="#IPConn.Write">func (c *IPConn) Write(b []byte) (int, error)</a>
+</li>
+<li> <a href="#IPConn.WriteMsgIP">func (c *IPConn) WriteMsgIP(b, oob []byte, addr *IPAddr) (n, oobn int, err error)</a>
+</li>
+<li> <a href="#IPConn.WriteTo">func (c *IPConn) WriteTo(b []byte, addr Addr) (int, error)</a>
+</li>
+<li> <a href="#IPConn.WriteToIP">func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error)</a>
+</li>
+<li><a href="#IPMask">type IPMask</a></li>
+<li> <a href="#CIDRMask">func CIDRMask(ones, bits int) IPMask</a>
+</li>
+<li> <a href="#IPv4Mask">func IPv4Mask(a, b, c, d byte) IPMask</a>
+</li>
+<li> <a href="#IPMask.Size">func (m IPMask) Size() (ones, bits int)</a>
+</li>
+<li> <a href="#IPMask.String">func (m IPMask) String() string</a>
+</li>
+<li><a href="#IPNet">type IPNet</a></li>
+<li> <a href="#IPNet.Contains">func (n *IPNet) Contains(ip IP) bool</a>
+</li>
+<li> <a href="#IPNet.Network">func (n *IPNet) Network() string</a>
+</li>
+<li> <a href="#IPNet.String">func (n *IPNet) String() string</a>
+</li>
+<li><a href="#Interface">type Interface</a></li>
+<li> <a href="#InterfaceByIndex">func InterfaceByIndex(index int) (*Interface, error)</a>
+</li>
+<li> <a href="#InterfaceByName">func InterfaceByName(name string) (*Interface, error)</a>
+</li>
+<li> <a href="#Interfaces">func Interfaces() ([]Interface, error)</a>
+</li>
+<li> <a href="#Interface.Addrs">func (ifi *Interface) Addrs() ([]Addr, error)</a>
+</li>
+<li> <a href="#Interface.MulticastAddrs">func (ifi *Interface) MulticastAddrs() ([]Addr, error)</a>
+</li>
+<li><a href="#InvalidAddrError">type InvalidAddrError</a></li>
+<li> <a href="#InvalidAddrError.Error">func (e InvalidAddrError) Error() string</a>
+</li>
+<li> <a href="#InvalidAddrError.Temporary">func (e InvalidAddrError) Temporary() bool</a>
+</li>
+<li> <a href="#InvalidAddrError.Timeout">func (e InvalidAddrError) Timeout() bool</a>
+</li>
+<li><a href="#ListenConfig">type ListenConfig</a></li>
+<li> <a href="#ListenConfig.Listen">func (lc *ListenConfig) Listen(ctx context.Context, network, address string) (Listener, error)</a>
+</li>
+<li> <a href="#ListenConfig.ListenPacket">func (lc *ListenConfig) ListenPacket(ctx context.Context, network, address string) (PacketConn, error)</a>
+</li>
+<li> <a href="#ListenConfig.MultipathTCP">func (lc *ListenConfig) MultipathTCP() bool</a>
+</li>
+<li> <a href="#ListenConfig.SetMultipathTCP">func (lc *ListenConfig) SetMultipathTCP(use bool)</a>
+</li>
+<li><a href="#Listener">type Listener</a></li>
+<li> <a href="#FileListener">func FileListener(f *os.File) (ln Listener, err error)</a>
+</li>
+<li> <a href="#Listen">func Listen(network, address string) (Listener, error)</a>
+</li>
+<li><a href="#MX">type MX</a></li>
+<li> <a href="#LookupMX">func LookupMX(name string) ([]*MX, error)</a>
+</li>
+<li><a href="#NS">type NS</a></li>
+<li> <a href="#LookupNS">func LookupNS(name string) ([]*NS, error)</a>
+</li>
+<li><a href="#OpError">type OpError</a></li>
+<li> <a href="#OpError.Error">func (e *OpError) Error() string</a>
+</li>
+<li> <a href="#OpError.Temporary">func (e *OpError) Temporary() bool</a>
+</li>
+<li> <a href="#OpError.Timeout">func (e *OpError) Timeout() bool</a>
+</li>
+<li> <a href="#OpError.Unwrap">func (e *OpError) Unwrap() error</a>
+</li>
+<li><a href="#PacketConn">type PacketConn</a></li>
+<li> <a href="#FilePacketConn">func FilePacketConn(f *os.File) (c PacketConn, err error)</a>
+</li>
+<li> <a href="#ListenPacket">func ListenPacket(network, address string) (PacketConn, error)</a>
+</li>
+<li><a href="#ParseError">type ParseError</a></li>
+<li> <a href="#ParseError.Error">func (e *ParseError) Error() string</a>
+</li>
+<li> <a href="#ParseError.Temporary">func (e *ParseError) Temporary() bool</a>
+</li>
+<li> <a href="#ParseError.Timeout">func (e *ParseError) Timeout() bool</a>
+</li>
+<li><a href="#Resolver">type Resolver</a></li>
+<li> <a href="#Resolver.LookupAddr">func (r *Resolver) LookupAddr(ctx context.Context, addr string) ([]string, error)</a>
+</li>
+<li> <a href="#Resolver.LookupCNAME">func (r *Resolver) LookupCNAME(ctx context.Context, host string) (string, error)</a>
+</li>
+<li> <a href="#Resolver.LookupHost">func (r *Resolver) LookupHost(ctx context.Context, host string) (addrs []string, err error)</a>
+</li>
+<li> <a href="#Resolver.LookupIP">func (r *Resolver) LookupIP(ctx context.Context, network, host string) ([]IP, error)</a>
+</li>
+<li> <a href="#Resolver.LookupIPAddr">func (r *Resolver) LookupIPAddr(ctx context.Context, host string) ([]IPAddr, error)</a>
+</li>
+<li> <a href="#Resolver.LookupMX">func (r *Resolver) LookupMX(ctx context.Context, name string) ([]*MX, error)</a>
+</li>
+<li> <a href="#Resolver.LookupNS">func (r *Resolver) LookupNS(ctx context.Context, name string) ([]*NS, error)</a>
+</li>
+<li> <a href="#Resolver.LookupNetIP">func (r *Resolver) LookupNetIP(ctx context.Context, network, host string) ([]netip.Addr, error)</a>
+</li>
+<li> <a href="#Resolver.LookupPort">func (r *Resolver) LookupPort(ctx context.Context, network, service string) (port int, err error)</a>
+</li>
+<li> <a href="#Resolver.LookupSRV">func (r *Resolver) LookupSRV(ctx context.Context, service, proto, name string) (string, []*SRV, error)</a>
+</li>
+<li> <a href="#Resolver.LookupTXT">func (r *Resolver) LookupTXT(ctx context.Context, name string) ([]string, error)</a>
+</li>
+<li><a href="#SRV">type SRV</a></li>
+<li> <a href="#LookupSRV">func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error)</a>
+</li>
+<li><a href="#TCPAddr">type TCPAddr</a></li>
+<li> <a href="#ResolveTCPAddr">func ResolveTCPAddr(network, address string) (*TCPAddr, error)</a>
+</li>
+<li> <a href="#TCPAddrFromAddrPort">func TCPAddrFromAddrPort(addr netip.AddrPort) *TCPAddr</a>
+</li>
+<li> <a href="#TCPAddr.AddrPort">func (a *TCPAddr) AddrPort() netip.AddrPort</a>
+</li>
+<li> <a href="#TCPAddr.Network">func (a *TCPAddr) Network() string</a>
+</li>
+<li> <a href="#TCPAddr.String">func (a *TCPAddr) String() string</a>
+</li>
+<li><a href="#TCPConn">type TCPConn</a></li>
+<li> <a href="#DialTCP">func DialTCP(network string, laddr, raddr *TCPAddr) (*TCPConn, error)</a>
+</li>
+<li> <a href="#TCPConn.Close">func (c *TCPConn) Close() error</a>
+</li>
+<li> <a href="#TCPConn.CloseRead">func (c *TCPConn) CloseRead() error</a>
+</li>
+<li> <a href="#TCPConn.CloseWrite">func (c *TCPConn) CloseWrite() error</a>
+</li>
+<li> <a href="#TCPConn.File">func (c *TCPConn) File() (f *os.File, err error)</a>
+</li>
+<li> <a href="#TCPConn.LocalAddr">func (c *TCPConn) LocalAddr() Addr</a>
+</li>
+<li> <a href="#TCPConn.MultipathTCP">func (c *TCPConn) MultipathTCP() (bool, error)</a>
+</li>
+<li> <a href="#TCPConn.Read">func (c *TCPConn) Read(b []byte) (int, error)</a>
+</li>
+<li> <a href="#TCPConn.ReadFrom">func (c *TCPConn) ReadFrom(r io.Reader) (int64, error)</a>
+</li>
+<li> <a href="#TCPConn.RemoteAddr">func (c *TCPConn) RemoteAddr() Addr</a>
+</li>
+<li> <a href="#TCPConn.SetDeadline">func (c *TCPConn) SetDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#TCPConn.SetKeepAlive">func (c *TCPConn) SetKeepAlive(keepalive bool) error</a>
+</li>
+<li> <a href="#TCPConn.SetKeepAlivePeriod">func (c *TCPConn) SetKeepAlivePeriod(d time.Duration) error</a>
+</li>
+<li> <a href="#TCPConn.SetLinger">func (c *TCPConn) SetLinger(sec int) error</a>
+</li>
+<li> <a href="#TCPConn.SetNoDelay">func (c *TCPConn) SetNoDelay(noDelay bool) error</a>
+</li>
+<li> <a href="#TCPConn.SetReadBuffer">func (c *TCPConn) SetReadBuffer(bytes int) error</a>
+</li>
+<li> <a href="#TCPConn.SetReadDeadline">func (c *TCPConn) SetReadDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#TCPConn.SetWriteBuffer">func (c *TCPConn) SetWriteBuffer(bytes int) error</a>
+</li>
+<li> <a href="#TCPConn.SetWriteDeadline">func (c *TCPConn) SetWriteDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#TCPConn.SyscallConn">func (c *TCPConn) SyscallConn() (syscall.RawConn, error)</a>
+</li>
+<li> <a href="#TCPConn.Write">func (c *TCPConn) Write(b []byte) (int, error)</a>
+</li>
+<li> <a href="#TCPConn.WriteTo">func (c *TCPConn) WriteTo(w io.Writer) (int64, error)</a>
+</li>
+<li><a href="#TCPListener">type TCPListener</a></li>
+<li> <a href="#ListenTCP">func ListenTCP(network string, laddr *TCPAddr) (*TCPListener, error)</a>
+</li>
+<li> <a href="#TCPListener.Accept">func (l *TCPListener) Accept() (Conn, error)</a>
+</li>
+<li> <a href="#TCPListener.AcceptTCP">func (l *TCPListener) AcceptTCP() (*TCPConn, error)</a>
+</li>
+<li> <a href="#TCPListener.Addr">func (l *TCPListener) Addr() Addr</a>
+</li>
+<li> <a href="#TCPListener.Close">func (l *TCPListener) Close() error</a>
+</li>
+<li> <a href="#TCPListener.File">func (l *TCPListener) File() (f *os.File, err error)</a>
+</li>
+<li> <a href="#TCPListener.SetDeadline">func (l *TCPListener) SetDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#TCPListener.SyscallConn">func (l *TCPListener) SyscallConn() (syscall.RawConn, error)</a>
+</li>
+<li><a href="#UDPAddr">type UDPAddr</a></li>
+<li> <a href="#ResolveUDPAddr">func ResolveUDPAddr(network, address string) (*UDPAddr, error)</a>
+</li>
+<li> <a href="#UDPAddrFromAddrPort">func UDPAddrFromAddrPort(addr netip.AddrPort) *UDPAddr</a>
+</li>
+<li> <a href="#UDPAddr.AddrPort">func (a *UDPAddr) AddrPort() netip.AddrPort</a>
+</li>
+<li> <a href="#UDPAddr.Network">func (a *UDPAddr) Network() string</a>
+</li>
+<li> <a href="#UDPAddr.String">func (a *UDPAddr) String() string</a>
+</li>
+<li><a href="#UDPConn">type UDPConn</a></li>
+<li> <a href="#DialUDP">func DialUDP(network string, laddr, raddr *UDPAddr) (*UDPConn, error)</a>
+</li>
+<li> <a href="#ListenMulticastUDP">func ListenMulticastUDP(network string, ifi *Interface, gaddr *UDPAddr) (*UDPConn, error)</a>
+</li>
+<li> <a href="#ListenUDP">func ListenUDP(network string, laddr *UDPAddr) (*UDPConn, error)</a>
+</li>
+<li> <a href="#UDPConn.Close">func (c *UDPConn) Close() error</a>
+</li>
+<li> <a href="#UDPConn.File">func (c *UDPConn) File() (f *os.File, err error)</a>
+</li>
+<li> <a href="#UDPConn.LocalAddr">func (c *UDPConn) LocalAddr() Addr</a>
+</li>
+<li> <a href="#UDPConn.Read">func (c *UDPConn) Read(b []byte) (int, error)</a>
+</li>
+<li> <a href="#UDPConn.ReadFrom">func (c *UDPConn) ReadFrom(b []byte) (int, Addr, error)</a>
+</li>
+<li> <a href="#UDPConn.ReadFromUDP">func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *UDPAddr, err error)</a>
+</li>
+<li> <a href="#UDPConn.ReadFromUDPAddrPort">func (c *UDPConn) ReadFromUDPAddrPort(b []byte) (n int, addr netip.AddrPort, err error)</a>
+</li>
+<li> <a href="#UDPConn.ReadMsgUDP">func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *UDPAddr, err error)</a>
+</li>
+<li> <a href="#UDPConn.ReadMsgUDPAddrPort">func (c *UDPConn) ReadMsgUDPAddrPort(b, oob []byte) (n, oobn, flags int, addr netip.AddrPort, err error)</a>
+</li>
+<li> <a href="#UDPConn.RemoteAddr">func (c *UDPConn) RemoteAddr() Addr</a>
+</li>
+<li> <a href="#UDPConn.SetDeadline">func (c *UDPConn) SetDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#UDPConn.SetReadBuffer">func (c *UDPConn) SetReadBuffer(bytes int) error</a>
+</li>
+<li> <a href="#UDPConn.SetReadDeadline">func (c *UDPConn) SetReadDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#UDPConn.SetWriteBuffer">func (c *UDPConn) SetWriteBuffer(bytes int) error</a>
+</li>
+<li> <a href="#UDPConn.SetWriteDeadline">func (c *UDPConn) SetWriteDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#UDPConn.SyscallConn">func (c *UDPConn) SyscallConn() (syscall.RawConn, error)</a>
+</li>
+<li> <a href="#UDPConn.Write">func (c *UDPConn) Write(b []byte) (int, error)</a>
+</li>
+<li> <a href="#UDPConn.WriteMsgUDP">func (c *UDPConn) WriteMsgUDP(b, oob []byte, addr *UDPAddr) (n, oobn int, err error)</a>
+</li>
+<li> <a href="#UDPConn.WriteMsgUDPAddrPort">func (c *UDPConn) WriteMsgUDPAddrPort(b, oob []byte, addr netip.AddrPort) (n, oobn int, err error)</a>
+</li>
+<li> <a href="#UDPConn.WriteTo">func (c *UDPConn) WriteTo(b []byte, addr Addr) (int, error)</a>
+</li>
+<li> <a href="#UDPConn.WriteToUDP">func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (int, error)</a>
+</li>
+<li> <a href="#UDPConn.WriteToUDPAddrPort">func (c *UDPConn) WriteToUDPAddrPort(b []byte, addr netip.AddrPort) (int, error)</a>
+</li>
+<li><a href="#UnixAddr">type UnixAddr</a></li>
+<li> <a href="#ResolveUnixAddr">func ResolveUnixAddr(network, address string) (*UnixAddr, error)</a>
+</li>
+<li> <a href="#UnixAddr.Network">func (a *UnixAddr) Network() string</a>
+</li>
+<li> <a href="#UnixAddr.String">func (a *UnixAddr) String() string</a>
+</li>
+<li><a href="#UnixConn">type UnixConn</a></li>
+<li> <a href="#DialUnix">func DialUnix(network string, laddr, raddr *UnixAddr) (*UnixConn, error)</a>
+</li>
+<li> <a href="#ListenUnixgram">func ListenUnixgram(network string, laddr *UnixAddr) (*UnixConn, error)</a>
+</li>
+<li> <a href="#UnixConn.Close">func (c *UnixConn) Close() error</a>
+</li>
+<li> <a href="#UnixConn.CloseRead">func (c *UnixConn) CloseRead() error</a>
+</li>
+<li> <a href="#UnixConn.CloseWrite">func (c *UnixConn) CloseWrite() error</a>
+</li>
+<li> <a href="#UnixConn.File">func (c *UnixConn) File() (f *os.File, err error)</a>
+</li>
+<li> <a href="#UnixConn.LocalAddr">func (c *UnixConn) LocalAddr() Addr</a>
+</li>
+<li> <a href="#UnixConn.Read">func (c *UnixConn) Read(b []byte) (int, error)</a>
+</li>
+<li> <a href="#UnixConn.ReadFrom">func (c *UnixConn) ReadFrom(b []byte) (int, Addr, error)</a>
+</li>
+<li> <a href="#UnixConn.ReadFromUnix">func (c *UnixConn) ReadFromUnix(b []byte) (int, *UnixAddr, error)</a>
+</li>
+<li> <a href="#UnixConn.ReadMsgUnix">func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAddr, err error)</a>
+</li>
+<li> <a href="#UnixConn.RemoteAddr">func (c *UnixConn) RemoteAddr() Addr</a>
+</li>
+<li> <a href="#UnixConn.SetDeadline">func (c *UnixConn) SetDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#UnixConn.SetReadBuffer">func (c *UnixConn) SetReadBuffer(bytes int) error</a>
+</li>
+<li> <a href="#UnixConn.SetReadDeadline">func (c *UnixConn) SetReadDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#UnixConn.SetWriteBuffer">func (c *UnixConn) SetWriteBuffer(bytes int) error</a>
+</li>
+<li> <a href="#UnixConn.SetWriteDeadline">func (c *UnixConn) SetWriteDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#UnixConn.SyscallConn">func (c *UnixConn) SyscallConn() (syscall.RawConn, error)</a>
+</li>
+<li> <a href="#UnixConn.Write">func (c *UnixConn) Write(b []byte) (int, error)</a>
+</li>
+<li> <a href="#UnixConn.WriteMsgUnix">func (c *UnixConn) WriteMsgUnix(b, oob []byte, addr *UnixAddr) (n, oobn int, err error)</a>
+</li>
+<li> <a href="#UnixConn.WriteTo">func (c *UnixConn) WriteTo(b []byte, addr Addr) (int, error)</a>
+</li>
+<li> <a href="#UnixConn.WriteToUnix">func (c *UnixConn) WriteToUnix(b []byte, addr *UnixAddr) (int, error)</a>
+</li>
+<li><a href="#UnixListener">type UnixListener</a></li>
+<li> <a href="#ListenUnix">func ListenUnix(network string, laddr *UnixAddr) (*UnixListener, error)</a>
+</li>
+<li> <a href="#UnixListener.Accept">func (l *UnixListener) Accept() (Conn, error)</a>
+</li>
+<li> <a href="#UnixListener.AcceptUnix">func (l *UnixListener) AcceptUnix() (*UnixConn, error)</a>
+</li>
+<li> <a href="#UnixListener.Addr">func (l *UnixListener) Addr() Addr</a>
+</li>
+<li> <a href="#UnixListener.Close">func (l *UnixListener) Close() error</a>
+</li>
+<li> <a href="#UnixListener.File">func (l *UnixListener) File() (f *os.File, err error)</a>
+</li>
+<li> <a href="#UnixListener.SetDeadline">func (l *UnixListener) SetDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#UnixListener.SetUnlinkOnClose">func (l *UnixListener) SetUnlinkOnClose(unlink bool)</a>
+</li>
+<li> <a href="#UnixListener.SyscallConn">func (l *UnixListener) SyscallConn() (syscall.RawConn, error)</a>
+</li>
+<li><a href="#UnknownNetworkError">type UnknownNetworkError</a></li>
+<li> <a href="#UnknownNetworkError.Error">func (e UnknownNetworkError) Error() string</a>
+</li>
+<li> <a href="#UnknownNetworkError.Temporary">func (e UnknownNetworkError) Temporary() bool</a>
+</li>
+<li> <a href="#UnknownNetworkError.Timeout">func (e UnknownNetworkError) Timeout() bool</a>
+</li>
+<li><a href="#pkg-note-BUG">Bugs</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_CIDRMask">CIDRMask</a></dd> <dd><a class="exampleLink" href="#example_Dialer">Dialer</a></dd> <dd><a class="exampleLink" href="#example_Dialer_unix">Dialer (Unix)</a></dd> <dd><a class="exampleLink" href="#example_IP_DefaultMask">IP.DefaultMask</a></dd> <dd><a class="exampleLink" href="#example_IP_Equal">IP.Equal</a></dd> <dd><a class="exampleLink" href="#example_IP_IsGlobalUnicast">IP.IsGlobalUnicast</a></dd> <dd><a class="exampleLink" href="#example_IP_IsInterfaceLocalMulticast">IP.IsInterfaceLocalMulticast</a></dd> <dd><a class="exampleLink" href="#example_IP_IsLinkLocalMulticast">IP.IsLinkLocalMulticast</a></dd> <dd><a class="exampleLink" href="#example_IP_IsLinkLocalUnicast">IP.IsLinkLocalUnicast</a></dd> <dd><a class="exampleLink" href="#example_IP_IsLoopback">IP.IsLoopback</a></dd> <dd><a class="exampleLink" href="#example_IP_IsMulticast">IP.IsMulticast</a></dd> <dd><a class="exampleLink" href="#example_IP_IsPrivate">IP.IsPrivate</a></dd> <dd><a class="exampleLink" href="#example_IP_IsUnspecified">IP.IsUnspecified</a></dd> <dd><a class="exampleLink" href="#example_IP_Mask">IP.Mask</a></dd> <dd><a class="exampleLink" href="#example_IP_String">IP.String</a></dd> <dd><a class="exampleLink" href="#example_IP_To16">IP.To16</a></dd> <dd><a class="exampleLink" href="#example_IP_to4">IP (To4)</a></dd> <dd><a class="exampleLink" href="#example_IPv4">IPv4</a></dd> <dd><a class="exampleLink" href="#example_IPv4Mask">IPv4Mask</a></dd> <dd><a class="exampleLink" href="#example_Listener">Listener</a></dd> <dd><a class="exampleLink" href="#example_ParseCIDR">ParseCIDR</a></dd> <dd><a class="exampleLink" href="#example_ParseIP">ParseIP</a></dd> <dd><a class="exampleLink" href="#example_UDPConn_WriteTo">UDPConn.WriteTo</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>addrselect.go</span> <span>cgo_linux.go</span> <span>cgo_resnew.go</span> <span>cgo_socknew.go</span> <span>cgo_unix.go</span> <span>cgo_unix_cgo.go</span> <span>cgo_unix_cgo_res.go</span> <span>conf.go</span> <span>dial.go</span> <span>dnsclient.go</span> <span>dnsclient_unix.go</span> <span>dnsconfig.go</span> <span>dnsconfig_unix.go</span> <span>error_posix.go</span> <span>error_unix.go</span> <span>fd_posix.go</span> <span>fd_unix.go</span> <span>file.go</span> <span>file_unix.go</span> <span>hook.go</span> <span>hook_unix.go</span> <span>hosts.go</span> <span>interface.go</span> <span>interface_linux.go</span> <span>ip.go</span> <span>iprawsock.go</span> <span>iprawsock_posix.go</span> <span>ipsock.go</span> <span>ipsock_posix.go</span> <span>lookup.go</span> <span>lookup_unix.go</span> <span>mac.go</span> <span>mptcpsock_linux.go</span> <span>net.go</span> <span>netcgo_off.go</span> <span>netgo_off.go</span> <span>nss.go</span> <span>parse.go</span> <span>pipe.go</span> <span>port.go</span> <span>port_unix.go</span> <span>rawconn.go</span> <span>rlimit_unix.go</span> <span>sendfile_linux.go</span> <span>sock_cloexec.go</span> <span>sock_linux.go</span> <span>sock_posix.go</span> <span>sockaddr_posix.go</span> <span>sockopt_linux.go</span> <span>sockopt_posix.go</span> <span>sockoptip_linux.go</span> <span>sockoptip_posix.go</span> <span>splice_linux.go</span> <span>tcpsock.go</span> <span>tcpsock_posix.go</span> <span>tcpsockopt_posix.go</span> <span>tcpsockopt_unix.go</span> <span>udpsock.go</span> <span>udpsock_posix.go</span> <span>unixsock.go</span> <span>unixsock_posix.go</span> <span>unixsock_readmsg_cmsg_cloexec.go</span> <span>writev_unix.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>IP address lengths (bytes). </p>
+<pre data-language="go">const (
+ IPv4len = 4
+ IPv6len = 16
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>Well-known IPv4 addresses </p>
+<pre data-language="go">var (
+ IPv4bcast = IPv4(255, 255, 255, 255) // limited broadcast
+ IPv4allsys = IPv4(224, 0, 0, 1) // all systems
+ IPv4allrouter = IPv4(224, 0, 0, 2) // all routers
+ IPv4zero = IPv4(0, 0, 0, 0) // all zeros
+)</pre> <p>Well-known IPv6 addresses </p>
+<pre data-language="go">var (
+ IPv6zero = IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ IPv6unspecified = IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ IPv6loopback = IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
+ IPv6interfacelocalallnodes = IP{0xff, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01}
+ IPv6linklocalallnodes = IP{0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01}
+ IPv6linklocalallrouters = IP{0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02}
+)</pre> <p>DefaultResolver is the resolver used by the package-level Lookup functions and by Dialers without a specified Resolver. </p>
+<pre data-language="go">var DefaultResolver = &amp;Resolver{}</pre> <p>ErrClosed is the error returned by an I/O call on a network connection that has already been closed, or that is closed by another goroutine before the I/O is completed. This may be wrapped in another error, and should normally be tested using errors.Is(err, net.ErrClosed). </p>
+<pre data-language="go">var ErrClosed error = errClosed</pre> <p>Various errors contained in OpError. </p>
+<pre data-language="go">var (
+ ErrWriteToConnected = errors.New("use of WriteTo with pre-connected connection")
+)</pre> <h2 id="JoinHostPort">func <span>JoinHostPort</span> </h2> <pre data-language="go">func JoinHostPort(host, port string) string</pre> <p>JoinHostPort combines host and port into a network address of the form "host:port". If host contains a colon, as found in literal IPv6 addresses, then JoinHostPort returns "[host]:port". </p>
+<p>See func Dial for a description of the host and port parameters. </p>
+<h2 id="LookupAddr">func <span>LookupAddr</span> </h2> <pre data-language="go">func LookupAddr(addr string) (names []string, err error)</pre> <p>LookupAddr performs a reverse lookup for the given address, returning a list of names mapping to that address. </p>
+<p>The returned names are validated to be properly formatted presentation-format domain names. If the response contains invalid names, those records are filtered out and an error will be returned alongside the remaining results, if any. </p>
+<p>When using the host C library resolver, at most one result will be returned. To bypass the host resolver, use a custom <a href="#Resolver">Resolver</a>. </p>
+<p>LookupAddr uses <span>context.Background</span> internally; to specify the context, use <a href="#Resolver.LookupAddr">Resolver.LookupAddr</a>. </p>
+<h2 id="LookupCNAME">func <span>LookupCNAME</span> </h2> <pre data-language="go">func LookupCNAME(host string) (cname string, err error)</pre> <p>LookupCNAME returns the canonical name for the given host. Callers that do not care about the canonical name can call <a href="#LookupHost">LookupHost</a> or <a href="#LookupIP">LookupIP</a> directly; both take care of resolving the canonical name as part of the lookup. </p>
+<p>A canonical name is the final name after following zero or more CNAME records. LookupCNAME does not return an error if host does not contain DNS "CNAME" records, as long as host resolves to address records. </p>
+<p>The returned canonical name is validated to be a properly formatted presentation-format domain name. </p>
+<p>LookupCNAME uses <span>context.Background</span> internally; to specify the context, use <a href="#Resolver.LookupCNAME">Resolver.LookupCNAME</a>. </p>
+<h2 id="LookupHost">func <span>LookupHost</span> </h2> <pre data-language="go">func LookupHost(host string) (addrs []string, err error)</pre> <p>LookupHost looks up the given host using the local resolver. It returns a slice of that host's addresses. </p>
+<p>LookupHost uses <span>context.Background</span> internally; to specify the context, use <a href="#Resolver.LookupHost">Resolver.LookupHost</a>. </p>
+<h2 id="LookupPort">func <span>LookupPort</span> </h2> <pre data-language="go">func LookupPort(network, service string) (port int, err error)</pre> <p>LookupPort looks up the port for the given network and service. </p>
+<p>LookupPort uses <span>context.Background</span> internally; to specify the context, use <a href="#Resolver.LookupPort">Resolver.LookupPort</a>. </p>
+<h2 id="LookupTXT">func <span>LookupTXT</span> </h2> <pre data-language="go">func LookupTXT(name string) ([]string, error)</pre> <p>LookupTXT returns the DNS TXT records for the given domain name. </p>
+<p>LookupTXT uses <span>context.Background</span> internally; to specify the context, use <a href="#Resolver.LookupTXT">Resolver.LookupTXT</a>. </p>
+<h2 id="ParseCIDR">func <span>ParseCIDR</span> </h2> <pre data-language="go">func ParseCIDR(s string) (IP, *IPNet, error)</pre> <p>ParseCIDR parses s as a CIDR notation IP address and prefix length, like "192.0.2.0/24" or "2001:db8::/32", as defined in RFC 4632 and RFC 4291. </p>
+<p>It returns the IP address and the network implied by the IP and prefix length. For example, ParseCIDR("192.0.2.1/24") returns the IP address 192.0.2.1 and the network 192.0.2.0/24. </p> <h4 id="example_ParseCIDR"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv4Addr, ipv4Net, err := net.ParseCIDR("192.0.2.1/24")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(ipv4Addr)
+fmt.Println(ipv4Net)
+
+ipv6Addr, ipv6Net, err := net.ParseCIDR("2001:db8:a0b:12f0::1/32")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(ipv6Addr)
+fmt.Println(ipv6Net)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">192.0.2.1
+192.0.2.0/24
+2001:db8:a0b:12f0::1
+2001:db8::/32
+</pre> <h2 id="Pipe">func <span>Pipe</span> </h2> <pre data-language="go">func Pipe() (Conn, Conn)</pre> <p>Pipe creates a synchronous, in-memory, full duplex network connection; both ends implement the <a href="#Conn">Conn</a> interface. Reads on one end are matched with writes on the other, copying data directly between the two; there is no internal buffering. </p>
+<h2 id="SplitHostPort">func <span>SplitHostPort</span> </h2> <pre data-language="go">func SplitHostPort(hostport string) (host, port string, err error)</pre> <p>SplitHostPort splits a network address of the form "host:port", "host%zone:port", "[host]:port" or "[host%zone]:port" into host or host%zone and port. </p>
+<p>A literal IPv6 address in hostport must be enclosed in square brackets, as in "[::1]:80", "[::1%lo0]:80". </p>
+<p>See func Dial for a description of the hostport parameter, and host and port results. </p>
+<h2 id="Addr">type <span>Addr</span> </h2> <p>Addr represents a network end point address. </p>
+<p>The two methods [Addr.Network] and [Addr.String] conventionally return strings that can be passed as the arguments to <a href="#Dial">Dial</a>, but the exact form and meaning of the strings is up to the implementation. </p>
+<pre data-language="go">type Addr interface {
+ Network() string // name of the network (for example, "tcp", "udp")
+ String() string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80")
+}</pre> <h3 id="InterfaceAddrs">func <span>InterfaceAddrs</span> </h3> <pre data-language="go">func InterfaceAddrs() ([]Addr, error)</pre> <p>InterfaceAddrs returns a list of the system's unicast interface addresses. </p>
+<p>The returned list does not identify the associated interface; use Interfaces and <a href="#Interface.Addrs">Interface.Addrs</a> for more detail. </p>
+<h2 id="AddrError">type <span>AddrError</span> </h2> <pre data-language="go">type AddrError struct {
+ Err string
+ Addr string
+}
+</pre> <h3 id="AddrError.Error">func (*AddrError) <span>Error</span> </h3> <pre data-language="go">func (e *AddrError) Error() string</pre> <h3 id="AddrError.Temporary">func (*AddrError) <span>Temporary</span> </h3> <pre data-language="go">func (e *AddrError) Temporary() bool</pre> <h3 id="AddrError.Timeout">func (*AddrError) <span>Timeout</span> </h3> <pre data-language="go">func (e *AddrError) Timeout() bool</pre> <h2 id="Buffers">type <span>Buffers</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>Buffers contains zero or more runs of bytes to write. </p>
+<p>On certain machines, for certain types of connections, this is optimized into an OS-specific batch write operation (such as "writev"). </p>
+<pre data-language="go">type Buffers [][]byte</pre> <h3 id="Buffers.Read">func (*Buffers) <span>Read</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (v *Buffers) Read(p []byte) (n int, err error)</pre> <p>Read from the buffers. </p>
+<p>Read implements <span>io.Reader</span> for <a href="#Buffers">Buffers</a>. </p>
+<p>Read modifies the slice v as well as v[i] for 0 &lt;= i &lt; len(v), but does not modify v[i][j] for any i, j. </p>
+<h3 id="Buffers.WriteTo">func (*Buffers) <span>WriteTo</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (v *Buffers) WriteTo(w io.Writer) (n int64, err error)</pre> <p>WriteTo writes contents of the buffers to w. </p>
+<p>WriteTo implements <span>io.WriterTo</span> for <a href="#Buffers">Buffers</a>. </p>
+<p>WriteTo modifies the slice v as well as v[i] for 0 &lt;= i &lt; len(v), but does not modify v[i][j] for any i, j. </p>
+<h2 id="Conn">type <span>Conn</span> </h2> <p>Conn is a generic stream-oriented network connection. </p>
+<p>Multiple goroutines may invoke methods on a Conn simultaneously. </p>
+<pre data-language="go">type Conn interface {
+ // Read reads data from the connection.
+ // Read can be made to time out and return an error after a fixed
+ // time limit; see SetDeadline and SetReadDeadline.
+ Read(b []byte) (n int, err error)
+
+ // Write writes data to the connection.
+ // Write can be made to time out and return an error after a fixed
+ // time limit; see SetDeadline and SetWriteDeadline.
+ Write(b []byte) (n int, err error)
+
+ // Close closes the connection.
+ // Any blocked Read or Write operations will be unblocked and return errors.
+ Close() error
+
+ // LocalAddr returns the local network address, if known.
+ LocalAddr() Addr
+
+ // RemoteAddr returns the remote network address, if known.
+ RemoteAddr() Addr
+
+ // SetDeadline sets the read and write deadlines associated
+ // with the connection. It is equivalent to calling both
+ // SetReadDeadline and SetWriteDeadline.
+ //
+ // A deadline is an absolute time after which I/O operations
+ // fail instead of blocking. The deadline applies to all future
+ // and pending I/O, not just the immediately following call to
+ // Read or Write. After a deadline has been exceeded, the
+ // connection can be refreshed by setting a deadline in the future.
+ //
+ // If the deadline is exceeded a call to Read or Write or to other
+ // I/O methods will return an error that wraps os.ErrDeadlineExceeded.
+ // This can be tested using errors.Is(err, os.ErrDeadlineExceeded).
+ // The error's Timeout method will return true, but note that there
+ // are other possible errors for which the Timeout method will
+ // return true even if the deadline has not been exceeded.
+ //
+ // An idle timeout can be implemented by repeatedly extending
+ // the deadline after successful Read or Write calls.
+ //
+ // A zero value for t means I/O operations will not time out.
+ SetDeadline(t time.Time) error
+
+ // SetReadDeadline sets the deadline for future Read calls
+ // and any currently-blocked Read call.
+ // A zero value for t means Read will not time out.
+ SetReadDeadline(t time.Time) error
+
+ // SetWriteDeadline sets the deadline for future Write calls
+ // and any currently-blocked Write call.
+ // Even if write times out, it may return n &gt; 0, indicating that
+ // some of the data was successfully written.
+ // A zero value for t means Write will not time out.
+ SetWriteDeadline(t time.Time) error
+}</pre> <h3 id="Dial">func <span>Dial</span> </h3> <pre data-language="go">func Dial(network, address string) (Conn, error)</pre> <p>Dial connects to the address on the named network. </p>
+<p>Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only), "udp", "udp4" (IPv4-only), "udp6" (IPv6-only), "ip", "ip4" (IPv4-only), "ip6" (IPv6-only), "unix", "unixgram" and "unixpacket". </p>
+<p>For TCP and UDP networks, the address has the form "host:port". The host must be a literal IP address, or a host name that can be resolved to IP addresses. The port must be a literal port number or a service name. If the host is a literal IPv6 address it must be enclosed in square brackets, as in "[2001:db8::1]:80" or "[fe80::1%zone]:80". The zone specifies the scope of the literal IPv6 address as defined in RFC 4007. The functions <a href="#JoinHostPort">JoinHostPort</a> and <a href="#SplitHostPort">SplitHostPort</a> manipulate a pair of host and port in this form. When using TCP, and the host resolves to multiple IP addresses, Dial will try each IP address in order until one succeeds. </p>
+<p>Examples: </p>
+<pre data-language="go">Dial("tcp", "golang.org:http")
+Dial("tcp", "192.0.2.1:http")
+Dial("tcp", "198.51.100.1:80")
+Dial("udp", "[2001:db8::1]:domain")
+Dial("udp", "[fe80::1%lo0]:53")
+Dial("tcp", ":80")
+</pre> <p>For IP networks, the network must be "ip", "ip4" or "ip6" followed by a colon and a literal protocol number or a protocol name, and the address has the form "host". The host must be a literal IP address or a literal IPv6 address with zone. It depends on each operating system how the operating system behaves with a non-well known protocol number such as "0" or "255". </p>
+<p>Examples: </p>
+<pre data-language="go">Dial("ip4:1", "192.0.2.1")
+Dial("ip6:ipv6-icmp", "2001:db8::1")
+Dial("ip6:58", "fe80::1%lo0")
+</pre> <p>For TCP, UDP and IP networks, if the host is empty or a literal unspecified IP address, as in ":80", "0.0.0.0:80" or "[::]:80" for TCP and UDP, "", "0.0.0.0" or "::" for IP, the local system is assumed. </p>
+<p>For Unix networks, the address must be a file system path. </p>
+<h3 id="DialTimeout">func <span>DialTimeout</span> </h3> <pre data-language="go">func DialTimeout(network, address string, timeout time.Duration) (Conn, error)</pre> <p>DialTimeout acts like <a href="#Dial">Dial</a> but takes a timeout. </p>
+<p>The timeout includes name resolution, if required. When using TCP, and the host in the address parameter resolves to multiple IP addresses, the timeout is spread over each consecutive dial, such that each is given an appropriate fraction of the time to connect. </p>
+<p>See func Dial for a description of the network and address parameters. </p>
+<h3 id="FileConn">func <span>FileConn</span> </h3> <pre data-language="go">func FileConn(f *os.File) (c Conn, err error)</pre> <p>FileConn returns a copy of the network connection corresponding to the open file f. It is the caller's responsibility to close f when finished. Closing c does not affect f, and closing f does not affect c. </p>
+<h2 id="DNSConfigError">type <span>DNSConfigError</span> </h2> <p>DNSConfigError represents an error reading the machine's DNS configuration. (No longer used; kept for compatibility.) </p>
+<pre data-language="go">type DNSConfigError struct {
+ Err error
+}
+</pre> <h3 id="DNSConfigError.Error">func (*DNSConfigError) <span>Error</span> </h3> <pre data-language="go">func (e *DNSConfigError) Error() string</pre> <h3 id="DNSConfigError.Temporary">func (*DNSConfigError) <span>Temporary</span> </h3> <pre data-language="go">func (e *DNSConfigError) Temporary() bool</pre> <h3 id="DNSConfigError.Timeout">func (*DNSConfigError) <span>Timeout</span> </h3> <pre data-language="go">func (e *DNSConfigError) Timeout() bool</pre> <h3 id="DNSConfigError.Unwrap">func (*DNSConfigError) <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e *DNSConfigError) Unwrap() error</pre> <h2 id="DNSError">type <span>DNSError</span> </h2> <p>DNSError represents a DNS lookup error. </p>
+<pre data-language="go">type DNSError struct {
+ Err string // description of the error
+ Name string // name looked for
+ Server string // server used
+ IsTimeout bool // if true, timed out; not all timeouts set this
+ IsTemporary bool // if true, error is temporary; not all errors set this; added in Go 1.6
+
+ // IsNotFound is set to true when the requested name does not
+ // contain any records of the requested type (data not found),
+ // or the name itself was not found (NXDOMAIN).
+ IsNotFound bool // Go 1.13
+}
+</pre> <h3 id="DNSError.Error">func (*DNSError) <span>Error</span> </h3> <pre data-language="go">func (e *DNSError) Error() string</pre> <h3 id="DNSError.Temporary">func (*DNSError) <span>Temporary</span> </h3> <pre data-language="go">func (e *DNSError) Temporary() bool</pre> <p>Temporary reports whether the DNS error is known to be temporary. This is not always known; a DNS lookup may fail due to a temporary error and return a <a href="#DNSError">DNSError</a> for which Temporary returns false. </p>
+<h3 id="DNSError.Timeout">func (*DNSError) <span>Timeout</span> </h3> <pre data-language="go">func (e *DNSError) Timeout() bool</pre> <p>Timeout reports whether the DNS lookup is known to have timed out. This is not always known; a DNS lookup may fail due to a timeout and return a <a href="#DNSError">DNSError</a> for which Timeout returns false. </p>
+<h2 id="Dialer">type <span>Dialer</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>A Dialer contains options for connecting to an address. </p>
+<p>The zero value for each field is equivalent to dialing without that option. Dialing with the zero value of Dialer is therefore equivalent to just calling the <a href="#Dial">Dial</a> function. </p>
+<p>It is safe to call Dialer's methods concurrently. </p>
+<pre data-language="go">type Dialer struct {
+ // Timeout is the maximum amount of time a dial will wait for
+ // a connect to complete. If Deadline is also set, it may fail
+ // earlier.
+ //
+ // The default is no timeout.
+ //
+ // When using TCP and dialing a host name with multiple IP
+ // addresses, the timeout may be divided between them.
+ //
+ // With or without a timeout, the operating system may impose
+ // its own earlier timeout. For instance, TCP timeouts are
+ // often around 3 minutes.
+ Timeout time.Duration
+
+ // Deadline is the absolute point in time after which dials
+ // will fail. If Timeout is set, it may fail earlier.
+ // Zero means no deadline, or dependent on the operating system
+ // as with the Timeout option.
+ Deadline time.Time
+
+ // LocalAddr is the local address to use when dialing an
+ // address. The address must be of a compatible type for the
+ // network being dialed.
+ // If nil, a local address is automatically chosen.
+ LocalAddr Addr
+
+ // DualStack previously enabled RFC 6555 Fast Fallback
+ // support, also known as "Happy Eyeballs", in which IPv4 is
+ // tried soon if IPv6 appears to be misconfigured and
+ // hanging.
+ //
+ // Deprecated: Fast Fallback is enabled by default. To
+ // disable, set FallbackDelay to a negative value.
+ DualStack bool // Go 1.2
+
+ // FallbackDelay specifies the length of time to wait before
+ // spawning a RFC 6555 Fast Fallback connection. That is, this
+ // is the amount of time to wait for IPv6 to succeed before
+ // assuming that IPv6 is misconfigured and falling back to
+ // IPv4.
+ //
+ // If zero, a default delay of 300ms is used.
+ // A negative value disables Fast Fallback support.
+ FallbackDelay time.Duration // Go 1.5
+
+ // KeepAlive specifies the interval between keep-alive
+ // probes for an active network connection.
+ // If zero, keep-alive probes are sent with a default value
+ // (currently 15 seconds), if supported by the protocol and operating
+ // system. Network protocols or operating systems that do
+ // not support keep-alives ignore this field.
+ // If negative, keep-alive probes are disabled.
+ KeepAlive time.Duration // Go 1.3
+
+ // Resolver optionally specifies an alternate resolver to use.
+ Resolver *Resolver // Go 1.8
+
+ // Cancel is an optional channel whose closure indicates that
+ // the dial should be canceled. Not all types of dials support
+ // cancellation.
+ //
+ // Deprecated: Use DialContext instead.
+ Cancel &lt;-chan struct{} // Go 1.6
+
+ // If Control is not nil, it is called after creating the network
+ // connection but before actually dialing.
+ //
+ // Network and address parameters passed to Control function are not
+ // necessarily the ones passed to Dial. For example, passing "tcp" to Dial
+ // will cause the Control function to be called with "tcp4" or "tcp6".
+ //
+ // Control is ignored if ControlContext is not nil.
+ Control func(network, address string, c syscall.RawConn) error // Go 1.11
+
+ // If ControlContext is not nil, it is called after creating the network
+ // connection but before actually dialing.
+ //
+ // Network and address parameters passed to ControlContext function are not
+ // necessarily the ones passed to Dial. For example, passing "tcp" to Dial
+ // will cause the ControlContext function to be called with "tcp4" or "tcp6".
+ //
+ // If ControlContext is not nil, Control is ignored.
+ ControlContext func(ctx context.Context, network, address string, c syscall.RawConn) error // Go 1.20
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Dialer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+var d net.Dialer
+ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
+defer cancel()
+
+conn, err := d.DialContext(ctx, "tcp", "localhost:12345")
+if err != nil {
+ log.Fatalf("Failed to dial: %v", err)
+}
+defer conn.Close()
+
+if _, err := conn.Write([]byte("Hello, World!")); err != nil {
+ log.Fatal(err)
+}
+</pre> <h4 id="example_Dialer_unix"> <span class="text">Example (Unix)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// DialUnix does not take a context.Context parameter. This example shows
+// how to dial a Unix socket with a Context. Note that the Context only
+// applies to the dial operation; it does not apply to the connection once
+// it has been established.
+var d net.Dialer
+ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
+defer cancel()
+
+d.LocalAddr = nil // if you have a local addr, add it here
+raddr := net.UnixAddr{Name: "/path/to/unix.sock", Net: "unix"}
+conn, err := d.DialContext(ctx, "unix", raddr.String())
+if err != nil {
+ log.Fatalf("Failed to dial: %v", err)
+}
+defer conn.Close()
+if _, err := conn.Write([]byte("Hello, socket!")); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="Dialer.Dial">func (*Dialer) <span>Dial</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (d *Dialer) Dial(network, address string) (Conn, error)</pre> <p>Dial connects to the address on the named network. </p>
+<p>See func Dial for a description of the network and address parameters. </p>
+<p>Dial uses <span>context.Background</span> internally; to specify the context, use <a href="#Dialer.DialContext">Dialer.DialContext</a>. </p>
+<h3 id="Dialer.DialContext">func (*Dialer) <span>DialContext</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (d *Dialer) DialContext(ctx context.Context, network, address string) (Conn, error)</pre> <p>DialContext connects to the address on the named network using the provided context. </p>
+<p>The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context will not affect the connection. </p>
+<p>When using TCP, and the host in the address parameter resolves to multiple network addresses, any dial timeout (from d.Timeout or ctx) is spread over each consecutive dial, such that each is given an appropriate fraction of the time to connect. For example, if a host has 4 IP addresses and the timeout is 1 minute, the connect to each single address will be given 15 seconds to complete before trying the next one. </p>
+<p>See func <a href="#Dial">Dial</a> for a description of the network and address parameters. </p>
+<h3 id="Dialer.MultipathTCP">func (*Dialer) <span>MultipathTCP</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (d *Dialer) MultipathTCP() bool</pre> <p>MultipathTCP reports whether MPTCP will be used. </p>
+<p>This method doesn't check if MPTCP is supported by the operating system or not. </p>
+<h3 id="Dialer.SetMultipathTCP">func (*Dialer) <span>SetMultipathTCP</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (d *Dialer) SetMultipathTCP(use bool)</pre> <p>SetMultipathTCP directs the <a href="#Dial">Dial</a> methods to use, or not use, MPTCP, if supported by the operating system. This method overrides the system default and the GODEBUG=multipathtcp=... setting if any. </p>
+<p>If MPTCP is not available on the host or not supported by the server, the Dial methods will fall back to TCP. </p>
+<h2 id="Error">type <span>Error</span> </h2> <p>An Error represents a network error. </p>
+<pre data-language="go">type Error interface {
+ error
+ Timeout() bool // Is the error a timeout?
+
+ // Deprecated: Temporary errors are not well-defined.
+ // Most "temporary" errors are timeouts, and the few exceptions are surprising.
+ // Do not use this method.
+ Temporary() bool
+}</pre> <h2 id="Flags">type <span>Flags</span> </h2> <pre data-language="go">type Flags uint</pre> <pre data-language="go">const (
+ FlagUp Flags = 1 &lt;&lt; iota // interface is administratively up
+ FlagBroadcast // interface supports broadcast access capability
+ FlagLoopback // interface is a loopback interface
+ FlagPointToPoint // interface belongs to a point-to-point link
+ FlagMulticast // interface supports multicast access capability
+ FlagRunning // interface is in running state
+)</pre> <h3 id="Flags.String">func (Flags) <span>String</span> </h3> <pre data-language="go">func (f Flags) String() string</pre> <h2 id="HardwareAddr">type <span>HardwareAddr</span> </h2> <p>A HardwareAddr represents a physical hardware address. </p>
+<pre data-language="go">type HardwareAddr []byte</pre> <h3 id="ParseMAC">func <span>ParseMAC</span> </h3> <pre data-language="go">func ParseMAC(s string) (hw HardwareAddr, err error)</pre> <p>ParseMAC parses s as an IEEE 802 MAC-48, EUI-48, EUI-64, or a 20-octet IP over InfiniBand link-layer address using one of the following formats: </p>
+<pre data-language="go">00:00:5e:00:53:01
+02:00:5e:10:00:00:00:01
+00:00:00:00:fe:80:00:00:00:00:00:00:02:00:5e:10:00:00:00:01
+00-00-5e-00-53-01
+02-00-5e-10-00-00-00-01
+00-00-00-00-fe-80-00-00-00-00-00-00-02-00-5e-10-00-00-00-01
+0000.5e00.5301
+0200.5e10.0000.0001
+0000.0000.fe80.0000.0000.0000.0200.5e10.0000.0001
+</pre> <h3 id="HardwareAddr.String">func (HardwareAddr) <span>String</span> </h3> <pre data-language="go">func (a HardwareAddr) String() string</pre> <h2 id="IP">type <span>IP</span> </h2> <p>An IP is a single IP address, a slice of bytes. Functions in this package accept either 4-byte (IPv4) or 16-byte (IPv6) slices as input. </p>
+<p>Note that in this documentation, referring to an IP address as an IPv4 address or an IPv6 address is a semantic property of the address, not just the length of the byte slice: a 16-byte slice can still be an IPv4 address. </p>
+<pre data-language="go">type IP []byte</pre> <h4 id="example_IP_to4"> <span class="text">Example (To4)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6 := net.IP{0xfc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ipv4 := net.IPv4(10, 255, 0, 0)
+
+fmt.Println(ipv6.To4())
+fmt.Println(ipv4.To4())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">&lt;nil&gt;
+10.255.0.0
+</pre> <h3 id="IPv4">func <span>IPv4</span> </h3> <pre data-language="go">func IPv4(a, b, c, d byte) IP</pre> <p>IPv4 returns the IP address (in 16-byte form) of the IPv4 address a.b.c.d. </p> <h4 id="example_IPv4"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(net.IPv4(8, 8, 8, 8))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">8.8.8.8
+</pre> <h3 id="LookupIP">func <span>LookupIP</span> </h3> <pre data-language="go">func LookupIP(host string) ([]IP, error)</pre> <p>LookupIP looks up host using the local resolver. It returns a slice of that host's IPv4 and IPv6 addresses. </p>
+<h3 id="ParseIP">func <span>ParseIP</span> </h3> <pre data-language="go">func ParseIP(s string) IP</pre> <p>ParseIP parses s as an IP address, returning the result. The string s can be in IPv4 dotted decimal ("192.0.2.1"), IPv6 ("2001:db8::68"), or IPv4-mapped IPv6 ("::ffff:192.0.2.1") form. If s is not a valid textual representation of an IP address, ParseIP returns nil. </p> <h4 id="example_ParseIP"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(net.ParseIP("192.0.2.1"))
+fmt.Println(net.ParseIP("2001:db8::68"))
+fmt.Println(net.ParseIP("192.0.2"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">192.0.2.1
+2001:db8::68
+&lt;nil&gt;
+</pre> <h3 id="IP.DefaultMask">func (IP) <span>DefaultMask</span> </h3> <pre data-language="go">func (ip IP) DefaultMask() IPMask</pre> <p>DefaultMask returns the default IP mask for the IP address ip. Only IPv4 addresses have default masks; DefaultMask returns nil if ip is not a valid IPv4 address. </p> <h4 id="example_IP_DefaultMask"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ip := net.ParseIP("192.0.2.1")
+fmt.Println(ip.DefaultMask())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">ffffff00
+</pre> <h3 id="IP.Equal">func (IP) <span>Equal</span> </h3> <pre data-language="go">func (ip IP) Equal(x IP) bool</pre> <p>Equal reports whether ip and x are the same IP address. An IPv4 address and that same address in IPv6 form are considered to be equal. </p> <h4 id="example_IP_Equal"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv4DNS := net.ParseIP("8.8.8.8")
+ipv4Lo := net.ParseIP("127.0.0.1")
+ipv6DNS := net.ParseIP("0:0:0:0:0:FFFF:0808:0808")
+
+fmt.Println(ipv4DNS.Equal(ipv4DNS))
+fmt.Println(ipv4DNS.Equal(ipv4Lo))
+fmt.Println(ipv4DNS.Equal(ipv6DNS))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+</pre> <h3 id="IP.IsGlobalUnicast">func (IP) <span>IsGlobalUnicast</span> </h3> <pre data-language="go">func (ip IP) IsGlobalUnicast() bool</pre> <p>IsGlobalUnicast reports whether ip is a global unicast address. </p>
+<p>The identification of global unicast addresses uses address type identification as defined in RFC 1122, RFC 4632 and RFC 4291 with the exception of IPv4 directed broadcast addresses. It returns true even if ip is in IPv4 private address space or local IPv6 unicast address space. </p> <h4 id="example_IP_IsGlobalUnicast"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6Global := net.ParseIP("2000::")
+ipv6UniqLocal := net.ParseIP("2000::")
+ipv6Multi := net.ParseIP("FF00::")
+
+ipv4Private := net.ParseIP("10.255.0.0")
+ipv4Public := net.ParseIP("8.8.8.8")
+ipv4Broadcast := net.ParseIP("255.255.255.255")
+
+fmt.Println(ipv6Global.IsGlobalUnicast())
+fmt.Println(ipv6UniqLocal.IsGlobalUnicast())
+fmt.Println(ipv6Multi.IsGlobalUnicast())
+
+fmt.Println(ipv4Private.IsGlobalUnicast())
+fmt.Println(ipv4Public.IsGlobalUnicast())
+fmt.Println(ipv4Broadcast.IsGlobalUnicast())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+true
+false
+true
+true
+false
+</pre> <h3 id="IP.IsInterfaceLocalMulticast">func (IP) <span>IsInterfaceLocalMulticast</span> </h3> <pre data-language="go">func (ip IP) IsInterfaceLocalMulticast() bool</pre> <p>IsInterfaceLocalMulticast reports whether ip is an interface-local multicast address. </p> <h4 id="example_IP_IsInterfaceLocalMulticast"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6InterfaceLocalMulti := net.ParseIP("ff01::1")
+ipv6Global := net.ParseIP("2000::")
+ipv4 := net.ParseIP("255.0.0.0")
+
+fmt.Println(ipv6InterfaceLocalMulti.IsInterfaceLocalMulticast())
+fmt.Println(ipv6Global.IsInterfaceLocalMulticast())
+fmt.Println(ipv4.IsInterfaceLocalMulticast())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+false
+</pre> <h3 id="IP.IsLinkLocalMulticast">func (IP) <span>IsLinkLocalMulticast</span> </h3> <pre data-language="go">func (ip IP) IsLinkLocalMulticast() bool</pre> <p>IsLinkLocalMulticast reports whether ip is a link-local multicast address. </p> <h4 id="example_IP_IsLinkLocalMulticast"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6LinkLocalMulti := net.ParseIP("ff02::2")
+ipv6LinkLocalUni := net.ParseIP("fe80::")
+ipv4LinkLocalMulti := net.ParseIP("224.0.0.0")
+ipv4LinkLocalUni := net.ParseIP("169.254.0.0")
+
+fmt.Println(ipv6LinkLocalMulti.IsLinkLocalMulticast())
+fmt.Println(ipv6LinkLocalUni.IsLinkLocalMulticast())
+fmt.Println(ipv4LinkLocalMulti.IsLinkLocalMulticast())
+fmt.Println(ipv4LinkLocalUni.IsLinkLocalMulticast())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+false
+</pre> <h3 id="IP.IsLinkLocalUnicast">func (IP) <span>IsLinkLocalUnicast</span> </h3> <pre data-language="go">func (ip IP) IsLinkLocalUnicast() bool</pre> <p>IsLinkLocalUnicast reports whether ip is a link-local unicast address. </p> <h4 id="example_IP_IsLinkLocalUnicast"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6LinkLocalUni := net.ParseIP("fe80::")
+ipv6Global := net.ParseIP("2000::")
+ipv4LinkLocalUni := net.ParseIP("169.254.0.0")
+ipv4LinkLocalMulti := net.ParseIP("224.0.0.0")
+
+fmt.Println(ipv6LinkLocalUni.IsLinkLocalUnicast())
+fmt.Println(ipv6Global.IsLinkLocalUnicast())
+fmt.Println(ipv4LinkLocalUni.IsLinkLocalUnicast())
+fmt.Println(ipv4LinkLocalMulti.IsLinkLocalUnicast())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+false
+</pre> <h3 id="IP.IsLoopback">func (IP) <span>IsLoopback</span> </h3> <pre data-language="go">func (ip IP) IsLoopback() bool</pre> <p>IsLoopback reports whether ip is a loopback address. </p> <h4 id="example_IP_IsLoopback"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6Lo := net.ParseIP("::1")
+ipv6 := net.ParseIP("ff02::1")
+ipv4Lo := net.ParseIP("127.0.0.0")
+ipv4 := net.ParseIP("128.0.0.0")
+
+fmt.Println(ipv6Lo.IsLoopback())
+fmt.Println(ipv6.IsLoopback())
+fmt.Println(ipv4Lo.IsLoopback())
+fmt.Println(ipv4.IsLoopback())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+false
+</pre> <h3 id="IP.IsMulticast">func (IP) <span>IsMulticast</span> </h3> <pre data-language="go">func (ip IP) IsMulticast() bool</pre> <p>IsMulticast reports whether ip is a multicast address. </p> <h4 id="example_IP_IsMulticast"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6Multi := net.ParseIP("FF00::")
+ipv6LinkLocalMulti := net.ParseIP("ff02::1")
+ipv6Lo := net.ParseIP("::1")
+ipv4Multi := net.ParseIP("239.0.0.0")
+ipv4LinkLocalMulti := net.ParseIP("224.0.0.0")
+ipv4Lo := net.ParseIP("127.0.0.0")
+
+fmt.Println(ipv6Multi.IsMulticast())
+fmt.Println(ipv6LinkLocalMulti.IsMulticast())
+fmt.Println(ipv6Lo.IsMulticast())
+fmt.Println(ipv4Multi.IsMulticast())
+fmt.Println(ipv4LinkLocalMulti.IsMulticast())
+fmt.Println(ipv4Lo.IsMulticast())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+true
+false
+true
+true
+false
+</pre> <h3 id="IP.IsPrivate">func (IP) <span>IsPrivate</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (ip IP) IsPrivate() bool</pre> <p>IsPrivate reports whether ip is a private address, according to RFC 1918 (IPv4 addresses) and RFC 4193 (IPv6 addresses). </p> <h4 id="example_IP_IsPrivate"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6Private := net.ParseIP("fc00::")
+ipv6Public := net.ParseIP("fe00::")
+ipv4Private := net.ParseIP("10.255.0.0")
+ipv4Public := net.ParseIP("11.0.0.0")
+
+fmt.Println(ipv6Private.IsPrivate())
+fmt.Println(ipv6Public.IsPrivate())
+fmt.Println(ipv4Private.IsPrivate())
+fmt.Println(ipv4Public.IsPrivate())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+false
+</pre> <h3 id="IP.IsUnspecified">func (IP) <span>IsUnspecified</span> </h3> <pre data-language="go">func (ip IP) IsUnspecified() bool</pre> <p>IsUnspecified reports whether ip is an unspecified address, either the IPv4 address "0.0.0.0" or the IPv6 address "::". </p> <h4 id="example_IP_IsUnspecified"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6Unspecified := net.ParseIP("::")
+ipv6Specified := net.ParseIP("fe00::")
+ipv4Unspecified := net.ParseIP("0.0.0.0")
+ipv4Specified := net.ParseIP("8.8.8.8")
+
+fmt.Println(ipv6Unspecified.IsUnspecified())
+fmt.Println(ipv6Specified.IsUnspecified())
+fmt.Println(ipv4Unspecified.IsUnspecified())
+fmt.Println(ipv4Specified.IsUnspecified())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+false
+</pre> <h3 id="IP.MarshalText">func (IP) <span>MarshalText</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (ip IP) MarshalText() ([]byte, error)</pre> <p>MarshalText implements the <span>encoding.TextMarshaler</span> interface. The encoding is the same as returned by <a href="#IP.String">IP.String</a>, with one exception: When len(ip) is zero, it returns an empty slice. </p>
+<h3 id="IP.Mask">func (IP) <span>Mask</span> </h3> <pre data-language="go">func (ip IP) Mask(mask IPMask) IP</pre> <p>Mask returns the result of masking the IP address ip with mask. </p> <h4 id="example_IP_Mask"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv4Addr := net.ParseIP("192.0.2.1")
+// This mask corresponds to a /24 subnet for IPv4.
+ipv4Mask := net.CIDRMask(24, 32)
+fmt.Println(ipv4Addr.Mask(ipv4Mask))
+
+ipv6Addr := net.ParseIP("2001:db8:a0b:12f0::1")
+// This mask corresponds to a /32 subnet for IPv6.
+ipv6Mask := net.CIDRMask(32, 128)
+fmt.Println(ipv6Addr.Mask(ipv6Mask))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">192.0.2.0
+2001:db8::
+</pre> <h3 id="IP.String">func (IP) <span>String</span> </h3> <pre data-language="go">func (ip IP) String() string</pre> <p>String returns the string form of the IP address ip. It returns one of 4 forms: </p>
+<ul> <li>"&lt;nil&gt;", if ip has length 0 </li>
+<li>dotted decimal ("192.0.2.1"), if ip is an IPv4 or IP4-mapped IPv6 address </li>
+<li>IPv6 conforming to RFC 5952 ("2001:db8::1"), if ip is a valid IPv6 address </li>
+<li>the hexadecimal form of ip, without punctuation, if no other cases apply </li>
+</ul> <h4 id="example_IP_String"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6 := net.IP{0xfc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ipv4 := net.IPv4(10, 255, 0, 0)
+
+fmt.Println(ipv6.String())
+fmt.Println(ipv4.String())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">fc00::
+10.255.0.0
+</pre> <h3 id="IP.To16">func (IP) <span>To16</span> </h3> <pre data-language="go">func (ip IP) To16() IP</pre> <p>To16 converts the IP address ip to a 16-byte representation. If ip is not an IP address (it is the wrong length), To16 returns nil. </p> <h4 id="example_IP_To16"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">ipv6 := net.IP{0xfc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ipv4 := net.IPv4(10, 255, 0, 0)
+
+fmt.Println(ipv6.To16())
+fmt.Println(ipv4.To16())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">fc00::
+10.255.0.0
+</pre> <h3 id="IP.To4">func (IP) <span>To4</span> </h3> <pre data-language="go">func (ip IP) To4() IP</pre> <p>To4 converts the IPv4 address ip to a 4-byte representation. If ip is not an IPv4 address, To4 returns nil. </p>
+<h3 id="IP.UnmarshalText">func (*IP) <span>UnmarshalText</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (ip *IP) UnmarshalText(text []byte) error</pre> <p>UnmarshalText implements the <span>encoding.TextUnmarshaler</span> interface. The IP address is expected in a form accepted by <a href="#ParseIP">ParseIP</a>. </p>
+<h2 id="IPAddr">type <span>IPAddr</span> </h2> <p>IPAddr represents the address of an IP end point. </p>
+<pre data-language="go">type IPAddr struct {
+ IP IP
+ Zone string // IPv6 scoped addressing zone; added in Go 1.1
+}
+</pre> <h3 id="ResolveIPAddr">func <span>ResolveIPAddr</span> </h3> <pre data-language="go">func ResolveIPAddr(network, address string) (*IPAddr, error)</pre> <p>ResolveIPAddr returns an address of IP end point. </p>
+<p>The network must be an IP network name. </p>
+<p>If the host in the address parameter is not a literal IP address, ResolveIPAddr resolves the address to an address of IP end point. Otherwise, it parses the address as a literal IP address. The address parameter can use a host name, but this is not recommended, because it will return at most one of the host name's IP addresses. </p>
+<p>See func <a href="#Dial">Dial</a> for a description of the network and address parameters. </p>
+<h3 id="IPAddr.Network">func (*IPAddr) <span>Network</span> </h3> <pre data-language="go">func (a *IPAddr) Network() string</pre> <p>Network returns the address's network name, "ip". </p>
+<h3 id="IPAddr.String">func (*IPAddr) <span>String</span> </h3> <pre data-language="go">func (a *IPAddr) String() string</pre> <h2 id="IPConn">type <span>IPConn</span> </h2> <p>IPConn is the implementation of the <a href="#Conn">Conn</a> and <a href="#PacketConn">PacketConn</a> interfaces for IP network connections. </p>
+<pre data-language="go">type IPConn struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="DialIP">func <span>DialIP</span> </h3> <pre data-language="go">func DialIP(network string, laddr, raddr *IPAddr) (*IPConn, error)</pre> <p>DialIP acts like <a href="#Dial">Dial</a> for IP networks. </p>
+<p>The network must be an IP network name; see func Dial for details. </p>
+<p>If laddr is nil, a local address is automatically chosen. If the IP field of raddr is nil or an unspecified IP address, the local system is assumed. </p>
+<h3 id="ListenIP">func <span>ListenIP</span> </h3> <pre data-language="go">func ListenIP(network string, laddr *IPAddr) (*IPConn, error)</pre> <p>ListenIP acts like <a href="#ListenPacket">ListenPacket</a> for IP networks. </p>
+<p>The network must be an IP network name; see func Dial for details. </p>
+<p>If the IP field of laddr is nil or an unspecified IP address, ListenIP listens on all available IP addresses of the local system except multicast IP addresses. </p>
+<h3 id="IPConn.Close">func (*IPConn) <span>Close</span> </h3> <pre data-language="go">func (c *IPConn) Close() error</pre> <p>Close closes the connection. </p>
+<h3 id="IPConn.File">func (*IPConn) <span>File</span> </h3> <pre data-language="go">func (c *IPConn) File() (f *os.File, err error)</pre> <p>File returns a copy of the underlying <span>os.File</span>. It is the caller's responsibility to close f when finished. Closing c does not affect f, and closing f does not affect c. </p>
+<p>The returned os.File's file descriptor is different from the connection's. Attempting to change properties of the original using this duplicate may or may not have the desired effect. </p>
+<h3 id="IPConn.LocalAddr">func (*IPConn) <span>LocalAddr</span> </h3> <pre data-language="go">func (c *IPConn) LocalAddr() Addr</pre> <p>LocalAddr returns the local network address. The Addr returned is shared by all invocations of LocalAddr, so do not modify it. </p>
+<h3 id="IPConn.Read">func (*IPConn) <span>Read</span> </h3> <pre data-language="go">func (c *IPConn) Read(b []byte) (int, error)</pre> <p>Read implements the Conn Read method. </p>
+<h3 id="IPConn.ReadFrom">func (*IPConn) <span>ReadFrom</span> </h3> <pre data-language="go">func (c *IPConn) ReadFrom(b []byte) (int, Addr, error)</pre> <p>ReadFrom implements the <a href="#PacketConn">PacketConn</a> ReadFrom method. </p>
+<h3 id="IPConn.ReadFromIP">func (*IPConn) <span>ReadFromIP</span> </h3> <pre data-language="go">func (c *IPConn) ReadFromIP(b []byte) (int, *IPAddr, error)</pre> <p>ReadFromIP acts like ReadFrom but returns an IPAddr. </p>
+<h3 id="IPConn.ReadMsgIP">func (*IPConn) <span>ReadMsgIP</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *IPConn) ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *IPAddr, err error)</pre> <p>ReadMsgIP reads a message from c, copying the payload into b and the associated out-of-band data into oob. It returns the number of bytes copied into b, the number of bytes copied into oob, the flags that were set on the message and the source address of the message. </p>
+<p>The packages golang.org/x/net/ipv4 and golang.org/x/net/ipv6 can be used to manipulate IP-level socket options in oob. </p>
+<h3 id="IPConn.RemoteAddr">func (*IPConn) <span>RemoteAddr</span> </h3> <pre data-language="go">func (c *IPConn) RemoteAddr() Addr</pre> <p>RemoteAddr returns the remote network address. The Addr returned is shared by all invocations of RemoteAddr, so do not modify it. </p>
+<h3 id="IPConn.SetDeadline">func (*IPConn) <span>SetDeadline</span> </h3> <pre data-language="go">func (c *IPConn) SetDeadline(t time.Time) error</pre> <p>SetDeadline implements the Conn SetDeadline method. </p>
+<h3 id="IPConn.SetReadBuffer">func (*IPConn) <span>SetReadBuffer</span> </h3> <pre data-language="go">func (c *IPConn) SetReadBuffer(bytes int) error</pre> <p>SetReadBuffer sets the size of the operating system's receive buffer associated with the connection. </p>
+<h3 id="IPConn.SetReadDeadline">func (*IPConn) <span>SetReadDeadline</span> </h3> <pre data-language="go">func (c *IPConn) SetReadDeadline(t time.Time) error</pre> <p>SetReadDeadline implements the Conn SetReadDeadline method. </p>
+<h3 id="IPConn.SetWriteBuffer">func (*IPConn) <span>SetWriteBuffer</span> </h3> <pre data-language="go">func (c *IPConn) SetWriteBuffer(bytes int) error</pre> <p>SetWriteBuffer sets the size of the operating system's transmit buffer associated with the connection. </p>
+<h3 id="IPConn.SetWriteDeadline">func (*IPConn) <span>SetWriteDeadline</span> </h3> <pre data-language="go">func (c *IPConn) SetWriteDeadline(t time.Time) error</pre> <p>SetWriteDeadline implements the Conn SetWriteDeadline method. </p>
+<h3 id="IPConn.SyscallConn">func (*IPConn) <span>SyscallConn</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *IPConn) SyscallConn() (syscall.RawConn, error)</pre> <p>SyscallConn returns a raw network connection. This implements the <span>syscall.Conn</span> interface. </p>
+<h3 id="IPConn.Write">func (*IPConn) <span>Write</span> </h3> <pre data-language="go">func (c *IPConn) Write(b []byte) (int, error)</pre> <p>Write implements the Conn Write method. </p>
+<h3 id="IPConn.WriteMsgIP">func (*IPConn) <span>WriteMsgIP</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *IPConn) WriteMsgIP(b, oob []byte, addr *IPAddr) (n, oobn int, err error)</pre> <p>WriteMsgIP writes a message to addr via c, copying the payload from b and the associated out-of-band data from oob. It returns the number of payload and out-of-band bytes written. </p>
+<p>The packages golang.org/x/net/ipv4 and golang.org/x/net/ipv6 can be used to manipulate IP-level socket options in oob. </p>
+<h3 id="IPConn.WriteTo">func (*IPConn) <span>WriteTo</span> </h3> <pre data-language="go">func (c *IPConn) WriteTo(b []byte, addr Addr) (int, error)</pre> <p>WriteTo implements the <a href="#PacketConn">PacketConn</a> WriteTo method. </p>
+<h3 id="IPConn.WriteToIP">func (*IPConn) <span>WriteToIP</span> </h3> <pre data-language="go">func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error)</pre> <p>WriteToIP acts like <a href="#IPConn.WriteTo">IPConn.WriteTo</a> but takes an <a href="#IPAddr">IPAddr</a>. </p>
+<h2 id="IPMask">type <span>IPMask</span> </h2> <p>An IPMask is a bitmask that can be used to manipulate IP addresses for IP addressing and routing. </p>
+<p>See type <a href="#IPNet">IPNet</a> and func <a href="#ParseCIDR">ParseCIDR</a> for details. </p>
+<pre data-language="go">type IPMask []byte</pre> <h3 id="CIDRMask">func <span>CIDRMask</span> </h3> <pre data-language="go">func CIDRMask(ones, bits int) IPMask</pre> <p>CIDRMask returns an <a href="#IPMask">IPMask</a> consisting of 'ones' 1 bits followed by 0s up to a total length of 'bits' bits. For a mask of this form, CIDRMask is the inverse of <a href="#IPMask.Size">IPMask.Size</a>. </p> <h4 id="example_CIDRMask"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// This mask corresponds to a /31 subnet for IPv4.
+fmt.Println(net.CIDRMask(31, 32))
+
+// This mask corresponds to a /64 subnet for IPv6.
+fmt.Println(net.CIDRMask(64, 128))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">fffffffe
+ffffffffffffffff0000000000000000
+</pre> <h3 id="IPv4Mask">func <span>IPv4Mask</span> </h3> <pre data-language="go">func IPv4Mask(a, b, c, d byte) IPMask</pre> <p>IPv4Mask returns the IP mask (in 4-byte form) of the IPv4 mask a.b.c.d. </p> <h4 id="example_IPv4Mask"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(net.IPv4Mask(255, 255, 255, 0))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">ffffff00
+</pre> <h3 id="IPMask.Size">func (IPMask) <span>Size</span> </h3> <pre data-language="go">func (m IPMask) Size() (ones, bits int)</pre> <p>Size returns the number of leading ones and total bits in the mask. If the mask is not in the canonical form--ones followed by zeros--then Size returns 0, 0. </p>
+<h3 id="IPMask.String">func (IPMask) <span>String</span> </h3> <pre data-language="go">func (m IPMask) String() string</pre> <p>String returns the hexadecimal form of m, with no punctuation. </p>
+<h2 id="IPNet">type <span>IPNet</span> </h2> <p>An IPNet represents an IP network. </p>
+<pre data-language="go">type IPNet struct {
+ IP IP // network number
+ Mask IPMask // network mask
+}
+</pre> <h3 id="IPNet.Contains">func (*IPNet) <span>Contains</span> </h3> <pre data-language="go">func (n *IPNet) Contains(ip IP) bool</pre> <p>Contains reports whether the network includes ip. </p>
+<h3 id="IPNet.Network">func (*IPNet) <span>Network</span> </h3> <pre data-language="go">func (n *IPNet) Network() string</pre> <p>Network returns the address's network name, "ip+net". </p>
+<h3 id="IPNet.String">func (*IPNet) <span>String</span> </h3> <pre data-language="go">func (n *IPNet) String() string</pre> <p>String returns the CIDR notation of n like "192.0.2.0/24" or "2001:db8::/48" as defined in RFC 4632 and RFC 4291. If the mask is not in the canonical form, it returns the string which consists of an IP address, followed by a slash character and a mask expressed as hexadecimal form with no punctuation like "198.51.100.0/c000ff00". </p>
+<h2 id="Interface">type <span>Interface</span> </h2> <p>Interface represents a mapping between network interface name and index. It also represents network interface facility information. </p>
+<pre data-language="go">type Interface struct {
+ Index int // positive integer that starts at one, zero is never used
+ MTU int // maximum transmission unit
+ Name string // e.g., "en0", "lo0", "eth0.100"
+ HardwareAddr HardwareAddr // IEEE MAC-48, EUI-48 and EUI-64 form
+ Flags Flags // e.g., FlagUp, FlagLoopback, FlagMulticast
+}
+</pre> <h3 id="InterfaceByIndex">func <span>InterfaceByIndex</span> </h3> <pre data-language="go">func InterfaceByIndex(index int) (*Interface, error)</pre> <p>InterfaceByIndex returns the interface specified by index. </p>
+<p>On Solaris, it returns one of the logical network interfaces sharing the logical data link; for more precision use <a href="#InterfaceByName">InterfaceByName</a>. </p>
+<h3 id="InterfaceByName">func <span>InterfaceByName</span> </h3> <pre data-language="go">func InterfaceByName(name string) (*Interface, error)</pre> <p>InterfaceByName returns the interface specified by name. </p>
+<h3 id="Interfaces">func <span>Interfaces</span> </h3> <pre data-language="go">func Interfaces() ([]Interface, error)</pre> <p>Interfaces returns a list of the system's network interfaces. </p>
+<h3 id="Interface.Addrs">func (*Interface) <span>Addrs</span> </h3> <pre data-language="go">func (ifi *Interface) Addrs() ([]Addr, error)</pre> <p>Addrs returns a list of unicast interface addresses for a specific interface. </p>
+<h3 id="Interface.MulticastAddrs">func (*Interface) <span>MulticastAddrs</span> </h3> <pre data-language="go">func (ifi *Interface) MulticastAddrs() ([]Addr, error)</pre> <p>MulticastAddrs returns a list of multicast, joined group addresses for a specific interface. </p>
+<h2 id="InvalidAddrError">type <span>InvalidAddrError</span> </h2> <pre data-language="go">type InvalidAddrError string</pre> <h3 id="InvalidAddrError.Error">func (InvalidAddrError) <span>Error</span> </h3> <pre data-language="go">func (e InvalidAddrError) Error() string</pre> <h3 id="InvalidAddrError.Temporary">func (InvalidAddrError) <span>Temporary</span> </h3> <pre data-language="go">func (e InvalidAddrError) Temporary() bool</pre> <h3 id="InvalidAddrError.Timeout">func (InvalidAddrError) <span>Timeout</span> </h3> <pre data-language="go">func (e InvalidAddrError) Timeout() bool</pre> <h2 id="ListenConfig">type <span>ListenConfig</span> <span title="Added in Go 1.11">1.11</span> </h2> <p>ListenConfig contains options for listening to an address. </p>
+<pre data-language="go">type ListenConfig struct {
+ // If Control is not nil, it is called after creating the network
+ // connection but before binding it to the operating system.
+ //
+ // Network and address parameters passed to Control method are not
+ // necessarily the ones passed to Listen. For example, passing "tcp" to
+ // Listen will cause the Control function to be called with "tcp4" or "tcp6".
+ Control func(network, address string, c syscall.RawConn) error
+
+ // KeepAlive specifies the keep-alive period for network
+ // connections accepted by this listener.
+ // If zero, keep-alives are enabled if supported by the protocol
+ // and operating system. Network protocols or operating systems
+ // that do not support keep-alives ignore this field.
+ // If negative, keep-alives are disabled.
+ KeepAlive time.Duration // Go 1.13
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ListenConfig.Listen">func (*ListenConfig) <span>Listen</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (lc *ListenConfig) Listen(ctx context.Context, network, address string) (Listener, error)</pre> <p>Listen announces on the local network address. </p>
+<p>See func Listen for a description of the network and address parameters. </p>
+<h3 id="ListenConfig.ListenPacket">func (*ListenConfig) <span>ListenPacket</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (lc *ListenConfig) ListenPacket(ctx context.Context, network, address string) (PacketConn, error)</pre> <p>ListenPacket announces on the local network address. </p>
+<p>See func ListenPacket for a description of the network and address parameters. </p>
+<h3 id="ListenConfig.MultipathTCP">func (*ListenConfig) <span>MultipathTCP</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (lc *ListenConfig) MultipathTCP() bool</pre> <p>MultipathTCP reports whether MPTCP will be used. </p>
+<p>This method doesn't check if MPTCP is supported by the operating system or not. </p>
+<h3 id="ListenConfig.SetMultipathTCP">func (*ListenConfig) <span>SetMultipathTCP</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (lc *ListenConfig) SetMultipathTCP(use bool)</pre> <p>SetMultipathTCP directs the <a href="#Listen">Listen</a> method to use, or not use, MPTCP, if supported by the operating system. This method overrides the system default and the GODEBUG=multipathtcp=... setting if any. </p>
+<p>If MPTCP is not available on the host or not supported by the client, the Listen method will fall back to TCP. </p>
+<h2 id="Listener">type <span>Listener</span> </h2> <p>A Listener is a generic network listener for stream-oriented protocols. </p>
+<p>Multiple goroutines may invoke methods on a Listener simultaneously. </p>
+<pre data-language="go">type Listener interface {
+ // Accept waits for and returns the next connection to the listener.
+ Accept() (Conn, error)
+
+ // Close closes the listener.
+ // Any blocked Accept operations will be unblocked and return errors.
+ Close() error
+
+ // Addr returns the listener's network address.
+ Addr() Addr
+}</pre> <h4 id="example_Listener"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Listen on TCP port 2000 on all available unicast and
+// anycast IP addresses of the local system.
+l, err := net.Listen("tcp", ":2000")
+if err != nil {
+ log.Fatal(err)
+}
+defer l.Close()
+for {
+ // Wait for a connection.
+ conn, err := l.Accept()
+ if err != nil {
+ log.Fatal(err)
+ }
+ // Handle the connection in a new goroutine.
+ // The loop then returns to accepting, so that
+ // multiple connections may be served concurrently.
+ go func(c net.Conn) {
+ // Echo all incoming data.
+ io.Copy(c, c)
+ // Shut down the connection.
+ c.Close()
+ }(conn)
+}
+</pre> <h3 id="FileListener">func <span>FileListener</span> </h3> <pre data-language="go">func FileListener(f *os.File) (ln Listener, err error)</pre> <p>FileListener returns a copy of the network listener corresponding to the open file f. It is the caller's responsibility to close ln when finished. Closing ln does not affect f, and closing f does not affect ln. </p>
+<h3 id="Listen">func <span>Listen</span> </h3> <pre data-language="go">func Listen(network, address string) (Listener, error)</pre> <p>Listen announces on the local network address. </p>
+<p>The network must be "tcp", "tcp4", "tcp6", "unix" or "unixpacket". </p>
+<p>For TCP networks, if the host in the address parameter is empty or a literal unspecified IP address, Listen listens on all available unicast and anycast IP addresses of the local system. To only use IPv4, use network "tcp4". The address can use a host name, but this is not recommended, because it will create a listener for at most one of the host's IP addresses. If the port in the address parameter is empty or "0", as in "127.0.0.1:" or "[::1]:0", a port number is automatically chosen. The <a href="#Addr">Addr</a> method of <a href="#Listener">Listener</a> can be used to discover the chosen port. </p>
+<p>See func <a href="#Dial">Dial</a> for a description of the network and address parameters. </p>
+<p>Listen uses context.Background internally; to specify the context, use <a href="#ListenConfig.Listen">ListenConfig.Listen</a>. </p>
+<h2 id="MX">type <span>MX</span> </h2> <p>An MX represents a single DNS MX record. </p>
+<pre data-language="go">type MX struct {
+ Host string
+ Pref uint16
+}
+</pre> <h3 id="LookupMX">func <span>LookupMX</span> </h3> <pre data-language="go">func LookupMX(name string) ([]*MX, error)</pre> <p>LookupMX returns the DNS MX records for the given domain name sorted by preference. </p>
+<p>The returned mail server names are validated to be properly formatted presentation-format domain names. If the response contains invalid names, those records are filtered out and an error will be returned alongside the remaining results, if any. </p>
+<p>LookupMX uses <span>context.Background</span> internally; to specify the context, use <a href="#Resolver.LookupMX">Resolver.LookupMX</a>. </p>
+<h2 id="NS">type <span>NS</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>An NS represents a single DNS NS record. </p>
+<pre data-language="go">type NS struct {
+ Host string
+}
+</pre> <h3 id="LookupNS">func <span>LookupNS</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func LookupNS(name string) ([]*NS, error)</pre> <p>LookupNS returns the DNS NS records for the given domain name. </p>
+<p>The returned name server names are validated to be properly formatted presentation-format domain names. If the response contains invalid names, those records are filtered out and an error will be returned alongside the remaining results, if any. </p>
+<p>LookupNS uses <span>context.Background</span> internally; to specify the context, use <a href="#Resolver.LookupNS">Resolver.LookupNS</a>. </p>
+<h2 id="OpError">type <span>OpError</span> </h2> <p>OpError is the error type usually returned by functions in the net package. It describes the operation, network type, and address of an error. </p>
+<pre data-language="go">type OpError struct {
+ // Op is the operation which caused the error, such as
+ // "read" or "write".
+ Op string
+
+ // Net is the network type on which this error occurred,
+ // such as "tcp" or "udp6".
+ Net string
+
+ // For operations involving a remote network connection, like
+ // Dial, Read, or Write, Source is the corresponding local
+ // network address.
+ Source Addr // Go 1.5
+
+ // Addr is the network address for which this error occurred.
+ // For local operations, like Listen or SetDeadline, Addr is
+ // the address of the local endpoint being manipulated.
+ // For operations involving a remote network connection, like
+ // Dial, Read, or Write, Addr is the remote address of that
+ // connection.
+ Addr Addr
+
+ // Err is the error that occurred during the operation.
+ // The Error method panics if the error is nil.
+ Err error
+}
+</pre> <h3 id="OpError.Error">func (*OpError) <span>Error</span> </h3> <pre data-language="go">func (e *OpError) Error() string</pre> <h3 id="OpError.Temporary">func (*OpError) <span>Temporary</span> </h3> <pre data-language="go">func (e *OpError) Temporary() bool</pre> <h3 id="OpError.Timeout">func (*OpError) <span>Timeout</span> </h3> <pre data-language="go">func (e *OpError) Timeout() bool</pre> <h3 id="OpError.Unwrap">func (*OpError) <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e *OpError) Unwrap() error</pre> <h2 id="PacketConn">type <span>PacketConn</span> </h2> <p>PacketConn is a generic packet-oriented network connection. </p>
+<p>Multiple goroutines may invoke methods on a PacketConn simultaneously. </p>
+<pre data-language="go">type PacketConn interface {
+ // ReadFrom reads a packet from the connection,
+ // copying the payload into p. It returns the number of
+ // bytes copied into p and the return address that
+ // was on the packet.
+ // It returns the number of bytes read (0 &lt;= n &lt;= len(p))
+ // and any error encountered. Callers should always process
+ // the n &gt; 0 bytes returned before considering the error err.
+ // ReadFrom can be made to time out and return an error after a
+ // fixed time limit; see SetDeadline and SetReadDeadline.
+ ReadFrom(p []byte) (n int, addr Addr, err error)
+
+ // WriteTo writes a packet with payload p to addr.
+ // WriteTo can be made to time out and return an Error after a
+ // fixed time limit; see SetDeadline and SetWriteDeadline.
+ // On packet-oriented connections, write timeouts are rare.
+ WriteTo(p []byte, addr Addr) (n int, err error)
+
+ // Close closes the connection.
+ // Any blocked ReadFrom or WriteTo operations will be unblocked and return errors.
+ Close() error
+
+ // LocalAddr returns the local network address, if known.
+ LocalAddr() Addr
+
+ // SetDeadline sets the read and write deadlines associated
+ // with the connection. It is equivalent to calling both
+ // SetReadDeadline and SetWriteDeadline.
+ //
+ // A deadline is an absolute time after which I/O operations
+ // fail instead of blocking. The deadline applies to all future
+ // and pending I/O, not just the immediately following call to
+ // Read or Write. After a deadline has been exceeded, the
+ // connection can be refreshed by setting a deadline in the future.
+ //
+ // If the deadline is exceeded a call to Read or Write or to other
+ // I/O methods will return an error that wraps os.ErrDeadlineExceeded.
+ // This can be tested using errors.Is(err, os.ErrDeadlineExceeded).
+ // The error's Timeout method will return true, but note that there
+ // are other possible errors for which the Timeout method will
+ // return true even if the deadline has not been exceeded.
+ //
+ // An idle timeout can be implemented by repeatedly extending
+ // the deadline after successful ReadFrom or WriteTo calls.
+ //
+ // A zero value for t means I/O operations will not time out.
+ SetDeadline(t time.Time) error
+
+ // SetReadDeadline sets the deadline for future ReadFrom calls
+ // and any currently-blocked ReadFrom call.
+ // A zero value for t means ReadFrom will not time out.
+ SetReadDeadline(t time.Time) error
+
+ // SetWriteDeadline sets the deadline for future WriteTo calls
+ // and any currently-blocked WriteTo call.
+ // Even if write times out, it may return n &gt; 0, indicating that
+ // some of the data was successfully written.
+ // A zero value for t means WriteTo will not time out.
+ SetWriteDeadline(t time.Time) error
+}</pre> <h3 id="FilePacketConn">func <span>FilePacketConn</span> </h3> <pre data-language="go">func FilePacketConn(f *os.File) (c PacketConn, err error)</pre> <p>FilePacketConn returns a copy of the packet network connection corresponding to the open file f. It is the caller's responsibility to close f when finished. Closing c does not affect f, and closing f does not affect c. </p>
+<h3 id="ListenPacket">func <span>ListenPacket</span> </h3> <pre data-language="go">func ListenPacket(network, address string) (PacketConn, error)</pre> <p>ListenPacket announces on the local network address. </p>
+<p>The network must be "udp", "udp4", "udp6", "unixgram", or an IP transport. The IP transports are "ip", "ip4", or "ip6" followed by a colon and a literal protocol number or a protocol name, as in "ip:1" or "ip:icmp". </p>
+<p>For UDP and IP networks, if the host in the address parameter is empty or a literal unspecified IP address, ListenPacket listens on all available IP addresses of the local system except multicast IP addresses. To only use IPv4, use network "udp4" or "ip4:proto". The address can use a host name, but this is not recommended, because it will create a listener for at most one of the host's IP addresses. If the port in the address parameter is empty or "0", as in "127.0.0.1:" or "[::1]:0", a port number is automatically chosen. The LocalAddr method of <a href="#PacketConn">PacketConn</a> can be used to discover the chosen port. </p>
+<p>See func <a href="#Dial">Dial</a> for a description of the network and address parameters. </p>
+<p>ListenPacket uses context.Background internally; to specify the context, use <a href="#ListenConfig.ListenPacket">ListenConfig.ListenPacket</a>. </p>
+<h2 id="ParseError">type <span>ParseError</span> </h2> <p>A ParseError is the error type of literal network address parsers. </p>
+<pre data-language="go">type ParseError struct {
+ // Type is the type of string that was expected, such as
+ // "IP address", "CIDR address".
+ Type string
+
+ // Text is the malformed text string.
+ Text string
+}
+</pre> <h3 id="ParseError.Error">func (*ParseError) <span>Error</span> </h3> <pre data-language="go">func (e *ParseError) Error() string</pre> <h3 id="ParseError.Temporary">func (*ParseError) <span>Temporary</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (e *ParseError) Temporary() bool</pre> <h3 id="ParseError.Timeout">func (*ParseError) <span>Timeout</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (e *ParseError) Timeout() bool</pre> <h2 id="Resolver">type <span>Resolver</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>A Resolver looks up names and numbers. </p>
+<p>A nil *Resolver is equivalent to a zero Resolver. </p>
+<pre data-language="go">type Resolver struct {
+ // PreferGo controls whether Go's built-in DNS resolver is preferred
+ // on platforms where it's available. It is equivalent to setting
+ // GODEBUG=netdns=go, but scoped to just this resolver.
+ PreferGo bool
+
+ // StrictErrors controls the behavior of temporary errors
+ // (including timeout, socket errors, and SERVFAIL) when using
+ // Go's built-in resolver. For a query composed of multiple
+ // sub-queries (such as an A+AAAA address lookup, or walking the
+ // DNS search list), this option causes such errors to abort the
+ // whole query instead of returning a partial result. This is
+ // not enabled by default because it may affect compatibility
+ // with resolvers that process AAAA queries incorrectly.
+ StrictErrors bool // Go 1.9
+
+ // Dial optionally specifies an alternate dialer for use by
+ // Go's built-in DNS resolver to make TCP and UDP connections
+ // to DNS services. The host in the address parameter will
+ // always be a literal IP address and not a host name, and the
+ // port in the address parameter will be a literal port number
+ // and not a service name.
+ // If the Conn returned is also a PacketConn, sent and received DNS
+ // messages must adhere to RFC 1035 section 4.2.1, "UDP usage".
+ // Otherwise, DNS messages transmitted over Conn must adhere
+ // to RFC 7766 section 5, "Transport Protocol Selection".
+ // If nil, the default dialer is used.
+ Dial func(ctx context.Context, network, address string) (Conn, error) // Go 1.9
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Resolver.LookupAddr">func (*Resolver) <span>LookupAddr</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Resolver) LookupAddr(ctx context.Context, addr string) ([]string, error)</pre> <p>LookupAddr performs a reverse lookup for the given address, returning a list of names mapping to that address. </p>
+<p>The returned names are validated to be properly formatted presentation-format domain names. If the response contains invalid names, those records are filtered out and an error will be returned alongside the remaining results, if any. </p>
+<h3 id="Resolver.LookupCNAME">func (*Resolver) <span>LookupCNAME</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Resolver) LookupCNAME(ctx context.Context, host string) (string, error)</pre> <p>LookupCNAME returns the canonical name for the given host. Callers that do not care about the canonical name can call <a href="#LookupHost">LookupHost</a> or <a href="#LookupIP">LookupIP</a> directly; both take care of resolving the canonical name as part of the lookup. </p>
+<p>A canonical name is the final name after following zero or more CNAME records. LookupCNAME does not return an error if host does not contain DNS "CNAME" records, as long as host resolves to address records. </p>
+<p>The returned canonical name is validated to be a properly formatted presentation-format domain name. </p>
+<h3 id="Resolver.LookupHost">func (*Resolver) <span>LookupHost</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Resolver) LookupHost(ctx context.Context, host string) (addrs []string, err error)</pre> <p>LookupHost looks up the given host using the local resolver. It returns a slice of that host's addresses. </p>
+<h3 id="Resolver.LookupIP">func (*Resolver) <span>LookupIP</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (r *Resolver) LookupIP(ctx context.Context, network, host string) ([]IP, error)</pre> <p>LookupIP looks up host for the given network using the local resolver. It returns a slice of that host's IP addresses of the type specified by network. network must be one of "ip", "ip4" or "ip6". </p>
+<h3 id="Resolver.LookupIPAddr">func (*Resolver) <span>LookupIPAddr</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Resolver) LookupIPAddr(ctx context.Context, host string) ([]IPAddr, error)</pre> <p>LookupIPAddr looks up host using the local resolver. It returns a slice of that host's IPv4 and IPv6 addresses. </p>
+<h3 id="Resolver.LookupMX">func (*Resolver) <span>LookupMX</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Resolver) LookupMX(ctx context.Context, name string) ([]*MX, error)</pre> <p>LookupMX returns the DNS MX records for the given domain name sorted by preference. </p>
+<p>The returned mail server names are validated to be properly formatted presentation-format domain names. If the response contains invalid names, those records are filtered out and an error will be returned alongside the remaining results, if any. </p>
+<h3 id="Resolver.LookupNS">func (*Resolver) <span>LookupNS</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Resolver) LookupNS(ctx context.Context, name string) ([]*NS, error)</pre> <p>LookupNS returns the DNS NS records for the given domain name. </p>
+<p>The returned name server names are validated to be properly formatted presentation-format domain names. If the response contains invalid names, those records are filtered out and an error will be returned alongside the remaining results, if any. </p>
+<h3 id="Resolver.LookupNetIP">func (*Resolver) <span>LookupNetIP</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (r *Resolver) LookupNetIP(ctx context.Context, network, host string) ([]netip.Addr, error)</pre> <p>LookupNetIP looks up host using the local resolver. It returns a slice of that host's IP addresses of the type specified by network. The network must be one of "ip", "ip4" or "ip6". </p>
+<h3 id="Resolver.LookupPort">func (*Resolver) <span>LookupPort</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Resolver) LookupPort(ctx context.Context, network, service string) (port int, err error)</pre> <p>LookupPort looks up the port for the given network and service. </p>
+<p>The network must be one of "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6" or "ip". </p>
+<h3 id="Resolver.LookupSRV">func (*Resolver) <span>LookupSRV</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Resolver) LookupSRV(ctx context.Context, service, proto, name string) (string, []*SRV, error)</pre> <p>LookupSRV tries to resolve an <a href="#SRV">SRV</a> query of the given service, protocol, and domain name. The proto is "tcp" or "udp". The returned records are sorted by priority and randomized by weight within a priority. </p>
+<p>LookupSRV constructs the DNS name to look up following RFC 2782. That is, it looks up _service._proto.name. To accommodate services publishing SRV records under non-standard names, if both service and proto are empty strings, LookupSRV looks up name directly. </p>
+<p>The returned service names are validated to be properly formatted presentation-format domain names. If the response contains invalid names, those records are filtered out and an error will be returned alongside the remaining results, if any. </p>
+<h3 id="Resolver.LookupTXT">func (*Resolver) <span>LookupTXT</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (r *Resolver) LookupTXT(ctx context.Context, name string) ([]string, error)</pre> <p>LookupTXT returns the DNS TXT records for the given domain name. </p>
+<h2 id="SRV">type <span>SRV</span> </h2> <p>An SRV represents a single DNS SRV record. </p>
+<pre data-language="go">type SRV struct {
+ Target string
+ Port uint16
+ Priority uint16
+ Weight uint16
+}
+</pre> <h3 id="LookupSRV">func <span>LookupSRV</span> </h3> <pre data-language="go">func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error)</pre> <p>LookupSRV tries to resolve an <a href="#SRV">SRV</a> query of the given service, protocol, and domain name. The proto is "tcp" or "udp". The returned records are sorted by priority and randomized by weight within a priority. </p>
+<p>LookupSRV constructs the DNS name to look up following RFC 2782. That is, it looks up _service._proto.name. To accommodate services publishing SRV records under non-standard names, if both service and proto are empty strings, LookupSRV looks up name directly. </p>
+<p>The returned service names are validated to be properly formatted presentation-format domain names. If the response contains invalid names, those records are filtered out and an error will be returned alongside the remaining results, if any. </p>
+<h2 id="TCPAddr">type <span>TCPAddr</span> </h2> <p>TCPAddr represents the address of a TCP end point. </p>
+<pre data-language="go">type TCPAddr struct {
+ IP IP
+ Port int
+ Zone string // IPv6 scoped addressing zone; added in Go 1.1
+}
+</pre> <h3 id="ResolveTCPAddr">func <span>ResolveTCPAddr</span> </h3> <pre data-language="go">func ResolveTCPAddr(network, address string) (*TCPAddr, error)</pre> <p>ResolveTCPAddr returns an address of TCP end point. </p>
+<p>The network must be a TCP network name. </p>
+<p>If the host in the address parameter is not a literal IP address or the port is not a literal port number, ResolveTCPAddr resolves the address to an address of TCP end point. Otherwise, it parses the address as a pair of literal IP address and port number. The address parameter can use a host name, but this is not recommended, because it will return at most one of the host name's IP addresses. </p>
+<p>See func <a href="#Dial">Dial</a> for a description of the network and address parameters. </p>
+<h3 id="TCPAddrFromAddrPort">func <span>TCPAddrFromAddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func TCPAddrFromAddrPort(addr netip.AddrPort) *TCPAddr</pre> <p>TCPAddrFromAddrPort returns addr as a <a href="#TCPAddr">TCPAddr</a>. If addr.IsValid() is false, then the returned TCPAddr will contain a nil IP field, indicating an address family-agnostic unspecified address. </p>
+<h3 id="TCPAddr.AddrPort">func (*TCPAddr) <span>AddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (a *TCPAddr) AddrPort() netip.AddrPort</pre> <p>AddrPort returns the <a href="#TCPAddr">TCPAddr</a> a as a <span>netip.AddrPort</span>. </p>
+<p>If a.Port does not fit in a uint16, it's silently truncated. </p>
+<p>If a is nil, a zero value is returned. </p>
+<h3 id="TCPAddr.Network">func (*TCPAddr) <span>Network</span> </h3> <pre data-language="go">func (a *TCPAddr) Network() string</pre> <p>Network returns the address's network name, "tcp". </p>
+<h3 id="TCPAddr.String">func (*TCPAddr) <span>String</span> </h3> <pre data-language="go">func (a *TCPAddr) String() string</pre> <h2 id="TCPConn">type <span>TCPConn</span> </h2> <p>TCPConn is an implementation of the <a href="#Conn">Conn</a> interface for TCP network connections. </p>
+<pre data-language="go">type TCPConn struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="DialTCP">func <span>DialTCP</span> </h3> <pre data-language="go">func DialTCP(network string, laddr, raddr *TCPAddr) (*TCPConn, error)</pre> <p>DialTCP acts like <a href="#Dial">Dial</a> for TCP networks. </p>
+<p>The network must be a TCP network name; see func Dial for details. </p>
+<p>If laddr is nil, a local address is automatically chosen. If the IP field of raddr is nil or an unspecified IP address, the local system is assumed. </p>
+<h3 id="TCPConn.Close">func (*TCPConn) <span>Close</span> </h3> <pre data-language="go">func (c *TCPConn) Close() error</pre> <p>Close closes the connection. </p>
+<h3 id="TCPConn.CloseRead">func (*TCPConn) <span>CloseRead</span> </h3> <pre data-language="go">func (c *TCPConn) CloseRead() error</pre> <p>CloseRead shuts down the reading side of the TCP connection. Most callers should just use Close. </p>
+<h3 id="TCPConn.CloseWrite">func (*TCPConn) <span>CloseWrite</span> </h3> <pre data-language="go">func (c *TCPConn) CloseWrite() error</pre> <p>CloseWrite shuts down the writing side of the TCP connection. Most callers should just use Close. </p>
+<h3 id="TCPConn.File">func (*TCPConn) <span>File</span> </h3> <pre data-language="go">func (c *TCPConn) File() (f *os.File, err error)</pre> <p>File returns a copy of the underlying <span>os.File</span>. It is the caller's responsibility to close f when finished. Closing c does not affect f, and closing f does not affect c. </p>
+<p>The returned os.File's file descriptor is different from the connection's. Attempting to change properties of the original using this duplicate may or may not have the desired effect. </p>
+<h3 id="TCPConn.LocalAddr">func (*TCPConn) <span>LocalAddr</span> </h3> <pre data-language="go">func (c *TCPConn) LocalAddr() Addr</pre> <p>LocalAddr returns the local network address. The Addr returned is shared by all invocations of LocalAddr, so do not modify it. </p>
+<h3 id="TCPConn.MultipathTCP">func (*TCPConn) <span>MultipathTCP</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (c *TCPConn) MultipathTCP() (bool, error)</pre> <p>MultipathTCP reports whether the ongoing connection is using MPTCP. </p>
+<p>If Multipath TCP is not supported by the host, by the other peer or intentionally / accidentally filtered out by a device in between, a fallback to TCP will be done. This method does its best to check if MPTCP is still being used or not. </p>
+<p>On Linux, more conditions are verified on kernels &gt;= v5.16, improving the results. </p>
+<h3 id="TCPConn.Read">func (*TCPConn) <span>Read</span> </h3> <pre data-language="go">func (c *TCPConn) Read(b []byte) (int, error)</pre> <p>Read implements the Conn Read method. </p>
+<h3 id="TCPConn.ReadFrom">func (*TCPConn) <span>ReadFrom</span> </h3> <pre data-language="go">func (c *TCPConn) ReadFrom(r io.Reader) (int64, error)</pre> <p>ReadFrom implements the <span>io.ReaderFrom</span> ReadFrom method. </p>
+<h3 id="TCPConn.RemoteAddr">func (*TCPConn) <span>RemoteAddr</span> </h3> <pre data-language="go">func (c *TCPConn) RemoteAddr() Addr</pre> <p>RemoteAddr returns the remote network address. The Addr returned is shared by all invocations of RemoteAddr, so do not modify it. </p>
+<h3 id="TCPConn.SetDeadline">func (*TCPConn) <span>SetDeadline</span> </h3> <pre data-language="go">func (c *TCPConn) SetDeadline(t time.Time) error</pre> <p>SetDeadline implements the Conn SetDeadline method. </p>
+<h3 id="TCPConn.SetKeepAlive">func (*TCPConn) <span>SetKeepAlive</span> </h3> <pre data-language="go">func (c *TCPConn) SetKeepAlive(keepalive bool) error</pre> <p>SetKeepAlive sets whether the operating system should send keep-alive messages on the connection. </p>
+<h3 id="TCPConn.SetKeepAlivePeriod">func (*TCPConn) <span>SetKeepAlivePeriod</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (c *TCPConn) SetKeepAlivePeriod(d time.Duration) error</pre> <p>SetKeepAlivePeriod sets period between keep-alives. </p>
+<h3 id="TCPConn.SetLinger">func (*TCPConn) <span>SetLinger</span> </h3> <pre data-language="go">func (c *TCPConn) SetLinger(sec int) error</pre> <p>SetLinger sets the behavior of Close on a connection which still has data waiting to be sent or to be acknowledged. </p>
+<p>If sec &lt; 0 (the default), the operating system finishes sending the data in the background. </p>
+<p>If sec == 0, the operating system discards any unsent or unacknowledged data. </p>
+<p>If sec &gt; 0, the data is sent in the background as with sec &lt; 0. On some operating systems including Linux, this may cause Close to block until all data has been sent or discarded. On some operating systems after sec seconds have elapsed any remaining unsent data may be discarded. </p>
+<h3 id="TCPConn.SetNoDelay">func (*TCPConn) <span>SetNoDelay</span> </h3> <pre data-language="go">func (c *TCPConn) SetNoDelay(noDelay bool) error</pre> <p>SetNoDelay controls whether the operating system should delay packet transmission in hopes of sending fewer packets (Nagle's algorithm). The default is true (no delay), meaning that data is sent as soon as possible after a Write. </p>
+<h3 id="TCPConn.SetReadBuffer">func (*TCPConn) <span>SetReadBuffer</span> </h3> <pre data-language="go">func (c *TCPConn) SetReadBuffer(bytes int) error</pre> <p>SetReadBuffer sets the size of the operating system's receive buffer associated with the connection. </p>
+<h3 id="TCPConn.SetReadDeadline">func (*TCPConn) <span>SetReadDeadline</span> </h3> <pre data-language="go">func (c *TCPConn) SetReadDeadline(t time.Time) error</pre> <p>SetReadDeadline implements the Conn SetReadDeadline method. </p>
+<h3 id="TCPConn.SetWriteBuffer">func (*TCPConn) <span>SetWriteBuffer</span> </h3> <pre data-language="go">func (c *TCPConn) SetWriteBuffer(bytes int) error</pre> <p>SetWriteBuffer sets the size of the operating system's transmit buffer associated with the connection. </p>
+<h3 id="TCPConn.SetWriteDeadline">func (*TCPConn) <span>SetWriteDeadline</span> </h3> <pre data-language="go">func (c *TCPConn) SetWriteDeadline(t time.Time) error</pre> <p>SetWriteDeadline implements the Conn SetWriteDeadline method. </p>
+<h3 id="TCPConn.SyscallConn">func (*TCPConn) <span>SyscallConn</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *TCPConn) SyscallConn() (syscall.RawConn, error)</pre> <p>SyscallConn returns a raw network connection. This implements the <span>syscall.Conn</span> interface. </p>
+<h3 id="TCPConn.Write">func (*TCPConn) <span>Write</span> </h3> <pre data-language="go">func (c *TCPConn) Write(b []byte) (int, error)</pre> <p>Write implements the Conn Write method. </p>
+<h3 id="TCPConn.WriteTo">func (*TCPConn) <span>WriteTo</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (c *TCPConn) WriteTo(w io.Writer) (int64, error)</pre> <p>WriteTo implements the io.WriterTo WriteTo method. </p>
+<h2 id="TCPListener">type <span>TCPListener</span> </h2> <p>TCPListener is a TCP network listener. Clients should typically use variables of type <a href="#Listener">Listener</a> instead of assuming TCP. </p>
+<pre data-language="go">type TCPListener struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ListenTCP">func <span>ListenTCP</span> </h3> <pre data-language="go">func ListenTCP(network string, laddr *TCPAddr) (*TCPListener, error)</pre> <p>ListenTCP acts like <a href="#Listen">Listen</a> for TCP networks. </p>
+<p>The network must be a TCP network name; see func Dial for details. </p>
+<p>If the IP field of laddr is nil or an unspecified IP address, ListenTCP listens on all available unicast and anycast IP addresses of the local system. If the Port field of laddr is 0, a port number is automatically chosen. </p>
+<h3 id="TCPListener.Accept">func (*TCPListener) <span>Accept</span> </h3> <pre data-language="go">func (l *TCPListener) Accept() (Conn, error)</pre> <p>Accept implements the Accept method in the <a href="#Listener">Listener</a> interface; it waits for the next call and returns a generic <a href="#Conn">Conn</a>. </p>
+<h3 id="TCPListener.AcceptTCP">func (*TCPListener) <span>AcceptTCP</span> </h3> <pre data-language="go">func (l *TCPListener) AcceptTCP() (*TCPConn, error)</pre> <p>AcceptTCP accepts the next incoming call and returns the new connection. </p>
+<h3 id="TCPListener.Addr">func (*TCPListener) <span>Addr</span> </h3> <pre data-language="go">func (l *TCPListener) Addr() Addr</pre> <p>Addr returns the listener's network address, a <a href="#TCPAddr">*TCPAddr</a>. The Addr returned is shared by all invocations of Addr, so do not modify it. </p>
+<h3 id="TCPListener.Close">func (*TCPListener) <span>Close</span> </h3> <pre data-language="go">func (l *TCPListener) Close() error</pre> <p>Close stops listening on the TCP address. Already Accepted connections are not closed. </p>
+<h3 id="TCPListener.File">func (*TCPListener) <span>File</span> </h3> <pre data-language="go">func (l *TCPListener) File() (f *os.File, err error)</pre> <p>File returns a copy of the underlying <span>os.File</span>. It is the caller's responsibility to close f when finished. Closing l does not affect f, and closing f does not affect l. </p>
+<p>The returned os.File's file descriptor is different from the connection's. Attempting to change properties of the original using this duplicate may or may not have the desired effect. </p>
+<h3 id="TCPListener.SetDeadline">func (*TCPListener) <span>SetDeadline</span> </h3> <pre data-language="go">func (l *TCPListener) SetDeadline(t time.Time) error</pre> <p>SetDeadline sets the deadline associated with the listener. A zero time value disables the deadline. </p>
+<h3 id="TCPListener.SyscallConn">func (*TCPListener) <span>SyscallConn</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (l *TCPListener) SyscallConn() (syscall.RawConn, error)</pre> <p>SyscallConn returns a raw network connection. This implements the <span>syscall.Conn</span> interface. </p>
+<p>The returned RawConn only supports calling Control. Read and Write return an error. </p>
+<h2 id="UDPAddr">type <span>UDPAddr</span> </h2> <p>UDPAddr represents the address of a UDP end point. </p>
+<pre data-language="go">type UDPAddr struct {
+ IP IP
+ Port int
+ Zone string // IPv6 scoped addressing zone; added in Go 1.1
+}
+</pre> <h3 id="ResolveUDPAddr">func <span>ResolveUDPAddr</span> </h3> <pre data-language="go">func ResolveUDPAddr(network, address string) (*UDPAddr, error)</pre> <p>ResolveUDPAddr returns an address of UDP end point. </p>
+<p>The network must be a UDP network name. </p>
+<p>If the host in the address parameter is not a literal IP address or the port is not a literal port number, ResolveUDPAddr resolves the address to an address of UDP end point. Otherwise, it parses the address as a pair of literal IP address and port number. The address parameter can use a host name, but this is not recommended, because it will return at most one of the host name's IP addresses. </p>
+<p>See func Dial for a description of the network and address parameters. </p>
+<h3 id="UDPAddrFromAddrPort">func <span>UDPAddrFromAddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func UDPAddrFromAddrPort(addr netip.AddrPort) *UDPAddr</pre> <p>UDPAddrFromAddrPort returns addr as a UDPAddr. If addr.IsValid() is false, then the returned UDPAddr will contain a nil IP field, indicating an address family-agnostic unspecified address. </p>
+<h3 id="UDPAddr.AddrPort">func (*UDPAddr) <span>AddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (a *UDPAddr) AddrPort() netip.AddrPort</pre> <p>AddrPort returns the UDPAddr a as a netip.AddrPort. </p>
+<p>If a.Port does not fit in a uint16, it's silently truncated. </p>
+<p>If a is nil, a zero value is returned. </p>
+<h3 id="UDPAddr.Network">func (*UDPAddr) <span>Network</span> </h3> <pre data-language="go">func (a *UDPAddr) Network() string</pre> <p>Network returns the address's network name, "udp". </p>
+<h3 id="UDPAddr.String">func (*UDPAddr) <span>String</span> </h3> <pre data-language="go">func (a *UDPAddr) String() string</pre> <h2 id="UDPConn">type <span>UDPConn</span> </h2> <p>UDPConn is the implementation of the Conn and PacketConn interfaces for UDP network connections. </p>
+<pre data-language="go">type UDPConn struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="DialUDP">func <span>DialUDP</span> </h3> <pre data-language="go">func DialUDP(network string, laddr, raddr *UDPAddr) (*UDPConn, error)</pre> <p>DialUDP acts like Dial for UDP networks. </p>
+<p>The network must be a UDP network name; see func Dial for details. </p>
+<p>If laddr is nil, a local address is automatically chosen. If the IP field of raddr is nil or an unspecified IP address, the local system is assumed. </p>
+<h3 id="ListenMulticastUDP">func <span>ListenMulticastUDP</span> </h3> <pre data-language="go">func ListenMulticastUDP(network string, ifi *Interface, gaddr *UDPAddr) (*UDPConn, error)</pre> <p>ListenMulticastUDP acts like ListenPacket for UDP networks but takes a group address on a specific network interface. </p>
+<p>The network must be a UDP network name; see func Dial for details. </p>
+<p>ListenMulticastUDP listens on all available IP addresses of the local system including the group, multicast IP address. If ifi is nil, ListenMulticastUDP uses the system-assigned multicast interface, although this is not recommended because the assignment depends on platforms and sometimes it might require routing configuration. If the Port field of gaddr is 0, a port number is automatically chosen. </p>
+<p>ListenMulticastUDP is just for convenience of simple, small applications. There are golang.org/x/net/ipv4 and golang.org/x/net/ipv6 packages for general purpose uses. </p>
+<p>Note that ListenMulticastUDP will set the IP_MULTICAST_LOOP socket option to 0 under IPPROTO_IP, to disable loopback of multicast packets. </p>
+<h3 id="ListenUDP">func <span>ListenUDP</span> </h3> <pre data-language="go">func ListenUDP(network string, laddr *UDPAddr) (*UDPConn, error)</pre> <p>ListenUDP acts like ListenPacket for UDP networks. </p>
+<p>The network must be a UDP network name; see func Dial for details. </p>
+<p>If the IP field of laddr is nil or an unspecified IP address, ListenUDP listens on all available IP addresses of the local system except multicast IP addresses. If the Port field of laddr is 0, a port number is automatically chosen. </p>
+<h3 id="UDPConn.Close">func (*UDPConn) <span>Close</span> </h3> <pre data-language="go">func (c *UDPConn) Close() error</pre> <p>Close closes the connection. </p>
+<h3 id="UDPConn.File">func (*UDPConn) <span>File</span> </h3> <pre data-language="go">func (c *UDPConn) File() (f *os.File, err error)</pre> <p>File returns a copy of the underlying <span>os.File</span>. It is the caller's responsibility to close f when finished. Closing c does not affect f, and closing f does not affect c. </p>
+<p>The returned os.File's file descriptor is different from the connection's. Attempting to change properties of the original using this duplicate may or may not have the desired effect. </p>
+<h3 id="UDPConn.LocalAddr">func (*UDPConn) <span>LocalAddr</span> </h3> <pre data-language="go">func (c *UDPConn) LocalAddr() Addr</pre> <p>LocalAddr returns the local network address. The Addr returned is shared by all invocations of LocalAddr, so do not modify it. </p>
+<h3 id="UDPConn.Read">func (*UDPConn) <span>Read</span> </h3> <pre data-language="go">func (c *UDPConn) Read(b []byte) (int, error)</pre> <p>Read implements the Conn Read method. </p>
+<h3 id="UDPConn.ReadFrom">func (*UDPConn) <span>ReadFrom</span> </h3> <pre data-language="go">func (c *UDPConn) ReadFrom(b []byte) (int, Addr, error)</pre> <p>ReadFrom implements the PacketConn ReadFrom method. </p>
+<h3 id="UDPConn.ReadFromUDP">func (*UDPConn) <span>ReadFromUDP</span> </h3> <pre data-language="go">func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *UDPAddr, err error)</pre> <p>ReadFromUDP acts like ReadFrom but returns a UDPAddr. </p>
+<h3 id="UDPConn.ReadFromUDPAddrPort">func (*UDPConn) <span>ReadFromUDPAddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *UDPConn) ReadFromUDPAddrPort(b []byte) (n int, addr netip.AddrPort, err error)</pre> <p>ReadFromUDPAddrPort acts like ReadFrom but returns a netip.AddrPort. </p>
+<p>If c is bound to an unspecified address, the returned netip.AddrPort's address might be an IPv4-mapped IPv6 address. Use netip.Addr.Unmap to get the address without the IPv6 prefix. </p>
+<h3 id="UDPConn.ReadMsgUDP">func (*UDPConn) <span>ReadMsgUDP</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *UDPAddr, err error)</pre> <p>ReadMsgUDP reads a message from c, copying the payload into b and the associated out-of-band data into oob. It returns the number of bytes copied into b, the number of bytes copied into oob, the flags that were set on the message and the source address of the message. </p>
+<p>The packages golang.org/x/net/ipv4 and golang.org/x/net/ipv6 can be used to manipulate IP-level socket options in oob. </p>
+<h3 id="UDPConn.ReadMsgUDPAddrPort">func (*UDPConn) <span>ReadMsgUDPAddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *UDPConn) ReadMsgUDPAddrPort(b, oob []byte) (n, oobn, flags int, addr netip.AddrPort, err error)</pre> <p>ReadMsgUDPAddrPort is like ReadMsgUDP but returns an netip.AddrPort instead of a UDPAddr. </p>
+<h3 id="UDPConn.RemoteAddr">func (*UDPConn) <span>RemoteAddr</span> </h3> <pre data-language="go">func (c *UDPConn) RemoteAddr() Addr</pre> <p>RemoteAddr returns the remote network address. The Addr returned is shared by all invocations of RemoteAddr, so do not modify it. </p>
+<h3 id="UDPConn.SetDeadline">func (*UDPConn) <span>SetDeadline</span> </h3> <pre data-language="go">func (c *UDPConn) SetDeadline(t time.Time) error</pre> <p>SetDeadline implements the Conn SetDeadline method. </p>
+<h3 id="UDPConn.SetReadBuffer">func (*UDPConn) <span>SetReadBuffer</span> </h3> <pre data-language="go">func (c *UDPConn) SetReadBuffer(bytes int) error</pre> <p>SetReadBuffer sets the size of the operating system's receive buffer associated with the connection. </p>
+<h3 id="UDPConn.SetReadDeadline">func (*UDPConn) <span>SetReadDeadline</span> </h3> <pre data-language="go">func (c *UDPConn) SetReadDeadline(t time.Time) error</pre> <p>SetReadDeadline implements the Conn SetReadDeadline method. </p>
+<h3 id="UDPConn.SetWriteBuffer">func (*UDPConn) <span>SetWriteBuffer</span> </h3> <pre data-language="go">func (c *UDPConn) SetWriteBuffer(bytes int) error</pre> <p>SetWriteBuffer sets the size of the operating system's transmit buffer associated with the connection. </p>
+<h3 id="UDPConn.SetWriteDeadline">func (*UDPConn) <span>SetWriteDeadline</span> </h3> <pre data-language="go">func (c *UDPConn) SetWriteDeadline(t time.Time) error</pre> <p>SetWriteDeadline implements the Conn SetWriteDeadline method. </p>
+<h3 id="UDPConn.SyscallConn">func (*UDPConn) <span>SyscallConn</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *UDPConn) SyscallConn() (syscall.RawConn, error)</pre> <p>SyscallConn returns a raw network connection. This implements the syscall.Conn interface. </p>
+<h3 id="UDPConn.Write">func (*UDPConn) <span>Write</span> </h3> <pre data-language="go">func (c *UDPConn) Write(b []byte) (int, error)</pre> <p>Write implements the Conn Write method. </p>
+<h3 id="UDPConn.WriteMsgUDP">func (*UDPConn) <span>WriteMsgUDP</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *UDPConn) WriteMsgUDP(b, oob []byte, addr *UDPAddr) (n, oobn int, err error)</pre> <p>WriteMsgUDP writes a message to addr via c if c isn't connected, or to c's remote address if c is connected (in which case addr must be nil). The payload is copied from b and the associated out-of-band data is copied from oob. It returns the number of payload and out-of-band bytes written. </p>
+<p>The packages golang.org/x/net/ipv4 and golang.org/x/net/ipv6 can be used to manipulate IP-level socket options in oob. </p>
+<h3 id="UDPConn.WriteMsgUDPAddrPort">func (*UDPConn) <span>WriteMsgUDPAddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *UDPConn) WriteMsgUDPAddrPort(b, oob []byte, addr netip.AddrPort) (n, oobn int, err error)</pre> <p>WriteMsgUDPAddrPort is like WriteMsgUDP but takes a netip.AddrPort instead of a UDPAddr. </p>
+<h3 id="UDPConn.WriteTo">func (*UDPConn) <span>WriteTo</span> </h3> <pre data-language="go">func (c *UDPConn) WriteTo(b []byte, addr Addr) (int, error)</pre> <p>WriteTo implements the PacketConn WriteTo method. </p> <h4 id="example_UDPConn_WriteTo"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Unlike Dial, ListenPacket creates a connection without any
+// association with peers.
+conn, err := net.ListenPacket("udp", ":0")
+if err != nil {
+ log.Fatal(err)
+}
+defer conn.Close()
+
+dst, err := net.ResolveUDPAddr("udp", "192.0.2.1:2000")
+if err != nil {
+ log.Fatal(err)
+}
+
+// The connection can write data to the desired address.
+_, err = conn.WriteTo([]byte("data"), dst)
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="UDPConn.WriteToUDP">func (*UDPConn) <span>WriteToUDP</span> </h3> <pre data-language="go">func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (int, error)</pre> <p>WriteToUDP acts like WriteTo but takes a UDPAddr. </p>
+<h3 id="UDPConn.WriteToUDPAddrPort">func (*UDPConn) <span>WriteToUDPAddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *UDPConn) WriteToUDPAddrPort(b []byte, addr netip.AddrPort) (int, error)</pre> <p>WriteToUDPAddrPort acts like WriteTo but takes a netip.AddrPort. </p>
+<h2 id="UnixAddr">type <span>UnixAddr</span> </h2> <p>UnixAddr represents the address of a Unix domain socket end point. </p>
+<pre data-language="go">type UnixAddr struct {
+ Name string
+ Net string
+}
+</pre> <h3 id="ResolveUnixAddr">func <span>ResolveUnixAddr</span> </h3> <pre data-language="go">func ResolveUnixAddr(network, address string) (*UnixAddr, error)</pre> <p>ResolveUnixAddr returns an address of Unix domain socket end point. </p>
+<p>The network must be a Unix network name. </p>
+<p>See func <a href="#Dial">Dial</a> for a description of the network and address parameters. </p>
+<h3 id="UnixAddr.Network">func (*UnixAddr) <span>Network</span> </h3> <pre data-language="go">func (a *UnixAddr) Network() string</pre> <p>Network returns the address's network name, "unix", "unixgram" or "unixpacket". </p>
+<h3 id="UnixAddr.String">func (*UnixAddr) <span>String</span> </h3> <pre data-language="go">func (a *UnixAddr) String() string</pre> <h2 id="UnixConn">type <span>UnixConn</span> </h2> <p>UnixConn is an implementation of the <a href="#Conn">Conn</a> interface for connections to Unix domain sockets. </p>
+<pre data-language="go">type UnixConn struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="DialUnix">func <span>DialUnix</span> </h3> <pre data-language="go">func DialUnix(network string, laddr, raddr *UnixAddr) (*UnixConn, error)</pre> <p>DialUnix acts like <a href="#Dial">Dial</a> for Unix networks. </p>
+<p>The network must be a Unix network name; see func Dial for details. </p>
+<p>If laddr is non-nil, it is used as the local address for the connection. </p>
+<h3 id="ListenUnixgram">func <span>ListenUnixgram</span> </h3> <pre data-language="go">func ListenUnixgram(network string, laddr *UnixAddr) (*UnixConn, error)</pre> <p>ListenUnixgram acts like <a href="#ListenPacket">ListenPacket</a> for Unix networks. </p>
+<p>The network must be "unixgram". </p>
+<h3 id="UnixConn.Close">func (*UnixConn) <span>Close</span> </h3> <pre data-language="go">func (c *UnixConn) Close() error</pre> <p>Close closes the connection. </p>
+<h3 id="UnixConn.CloseRead">func (*UnixConn) <span>CloseRead</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *UnixConn) CloseRead() error</pre> <p>CloseRead shuts down the reading side of the Unix domain connection. Most callers should just use Close. </p>
+<h3 id="UnixConn.CloseWrite">func (*UnixConn) <span>CloseWrite</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *UnixConn) CloseWrite() error</pre> <p>CloseWrite shuts down the writing side of the Unix domain connection. Most callers should just use Close. </p>
+<h3 id="UnixConn.File">func (*UnixConn) <span>File</span> </h3> <pre data-language="go">func (c *UnixConn) File() (f *os.File, err error)</pre> <p>File returns a copy of the underlying <span>os.File</span>. It is the caller's responsibility to close f when finished. Closing c does not affect f, and closing f does not affect c. </p>
+<p>The returned os.File's file descriptor is different from the connection's. Attempting to change properties of the original using this duplicate may or may not have the desired effect. </p>
+<h3 id="UnixConn.LocalAddr">func (*UnixConn) <span>LocalAddr</span> </h3> <pre data-language="go">func (c *UnixConn) LocalAddr() Addr</pre> <p>LocalAddr returns the local network address. The Addr returned is shared by all invocations of LocalAddr, so do not modify it. </p>
+<h3 id="UnixConn.Read">func (*UnixConn) <span>Read</span> </h3> <pre data-language="go">func (c *UnixConn) Read(b []byte) (int, error)</pre> <p>Read implements the Conn Read method. </p>
+<h3 id="UnixConn.ReadFrom">func (*UnixConn) <span>ReadFrom</span> </h3> <pre data-language="go">func (c *UnixConn) ReadFrom(b []byte) (int, Addr, error)</pre> <p>ReadFrom implements the <a href="#PacketConn">PacketConn</a> ReadFrom method. </p>
+<h3 id="UnixConn.ReadFromUnix">func (*UnixConn) <span>ReadFromUnix</span> </h3> <pre data-language="go">func (c *UnixConn) ReadFromUnix(b []byte) (int, *UnixAddr, error)</pre> <p>ReadFromUnix acts like <a href="#UnixConn.ReadFrom">UnixConn.ReadFrom</a> but returns a <a href="#UnixAddr">UnixAddr</a>. </p>
+<h3 id="UnixConn.ReadMsgUnix">func (*UnixConn) <span>ReadMsgUnix</span> </h3> <pre data-language="go">func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAddr, err error)</pre> <p>ReadMsgUnix reads a message from c, copying the payload into b and the associated out-of-band data into oob. It returns the number of bytes copied into b, the number of bytes copied into oob, the flags that were set on the message and the source address of the message. </p>
+<p>Note that if len(b) == 0 and len(oob) &gt; 0, this function will still read (and discard) 1 byte from the connection. </p>
+<h3 id="UnixConn.RemoteAddr">func (*UnixConn) <span>RemoteAddr</span> </h3> <pre data-language="go">func (c *UnixConn) RemoteAddr() Addr</pre> <p>RemoteAddr returns the remote network address. The Addr returned is shared by all invocations of RemoteAddr, so do not modify it. </p>
+<h3 id="UnixConn.SetDeadline">func (*UnixConn) <span>SetDeadline</span> </h3> <pre data-language="go">func (c *UnixConn) SetDeadline(t time.Time) error</pre> <p>SetDeadline implements the Conn SetDeadline method. </p>
+<h3 id="UnixConn.SetReadBuffer">func (*UnixConn) <span>SetReadBuffer</span> </h3> <pre data-language="go">func (c *UnixConn) SetReadBuffer(bytes int) error</pre> <p>SetReadBuffer sets the size of the operating system's receive buffer associated with the connection. </p>
+<h3 id="UnixConn.SetReadDeadline">func (*UnixConn) <span>SetReadDeadline</span> </h3> <pre data-language="go">func (c *UnixConn) SetReadDeadline(t time.Time) error</pre> <p>SetReadDeadline implements the Conn SetReadDeadline method. </p>
+<h3 id="UnixConn.SetWriteBuffer">func (*UnixConn) <span>SetWriteBuffer</span> </h3> <pre data-language="go">func (c *UnixConn) SetWriteBuffer(bytes int) error</pre> <p>SetWriteBuffer sets the size of the operating system's transmit buffer associated with the connection. </p>
+<h3 id="UnixConn.SetWriteDeadline">func (*UnixConn) <span>SetWriteDeadline</span> </h3> <pre data-language="go">func (c *UnixConn) SetWriteDeadline(t time.Time) error</pre> <p>SetWriteDeadline implements the Conn SetWriteDeadline method. </p>
+<h3 id="UnixConn.SyscallConn">func (*UnixConn) <span>SyscallConn</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *UnixConn) SyscallConn() (syscall.RawConn, error)</pre> <p>SyscallConn returns a raw network connection. This implements the <span>syscall.Conn</span> interface. </p>
+<h3 id="UnixConn.Write">func (*UnixConn) <span>Write</span> </h3> <pre data-language="go">func (c *UnixConn) Write(b []byte) (int, error)</pre> <p>Write implements the Conn Write method. </p>
+<h3 id="UnixConn.WriteMsgUnix">func (*UnixConn) <span>WriteMsgUnix</span> </h3> <pre data-language="go">func (c *UnixConn) WriteMsgUnix(b, oob []byte, addr *UnixAddr) (n, oobn int, err error)</pre> <p>WriteMsgUnix writes a message to addr via c, copying the payload from b and the associated out-of-band data from oob. It returns the number of payload and out-of-band bytes written. </p>
+<p>Note that if len(b) == 0 and len(oob) &gt; 0, this function will still write 1 byte to the connection. </p>
+<h3 id="UnixConn.WriteTo">func (*UnixConn) <span>WriteTo</span> </h3> <pre data-language="go">func (c *UnixConn) WriteTo(b []byte, addr Addr) (int, error)</pre> <p>WriteTo implements the <a href="#PacketConn">PacketConn</a> WriteTo method. </p>
+<h3 id="UnixConn.WriteToUnix">func (*UnixConn) <span>WriteToUnix</span> </h3> <pre data-language="go">func (c *UnixConn) WriteToUnix(b []byte, addr *UnixAddr) (int, error)</pre> <p>WriteToUnix acts like <a href="#UnixConn.WriteTo">UnixConn.WriteTo</a> but takes a <a href="#UnixAddr">UnixAddr</a>. </p>
+<h2 id="UnixListener">type <span>UnixListener</span> </h2> <p>UnixListener is a Unix domain socket listener. Clients should typically use variables of type <a href="#Listener">Listener</a> instead of assuming Unix domain sockets. </p>
+<pre data-language="go">type UnixListener struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ListenUnix">func <span>ListenUnix</span> </h3> <pre data-language="go">func ListenUnix(network string, laddr *UnixAddr) (*UnixListener, error)</pre> <p>ListenUnix acts like <a href="#Listen">Listen</a> for Unix networks. </p>
+<p>The network must be "unix" or "unixpacket". </p>
+<h3 id="UnixListener.Accept">func (*UnixListener) <span>Accept</span> </h3> <pre data-language="go">func (l *UnixListener) Accept() (Conn, error)</pre> <p>Accept implements the Accept method in the <a href="#Listener">Listener</a> interface. Returned connections will be of type <a href="#UnixConn">*UnixConn</a>. </p>
+<h3 id="UnixListener.AcceptUnix">func (*UnixListener) <span>AcceptUnix</span> </h3> <pre data-language="go">func (l *UnixListener) AcceptUnix() (*UnixConn, error)</pre> <p>AcceptUnix accepts the next incoming call and returns the new connection. </p>
+<h3 id="UnixListener.Addr">func (*UnixListener) <span>Addr</span> </h3> <pre data-language="go">func (l *UnixListener) Addr() Addr</pre> <p>Addr returns the listener's network address. The Addr returned is shared by all invocations of Addr, so do not modify it. </p>
+<h3 id="UnixListener.Close">func (*UnixListener) <span>Close</span> </h3> <pre data-language="go">func (l *UnixListener) Close() error</pre> <p>Close stops listening on the Unix address. Already accepted connections are not closed. </p>
+<h3 id="UnixListener.File">func (*UnixListener) <span>File</span> </h3> <pre data-language="go">func (l *UnixListener) File() (f *os.File, err error)</pre> <p>File returns a copy of the underlying <span>os.File</span>. It is the caller's responsibility to close f when finished. Closing l does not affect f, and closing f does not affect l. </p>
+<p>The returned os.File's file descriptor is different from the connection's. Attempting to change properties of the original using this duplicate may or may not have the desired effect. </p>
+<h3 id="UnixListener.SetDeadline">func (*UnixListener) <span>SetDeadline</span> </h3> <pre data-language="go">func (l *UnixListener) SetDeadline(t time.Time) error</pre> <p>SetDeadline sets the deadline associated with the listener. A zero time value disables the deadline. </p>
+<h3 id="UnixListener.SetUnlinkOnClose">func (*UnixListener) <span>SetUnlinkOnClose</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (l *UnixListener) SetUnlinkOnClose(unlink bool)</pre> <p>SetUnlinkOnClose sets whether the underlying socket file should be removed from the file system when the listener is closed. </p>
+<p>The default behavior is to unlink the socket file only when package net created it. That is, when the listener and the underlying socket file were created by a call to Listen or ListenUnix, then by default closing the listener will remove the socket file. but if the listener was created by a call to FileListener to use an already existing socket file, then by default closing the listener will not remove the socket file. </p>
+<h3 id="UnixListener.SyscallConn">func (*UnixListener) <span>SyscallConn</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (l *UnixListener) SyscallConn() (syscall.RawConn, error)</pre> <p>SyscallConn returns a raw network connection. This implements the <span>syscall.Conn</span> interface. </p>
+<p>The returned RawConn only supports calling Control. Read and Write return an error. </p>
+<h2 id="UnknownNetworkError">type <span>UnknownNetworkError</span> </h2> <pre data-language="go">type UnknownNetworkError string</pre> <h3 id="UnknownNetworkError.Error">func (UnknownNetworkError) <span>Error</span> </h3> <pre data-language="go">func (e UnknownNetworkError) Error() string</pre> <h3 id="UnknownNetworkError.Temporary">func (UnknownNetworkError) <span>Temporary</span> </h3> <pre data-language="go">func (e UnknownNetworkError) Temporary() bool</pre> <h3 id="UnknownNetworkError.Timeout">func (UnknownNetworkError) <span>Timeout</span> </h3> <pre data-language="go">func (e UnknownNetworkError) Timeout() bool</pre> <h2 id="pkg-note-BUG">Bugs</h2> <ul> <li>☞ <p>On JS and Windows, the FileConn, FileListener and FilePacketConn functions are not implemented. </p>
+</li> <li>☞ <p>On JS, methods and functions related to Interface are not implemented. </p>
+</li> <li>☞ <p>On AIX, DragonFly BSD, NetBSD, OpenBSD, Plan 9 and Solaris, the MulticastAddrs method of Interface is not implemented. </p>
+</li> <li>☞ <p>On every POSIX platform, reads from the "ip4" network using the ReadFrom or ReadFromIP method might not return a complete IPv4 packet, including its header, even if there is space available. This can occur even in cases where Read or ReadMsgIP could return a complete packet. For this reason, it is recommended that you do not use these methods if it is important to receive a full packet. </p>
+<p>The Go 1 compatibility guidelines make it impossible for us to change the behavior of these methods; use Read or ReadMsgIP instead. </p>
+</li> <li>☞ <p>On JS and Plan 9, methods and functions related to IPConn are not implemented. </p>
+</li> <li>☞ <p>On Windows, the File method of IPConn is not implemented. </p>
+</li> <li>☞ <p>On DragonFly BSD and OpenBSD, listening on the "tcp" and "udp" networks does not listen for both IPv4 and IPv6 connections. This is due to the fact that IPv4 traffic will not be routed to an IPv6 socket - two separate sockets are required if both address families are to be supported. See inet6(4) for details. </p>
+</li> <li>☞ <p>On Windows, the Write method of syscall.RawConn does not integrate with the runtime's network poller. It cannot wait for the connection to become writeable, and does not respect deadlines. If the user-provided callback returns false, the Write method will fail immediately. </p>
+</li> <li>☞ <p>On JS and Plan 9, the Control, Read and Write methods of syscall.RawConn are not implemented. </p>
+</li> <li>☞ <p>On JS and Windows, the File method of TCPConn and TCPListener is not implemented. </p>
+</li> <li>☞ <p>On Plan 9, the ReadMsgUDP and WriteMsgUDP methods of UDPConn are not implemented. </p>
+</li> <li>☞ <p>On Windows, the File method of UDPConn is not implemented. </p>
+</li> <li>☞ <p>On JS, methods and functions related to UDPConn are not implemented. </p>
+</li> <li>☞ <p>On JS, WASIP1 and Plan 9, methods and functions related to UnixConn and UnixListener are not implemented. </p>
+</li> <li>☞ <p>On Windows, methods and functions related to UnixConn and UnixListener don't work for "unixgram" and "unixpacket". </p>
+</li> </ul> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="http/index">http</a> </td> <td class="pkg-synopsis"> Package http provides HTTP client and server implementations. </td> </tr> <tr> <td class="pkg-name"> <a href="http/cgi/index">cgi</a> </td> <td class="pkg-synopsis"> Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875. </td> </tr> <tr> <td class="pkg-name"> <a href="http/cookiejar/index">cookiejar</a> </td> <td class="pkg-synopsis"> Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar. </td> </tr> <tr> <td class="pkg-name"> <a href="http/fcgi/index">fcgi</a> </td> <td class="pkg-synopsis"> Package fcgi implements the FastCGI protocol. </td> </tr> <tr> <td class="pkg-name"> <a href="http/httptest/index">httptest</a> </td> <td class="pkg-synopsis"> Package httptest provides utilities for HTTP testing. </td> </tr> <tr> <td class="pkg-name"> <a href="http/httptrace/index">httptrace</a> </td> <td class="pkg-synopsis"> Package httptrace provides mechanisms to trace the events within HTTP client requests. </td> </tr> <tr> <td class="pkg-name"> <a href="http/httputil/index">httputil</a> </td> <td class="pkg-synopsis"> Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package. </td> </tr> <tr> <td class="pkg-name"> <a href="http/pprof/index">pprof</a> </td> <td class="pkg-synopsis"> Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. </td> </tr> <tr> <td class="pkg-name"> <a href="mail/index">mail</a> </td> <td class="pkg-synopsis"> Package mail implements parsing of mail messages. </td> </tr> <tr> <td class="pkg-name"> <a href="netip/index">netip</a> </td> <td class="pkg-synopsis"> Package netip defines an IP address type that's a small value type. </td> </tr> <tr> <td class="pkg-name"> <a href="rpc/index">rpc</a> </td> <td class="pkg-synopsis"> Package rpc provides access to the exported methods of an object across a network or other I/O connection. </td> </tr> <tr> <td class="pkg-name"> <a href="rpc/jsonrpc/index">jsonrpc</a> </td> <td class="pkg-synopsis"> Package jsonrpc implements a JSON-RPC 1.0 ClientCodec and ServerCodec for the rpc package. </td> </tr> <tr> <td class="pkg-name"> <a href="smtp/index">smtp</a> </td> <td class="pkg-synopsis"> Package smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321. </td> </tr> <tr> <td class="pkg-name"> <a href="textproto/index">textproto</a> </td> <td class="pkg-synopsis"> Package textproto implements generic support for text-based request/response protocols in the style of HTTP, NNTP, and SMTP. </td> </tr> <tr> <td class="pkg-name"> <a href="url/index">url</a> </td> <td class="pkg-synopsis"> Package url parses URLs and implements query escaping. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/" class="_attribution-link">http://golang.org/pkg/net/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fmail%2Findex.html b/devdocs/go/net%2Fmail%2Findex.html
new file mode 100644
index 00000000..dced07f0
--- /dev/null
+++ b/devdocs/go/net%2Fmail%2Findex.html
@@ -0,0 +1,121 @@
+<h1> Package mail </h1> <ul id="short-nav">
+<li><code>import "net/mail"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package mail implements parsing of mail messages. </p>
+<p>For the most part, this package follows the syntax as specified by RFC 5322 and extended by RFC 6532. Notable divergences: </p>
+<ul> <li>Obsolete address formats are not parsed, including addresses with embedded route information. </li>
+<li>The full range of spacing (the CFWS syntax element) is not supported, such as breaking addresses across lines. </li>
+<li>No unicode normalization is performed. </li>
+<li>The special characters ()[]:;@\, are allowed to appear unquoted in names. </li>
+<li>A leading From line is permitted, as in mbox format (RFC 4155). </li>
+</ul> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#ParseDate">func ParseDate(date string) (time.Time, error)</a></li>
+<li><a href="#Address">type Address</a></li>
+<li> <a href="#ParseAddress">func ParseAddress(address string) (*Address, error)</a>
+</li>
+<li> <a href="#ParseAddressList">func ParseAddressList(list string) ([]*Address, error)</a>
+</li>
+<li> <a href="#Address.String">func (a *Address) String() string</a>
+</li>
+<li><a href="#AddressParser">type AddressParser</a></li>
+<li> <a href="#AddressParser.Parse">func (p *AddressParser) Parse(address string) (*Address, error)</a>
+</li>
+<li> <a href="#AddressParser.ParseList">func (p *AddressParser) ParseList(list string) ([]*Address, error)</a>
+</li>
+<li><a href="#Header">type Header</a></li>
+<li> <a href="#Header.AddressList">func (h Header) AddressList(key string) ([]*Address, error)</a>
+</li>
+<li> <a href="#Header.Date">func (h Header) Date() (time.Time, error)</a>
+</li>
+<li> <a href="#Header.Get">func (h Header) Get(key string) string</a>
+</li>
+<li><a href="#Message">type Message</a></li>
+<li> <a href="#ReadMessage">func ReadMessage(r io.Reader) (msg *Message, err error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_ParseAddress">ParseAddress</a></dd> <dd><a class="exampleLink" href="#example_ParseAddressList">ParseAddressList</a></dd> <dd><a class="exampleLink" href="#example_ReadMessage">ReadMessage</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>message.go</span> </p> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var ErrHeaderNotPresent = errors.New("mail: header not in message")</pre> <h2 id="ParseDate">func <span>ParseDate</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func ParseDate(date string) (time.Time, error)</pre> <p>ParseDate parses an RFC 5322 date string. </p>
+<h2 id="Address">type <span>Address</span> </h2> <p>Address represents a single mail address. An address such as "Barry Gibbs &lt;bg@example.com&gt;" is represented as Address{Name: "Barry Gibbs", Address: "bg@example.com"}. </p>
+<pre data-language="go">type Address struct {
+ Name string // Proper name; may be empty.
+ Address string // user@domain
+}
+</pre> <h3 id="ParseAddress">func <span>ParseAddress</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func ParseAddress(address string) (*Address, error)</pre> <p>ParseAddress parses a single RFC 5322 address, e.g. "Barry Gibbs &lt;bg@example.com&gt;" </p> <h4 id="example_ParseAddress"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">e, err := mail.ParseAddress("Alice &lt;alice@example.com&gt;")
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Println(e.Name, e.Address)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Alice alice@example.com
+</pre> <h3 id="ParseAddressList">func <span>ParseAddressList</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func ParseAddressList(list string) ([]*Address, error)</pre> <p>ParseAddressList parses the given string as a list of addresses. </p> <h4 id="example_ParseAddressList"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const list = "Alice &lt;alice@example.com&gt;, Bob &lt;bob@example.com&gt;, Eve &lt;eve@example.com&gt;"
+emails, err := mail.ParseAddressList(list)
+if err != nil {
+ log.Fatal(err)
+}
+
+for _, v := range emails {
+ fmt.Println(v.Name, v.Address)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Alice alice@example.com
+Bob bob@example.com
+Eve eve@example.com
+</pre> <h3 id="Address.String">func (*Address) <span>String</span> </h3> <pre data-language="go">func (a *Address) String() string</pre> <p>String formats the address as a valid RFC 5322 address. If the address's name contains non-ASCII characters the name will be rendered according to RFC 2047. </p>
+<h2 id="AddressParser">type <span>AddressParser</span> <span title="Added in Go 1.5">1.5</span> </h2> <p>An AddressParser is an RFC 5322 address parser. </p>
+<pre data-language="go">type AddressParser struct {
+ // WordDecoder optionally specifies a decoder for RFC 2047 encoded-words.
+ WordDecoder *mime.WordDecoder
+}
+</pre> <h3 id="AddressParser.Parse">func (*AddressParser) <span>Parse</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *AddressParser) Parse(address string) (*Address, error)</pre> <p>Parse parses a single RFC 5322 address of the form "Gogh Fir &lt;gf@example.com&gt;" or "foo@example.com". </p>
+<h3 id="AddressParser.ParseList">func (*AddressParser) <span>ParseList</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (p *AddressParser) ParseList(list string) ([]*Address, error)</pre> <p>ParseList parses the given string as a list of comma-separated addresses of the form "Gogh Fir &lt;gf@example.com&gt;" or "foo@example.com". </p>
+<h2 id="Header">type <span>Header</span> </h2> <p>A Header represents the key-value pairs in a mail message header. </p>
+<pre data-language="go">type Header map[string][]string</pre> <h3 id="Header.AddressList">func (Header) <span>AddressList</span> </h3> <pre data-language="go">func (h Header) AddressList(key string) ([]*Address, error)</pre> <p>AddressList parses the named header field as a list of addresses. </p>
+<h3 id="Header.Date">func (Header) <span>Date</span> </h3> <pre data-language="go">func (h Header) Date() (time.Time, error)</pre> <p>Date parses the Date header field. </p>
+<h3 id="Header.Get">func (Header) <span>Get</span> </h3> <pre data-language="go">func (h Header) Get(key string) string</pre> <p>Get gets the first value associated with the given key. It is case insensitive; CanonicalMIMEHeaderKey is used to canonicalize the provided key. If there are no values associated with the key, Get returns "". To access multiple values of a key, or to use non-canonical keys, access the map directly. </p>
+<h2 id="Message">type <span>Message</span> </h2> <p>A Message represents a parsed mail message. </p>
+<pre data-language="go">type Message struct {
+ Header Header
+ Body io.Reader
+}
+</pre> <h3 id="ReadMessage">func <span>ReadMessage</span> </h3> <pre data-language="go">func ReadMessage(r io.Reader) (msg *Message, err error)</pre> <p>ReadMessage reads a message from r. The headers are parsed, and the body of the message will be available for reading from msg.Body. </p> <h4 id="example_ReadMessage"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">msg := `Date: Mon, 23 Jun 2015 11:40:36 -0400
+From: Gopher &lt;from@example.com&gt;
+To: Another Gopher &lt;to@example.com&gt;
+Subject: Gophers at Gophercon
+
+Message body
+`
+
+r := strings.NewReader(msg)
+m, err := mail.ReadMessage(r)
+if err != nil {
+ log.Fatal(err)
+}
+
+header := m.Header
+fmt.Println("Date:", header.Get("Date"))
+fmt.Println("From:", header.Get("From"))
+fmt.Println("To:", header.Get("To"))
+fmt.Println("Subject:", header.Get("Subject"))
+
+body, err := io.ReadAll(m.Body)
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s", body)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Date: Mon, 23 Jun 2015 11:40:36 -0400
+From: Gopher &lt;from@example.com&gt;
+To: Another Gopher &lt;to@example.com&gt;
+Subject: Gophers at Gophercon
+Message body
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/mail/" class="_attribution-link">http://golang.org/pkg/net/mail/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fnetip%2Findex.html b/devdocs/go/net%2Fnetip%2Findex.html
new file mode 100644
index 00000000..0c7a4bb9
--- /dev/null
+++ b/devdocs/go/net%2Fnetip%2Findex.html
@@ -0,0 +1,260 @@
+<h1> Package netip </h1> <ul id="short-nav">
+<li><code>import "net/netip"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package netip defines an IP address type that's a small value type. Building on that <a href="#Addr">Addr</a> type, the package also defines <a href="#AddrPort">AddrPort</a> (an IP address and a port) and <a href="#Prefix">Prefix</a> (an IP address and a bit length prefix). </p>
+<p>Compared to the <span>net.IP</span> type, <a href="#Addr">Addr</a> type takes less memory, is immutable, and is comparable (supports == and being a map key). </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Addr">type Addr</a></li>
+<li> <a href="#AddrFrom16">func AddrFrom16(addr [16]byte) Addr</a>
+</li>
+<li> <a href="#AddrFrom4">func AddrFrom4(addr [4]byte) Addr</a>
+</li>
+<li> <a href="#AddrFromSlice">func AddrFromSlice(slice []byte) (ip Addr, ok bool)</a>
+</li>
+<li> <a href="#IPv4Unspecified">func IPv4Unspecified() Addr</a>
+</li>
+<li> <a href="#IPv6LinkLocalAllNodes">func IPv6LinkLocalAllNodes() Addr</a>
+</li>
+<li> <a href="#IPv6LinkLocalAllRouters">func IPv6LinkLocalAllRouters() Addr</a>
+</li>
+<li> <a href="#IPv6Loopback">func IPv6Loopback() Addr</a>
+</li>
+<li> <a href="#IPv6Unspecified">func IPv6Unspecified() Addr</a>
+</li>
+<li> <a href="#MustParseAddr">func MustParseAddr(s string) Addr</a>
+</li>
+<li> <a href="#ParseAddr">func ParseAddr(s string) (Addr, error)</a>
+</li>
+<li> <a href="#Addr.AppendTo">func (ip Addr) AppendTo(b []byte) []byte</a>
+</li>
+<li> <a href="#Addr.As16">func (ip Addr) As16() (a16 [16]byte)</a>
+</li>
+<li> <a href="#Addr.As4">func (ip Addr) As4() (a4 [4]byte)</a>
+</li>
+<li> <a href="#Addr.AsSlice">func (ip Addr) AsSlice() []byte</a>
+</li>
+<li> <a href="#Addr.BitLen">func (ip Addr) BitLen() int</a>
+</li>
+<li> <a href="#Addr.Compare">func (ip Addr) Compare(ip2 Addr) int</a>
+</li>
+<li> <a href="#Addr.Is4">func (ip Addr) Is4() bool</a>
+</li>
+<li> <a href="#Addr.Is4In6">func (ip Addr) Is4In6() bool</a>
+</li>
+<li> <a href="#Addr.Is6">func (ip Addr) Is6() bool</a>
+</li>
+<li> <a href="#Addr.IsGlobalUnicast">func (ip Addr) IsGlobalUnicast() bool</a>
+</li>
+<li> <a href="#Addr.IsInterfaceLocalMulticast">func (ip Addr) IsInterfaceLocalMulticast() bool</a>
+</li>
+<li> <a href="#Addr.IsLinkLocalMulticast">func (ip Addr) IsLinkLocalMulticast() bool</a>
+</li>
+<li> <a href="#Addr.IsLinkLocalUnicast">func (ip Addr) IsLinkLocalUnicast() bool</a>
+</li>
+<li> <a href="#Addr.IsLoopback">func (ip Addr) IsLoopback() bool</a>
+</li>
+<li> <a href="#Addr.IsMulticast">func (ip Addr) IsMulticast() bool</a>
+</li>
+<li> <a href="#Addr.IsPrivate">func (ip Addr) IsPrivate() bool</a>
+</li>
+<li> <a href="#Addr.IsUnspecified">func (ip Addr) IsUnspecified() bool</a>
+</li>
+<li> <a href="#Addr.IsValid">func (ip Addr) IsValid() bool</a>
+</li>
+<li> <a href="#Addr.Less">func (ip Addr) Less(ip2 Addr) bool</a>
+</li>
+<li> <a href="#Addr.MarshalBinary">func (ip Addr) MarshalBinary() ([]byte, error)</a>
+</li>
+<li> <a href="#Addr.MarshalText">func (ip Addr) MarshalText() ([]byte, error)</a>
+</li>
+<li> <a href="#Addr.Next">func (ip Addr) Next() Addr</a>
+</li>
+<li> <a href="#Addr.Prefix">func (ip Addr) Prefix(b int) (Prefix, error)</a>
+</li>
+<li> <a href="#Addr.Prev">func (ip Addr) Prev() Addr</a>
+</li>
+<li> <a href="#Addr.String">func (ip Addr) String() string</a>
+</li>
+<li> <a href="#Addr.StringExpanded">func (ip Addr) StringExpanded() string</a>
+</li>
+<li> <a href="#Addr.Unmap">func (ip Addr) Unmap() Addr</a>
+</li>
+<li> <a href="#Addr.UnmarshalBinary">func (ip *Addr) UnmarshalBinary(b []byte) error</a>
+</li>
+<li> <a href="#Addr.UnmarshalText">func (ip *Addr) UnmarshalText(text []byte) error</a>
+</li>
+<li> <a href="#Addr.WithZone">func (ip Addr) WithZone(zone string) Addr</a>
+</li>
+<li> <a href="#Addr.Zone">func (ip Addr) Zone() string</a>
+</li>
+<li><a href="#AddrPort">type AddrPort</a></li>
+<li> <a href="#AddrPortFrom">func AddrPortFrom(ip Addr, port uint16) AddrPort</a>
+</li>
+<li> <a href="#MustParseAddrPort">func MustParseAddrPort(s string) AddrPort</a>
+</li>
+<li> <a href="#ParseAddrPort">func ParseAddrPort(s string) (AddrPort, error)</a>
+</li>
+<li> <a href="#AddrPort.Addr">func (p AddrPort) Addr() Addr</a>
+</li>
+<li> <a href="#AddrPort.AppendTo">func (p AddrPort) AppendTo(b []byte) []byte</a>
+</li>
+<li> <a href="#AddrPort.Compare">func (p AddrPort) Compare(p2 AddrPort) int</a>
+</li>
+<li> <a href="#AddrPort.IsValid">func (p AddrPort) IsValid() bool</a>
+</li>
+<li> <a href="#AddrPort.MarshalBinary">func (p AddrPort) MarshalBinary() ([]byte, error)</a>
+</li>
+<li> <a href="#AddrPort.MarshalText">func (p AddrPort) MarshalText() ([]byte, error)</a>
+</li>
+<li> <a href="#AddrPort.Port">func (p AddrPort) Port() uint16</a>
+</li>
+<li> <a href="#AddrPort.String">func (p AddrPort) String() string</a>
+</li>
+<li> <a href="#AddrPort.UnmarshalBinary">func (p *AddrPort) UnmarshalBinary(b []byte) error</a>
+</li>
+<li> <a href="#AddrPort.UnmarshalText">func (p *AddrPort) UnmarshalText(text []byte) error</a>
+</li>
+<li><a href="#Prefix">type Prefix</a></li>
+<li> <a href="#MustParsePrefix">func MustParsePrefix(s string) Prefix</a>
+</li>
+<li> <a href="#ParsePrefix">func ParsePrefix(s string) (Prefix, error)</a>
+</li>
+<li> <a href="#PrefixFrom">func PrefixFrom(ip Addr, bits int) Prefix</a>
+</li>
+<li> <a href="#Prefix.Addr">func (p Prefix) Addr() Addr</a>
+</li>
+<li> <a href="#Prefix.AppendTo">func (p Prefix) AppendTo(b []byte) []byte</a>
+</li>
+<li> <a href="#Prefix.Bits">func (p Prefix) Bits() int</a>
+</li>
+<li> <a href="#Prefix.Contains">func (p Prefix) Contains(ip Addr) bool</a>
+</li>
+<li> <a href="#Prefix.IsSingleIP">func (p Prefix) IsSingleIP() bool</a>
+</li>
+<li> <a href="#Prefix.IsValid">func (p Prefix) IsValid() bool</a>
+</li>
+<li> <a href="#Prefix.MarshalBinary">func (p Prefix) MarshalBinary() ([]byte, error)</a>
+</li>
+<li> <a href="#Prefix.MarshalText">func (p Prefix) MarshalText() ([]byte, error)</a>
+</li>
+<li> <a href="#Prefix.Masked">func (p Prefix) Masked() Prefix</a>
+</li>
+<li> <a href="#Prefix.Overlaps">func (p Prefix) Overlaps(o Prefix) bool</a>
+</li>
+<li> <a href="#Prefix.String">func (p Prefix) String() string</a>
+</li>
+<li> <a href="#Prefix.UnmarshalBinary">func (p *Prefix) UnmarshalBinary(b []byte) error</a>
+</li>
+<li> <a href="#Prefix.UnmarshalText">func (p *Prefix) UnmarshalText(text []byte) error</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>leaf_alts.go</span> <span>netip.go</span> <span>uint128.go</span> </p> <h2 id="Addr">type <span>Addr</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>Addr represents an IPv4 or IPv6 address (with or without a scoped addressing zone), similar to <span>net.IP</span> or <span>net.IPAddr</span>. </p>
+<p>Unlike <span>net.IP</span> or <span>net.IPAddr</span>, Addr is a comparable value type (it supports == and can be a map key) and is immutable. </p>
+<p>The zero Addr is not a valid IP address. Addr{} is distinct from both 0.0.0.0 and ::. </p>
+<pre data-language="go">type Addr struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="AddrFrom16">func <span>AddrFrom16</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func AddrFrom16(addr [16]byte) Addr</pre> <p>AddrFrom16 returns the IPv6 address given by the bytes in addr. An IPv4-mapped IPv6 address is left as an IPv6 address. (Use Unmap to convert them if needed.) </p>
+<h3 id="AddrFrom4">func <span>AddrFrom4</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func AddrFrom4(addr [4]byte) Addr</pre> <p>AddrFrom4 returns the address of the IPv4 address given by the bytes in addr. </p>
+<h3 id="AddrFromSlice">func <span>AddrFromSlice</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func AddrFromSlice(slice []byte) (ip Addr, ok bool)</pre> <p>AddrFromSlice parses the 4- or 16-byte byte slice as an IPv4 or IPv6 address. Note that a <span>net.IP</span> can be passed directly as the []byte argument. If slice's length is not 4 or 16, AddrFromSlice returns <a href="#Addr">Addr</a>{}, false. </p>
+<h3 id="IPv4Unspecified">func <span>IPv4Unspecified</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func IPv4Unspecified() Addr</pre> <p>IPv4Unspecified returns the IPv4 unspecified address "0.0.0.0". </p>
+<h3 id="IPv6LinkLocalAllNodes">func <span>IPv6LinkLocalAllNodes</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func IPv6LinkLocalAllNodes() Addr</pre> <p>IPv6LinkLocalAllNodes returns the IPv6 link-local all nodes multicast address ff02::1. </p>
+<h3 id="IPv6LinkLocalAllRouters">func <span>IPv6LinkLocalAllRouters</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func IPv6LinkLocalAllRouters() Addr</pre> <p>IPv6LinkLocalAllRouters returns the IPv6 link-local all routers multicast address ff02::2. </p>
+<h3 id="IPv6Loopback">func <span>IPv6Loopback</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func IPv6Loopback() Addr</pre> <p>IPv6Loopback returns the IPv6 loopback address ::1. </p>
+<h3 id="IPv6Unspecified">func <span>IPv6Unspecified</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func IPv6Unspecified() Addr</pre> <p>IPv6Unspecified returns the IPv6 unspecified address "::". </p>
+<h3 id="MustParseAddr">func <span>MustParseAddr</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func MustParseAddr(s string) Addr</pre> <p>MustParseAddr calls <a href="#ParseAddr">ParseAddr</a>(s) and panics on error. It is intended for use in tests with hard-coded strings. </p>
+<h3 id="ParseAddr">func <span>ParseAddr</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func ParseAddr(s string) (Addr, error)</pre> <p>ParseAddr parses s as an IP address, returning the result. The string s can be in dotted decimal ("192.0.2.1"), IPv6 ("2001:db8::68"), or IPv6 with a scoped addressing zone ("fe80::1cc0:3e8c:119f:c2e1%ens18"). </p>
+<h3 id="Addr.AppendTo">func (Addr) <span>AppendTo</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) AppendTo(b []byte) []byte</pre> <p>AppendTo appends a text encoding of ip, as generated by <a href="#Addr.MarshalText">Addr.MarshalText</a>, to b and returns the extended buffer. </p>
+<h3 id="Addr.As16">func (Addr) <span>As16</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) As16() (a16 [16]byte)</pre> <p>As16 returns the IP address in its 16-byte representation. IPv4 addresses are returned as IPv4-mapped IPv6 addresses. IPv6 addresses with zones are returned without their zone (use the <a href="#Addr.Zone">Addr.Zone</a> method to get it). The ip zero value returns all zeroes. </p>
+<h3 id="Addr.As4">func (Addr) <span>As4</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) As4() (a4 [4]byte)</pre> <p>As4 returns an IPv4 or IPv4-in-IPv6 address in its 4-byte representation. If ip is the zero <a href="#Addr">Addr</a> or an IPv6 address, As4 panics. Note that 0.0.0.0 is not the zero Addr. </p>
+<h3 id="Addr.AsSlice">func (Addr) <span>AsSlice</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) AsSlice() []byte</pre> <p>AsSlice returns an IPv4 or IPv6 address in its respective 4-byte or 16-byte representation. </p>
+<h3 id="Addr.BitLen">func (Addr) <span>BitLen</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) BitLen() int</pre> <p>BitLen returns the number of bits in the IP address: 128 for IPv6, 32 for IPv4, and 0 for the zero <a href="#Addr">Addr</a>. </p>
+<p>Note that IPv4-mapped IPv6 addresses are considered IPv6 addresses and therefore have bit length 128. </p>
+<h3 id="Addr.Compare">func (Addr) <span>Compare</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Compare(ip2 Addr) int</pre> <p>Compare returns an integer comparing two IPs. The result will be 0 if ip == ip2, -1 if ip &lt; ip2, and +1 if ip &gt; ip2. The definition of "less than" is the same as the <a href="#Addr.Less">Addr.Less</a> method. </p>
+<h3 id="Addr.Is4">func (Addr) <span>Is4</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Is4() bool</pre> <p>Is4 reports whether ip is an IPv4 address. </p>
+<p>It returns false for IPv4-mapped IPv6 addresses. See <a href="#Addr.Unmap">Addr.Unmap</a>. </p>
+<h3 id="Addr.Is4In6">func (Addr) <span>Is4In6</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Is4In6() bool</pre> <p>Is4In6 reports whether ip is an IPv4-mapped IPv6 address. </p>
+<h3 id="Addr.Is6">func (Addr) <span>Is6</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Is6() bool</pre> <p>Is6 reports whether ip is an IPv6 address, including IPv4-mapped IPv6 addresses. </p>
+<h3 id="Addr.IsGlobalUnicast">func (Addr) <span>IsGlobalUnicast</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) IsGlobalUnicast() bool</pre> <p>IsGlobalUnicast reports whether ip is a global unicast address. </p>
+<p>It returns true for IPv6 addresses which fall outside of the current IANA-allocated 2000::/3 global unicast space, with the exception of the link-local address space. It also returns true even if ip is in the IPv4 private address space or IPv6 unique local address space. It returns false for the zero <a href="#Addr">Addr</a>. </p>
+<p>For reference, see RFC 1122, RFC 4291, and RFC 4632. </p>
+<h3 id="Addr.IsInterfaceLocalMulticast">func (Addr) <span>IsInterfaceLocalMulticast</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) IsInterfaceLocalMulticast() bool</pre> <p>IsInterfaceLocalMulticast reports whether ip is an IPv6 interface-local multicast address. </p>
+<h3 id="Addr.IsLinkLocalMulticast">func (Addr) <span>IsLinkLocalMulticast</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) IsLinkLocalMulticast() bool</pre> <p>IsLinkLocalMulticast reports whether ip is a link-local multicast address. </p>
+<h3 id="Addr.IsLinkLocalUnicast">func (Addr) <span>IsLinkLocalUnicast</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) IsLinkLocalUnicast() bool</pre> <p>IsLinkLocalUnicast reports whether ip is a link-local unicast address. </p>
+<h3 id="Addr.IsLoopback">func (Addr) <span>IsLoopback</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) IsLoopback() bool</pre> <p>IsLoopback reports whether ip is a loopback address. </p>
+<h3 id="Addr.IsMulticast">func (Addr) <span>IsMulticast</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) IsMulticast() bool</pre> <p>IsMulticast reports whether ip is a multicast address. </p>
+<h3 id="Addr.IsPrivate">func (Addr) <span>IsPrivate</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) IsPrivate() bool</pre> <p>IsPrivate reports whether ip is a private address, according to RFC 1918 (IPv4 addresses) and RFC 4193 (IPv6 addresses). That is, it reports whether ip is in 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, or fc00::/7. This is the same as <span>net.IP.IsPrivate</span>. </p>
+<h3 id="Addr.IsUnspecified">func (Addr) <span>IsUnspecified</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) IsUnspecified() bool</pre> <p>IsUnspecified reports whether ip is an unspecified address, either the IPv4 address "0.0.0.0" or the IPv6 address "::". </p>
+<p>Note that the zero <a href="#Addr">Addr</a> is not an unspecified address. </p>
+<h3 id="Addr.IsValid">func (Addr) <span>IsValid</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) IsValid() bool</pre> <p>IsValid reports whether the <a href="#Addr">Addr</a> is an initialized address (not the zero Addr). </p>
+<p>Note that "0.0.0.0" and "::" are both valid values. </p>
+<h3 id="Addr.Less">func (Addr) <span>Less</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Less(ip2 Addr) bool</pre> <p>Less reports whether ip sorts before ip2. IP addresses sort first by length, then their address. IPv6 addresses with zones sort just after the same address without a zone. </p>
+<h3 id="Addr.MarshalBinary">func (Addr) <span>MarshalBinary</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) MarshalBinary() ([]byte, error)</pre> <p>MarshalBinary implements the <span>encoding.BinaryMarshaler</span> interface. It returns a zero-length slice for the zero <a href="#Addr">Addr</a>, the 4-byte form for an IPv4 address, and the 16-byte form with zone appended for an IPv6 address. </p>
+<h3 id="Addr.MarshalText">func (Addr) <span>MarshalText</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) MarshalText() ([]byte, error)</pre> <p>MarshalText implements the <span>encoding.TextMarshaler</span> interface, The encoding is the same as returned by <a href="#Addr.String">Addr.String</a>, with one exception: If ip is the zero <a href="#Addr">Addr</a>, the encoding is the empty string. </p>
+<h3 id="Addr.Next">func (Addr) <span>Next</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Next() Addr</pre> <p>Next returns the address following ip. If there is none, it returns the zero <a href="#Addr">Addr</a>. </p>
+<h3 id="Addr.Prefix">func (Addr) <span>Prefix</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Prefix(b int) (Prefix, error)</pre> <p>Prefix keeps only the top b bits of IP, producing a Prefix of the specified length. If ip is a zero <a href="#Addr">Addr</a>, Prefix always returns a zero Prefix and a nil error. Otherwise, if bits is less than zero or greater than ip.BitLen(), Prefix returns an error. </p>
+<h3 id="Addr.Prev">func (Addr) <span>Prev</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Prev() Addr</pre> <p>Prev returns the IP before ip. If there is none, it returns the IP zero value. </p>
+<h3 id="Addr.String">func (Addr) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) String() string</pre> <p>String returns the string form of the IP address ip. It returns one of 5 forms: </p>
+<ul> <li>"invalid IP", if ip is the zero <a href="#Addr">Addr</a> </li>
+<li>IPv4 dotted decimal ("192.0.2.1") </li>
+<li>IPv6 ("2001:db8::1") </li>
+<li>"::ffff:1.2.3.4" (if <a href="#Addr.Is4In6">Addr.Is4In6</a>) </li>
+<li>IPv6 with zone ("fe80:db8::1%eth0") </li>
+</ul> <p>Note that unlike package net's IP.String method, IPv4-mapped IPv6 addresses format with a "::ffff:" prefix before the dotted quad. </p>
+<h3 id="Addr.StringExpanded">func (Addr) <span>StringExpanded</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) StringExpanded() string</pre> <p>StringExpanded is like <a href="#Addr.String">Addr.String</a> but IPv6 addresses are expanded with leading zeroes and no "::" compression. For example, "2001:db8::1" becomes "2001:0db8:0000:0000:0000:0000:0000:0001". </p>
+<h3 id="Addr.Unmap">func (Addr) <span>Unmap</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Unmap() Addr</pre> <p>Unmap returns ip with any IPv4-mapped IPv6 address prefix removed. </p>
+<p>That is, if ip is an IPv6 address wrapping an IPv4 address, it returns the wrapped IPv4 address. Otherwise it returns ip unmodified. </p>
+<h3 id="Addr.UnmarshalBinary">func (*Addr) <span>UnmarshalBinary</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip *Addr) UnmarshalBinary(b []byte) error</pre> <p>UnmarshalBinary implements the <span>encoding.BinaryUnmarshaler</span> interface. It expects data in the form generated by MarshalBinary. </p>
+<h3 id="Addr.UnmarshalText">func (*Addr) <span>UnmarshalText</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip *Addr) UnmarshalText(text []byte) error</pre> <p>UnmarshalText implements the encoding.TextUnmarshaler interface. The IP address is expected in a form accepted by <a href="#ParseAddr">ParseAddr</a>. </p>
+<p>If text is empty, UnmarshalText sets *ip to the zero <a href="#Addr">Addr</a> and returns no error. </p>
+<h3 id="Addr.WithZone">func (Addr) <span>WithZone</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) WithZone(zone string) Addr</pre> <p>WithZone returns an IP that's the same as ip but with the provided zone. If zone is empty, the zone is removed. If ip is an IPv4 address, WithZone is a no-op and returns ip unchanged. </p>
+<h3 id="Addr.Zone">func (Addr) <span>Zone</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (ip Addr) Zone() string</pre> <p>Zone returns ip's IPv6 scoped addressing zone, if any. </p>
+<h2 id="AddrPort">type <span>AddrPort</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>AddrPort is an IP and a port number. </p>
+<pre data-language="go">type AddrPort struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="AddrPortFrom">func <span>AddrPortFrom</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func AddrPortFrom(ip Addr, port uint16) AddrPort</pre> <p>AddrPortFrom returns an <a href="#AddrPort">AddrPort</a> with the provided IP and port. It does not allocate. </p>
+<h3 id="MustParseAddrPort">func <span>MustParseAddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func MustParseAddrPort(s string) AddrPort</pre> <p>MustParseAddrPort calls <a href="#ParseAddrPort">ParseAddrPort</a>(s) and panics on error. It is intended for use in tests with hard-coded strings. </p>
+<h3 id="ParseAddrPort">func <span>ParseAddrPort</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func ParseAddrPort(s string) (AddrPort, error)</pre> <p>ParseAddrPort parses s as an <a href="#AddrPort">AddrPort</a>. </p>
+<p>It doesn't do any name resolution: both the address and the port must be numeric. </p>
+<h3 id="AddrPort.Addr">func (AddrPort) <span>Addr</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p AddrPort) Addr() Addr</pre> <p>Addr returns p's IP address. </p>
+<h3 id="AddrPort.AppendTo">func (AddrPort) <span>AppendTo</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p AddrPort) AppendTo(b []byte) []byte</pre> <p>AppendTo appends a text encoding of p, as generated by <a href="#AddrPort.MarshalText">AddrPort.MarshalText</a>, to b and returns the extended buffer. </p>
+<h3 id="AddrPort.Compare">func (AddrPort) <span>Compare</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (p AddrPort) Compare(p2 AddrPort) int</pre> <p>Compare returns an integer comparing two AddrPorts. The result will be 0 if p == p2, -1 if p &lt; p2, and +1 if p &gt; p2. AddrPorts sort first by IP address, then port. </p>
+<h3 id="AddrPort.IsValid">func (AddrPort) <span>IsValid</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p AddrPort) IsValid() bool</pre> <p>IsValid reports whether p.Addr() is valid. All ports are valid, including zero. </p>
+<h3 id="AddrPort.MarshalBinary">func (AddrPort) <span>MarshalBinary</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p AddrPort) MarshalBinary() ([]byte, error)</pre> <p>MarshalBinary implements the <span>encoding.BinaryMarshaler</span> interface. It returns <a href="#Addr.MarshalBinary">Addr.MarshalBinary</a> with an additional two bytes appended containing the port in little-endian. </p>
+<h3 id="AddrPort.MarshalText">func (AddrPort) <span>MarshalText</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p AddrPort) MarshalText() ([]byte, error)</pre> <p>MarshalText implements the <span>encoding.TextMarshaler</span> interface. The encoding is the same as returned by <a href="#AddrPort.String">AddrPort.String</a>, with one exception: if p.Addr() is the zero <a href="#Addr">Addr</a>, the encoding is the empty string. </p>
+<h3 id="AddrPort.Port">func (AddrPort) <span>Port</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p AddrPort) Port() uint16</pre> <p>Port returns p's port. </p>
+<h3 id="AddrPort.String">func (AddrPort) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p AddrPort) String() string</pre> <h3 id="AddrPort.UnmarshalBinary">func (*AddrPort) <span>UnmarshalBinary</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p *AddrPort) UnmarshalBinary(b []byte) error</pre> <p>UnmarshalBinary implements the <span>encoding.BinaryUnmarshaler</span> interface. It expects data in the form generated by <a href="#AddrPort.MarshalBinary">AddrPort.MarshalBinary</a>. </p>
+<h3 id="AddrPort.UnmarshalText">func (*AddrPort) <span>UnmarshalText</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p *AddrPort) UnmarshalText(text []byte) error</pre> <p>UnmarshalText implements the encoding.TextUnmarshaler interface. The <a href="#AddrPort">AddrPort</a> is expected in a form generated by <a href="#AddrPort.MarshalText">AddrPort.MarshalText</a> or accepted by <a href="#ParseAddrPort">ParseAddrPort</a>. </p>
+<h2 id="Prefix">type <span>Prefix</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>Prefix is an IP address prefix (CIDR) representing an IP network. </p>
+<p>The first <a href="#Prefix.Bits">Prefix.Bits</a>() of <a href="#Addr">Addr</a>() are specified. The remaining bits match any address. The range of Bits() is [0,32] for IPv4 or [0,128] for IPv6. </p>
+<pre data-language="go">type Prefix struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="MustParsePrefix">func <span>MustParsePrefix</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func MustParsePrefix(s string) Prefix</pre> <p>MustParsePrefix calls <a href="#ParsePrefix">ParsePrefix</a>(s) and panics on error. It is intended for use in tests with hard-coded strings. </p>
+<h3 id="ParsePrefix">func <span>ParsePrefix</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func ParsePrefix(s string) (Prefix, error)</pre> <p>ParsePrefix parses s as an IP address prefix. The string can be in the form "192.168.1.0/24" or "2001:db8::/32", the CIDR notation defined in RFC 4632 and RFC 4291. IPv6 zones are not permitted in prefixes, and an error will be returned if a zone is present. </p>
+<p>Note that masked address bits are not zeroed. Use Masked for that. </p>
+<h3 id="PrefixFrom">func <span>PrefixFrom</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func PrefixFrom(ip Addr, bits int) Prefix</pre> <p>PrefixFrom returns a <a href="#Prefix">Prefix</a> with the provided IP address and bit prefix length. </p>
+<p>It does not allocate. Unlike <a href="#Addr.Prefix">Addr.Prefix</a>, <a href="#PrefixFrom">PrefixFrom</a> does not mask off the host bits of ip. </p>
+<p>If bits is less than zero or greater than ip.BitLen, <a href="#Prefix.Bits">Prefix.Bits</a> will return an invalid value -1. </p>
+<h3 id="Prefix.Addr">func (Prefix) <span>Addr</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) Addr() Addr</pre> <p>Addr returns p's IP address. </p>
+<h3 id="Prefix.AppendTo">func (Prefix) <span>AppendTo</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) AppendTo(b []byte) []byte</pre> <p>AppendTo appends a text encoding of p, as generated by <a href="#Prefix.MarshalText">Prefix.MarshalText</a>, to b and returns the extended buffer. </p>
+<h3 id="Prefix.Bits">func (Prefix) <span>Bits</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) Bits() int</pre> <p>Bits returns p's prefix length. </p>
+<p>It reports -1 if invalid. </p>
+<h3 id="Prefix.Contains">func (Prefix) <span>Contains</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) Contains(ip Addr) bool</pre> <p>Contains reports whether the network p includes ip. </p>
+<p>An IPv4 address will not match an IPv6 prefix. An IPv4-mapped IPv6 address will not match an IPv4 prefix. A zero-value IP will not match any prefix. If ip has an IPv6 zone, Contains returns false, because Prefixes strip zones. </p>
+<h3 id="Prefix.IsSingleIP">func (Prefix) <span>IsSingleIP</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) IsSingleIP() bool</pre> <p>IsSingleIP reports whether p contains exactly one IP. </p>
+<h3 id="Prefix.IsValid">func (Prefix) <span>IsValid</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) IsValid() bool</pre> <p>IsValid reports whether p.Bits() has a valid range for p.Addr(). If p.Addr() is the zero <a href="#Addr">Addr</a>, IsValid returns false. Note that if p is the zero <a href="#Prefix">Prefix</a>, then p.IsValid() == false. </p>
+<h3 id="Prefix.MarshalBinary">func (Prefix) <span>MarshalBinary</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) MarshalBinary() ([]byte, error)</pre> <p>MarshalBinary implements the <span>encoding.BinaryMarshaler</span> interface. It returns <a href="#Addr.MarshalBinary">Addr.MarshalBinary</a> with an additional byte appended containing the prefix bits. </p>
+<h3 id="Prefix.MarshalText">func (Prefix) <span>MarshalText</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) MarshalText() ([]byte, error)</pre> <p>MarshalText implements the <span>encoding.TextMarshaler</span> interface, The encoding is the same as returned by <a href="#Prefix.String">Prefix.String</a>, with one exception: If p is the zero value, the encoding is the empty string. </p>
+<h3 id="Prefix.Masked">func (Prefix) <span>Masked</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) Masked() Prefix</pre> <p>Masked returns p in its canonical form, with all but the high p.Bits() bits of p.Addr() masked off. </p>
+<p>If p is zero or otherwise invalid, Masked returns the zero <a href="#Prefix">Prefix</a>. </p>
+<h3 id="Prefix.Overlaps">func (Prefix) <span>Overlaps</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) Overlaps(o Prefix) bool</pre> <p>Overlaps reports whether p and o contain any IP addresses in common. </p>
+<p>If p and o are of different address families or either have a zero IP, it reports false. Like the Contains method, a prefix with an IPv4-mapped IPv6 address is still treated as an IPv6 mask. </p>
+<h3 id="Prefix.String">func (Prefix) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p Prefix) String() string</pre> <p>String returns the CIDR notation of p: "&lt;ip&gt;/&lt;bits&gt;". </p>
+<h3 id="Prefix.UnmarshalBinary">func (*Prefix) <span>UnmarshalBinary</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p *Prefix) UnmarshalBinary(b []byte) error</pre> <p>UnmarshalBinary implements the <span>encoding.BinaryUnmarshaler</span> interface. It expects data in the form generated by <a href="#Prefix.MarshalBinary">Prefix.MarshalBinary</a>. </p>
+<h3 id="Prefix.UnmarshalText">func (*Prefix) <span>UnmarshalText</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (p *Prefix) UnmarshalText(text []byte) error</pre> <p>UnmarshalText implements the encoding.TextUnmarshaler interface. The IP address is expected in a form accepted by <a href="#ParsePrefix">ParsePrefix</a> or generated by <a href="#Prefix.MarshalText">Prefix.MarshalText</a>. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/netip/" class="_attribution-link">http://golang.org/pkg/net/netip/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Frpc%2Findex.html b/devdocs/go/net%2Frpc%2Findex.html
new file mode 100644
index 00000000..b70617b5
--- /dev/null
+++ b/devdocs/go/net%2Frpc%2Findex.html
@@ -0,0 +1,218 @@
+<h1> Package rpc </h1> <ul id="short-nav">
+<li><code>import "net/rpc"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package rpc provides access to the exported methods of an object across a network or other I/O connection. A server registers an object, making it visible as a service with the name of the type of the object. After registration, exported methods of the object will be accessible remotely. A server may register multiple objects (services) of different types but it is an error to register multiple objects of the same type. </p>
+<p>Only methods that satisfy these criteria will be made available for remote access; other methods will be ignored: </p>
+<ul> <li>the method's type is exported. </li>
+<li>the method is exported. </li>
+<li>the method has two arguments, both exported (or builtin) types. </li>
+<li>the method's second argument is a pointer. </li>
+<li>the method has return type error. </li>
+</ul> <p>In effect, the method must look schematically like </p>
+<pre data-language="go">func (t *T) MethodName(argType T1, replyType *T2) error
+</pre> <p>where T1 and T2 can be marshaled by encoding/gob. These requirements apply even if a different codec is used. (In the future, these requirements may soften for custom codecs.) </p>
+<p>The method's first argument represents the arguments provided by the caller; the second argument represents the result parameters to be returned to the caller. The method's return value, if non-nil, is passed back as a string that the client sees as if created by <span>errors.New</span>. If an error is returned, the reply parameter will not be sent back to the client. </p>
+<p>The server may handle requests on a single connection by calling <a href="#ServeConn">ServeConn</a>. More typically it will create a network listener and call <a href="#Accept">Accept</a> or, for an HTTP listener, <a href="#HandleHTTP">HandleHTTP</a> and <span>http.Serve</span>. </p>
+<p>A client wishing to use the service establishes a connection and then invokes <a href="#NewClient">NewClient</a> on the connection. The convenience function <a href="#Dial">Dial</a> (<a href="#DialHTTP">DialHTTP</a>) performs both steps for a raw network connection (an HTTP connection). The resulting <a href="#Client">Client</a> object has two methods, <a href="#Call">Call</a> and Go, that specify the service and method to call, a pointer containing the arguments, and a pointer to receive the result parameters. </p>
+<p>The Call method waits for the remote call to complete while the Go method launches the call asynchronously and signals completion using the Call structure's Done channel. </p>
+<p>Unless an explicit codec is set up, package <span>encoding/gob</span> is used to transport the data. </p>
+<p>Here is a simple example. A server wishes to export an object of type Arith: </p>
+<pre data-language="go">package server
+
+import "errors"
+
+type Args struct {
+ A, B int
+}
+
+type Quotient struct {
+ Quo, Rem int
+}
+
+type Arith int
+
+func (t *Arith) Multiply(args *Args, reply *int) error {
+ *reply = args.A * args.B
+ return nil
+}
+
+func (t *Arith) Divide(args *Args, quo *Quotient) error {
+ if args.B == 0 {
+ return errors.New("divide by zero")
+ }
+ quo.Quo = args.A / args.B
+ quo.Rem = args.A % args.B
+ return nil
+}
+</pre> <p>The server calls (for HTTP service): </p>
+<pre data-language="go">arith := new(Arith)
+rpc.Register(arith)
+rpc.HandleHTTP()
+l, err := net.Listen("tcp", ":1234")
+if err != nil {
+ log.Fatal("listen error:", err)
+}
+go http.Serve(l, nil)
+</pre> <p>At this point, clients can see a service "Arith" with methods "Arith.Multiply" and "Arith.Divide". To invoke one, a client first dials the server: </p>
+<pre data-language="go">client, err := rpc.DialHTTP("tcp", serverAddress + ":1234")
+if err != nil {
+ log.Fatal("dialing:", err)
+}
+</pre> <p>Then it can make a remote call: </p>
+<pre data-language="go">// Synchronous call
+args := &amp;server.Args{7,8}
+var reply int
+err = client.Call("Arith.Multiply", args, &amp;reply)
+if err != nil {
+ log.Fatal("arith error:", err)
+}
+fmt.Printf("Arith: %d*%d=%d", args.A, args.B, reply)
+</pre> <p>or </p>
+<pre data-language="go">// Asynchronous call
+quotient := new(Quotient)
+divCall := client.Go("Arith.Divide", args, quotient, nil)
+replyCall := &lt;-divCall.Done // will be equal to divCall
+// check errors, print, etc.
+</pre> <p>A server implementation will often provide a simple, type-safe wrapper for the client. </p>
+<p>The net/rpc package is frozen and is not accepting new features. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Accept">func Accept(lis net.Listener)</a></li>
+<li><a href="#HandleHTTP">func HandleHTTP()</a></li>
+<li><a href="#Register">func Register(rcvr any) error</a></li>
+<li><a href="#RegisterName">func RegisterName(name string, rcvr any) error</a></li>
+<li><a href="#ServeCodec">func ServeCodec(codec ServerCodec)</a></li>
+<li><a href="#ServeConn">func ServeConn(conn io.ReadWriteCloser)</a></li>
+<li><a href="#ServeRequest">func ServeRequest(codec ServerCodec) error</a></li>
+<li><a href="#Call">type Call</a></li>
+<li><a href="#Client">type Client</a></li>
+<li> <a href="#Dial">func Dial(network, address string) (*Client, error)</a>
+</li>
+<li> <a href="#DialHTTP">func DialHTTP(network, address string) (*Client, error)</a>
+</li>
+<li> <a href="#DialHTTPPath">func DialHTTPPath(network, address, path string) (*Client, error)</a>
+</li>
+<li> <a href="#NewClient">func NewClient(conn io.ReadWriteCloser) *Client</a>
+</li>
+<li> <a href="#NewClientWithCodec">func NewClientWithCodec(codec ClientCodec) *Client</a>
+</li>
+<li> <a href="#Client.Call">func (client *Client) Call(serviceMethod string, args any, reply any) error</a>
+</li>
+<li> <a href="#Client.Close">func (client *Client) Close() error</a>
+</li>
+<li> <a href="#Client.Go">func (client *Client) Go(serviceMethod string, args any, reply any, done chan *Call) *Call</a>
+</li>
+<li><a href="#ClientCodec">type ClientCodec</a></li>
+<li><a href="#Request">type Request</a></li>
+<li><a href="#Response">type Response</a></li>
+<li><a href="#Server">type Server</a></li>
+<li> <a href="#NewServer">func NewServer() *Server</a>
+</li>
+<li> <a href="#Server.Accept">func (server *Server) Accept(lis net.Listener)</a>
+</li>
+<li> <a href="#Server.HandleHTTP">func (server *Server) HandleHTTP(rpcPath, debugPath string)</a>
+</li>
+<li> <a href="#Server.Register">func (server *Server) Register(rcvr any) error</a>
+</li>
+<li> <a href="#Server.RegisterName">func (server *Server) RegisterName(name string, rcvr any) error</a>
+</li>
+<li> <a href="#Server.ServeCodec">func (server *Server) ServeCodec(codec ServerCodec)</a>
+</li>
+<li> <a href="#Server.ServeConn">func (server *Server) ServeConn(conn io.ReadWriteCloser)</a>
+</li>
+<li> <a href="#Server.ServeHTTP">func (server *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)</a>
+</li>
+<li> <a href="#Server.ServeRequest">func (server *Server) ServeRequest(codec ServerCodec) error</a>
+</li>
+<li><a href="#ServerCodec">type ServerCodec</a></li>
+<li><a href="#ServerError">type ServerError</a></li>
+<li> <a href="#ServerError.Error">func (e ServerError) Error() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>client.go</span> <span>debug.go</span> <span>server.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ // Defaults used by HandleHTTP
+ DefaultRPCPath = "/_goRPC_"
+ DefaultDebugPath = "/debug/rpc"
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>DefaultServer is the default instance of <a href="#Server">*Server</a>. </p>
+<pre data-language="go">var DefaultServer = NewServer()</pre> <pre data-language="go">var ErrShutdown = errors.New("connection is shut down")</pre> <h2 id="Accept">func <span>Accept</span> </h2> <pre data-language="go">func Accept(lis net.Listener)</pre> <p>Accept accepts connections on the listener and serves requests to <a href="#DefaultServer">DefaultServer</a> for each incoming connection. Accept blocks; the caller typically invokes it in a go statement. </p>
+<h2 id="HandleHTTP">func <span>HandleHTTP</span> </h2> <pre data-language="go">func HandleHTTP()</pre> <p>HandleHTTP registers an HTTP handler for RPC messages to <a href="#DefaultServer">DefaultServer</a> on <a href="#DefaultRPCPath">DefaultRPCPath</a> and a debugging handler on <a href="#DefaultDebugPath">DefaultDebugPath</a>. It is still necessary to invoke <span>http.Serve</span>(), typically in a go statement. </p>
+<h2 id="Register">func <span>Register</span> </h2> <pre data-language="go">func Register(rcvr any) error</pre> <p>Register publishes the receiver's methods in the <a href="#DefaultServer">DefaultServer</a>. </p>
+<h2 id="RegisterName">func <span>RegisterName</span> </h2> <pre data-language="go">func RegisterName(name string, rcvr any) error</pre> <p>RegisterName is like <a href="#Register">Register</a> but uses the provided name for the type instead of the receiver's concrete type. </p>
+<h2 id="ServeCodec">func <span>ServeCodec</span> </h2> <pre data-language="go">func ServeCodec(codec ServerCodec)</pre> <p>ServeCodec is like <a href="#ServeConn">ServeConn</a> but uses the specified codec to decode requests and encode responses. </p>
+<h2 id="ServeConn">func <span>ServeConn</span> </h2> <pre data-language="go">func ServeConn(conn io.ReadWriteCloser)</pre> <p>ServeConn runs the <a href="#DefaultServer">DefaultServer</a> on a single connection. ServeConn blocks, serving the connection until the client hangs up. The caller typically invokes ServeConn in a go statement. ServeConn uses the gob wire format (see package gob) on the connection. To use an alternate codec, use <a href="#ServeCodec">ServeCodec</a>. See <a href="#NewClient">NewClient</a>'s comment for information about concurrent access. </p>
+<h2 id="ServeRequest">func <span>ServeRequest</span> </h2> <pre data-language="go">func ServeRequest(codec ServerCodec) error</pre> <p>ServeRequest is like <a href="#ServeCodec">ServeCodec</a> but synchronously serves a single request. It does not close the codec upon completion. </p>
+<h2 id="Call">type <span>Call</span> </h2> <p>Call represents an active RPC. </p>
+<pre data-language="go">type Call struct {
+ ServiceMethod string // The name of the service and method to call.
+ Args any // The argument to the function (*struct).
+ Reply any // The reply from the function (*struct).
+ Error error // After completion, the error status.
+ Done chan *Call // Receives *Call when Go is complete.
+}
+</pre> <h2 id="Client">type <span>Client</span> </h2> <p>Client represents an RPC Client. There may be multiple outstanding Calls associated with a single Client, and a Client may be used by multiple goroutines simultaneously. </p>
+<pre data-language="go">type Client struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Dial">func <span>Dial</span> </h3> <pre data-language="go">func Dial(network, address string) (*Client, error)</pre> <p>Dial connects to an RPC server at the specified network address. </p>
+<h3 id="DialHTTP">func <span>DialHTTP</span> </h3> <pre data-language="go">func DialHTTP(network, address string) (*Client, error)</pre> <p>DialHTTP connects to an HTTP RPC server at the specified network address listening on the default HTTP RPC path. </p>
+<h3 id="DialHTTPPath">func <span>DialHTTPPath</span> </h3> <pre data-language="go">func DialHTTPPath(network, address, path string) (*Client, error)</pre> <p>DialHTTPPath connects to an HTTP RPC server at the specified network address and path. </p>
+<h3 id="NewClient">func <span>NewClient</span> </h3> <pre data-language="go">func NewClient(conn io.ReadWriteCloser) *Client</pre> <p>NewClient returns a new <a href="#Client">Client</a> to handle requests to the set of services at the other end of the connection. It adds a buffer to the write side of the connection so the header and payload are sent as a unit. </p>
+<p>The read and write halves of the connection are serialized independently, so no interlocking is required. However each half may be accessed concurrently so the implementation of conn should protect against concurrent reads or concurrent writes. </p>
+<h3 id="NewClientWithCodec">func <span>NewClientWithCodec</span> </h3> <pre data-language="go">func NewClientWithCodec(codec ClientCodec) *Client</pre> <p>NewClientWithCodec is like <a href="#NewClient">NewClient</a> but uses the specified codec to encode requests and decode responses. </p>
+<h3 id="Client.Call">func (*Client) <span>Call</span> </h3> <pre data-language="go">func (client *Client) Call(serviceMethod string, args any, reply any) error</pre> <p>Call invokes the named function, waits for it to complete, and returns its error status. </p>
+<h3 id="Client.Close">func (*Client) <span>Close</span> </h3> <pre data-language="go">func (client *Client) Close() error</pre> <p>Close calls the underlying codec's Close method. If the connection is already shutting down, <a href="#ErrShutdown">ErrShutdown</a> is returned. </p>
+<h3 id="Client.Go">func (*Client) <span>Go</span> </h3> <pre data-language="go">func (client *Client) Go(serviceMethod string, args any, reply any, done chan *Call) *Call</pre> <p>Go invokes the function asynchronously. It returns the <a href="#Call">Call</a> structure representing the invocation. The done channel will signal when the call is complete by returning the same Call object. If done is nil, Go will allocate a new channel. If non-nil, done must be buffered or Go will deliberately crash. </p>
+<h2 id="ClientCodec">type <span>ClientCodec</span> </h2> <p>A ClientCodec implements writing of RPC requests and reading of RPC responses for the client side of an RPC session. The client calls [ClientCodec.WriteRequest] to write a request to the connection and calls [ClientCodec.ReadResponseHeader] and [ClientCodec.ReadResponseBody] in pairs to read responses. The client calls [ClientCodec.Close] when finished with the connection. ReadResponseBody may be called with a nil argument to force the body of the response to be read and then discarded. See <a href="#NewClient">NewClient</a>'s comment for information about concurrent access. </p>
+<pre data-language="go">type ClientCodec interface {
+ WriteRequest(*Request, any) error
+ ReadResponseHeader(*Response) error
+ ReadResponseBody(any) error
+
+ Close() error
+}</pre> <h2 id="Request">type <span>Request</span> </h2> <p>Request is a header written before every RPC call. It is used internally but documented here as an aid to debugging, such as when analyzing network traffic. </p>
+<pre data-language="go">type Request struct {
+ ServiceMethod string // format: "Service.Method"
+ Seq uint64 // sequence number chosen by client
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="Response">type <span>Response</span> </h2> <p>Response is a header written before every RPC return. It is used internally but documented here as an aid to debugging, such as when analyzing network traffic. </p>
+<pre data-language="go">type Response struct {
+ ServiceMethod string // echoes that of the Request
+ Seq uint64 // echoes that of the request
+ Error string // error, if any.
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="Server">type <span>Server</span> </h2> <p>Server represents an RPC Server. </p>
+<pre data-language="go">type Server struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewServer">func <span>NewServer</span> </h3> <pre data-language="go">func NewServer() *Server</pre> <p>NewServer returns a new <a href="#Server">Server</a>. </p>
+<h3 id="Server.Accept">func (*Server) <span>Accept</span> </h3> <pre data-language="go">func (server *Server) Accept(lis net.Listener)</pre> <p>Accept accepts connections on the listener and serves requests for each incoming connection. Accept blocks until the listener returns a non-nil error. The caller typically invokes Accept in a go statement. </p>
+<h3 id="Server.HandleHTTP">func (*Server) <span>HandleHTTP</span> </h3> <pre data-language="go">func (server *Server) HandleHTTP(rpcPath, debugPath string)</pre> <p>HandleHTTP registers an HTTP handler for RPC messages on rpcPath, and a debugging handler on debugPath. It is still necessary to invoke <span>http.Serve</span>(), typically in a go statement. </p>
+<h3 id="Server.Register">func (*Server) <span>Register</span> </h3> <pre data-language="go">func (server *Server) Register(rcvr any) error</pre> <p>Register publishes in the server the set of methods of the receiver value that satisfy the following conditions: </p>
+<ul> <li>exported method of exported type </li>
+<li>two arguments, both of exported type </li>
+<li>the second argument is a pointer </li>
+<li>one return value, of type error </li>
+</ul> <p>It returns an error if the receiver is not an exported type or has no suitable methods. It also logs the error using package log. The client accesses each method using a string of the form "Type.Method", where Type is the receiver's concrete type. </p>
+<h3 id="Server.RegisterName">func (*Server) <span>RegisterName</span> </h3> <pre data-language="go">func (server *Server) RegisterName(name string, rcvr any) error</pre> <p>RegisterName is like <a href="#Register">Register</a> but uses the provided name for the type instead of the receiver's concrete type. </p>
+<h3 id="Server.ServeCodec">func (*Server) <span>ServeCodec</span> </h3> <pre data-language="go">func (server *Server) ServeCodec(codec ServerCodec)</pre> <p>ServeCodec is like <a href="#ServeConn">ServeConn</a> but uses the specified codec to decode requests and encode responses. </p>
+<h3 id="Server.ServeConn">func (*Server) <span>ServeConn</span> </h3> <pre data-language="go">func (server *Server) ServeConn(conn io.ReadWriteCloser)</pre> <p>ServeConn runs the server on a single connection. ServeConn blocks, serving the connection until the client hangs up. The caller typically invokes ServeConn in a go statement. ServeConn uses the gob wire format (see package gob) on the connection. To use an alternate codec, use <a href="#ServeCodec">ServeCodec</a>. See <a href="#NewClient">NewClient</a>'s comment for information about concurrent access. </p>
+<h3 id="Server.ServeHTTP">func (*Server) <span>ServeHTTP</span> </h3> <pre data-language="go">func (server *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)</pre> <p>ServeHTTP implements an <span>http.Handler</span> that answers RPC requests. </p>
+<h3 id="Server.ServeRequest">func (*Server) <span>ServeRequest</span> </h3> <pre data-language="go">func (server *Server) ServeRequest(codec ServerCodec) error</pre> <p>ServeRequest is like <a href="#ServeCodec">ServeCodec</a> but synchronously serves a single request. It does not close the codec upon completion. </p>
+<h2 id="ServerCodec">type <span>ServerCodec</span> </h2> <p>A ServerCodec implements reading of RPC requests and writing of RPC responses for the server side of an RPC session. The server calls [ServerCodec.ReadRequestHeader] and [ServerCodec.ReadRequestBody] in pairs to read requests from the connection, and it calls [ServerCodec.WriteResponse] to write a response back. The server calls [ServerCodec.Close] when finished with the connection. ReadRequestBody may be called with a nil argument to force the body of the request to be read and discarded. See <a href="#NewClient">NewClient</a>'s comment for information about concurrent access. </p>
+<pre data-language="go">type ServerCodec interface {
+ ReadRequestHeader(*Request) error
+ ReadRequestBody(any) error
+ WriteResponse(*Response, any) error
+
+ // Close can be called multiple times and must be idempotent.
+ Close() error
+}</pre> <h2 id="ServerError">type <span>ServerError</span> </h2> <p>ServerError represents an error that has been returned from the remote side of the RPC connection. </p>
+<pre data-language="go">type ServerError string</pre> <h3 id="ServerError.Error">func (ServerError) <span>Error</span> </h3> <pre data-language="go">func (e ServerError) Error() string</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="jsonrpc/index">jsonrpc</a> </td> <td class="pkg-synopsis"> Package jsonrpc implements a JSON-RPC 1.0 ClientCodec and ServerCodec for the rpc package. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/rpc/" class="_attribution-link">http://golang.org/pkg/net/rpc/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Frpc%2Fjsonrpc%2Findex.html b/devdocs/go/net%2Frpc%2Fjsonrpc%2Findex.html
new file mode 100644
index 00000000..8a32f580
--- /dev/null
+++ b/devdocs/go/net%2Frpc%2Fjsonrpc%2Findex.html
@@ -0,0 +1,20 @@
+<h1> Package jsonrpc </h1> <ul id="short-nav">
+<li><code>import "net/rpc/jsonrpc"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package jsonrpc implements a JSON-RPC 1.0 ClientCodec and ServerCodec for the rpc package. For JSON-RPC 2.0 support, see <a href="https://godoc.org/?q=json-rpc+2.0">https://godoc.org/?q=json-rpc+2.0</a> </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Dial">func Dial(network, address string) (*rpc.Client, error)</a></li>
+<li><a href="#NewClient">func NewClient(conn io.ReadWriteCloser) *rpc.Client</a></li>
+<li><a href="#NewClientCodec">func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec</a></li>
+<li><a href="#NewServerCodec">func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec</a></li>
+<li><a href="#ServeConn">func ServeConn(conn io.ReadWriteCloser)</a></li>
+</ul> <h3>Package files</h3> <p> <span>client.go</span> <span>server.go</span> </p> <h2 id="Dial">func <span>Dial</span> </h2> <pre data-language="go">func Dial(network, address string) (*rpc.Client, error)</pre> <p>Dial connects to a JSON-RPC server at the specified network address. </p>
+<h2 id="NewClient">func <span>NewClient</span> </h2> <pre data-language="go">func NewClient(conn io.ReadWriteCloser) *rpc.Client</pre> <p>NewClient returns a new <span>rpc.Client</span> to handle requests to the set of services at the other end of the connection. </p>
+<h2 id="NewClientCodec">func <span>NewClientCodec</span> </h2> <pre data-language="go">func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec</pre> <p>NewClientCodec returns a new <span>rpc.ClientCodec</span> using JSON-RPC on conn. </p>
+<h2 id="NewServerCodec">func <span>NewServerCodec</span> </h2> <pre data-language="go">func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec</pre> <p>NewServerCodec returns a new <span>rpc.ServerCodec</span> using JSON-RPC on conn. </p>
+<h2 id="ServeConn">func <span>ServeConn</span> </h2> <pre data-language="go">func ServeConn(conn io.ReadWriteCloser)</pre> <p>ServeConn runs the JSON-RPC server on a single connection. ServeConn blocks, serving the connection until the client hangs up. The caller typically invokes ServeConn in a go statement. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/rpc/jsonrpc/" class="_attribution-link">http://golang.org/pkg/net/rpc/jsonrpc/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Fsmtp%2Findex.html b/devdocs/go/net%2Fsmtp%2Findex.html
new file mode 100644
index 00000000..83ae06f8
--- /dev/null
+++ b/devdocs/go/net%2Fsmtp%2Findex.html
@@ -0,0 +1,168 @@
+<h1> Package smtp </h1> <ul id="short-nav">
+<li><code>import "net/smtp"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321. It also implements the following extensions: </p>
+<pre data-language="go">8BITMIME RFC 1652
+AUTH RFC 2554
+STARTTLS RFC 3207
+</pre> <p>Additional extensions may be handled by clients. </p>
+<p>The smtp package is frozen and is not accepting new features. Some external packages provide more functionality. See: </p>
+<pre data-language="go">https://godoc.org/?q=smtp
+</pre> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Connect to the remote SMTP server.
+c, err := smtp.Dial("mail.example.com:25")
+if err != nil {
+ log.Fatal(err)
+}
+
+// Set the sender and recipient first
+if err := c.Mail("sender@example.org"); err != nil {
+ log.Fatal(err)
+}
+if err := c.Rcpt("recipient@example.net"); err != nil {
+ log.Fatal(err)
+}
+
+// Send the email body.
+wc, err := c.Data()
+if err != nil {
+ log.Fatal(err)
+}
+_, err = fmt.Fprintf(wc, "This is the email body")
+if err != nil {
+ log.Fatal(err)
+}
+err = wc.Close()
+if err != nil {
+ log.Fatal(err)
+}
+
+// Send the QUIT command and close the connection.
+err = c.Quit()
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#SendMail">func SendMail(addr string, a Auth, from string, to []string, msg []byte) error</a></li>
+<li><a href="#Auth">type Auth</a></li>
+<li> <a href="#CRAMMD5Auth">func CRAMMD5Auth(username, secret string) Auth</a>
+</li>
+<li> <a href="#PlainAuth">func PlainAuth(identity, username, password, host string) Auth</a>
+</li>
+<li><a href="#Client">type Client</a></li>
+<li> <a href="#Dial">func Dial(addr string) (*Client, error)</a>
+</li>
+<li> <a href="#NewClient">func NewClient(conn net.Conn, host string) (*Client, error)</a>
+</li>
+<li> <a href="#Client.Auth">func (c *Client) Auth(a Auth) error</a>
+</li>
+<li> <a href="#Client.Close">func (c *Client) Close() error</a>
+</li>
+<li> <a href="#Client.Data">func (c *Client) Data() (io.WriteCloser, error)</a>
+</li>
+<li> <a href="#Client.Extension">func (c *Client) Extension(ext string) (bool, string)</a>
+</li>
+<li> <a href="#Client.Hello">func (c *Client) Hello(localName string) error</a>
+</li>
+<li> <a href="#Client.Mail">func (c *Client) Mail(from string) error</a>
+</li>
+<li> <a href="#Client.Noop">func (c *Client) Noop() error</a>
+</li>
+<li> <a href="#Client.Quit">func (c *Client) Quit() error</a>
+</li>
+<li> <a href="#Client.Rcpt">func (c *Client) Rcpt(to string) error</a>
+</li>
+<li> <a href="#Client.Reset">func (c *Client) Reset() error</a>
+</li>
+<li> <a href="#Client.StartTLS">func (c *Client) StartTLS(config *tls.Config) error</a>
+</li>
+<li> <a href="#Client.TLSConnectionState">func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool)</a>
+</li>
+<li> <a href="#Client.Verify">func (c *Client) Verify(addr string) error</a>
+</li>
+<li><a href="#ServerInfo">type ServerInfo</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example_PlainAuth">PlainAuth</a></dd> <dd><a class="exampleLink" href="#example_SendMail">SendMail</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>auth.go</span> <span>smtp.go</span> </p> <h2 id="SendMail">func <span>SendMail</span> </h2> <pre data-language="go">func SendMail(addr string, a Auth, from string, to []string, msg []byte) error</pre> <p>SendMail connects to the server at addr, switches to TLS if possible, authenticates with the optional mechanism a if possible, and then sends an email from address from, to addresses to, with message msg. The addr must include a port, as in "mail.example.com:smtp". </p>
+<p>The addresses in the to parameter are the SMTP RCPT addresses. </p>
+<p>The msg parameter should be an RFC 822-style email with headers first, a blank line, and then the message body. The lines of msg should be CRLF terminated. The msg headers should usually include fields such as "From", "To", "Subject", and "Cc". Sending "Bcc" messages is accomplished by including an email address in the to parameter but not including it in the msg headers. </p>
+<p>The SendMail function and the net/smtp package are low-level mechanisms and provide no support for DKIM signing, MIME attachments (see the mime/multipart package), or other mail functionality. Higher-level packages exist outside of the standard library. </p> <h4 id="example_SendMail"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Set up authentication information.
+auth := smtp.PlainAuth("", "user@example.com", "password", "mail.example.com")
+
+// Connect to the server, authenticate, set the sender and recipient,
+// and send the email all in one step.
+to := []string{"recipient@example.net"}
+msg := []byte("To: recipient@example.net\r\n" +
+ "Subject: discount Gophers!\r\n" +
+ "\r\n" +
+ "This is the email body.\r\n")
+err := smtp.SendMail("mail.example.com:25", auth, "sender@example.org", to, msg)
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="Auth">type <span>Auth</span> </h2> <p>Auth is implemented by an SMTP authentication mechanism. </p>
+<pre data-language="go">type Auth interface {
+ // Start begins an authentication with a server.
+ // It returns the name of the authentication protocol
+ // and optionally data to include in the initial AUTH message
+ // sent to the server.
+ // If it returns a non-nil error, the SMTP client aborts
+ // the authentication attempt and closes the connection.
+ Start(server *ServerInfo) (proto string, toServer []byte, err error)
+
+ // Next continues the authentication. The server has just sent
+ // the fromServer data. If more is true, the server expects a
+ // response, which Next should return as toServer; otherwise
+ // Next should return toServer == nil.
+ // If Next returns a non-nil error, the SMTP client aborts
+ // the authentication attempt and closes the connection.
+ Next(fromServer []byte, more bool) (toServer []byte, err error)
+}</pre> <h3 id="CRAMMD5Auth">func <span>CRAMMD5Auth</span> </h3> <pre data-language="go">func CRAMMD5Auth(username, secret string) Auth</pre> <p>CRAMMD5Auth returns an <a href="#Auth">Auth</a> that implements the CRAM-MD5 authentication mechanism as defined in RFC 2195. The returned Auth uses the given username and secret to authenticate to the server using the challenge-response mechanism. </p>
+<h3 id="PlainAuth">func <span>PlainAuth</span> </h3> <pre data-language="go">func PlainAuth(identity, username, password, host string) Auth</pre> <p>PlainAuth returns an <a href="#Auth">Auth</a> that implements the PLAIN authentication mechanism as defined in RFC 4616. The returned Auth uses the given username and password to authenticate to host and act as identity. Usually identity should be the empty string, to act as username. </p>
+<p>PlainAuth will only send the credentials if the connection is using TLS or is connected to localhost. Otherwise authentication will fail with an error, without sending the credentials. </p> <h4 id="example_PlainAuth"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// hostname is used by PlainAuth to validate the TLS certificate.
+hostname := "mail.example.com"
+auth := smtp.PlainAuth("", "user@example.com", "password", hostname)
+
+err := smtp.SendMail(hostname+":25", auth, from, recipients, msg)
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="Client">type <span>Client</span> </h2> <p>A Client represents a client connection to an SMTP server. </p>
+<pre data-language="go">type Client struct {
+ // Text is the textproto.Conn used by the Client. It is exported to allow for
+ // clients to add extensions.
+ Text *textproto.Conn
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Dial">func <span>Dial</span> </h3> <pre data-language="go">func Dial(addr string) (*Client, error)</pre> <p>Dial returns a new <a href="#Client">Client</a> connected to an SMTP server at addr. The addr must include a port, as in "mail.example.com:smtp". </p>
+<h3 id="NewClient">func <span>NewClient</span> </h3> <pre data-language="go">func NewClient(conn net.Conn, host string) (*Client, error)</pre> <p>NewClient returns a new <a href="#Client">Client</a> using an existing connection and host as a server name to be used when authenticating. </p>
+<h3 id="Client.Auth">func (*Client) <span>Auth</span> </h3> <pre data-language="go">func (c *Client) Auth(a Auth) error</pre> <p>Auth authenticates a client using the provided authentication mechanism. A failed authentication closes the connection. Only servers that advertise the AUTH extension support this function. </p>
+<h3 id="Client.Close">func (*Client) <span>Close</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (c *Client) Close() error</pre> <p>Close closes the connection. </p>
+<h3 id="Client.Data">func (*Client) <span>Data</span> </h3> <pre data-language="go">func (c *Client) Data() (io.WriteCloser, error)</pre> <p>Data issues a DATA command to the server and returns a writer that can be used to write the mail headers and body. The caller should close the writer before calling any more methods on c. A call to Data must be preceded by one or more calls to <a href="#Client.Rcpt">Client.Rcpt</a>. </p>
+<h3 id="Client.Extension">func (*Client) <span>Extension</span> </h3> <pre data-language="go">func (c *Client) Extension(ext string) (bool, string)</pre> <p>Extension reports whether an extension is support by the server. The extension name is case-insensitive. If the extension is supported, Extension also returns a string that contains any parameters the server specifies for the extension. </p>
+<h3 id="Client.Hello">func (*Client) <span>Hello</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *Client) Hello(localName string) error</pre> <p>Hello sends a HELO or EHLO to the server as the given host name. Calling this method is only necessary if the client needs control over the host name used. The client will introduce itself as "localhost" automatically otherwise. If Hello is called, it must be called before any of the other methods. </p>
+<h3 id="Client.Mail">func (*Client) <span>Mail</span> </h3> <pre data-language="go">func (c *Client) Mail(from string) error</pre> <p>Mail issues a MAIL command to the server using the provided email address. If the server supports the 8BITMIME extension, Mail adds the BODY=8BITMIME parameter. If the server supports the SMTPUTF8 extension, Mail adds the SMTPUTF8 parameter. This initiates a mail transaction and is followed by one or more <a href="#Client.Rcpt">Client.Rcpt</a> calls. </p>
+<h3 id="Client.Noop">func (*Client) <span>Noop</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (c *Client) Noop() error</pre> <p>Noop sends the NOOP command to the server. It does nothing but check that the connection to the server is okay. </p>
+<h3 id="Client.Quit">func (*Client) <span>Quit</span> </h3> <pre data-language="go">func (c *Client) Quit() error</pre> <p>Quit sends the QUIT command and closes the connection to the server. </p>
+<h3 id="Client.Rcpt">func (*Client) <span>Rcpt</span> </h3> <pre data-language="go">func (c *Client) Rcpt(to string) error</pre> <p>Rcpt issues a RCPT command to the server using the provided email address. A call to Rcpt must be preceded by a call to <a href="#Client.Mail">Client.Mail</a> and may be followed by a <a href="#Client.Data">Client.Data</a> call or another Rcpt call. </p>
+<h3 id="Client.Reset">func (*Client) <span>Reset</span> </h3> <pre data-language="go">func (c *Client) Reset() error</pre> <p>Reset sends the RSET command to the server, aborting the current mail transaction. </p>
+<h3 id="Client.StartTLS">func (*Client) <span>StartTLS</span> </h3> <pre data-language="go">func (c *Client) StartTLS(config *tls.Config) error</pre> <p>StartTLS sends the STARTTLS command and encrypts all further communication. Only servers that advertise the STARTTLS extension support this function. </p>
+<h3 id="Client.TLSConnectionState">func (*Client) <span>TLSConnectionState</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool)</pre> <p>TLSConnectionState returns the client's TLS connection state. The return values are their zero values if <a href="#Client.StartTLS">Client.StartTLS</a> did not succeed. </p>
+<h3 id="Client.Verify">func (*Client) <span>Verify</span> </h3> <pre data-language="go">func (c *Client) Verify(addr string) error</pre> <p>Verify checks the validity of an email address on the server. If Verify returns nil, the address is valid. A non-nil return does not necessarily indicate an invalid address. Many servers will not verify addresses for security reasons. </p>
+<h2 id="ServerInfo">type <span>ServerInfo</span> </h2> <p>ServerInfo records information about an SMTP server. </p>
+<pre data-language="go">type ServerInfo struct {
+ Name string // SMTP server name
+ TLS bool // using TLS, with valid certificate for Name
+ Auth []string // advertised authentication mechanisms
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/smtp/" class="_attribution-link">http://golang.org/pkg/net/smtp/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Ftextproto%2Findex.html b/devdocs/go/net%2Ftextproto%2Findex.html
new file mode 100644
index 00000000..5e4c4cab
--- /dev/null
+++ b/devdocs/go/net%2Ftextproto%2Findex.html
@@ -0,0 +1,213 @@
+<h1> Package textproto </h1> <ul id="short-nav">
+<li><code>import "net/textproto"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package textproto implements generic support for text-based request/response protocols in the style of HTTP, NNTP, and SMTP. </p>
+<p>The package provides: </p>
+<p><a href="#Error">Error</a>, which represents a numeric error response from a server. </p>
+<p><a href="#Pipeline">Pipeline</a>, to manage pipelined requests and responses in a client. </p>
+<p><a href="#Reader">Reader</a>, to read numeric response code lines, key: value headers, lines wrapped with leading spaces on continuation lines, and whole text blocks ending with a dot on a line by itself. </p>
+<p><a href="#Writer">Writer</a>, to write dot-encoded text blocks. </p>
+<p><a href="#Conn">Conn</a>, a convenient packaging of <a href="#Reader">Reader</a>, <a href="#Writer">Writer</a>, and <a href="#Pipeline">Pipeline</a> for use with a single network connection. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#CanonicalMIMEHeaderKey">func CanonicalMIMEHeaderKey(s string) string</a></li>
+<li><a href="#TrimBytes">func TrimBytes(b []byte) []byte</a></li>
+<li><a href="#TrimString">func TrimString(s string) string</a></li>
+<li><a href="#Conn">type Conn</a></li>
+<li> <a href="#Dial">func Dial(network, addr string) (*Conn, error)</a>
+</li>
+<li> <a href="#NewConn">func NewConn(conn io.ReadWriteCloser) *Conn</a>
+</li>
+<li> <a href="#Conn.Close">func (c *Conn) Close() error</a>
+</li>
+<li> <a href="#Conn.Cmd">func (c *Conn) Cmd(format string, args ...any) (id uint, err error)</a>
+</li>
+<li><a href="#Error">type Error</a></li>
+<li> <a href="#Error.Error">func (e *Error) Error() string</a>
+</li>
+<li><a href="#MIMEHeader">type MIMEHeader</a></li>
+<li> <a href="#MIMEHeader.Add">func (h MIMEHeader) Add(key, value string)</a>
+</li>
+<li> <a href="#MIMEHeader.Del">func (h MIMEHeader) Del(key string)</a>
+</li>
+<li> <a href="#MIMEHeader.Get">func (h MIMEHeader) Get(key string) string</a>
+</li>
+<li> <a href="#MIMEHeader.Set">func (h MIMEHeader) Set(key, value string)</a>
+</li>
+<li> <a href="#MIMEHeader.Values">func (h MIMEHeader) Values(key string) []string</a>
+</li>
+<li><a href="#Pipeline">type Pipeline</a></li>
+<li> <a href="#Pipeline.EndRequest">func (p *Pipeline) EndRequest(id uint)</a>
+</li>
+<li> <a href="#Pipeline.EndResponse">func (p *Pipeline) EndResponse(id uint)</a>
+</li>
+<li> <a href="#Pipeline.Next">func (p *Pipeline) Next() uint</a>
+</li>
+<li> <a href="#Pipeline.StartRequest">func (p *Pipeline) StartRequest(id uint)</a>
+</li>
+<li> <a href="#Pipeline.StartResponse">func (p *Pipeline) StartResponse(id uint)</a>
+</li>
+<li><a href="#ProtocolError">type ProtocolError</a></li>
+<li> <a href="#ProtocolError.Error">func (p ProtocolError) Error() string</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(r *bufio.Reader) *Reader</a>
+</li>
+<li> <a href="#Reader.DotReader">func (r *Reader) DotReader() io.Reader</a>
+</li>
+<li> <a href="#Reader.ReadCodeLine">func (r *Reader) ReadCodeLine(expectCode int) (code int, message string, err error)</a>
+</li>
+<li> <a href="#Reader.ReadContinuedLine">func (r *Reader) ReadContinuedLine() (string, error)</a>
+</li>
+<li> <a href="#Reader.ReadContinuedLineBytes">func (r *Reader) ReadContinuedLineBytes() ([]byte, error)</a>
+</li>
+<li> <a href="#Reader.ReadDotBytes">func (r *Reader) ReadDotBytes() ([]byte, error)</a>
+</li>
+<li> <a href="#Reader.ReadDotLines">func (r *Reader) ReadDotLines() ([]string, error)</a>
+</li>
+<li> <a href="#Reader.ReadLine">func (r *Reader) ReadLine() (string, error)</a>
+</li>
+<li> <a href="#Reader.ReadLineBytes">func (r *Reader) ReadLineBytes() ([]byte, error)</a>
+</li>
+<li> <a href="#Reader.ReadMIMEHeader">func (r *Reader) ReadMIMEHeader() (MIMEHeader, error)</a>
+</li>
+<li> <a href="#Reader.ReadResponse">func (r *Reader) ReadResponse(expectCode int) (code int, message string, err error)</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(w *bufio.Writer) *Writer</a>
+</li>
+<li> <a href="#Writer.DotWriter">func (w *Writer) DotWriter() io.WriteCloser</a>
+</li>
+<li> <a href="#Writer.PrintfLine">func (w *Writer) PrintfLine(format string, args ...any) error</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>header.go</span> <span>pipeline.go</span> <span>reader.go</span> <span>textproto.go</span> <span>writer.go</span> </p> <h2 id="CanonicalMIMEHeaderKey">func <span>CanonicalMIMEHeaderKey</span> </h2> <pre data-language="go">func CanonicalMIMEHeaderKey(s string) string</pre> <p>CanonicalMIMEHeaderKey returns the canonical format of the MIME header key s. The canonicalization converts the first letter and any letter following a hyphen to upper case; the rest are converted to lowercase. For example, the canonical key for "accept-encoding" is "Accept-Encoding". MIME header keys are assumed to be ASCII only. If s contains a space or invalid header field bytes, it is returned without modifications. </p>
+<h2 id="TrimBytes">func <span>TrimBytes</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func TrimBytes(b []byte) []byte</pre> <p>TrimBytes returns b without leading and trailing ASCII space. </p>
+<h2 id="TrimString">func <span>TrimString</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func TrimString(s string) string</pre> <p>TrimString returns s without leading and trailing ASCII space. </p>
+<h2 id="Conn">type <span>Conn</span> </h2> <p>A Conn represents a textual network protocol connection. It consists of a <a href="#Reader">Reader</a> and <a href="#Writer">Writer</a> to manage I/O and a <a href="#Pipeline">Pipeline</a> to sequence concurrent requests on the connection. These embedded types carry methods with them; see the documentation of those types for details. </p>
+<pre data-language="go">type Conn struct {
+ Reader
+ Writer
+ Pipeline
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Dial">func <span>Dial</span> </h3> <pre data-language="go">func Dial(network, addr string) (*Conn, error)</pre> <p>Dial connects to the given address on the given network using <span>net.Dial</span> and then returns a new <a href="#Conn">Conn</a> for the connection. </p>
+<h3 id="NewConn">func <span>NewConn</span> </h3> <pre data-language="go">func NewConn(conn io.ReadWriteCloser) *Conn</pre> <p>NewConn returns a new <a href="#Conn">Conn</a> using conn for I/O. </p>
+<h3 id="Conn.Close">func (*Conn) <span>Close</span> </h3> <pre data-language="go">func (c *Conn) Close() error</pre> <p>Close closes the connection. </p>
+<h3 id="Conn.Cmd">func (*Conn) <span>Cmd</span> </h3> <pre data-language="go">func (c *Conn) Cmd(format string, args ...any) (id uint, err error)</pre> <p>Cmd is a convenience method that sends a command after waiting its turn in the pipeline. The command text is the result of formatting format with args and appending \r\n. Cmd returns the id of the command, for use with StartResponse and EndResponse. </p>
+<p>For example, a client might run a HELP command that returns a dot-body by using: </p>
+<pre data-language="go">id, err := c.Cmd("HELP")
+if err != nil {
+ return nil, err
+}
+
+c.StartResponse(id)
+defer c.EndResponse(id)
+
+if _, _, err = c.ReadCodeLine(110); err != nil {
+ return nil, err
+}
+text, err := c.ReadDotBytes()
+if err != nil {
+ return nil, err
+}
+return c.ReadCodeLine(250)
+</pre> <h2 id="Error">type <span>Error</span> </h2> <p>An Error represents a numeric error response from a server. </p>
+<pre data-language="go">type Error struct {
+ Code int
+ Msg string
+}
+</pre> <h3 id="Error.Error">func (*Error) <span>Error</span> </h3> <pre data-language="go">func (e *Error) Error() string</pre> <h2 id="MIMEHeader">type <span>MIMEHeader</span> </h2> <p>A MIMEHeader represents a MIME-style header mapping keys to sets of values. </p>
+<pre data-language="go">type MIMEHeader map[string][]string</pre> <h3 id="MIMEHeader.Add">func (MIMEHeader) <span>Add</span> </h3> <pre data-language="go">func (h MIMEHeader) Add(key, value string)</pre> <p>Add adds the key, value pair to the header. It appends to any existing values associated with key. </p>
+<h3 id="MIMEHeader.Del">func (MIMEHeader) <span>Del</span> </h3> <pre data-language="go">func (h MIMEHeader) Del(key string)</pre> <p>Del deletes the values associated with key. </p>
+<h3 id="MIMEHeader.Get">func (MIMEHeader) <span>Get</span> </h3> <pre data-language="go">func (h MIMEHeader) Get(key string) string</pre> <p>Get gets the first value associated with the given key. It is case insensitive; <a href="#CanonicalMIMEHeaderKey">CanonicalMIMEHeaderKey</a> is used to canonicalize the provided key. If there are no values associated with the key, Get returns "". To use non-canonical keys, access the map directly. </p>
+<h3 id="MIMEHeader.Set">func (MIMEHeader) <span>Set</span> </h3> <pre data-language="go">func (h MIMEHeader) Set(key, value string)</pre> <p>Set sets the header entries associated with key to the single element value. It replaces any existing values associated with key. </p>
+<h3 id="MIMEHeader.Values">func (MIMEHeader) <span>Values</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (h MIMEHeader) Values(key string) []string</pre> <p>Values returns all values associated with the given key. It is case insensitive; <a href="#CanonicalMIMEHeaderKey">CanonicalMIMEHeaderKey</a> is used to canonicalize the provided key. To use non-canonical keys, access the map directly. The returned slice is not a copy. </p>
+<h2 id="Pipeline">type <span>Pipeline</span> </h2> <p>A Pipeline manages a pipelined in-order request/response sequence. </p>
+<p>To use a Pipeline p to manage multiple clients on a connection, each client should run: </p>
+<pre data-language="go">id := p.Next() // take a number
+
+p.StartRequest(id) // wait for turn to send request
+«send request»
+p.EndRequest(id) // notify Pipeline that request is sent
+
+p.StartResponse(id) // wait for turn to read response
+«read response»
+p.EndResponse(id) // notify Pipeline that response is read
+</pre> <p>A pipelined server can use the same calls to ensure that responses computed in parallel are written in the correct order. </p>
+<pre data-language="go">type Pipeline struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Pipeline.EndRequest">func (*Pipeline) <span>EndRequest</span> </h3> <pre data-language="go">func (p *Pipeline) EndRequest(id uint)</pre> <p>EndRequest notifies p that the request with the given id has been sent (or, if this is a server, received). </p>
+<h3 id="Pipeline.EndResponse">func (*Pipeline) <span>EndResponse</span> </h3> <pre data-language="go">func (p *Pipeline) EndResponse(id uint)</pre> <p>EndResponse notifies p that the response with the given id has been received (or, if this is a server, sent). </p>
+<h3 id="Pipeline.Next">func (*Pipeline) <span>Next</span> </h3> <pre data-language="go">func (p *Pipeline) Next() uint</pre> <p>Next returns the next id for a request/response pair. </p>
+<h3 id="Pipeline.StartRequest">func (*Pipeline) <span>StartRequest</span> </h3> <pre data-language="go">func (p *Pipeline) StartRequest(id uint)</pre> <p>StartRequest blocks until it is time to send (or, if this is a server, receive) the request with the given id. </p>
+<h3 id="Pipeline.StartResponse">func (*Pipeline) <span>StartResponse</span> </h3> <pre data-language="go">func (p *Pipeline) StartResponse(id uint)</pre> <p>StartResponse blocks until it is time to receive (or, if this is a server, send) the request with the given id. </p>
+<h2 id="ProtocolError">type <span>ProtocolError</span> </h2> <p>A ProtocolError describes a protocol violation such as an invalid response or a hung-up connection. </p>
+<pre data-language="go">type ProtocolError string</pre> <h3 id="ProtocolError.Error">func (ProtocolError) <span>Error</span> </h3> <pre data-language="go">func (p ProtocolError) Error() string</pre> <h2 id="Reader">type <span>Reader</span> </h2> <p>A Reader implements convenience methods for reading requests or responses from a text protocol network connection. </p>
+<pre data-language="go">type Reader struct {
+ R *bufio.Reader
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewReader">func <span>NewReader</span> </h3> <pre data-language="go">func NewReader(r *bufio.Reader) *Reader</pre> <p>NewReader returns a new <a href="#Reader">Reader</a> reading from r. </p>
+<p>To avoid denial of service attacks, the provided <span>bufio.Reader</span> should be reading from an <span>io.LimitReader</span> or similar Reader to bound the size of responses. </p>
+<h3 id="Reader.DotReader">func (*Reader) <span>DotReader</span> </h3> <pre data-language="go">func (r *Reader) DotReader() io.Reader</pre> <p>DotReader returns a new <a href="#Reader">Reader</a> that satisfies Reads using the decoded text of a dot-encoded block read from r. The returned Reader is only valid until the next call to a method on r. </p>
+<p>Dot encoding is a common framing used for data blocks in text protocols such as SMTP. The data consists of a sequence of lines, each of which ends in "\r\n". The sequence itself ends at a line containing just a dot: ".\r\n". Lines beginning with a dot are escaped with an additional dot to avoid looking like the end of the sequence. </p>
+<p>The decoded form returned by the Reader's Read method rewrites the "\r\n" line endings into the simpler "\n", removes leading dot escapes if present, and stops with error <span>io.EOF</span> after consuming (and discarding) the end-of-sequence line. </p>
+<h3 id="Reader.ReadCodeLine">func (*Reader) <span>ReadCodeLine</span> </h3> <pre data-language="go">func (r *Reader) ReadCodeLine(expectCode int) (code int, message string, err error)</pre> <p>ReadCodeLine reads a response code line of the form </p>
+<pre data-language="go">code message
+</pre> <p>where code is a three-digit status code and the message extends to the rest of the line. An example of such a line is: </p>
+<pre data-language="go">220 plan9.bell-labs.com ESMTP
+</pre> <p>If the prefix of the status does not match the digits in expectCode, ReadCodeLine returns with err set to &amp;Error{code, message}. For example, if expectCode is 31, an error will be returned if the status is not in the range [310,319]. </p>
+<p>If the response is multi-line, ReadCodeLine returns an error. </p>
+<p>An expectCode &lt;= 0 disables the check of the status code. </p>
+<h3 id="Reader.ReadContinuedLine">func (*Reader) <span>ReadContinuedLine</span> </h3> <pre data-language="go">func (r *Reader) ReadContinuedLine() (string, error)</pre> <p>ReadContinuedLine reads a possibly continued line from r, eliding the final trailing ASCII white space. Lines after the first are considered continuations if they begin with a space or tab character. In the returned data, continuation lines are separated from the previous line only by a single space: the newline and leading white space are removed. </p>
+<p>For example, consider this input: </p>
+<pre data-language="go">Line 1
+ continued...
+Line 2
+</pre> <p>The first call to ReadContinuedLine will return "Line 1 continued..." and the second will return "Line 2". </p>
+<p>Empty lines are never continued. </p>
+<h3 id="Reader.ReadContinuedLineBytes">func (*Reader) <span>ReadContinuedLineBytes</span> </h3> <pre data-language="go">func (r *Reader) ReadContinuedLineBytes() ([]byte, error)</pre> <p>ReadContinuedLineBytes is like <a href="#Reader.ReadContinuedLine">Reader.ReadContinuedLine</a> but returns a []byte instead of a string. </p>
+<h3 id="Reader.ReadDotBytes">func (*Reader) <span>ReadDotBytes</span> </h3> <pre data-language="go">func (r *Reader) ReadDotBytes() ([]byte, error)</pre> <p>ReadDotBytes reads a dot-encoding and returns the decoded data. </p>
+<p>See the documentation for the <a href="#Reader.DotReader">Reader.DotReader</a> method for details about dot-encoding. </p>
+<h3 id="Reader.ReadDotLines">func (*Reader) <span>ReadDotLines</span> </h3> <pre data-language="go">func (r *Reader) ReadDotLines() ([]string, error)</pre> <p>ReadDotLines reads a dot-encoding and returns a slice containing the decoded lines, with the final \r\n or \n elided from each. </p>
+<p>See the documentation for the <a href="#Reader.DotReader">Reader.DotReader</a> method for details about dot-encoding. </p>
+<h3 id="Reader.ReadLine">func (*Reader) <span>ReadLine</span> </h3> <pre data-language="go">func (r *Reader) ReadLine() (string, error)</pre> <p>ReadLine reads a single line from r, eliding the final \n or \r\n from the returned string. </p>
+<h3 id="Reader.ReadLineBytes">func (*Reader) <span>ReadLineBytes</span> </h3> <pre data-language="go">func (r *Reader) ReadLineBytes() ([]byte, error)</pre> <p>ReadLineBytes is like <a href="#Reader.ReadLine">Reader.ReadLine</a> but returns a []byte instead of a string. </p>
+<h3 id="Reader.ReadMIMEHeader">func (*Reader) <span>ReadMIMEHeader</span> </h3> <pre data-language="go">func (r *Reader) ReadMIMEHeader() (MIMEHeader, error)</pre> <p>ReadMIMEHeader reads a MIME-style header from r. The header is a sequence of possibly continued Key: Value lines ending in a blank line. The returned map m maps <a href="#CanonicalMIMEHeaderKey">CanonicalMIMEHeaderKey</a>(key) to a sequence of values in the same order encountered in the input. </p>
+<p>For example, consider this input: </p>
+<pre data-language="go">My-Key: Value 1
+Long-Key: Even
+ Longer Value
+My-Key: Value 2
+</pre> <p>Given that input, ReadMIMEHeader returns the map: </p>
+<pre data-language="go">map[string][]string{
+ "My-Key": {"Value 1", "Value 2"},
+ "Long-Key": {"Even Longer Value"},
+}
+</pre> <h3 id="Reader.ReadResponse">func (*Reader) <span>ReadResponse</span> </h3> <pre data-language="go">func (r *Reader) ReadResponse(expectCode int) (code int, message string, err error)</pre> <p>ReadResponse reads a multi-line response of the form: </p>
+<pre data-language="go">code-message line 1
+code-message line 2
+...
+code message line n
+</pre> <p>where code is a three-digit status code. The first line starts with the code and a hyphen. The response is terminated by a line that starts with the same code followed by a space. Each line in message is separated by a newline (\n). </p>
+<p>See page 36 of RFC 959 (<a href="https://www.ietf.org/rfc/rfc959.txt">https://www.ietf.org/rfc/rfc959.txt</a>) for details of another form of response accepted: </p>
+<pre data-language="go">code-message line 1
+message line 2
+...
+code message line n
+</pre> <p>If the prefix of the status does not match the digits in expectCode, ReadResponse returns with err set to &amp;Error{code, message}. For example, if expectCode is 31, an error will be returned if the status is not in the range [310,319]. </p>
+<p>An expectCode &lt;= 0 disables the check of the status code. </p>
+<h2 id="Writer">type <span>Writer</span> </h2> <p>A Writer implements convenience methods for writing requests or responses to a text protocol network connection. </p>
+<pre data-language="go">type Writer struct {
+ W *bufio.Writer
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(w *bufio.Writer) *Writer</pre> <p>NewWriter returns a new <a href="#Writer">Writer</a> writing to w. </p>
+<h3 id="Writer.DotWriter">func (*Writer) <span>DotWriter</span> </h3> <pre data-language="go">func (w *Writer) DotWriter() io.WriteCloser</pre> <p>DotWriter returns a writer that can be used to write a dot-encoding to w. It takes care of inserting leading dots when necessary, translating line-ending \n into \r\n, and adding the final .\r\n line when the DotWriter is closed. The caller should close the DotWriter before the next call to a method on w. </p>
+<p>See the documentation for the <a href="#Reader.DotReader">Reader.DotReader</a> method for details about dot-encoding. </p>
+<h3 id="Writer.PrintfLine">func (*Writer) <span>PrintfLine</span> </h3> <pre data-language="go">func (w *Writer) PrintfLine(format string, args ...any) error</pre> <p>PrintfLine writes the formatted output followed by \r\n. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/textproto/" class="_attribution-link">http://golang.org/pkg/net/textproto/</a>
+ </p>
+</div>
diff --git a/devdocs/go/net%2Furl%2Findex.html b/devdocs/go/net%2Furl%2Findex.html
new file mode 100644
index 00000000..2c773676
--- /dev/null
+++ b/devdocs/go/net%2Furl%2Findex.html
@@ -0,0 +1,425 @@
+<h1> Package url </h1> <ul id="short-nav">
+<li><code>import "net/url"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package url parses URLs and implements query escaping. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#JoinPath">func JoinPath(base string, elem ...string) (result string, err error)</a></li>
+<li><a href="#PathEscape">func PathEscape(s string) string</a></li>
+<li><a href="#PathUnescape">func PathUnescape(s string) (string, error)</a></li>
+<li><a href="#QueryEscape">func QueryEscape(s string) string</a></li>
+<li><a href="#QueryUnescape">func QueryUnescape(s string) (string, error)</a></li>
+<li><a href="#Error">type Error</a></li>
+<li> <a href="#Error.Error">func (e *Error) Error() string</a>
+</li>
+<li> <a href="#Error.Temporary">func (e *Error) Temporary() bool</a>
+</li>
+<li> <a href="#Error.Timeout">func (e *Error) Timeout() bool</a>
+</li>
+<li> <a href="#Error.Unwrap">func (e *Error) Unwrap() error</a>
+</li>
+<li><a href="#EscapeError">type EscapeError</a></li>
+<li> <a href="#EscapeError.Error">func (e EscapeError) Error() string</a>
+</li>
+<li><a href="#InvalidHostError">type InvalidHostError</a></li>
+<li> <a href="#InvalidHostError.Error">func (e InvalidHostError) Error() string</a>
+</li>
+<li><a href="#URL">type URL</a></li>
+<li> <a href="#Parse">func Parse(rawURL string) (*URL, error)</a>
+</li>
+<li> <a href="#ParseRequestURI">func ParseRequestURI(rawURL string) (*URL, error)</a>
+</li>
+<li> <a href="#URL.EscapedFragment">func (u *URL) EscapedFragment() string</a>
+</li>
+<li> <a href="#URL.EscapedPath">func (u *URL) EscapedPath() string</a>
+</li>
+<li> <a href="#URL.Hostname">func (u *URL) Hostname() string</a>
+</li>
+<li> <a href="#URL.IsAbs">func (u *URL) IsAbs() bool</a>
+</li>
+<li> <a href="#URL.JoinPath">func (u *URL) JoinPath(elem ...string) *URL</a>
+</li>
+<li> <a href="#URL.MarshalBinary">func (u *URL) MarshalBinary() (text []byte, err error)</a>
+</li>
+<li> <a href="#URL.Parse">func (u *URL) Parse(ref string) (*URL, error)</a>
+</li>
+<li> <a href="#URL.Port">func (u *URL) Port() string</a>
+</li>
+<li> <a href="#URL.Query">func (u *URL) Query() Values</a>
+</li>
+<li> <a href="#URL.Redacted">func (u *URL) Redacted() string</a>
+</li>
+<li> <a href="#URL.RequestURI">func (u *URL) RequestURI() string</a>
+</li>
+<li> <a href="#URL.ResolveReference">func (u *URL) ResolveReference(ref *URL) *URL</a>
+</li>
+<li> <a href="#URL.String">func (u *URL) String() string</a>
+</li>
+<li> <a href="#URL.UnmarshalBinary">func (u *URL) UnmarshalBinary(text []byte) error</a>
+</li>
+<li><a href="#Userinfo">type Userinfo</a></li>
+<li> <a href="#User">func User(username string) *Userinfo</a>
+</li>
+<li> <a href="#UserPassword">func UserPassword(username, password string) *Userinfo</a>
+</li>
+<li> <a href="#Userinfo.Password">func (u *Userinfo) Password() (string, bool)</a>
+</li>
+<li> <a href="#Userinfo.String">func (u *Userinfo) String() string</a>
+</li>
+<li> <a href="#Userinfo.Username">func (u *Userinfo) Username() string</a>
+</li>
+<li><a href="#Values">type Values</a></li>
+<li> <a href="#ParseQuery">func ParseQuery(query string) (Values, error)</a>
+</li>
+<li> <a href="#Values.Add">func (v Values) Add(key, value string)</a>
+</li>
+<li> <a href="#Values.Del">func (v Values) Del(key string)</a>
+</li>
+<li> <a href="#Values.Encode">func (v Values) Encode() string</a>
+</li>
+<li> <a href="#Values.Get">func (v Values) Get(key string) string</a>
+</li>
+<li> <a href="#Values.Has">func (v Values) Has(key string) bool</a>
+</li>
+<li> <a href="#Values.Set">func (v Values) Set(key, value string)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_ParseQuery">ParseQuery</a></dd> <dd><a class="exampleLink" href="#example_PathEscape">PathEscape</a></dd> <dd><a class="exampleLink" href="#example_PathUnescape">PathUnescape</a></dd> <dd><a class="exampleLink" href="#example_QueryEscape">QueryEscape</a></dd> <dd><a class="exampleLink" href="#example_QueryUnescape">QueryUnescape</a></dd> <dd><a class="exampleLink" href="#example_URL">URL</a></dd> <dd><a class="exampleLink" href="#example_URL_EscapedFragment">URL.EscapedFragment</a></dd> <dd><a class="exampleLink" href="#example_URL_EscapedPath">URL.EscapedPath</a></dd> <dd><a class="exampleLink" href="#example_URL_Hostname">URL.Hostname</a></dd> <dd><a class="exampleLink" href="#example_URL_IsAbs">URL.IsAbs</a></dd> <dd><a class="exampleLink" href="#example_URL_MarshalBinary">URL.MarshalBinary</a></dd> <dd><a class="exampleLink" href="#example_URL_Parse">URL.Parse</a></dd> <dd><a class="exampleLink" href="#example_URL_Port">URL.Port</a></dd> <dd><a class="exampleLink" href="#example_URL_Query">URL.Query</a></dd> <dd><a class="exampleLink" href="#example_URL_Redacted">URL.Redacted</a></dd> <dd><a class="exampleLink" href="#example_URL_RequestURI">URL.RequestURI</a></dd> <dd><a class="exampleLink" href="#example_URL_ResolveReference">URL.ResolveReference</a></dd> <dd><a class="exampleLink" href="#example_URL_String">URL.String</a></dd> <dd><a class="exampleLink" href="#example_URL_UnmarshalBinary">URL.UnmarshalBinary</a></dd> <dd><a class="exampleLink" href="#example_URL_roundtrip">URL (Roundtrip)</a></dd> <dd><a class="exampleLink" href="#example_Values">Values</a></dd> <dd><a class="exampleLink" href="#example_Values_Add">Values.Add</a></dd> <dd><a class="exampleLink" href="#example_Values_Del">Values.Del</a></dd> <dd><a class="exampleLink" href="#example_Values_Encode">Values.Encode</a></dd> <dd><a class="exampleLink" href="#example_Values_Get">Values.Get</a></dd> <dd><a class="exampleLink" href="#example_Values_Has">Values.Has</a></dd> <dd><a class="exampleLink" href="#example_Values_Set">Values.Set</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>url.go</span> </p> <h2 id="JoinPath">func <span>JoinPath</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func JoinPath(base string, elem ...string) (result string, err error)</pre> <p>JoinPath returns a <a href="#URL">URL</a> string with the provided path elements joined to the existing path of base and the resulting path cleaned of any ./ or ../ elements. </p>
+<h2 id="PathEscape">func <span>PathEscape</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func PathEscape(s string) string</pre> <p>PathEscape escapes the string so it can be safely placed inside a <a href="#URL">URL</a> path segment, replacing special characters (including /) with %XX sequences as needed. </p> <h4 id="example_PathEscape"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">path := url.PathEscape("my/cool+blog&amp;about,stuff")
+fmt.Println(path)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">my%2Fcool+blog&amp;about%2Cstuff
+</pre> <h2 id="PathUnescape">func <span>PathUnescape</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func PathUnescape(s string) (string, error)</pre> <p>PathUnescape does the inverse transformation of <a href="#PathEscape">PathEscape</a>, converting each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB. It returns an error if any % is not followed by two hexadecimal digits. </p>
+<p>PathUnescape is identical to <a href="#QueryUnescape">QueryUnescape</a> except that it does not unescape '+' to ' ' (space). </p> <h4 id="example_PathUnescape"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">escapedPath := "my%2Fcool+blog&amp;about%2Cstuff"
+path, err := url.PathUnescape(escapedPath)
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(path)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">my/cool+blog&amp;about,stuff
+</pre> <h2 id="QueryEscape">func <span>QueryEscape</span> </h2> <pre data-language="go">func QueryEscape(s string) string</pre> <p>QueryEscape escapes the string so it can be safely placed inside a <a href="#URL">URL</a> query. </p> <h4 id="example_QueryEscape"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">query := url.QueryEscape("my/cool+blog&amp;about,stuff")
+fmt.Println(query)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">my%2Fcool%2Bblog%26about%2Cstuff
+</pre> <h2 id="QueryUnescape">func <span>QueryUnescape</span> </h2> <pre data-language="go">func QueryUnescape(s string) (string, error)</pre> <p>QueryUnescape does the inverse transformation of <a href="#QueryEscape">QueryEscape</a>, converting each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB. It returns an error if any % is not followed by two hexadecimal digits. </p> <h4 id="example_QueryUnescape"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">escapedQuery := "my%2Fcool%2Bblog%26about%2Cstuff"
+query, err := url.QueryUnescape(escapedQuery)
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(query)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">my/cool+blog&amp;about,stuff
+</pre> <h2 id="Error">type <span>Error</span> </h2> <p>Error reports an error and the operation and URL that caused it. </p>
+<pre data-language="go">type Error struct {
+ Op string
+ URL string
+ Err error
+}
+</pre> <h3 id="Error.Error">func (*Error) <span>Error</span> </h3> <pre data-language="go">func (e *Error) Error() string</pre> <h3 id="Error.Temporary">func (*Error) <span>Temporary</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (e *Error) Temporary() bool</pre> <h3 id="Error.Timeout">func (*Error) <span>Timeout</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (e *Error) Timeout() bool</pre> <h3 id="Error.Unwrap">func (*Error) <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e *Error) Unwrap() error</pre> <h2 id="EscapeError">type <span>EscapeError</span> </h2> <pre data-language="go">type EscapeError string</pre> <h3 id="EscapeError.Error">func (EscapeError) <span>Error</span> </h3> <pre data-language="go">func (e EscapeError) Error() string</pre> <h2 id="InvalidHostError">type <span>InvalidHostError</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">type InvalidHostError string</pre> <h3 id="InvalidHostError.Error">func (InvalidHostError) <span>Error</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (e InvalidHostError) Error() string</pre> <h2 id="URL">type <span>URL</span> </h2> <p>A URL represents a parsed URL (technically, a URI reference). </p>
+<p>The general form represented is: </p>
+<pre data-language="go">[scheme:][//[userinfo@]host][/]path[?query][#fragment]
+</pre> <p>URLs that do not start with a slash after the scheme are interpreted as: </p>
+<pre data-language="go">scheme:opaque[?query][#fragment]
+</pre> <p>The Host field contains the host and port subcomponents of the URL. When the port is present, it is separated from the host with a colon. When the host is an IPv6 address, it must be enclosed in square brackets: "[fe80::1]:80". The <span>net.JoinHostPort</span> function combines a host and port into a string suitable for the Host field, adding square brackets to the host when necessary. </p>
+<p>Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. A consequence is that it is impossible to tell which slashes in the Path were slashes in the raw URL and which were %2f. This distinction is rarely important, but when it is, the code should use the <a href="#URL.EscapedPath">URL.EscapedPath</a> method, which preserves the original encoding of Path. </p>
+<p>The RawPath field is an optional field which is only set when the default encoding of Path is different from the escaped path. See the EscapedPath method for more details. </p>
+<p>URL's String method uses the EscapedPath method to obtain the path. </p>
+<pre data-language="go">type URL struct {
+ Scheme string
+ Opaque string // encoded opaque data
+ User *Userinfo // username and password information
+ Host string // host or host:port (see Hostname and Port methods)
+ Path string // path (relative paths may omit leading slash)
+ RawPath string // encoded path hint (see EscapedPath method); added in Go 1.5
+ OmitHost bool // do not emit empty host (authority); added in Go 1.19
+ ForceQuery bool // append a query ('?') even if RawQuery is empty; added in Go 1.7
+ RawQuery string // encoded query values, without '?'
+ Fragment string // fragment for references, without '#'
+ RawFragment string // encoded fragment hint (see EscapedFragment method); added in Go 1.15
+}
+</pre> <h4 id="example_URL"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, err := url.Parse("http://bing.com/search?q=dotnet")
+if err != nil {
+ log.Fatal(err)
+}
+u.Scheme = "https"
+u.Host = "google.com"
+q := u.Query()
+q.Set("q", "golang")
+u.RawQuery = q.Encode()
+fmt.Println(u)
+</pre> <p>Output:</p> <pre class="output" data-language="go">https://google.com/search?q=golang
+</pre> <h4 id="example_URL_roundtrip"> <span class="text">Example (Roundtrip)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Parse + String preserve the original encoding.
+u, err := url.Parse("https://example.com/foo%2fbar")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(u.Path)
+fmt.Println(u.RawPath)
+fmt.Println(u.String())
+</pre> <p>Output:</p> <pre class="output" data-language="go">/foo/bar
+/foo%2fbar
+https://example.com/foo%2fbar
+</pre> <h3 id="Parse">func <span>Parse</span> </h3> <pre data-language="go">func Parse(rawURL string) (*URL, error)</pre> <p>Parse parses a raw url into a <a href="#URL">URL</a> structure. </p>
+<p>The url may be relative (a path, without a host) or absolute (starting with a scheme). Trying to parse a hostname and path without a scheme is invalid but may not necessarily return an error, due to parsing ambiguities. </p>
+<h3 id="ParseRequestURI">func <span>ParseRequestURI</span> </h3> <pre data-language="go">func ParseRequestURI(rawURL string) (*URL, error)</pre> <p>ParseRequestURI parses a raw url into a <a href="#URL">URL</a> structure. It assumes that url was received in an HTTP request, so the url is interpreted only as an absolute URI or an absolute path. The string url is assumed not to have a #fragment suffix. (Web browsers strip #fragment before sending the URL to a web server.) </p>
+<h3 id="URL.EscapedFragment">func (*URL) <span>EscapedFragment</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (u *URL) EscapedFragment() string</pre> <p>EscapedFragment returns the escaped form of u.Fragment. In general there are multiple possible escaped forms of any fragment. EscapedFragment returns u.RawFragment when it is a valid escaping of u.Fragment. Otherwise EscapedFragment ignores u.RawFragment and computes an escaped form on its own. The <a href="#URL.String">URL.String</a> method uses EscapedFragment to construct its result. In general, code should call EscapedFragment instead of reading u.RawFragment directly. </p> <h4 id="example_URL_EscapedFragment"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, err := url.Parse("http://example.com/#x/y%2Fz")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println("Fragment:", u.Fragment)
+fmt.Println("RawFragment:", u.RawFragment)
+fmt.Println("EscapedFragment:", u.EscapedFragment())
+</pre> <p>Output:</p> <pre class="output" data-language="go">Fragment: x/y/z
+RawFragment: x/y%2Fz
+EscapedFragment: x/y%2Fz
+</pre> <h3 id="URL.EscapedPath">func (*URL) <span>EscapedPath</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (u *URL) EscapedPath() string</pre> <p>EscapedPath returns the escaped form of u.Path. In general there are multiple possible escaped forms of any path. EscapedPath returns u.RawPath when it is a valid escaping of u.Path. Otherwise EscapedPath ignores u.RawPath and computes an escaped form on its own. The <a href="#URL.String">URL.String</a> and <a href="#URL.RequestURI">URL.RequestURI</a> methods use EscapedPath to construct their results. In general, code should call EscapedPath instead of reading u.RawPath directly. </p> <h4 id="example_URL_EscapedPath"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, err := url.Parse("http://example.com/x/y%2Fz")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println("Path:", u.Path)
+fmt.Println("RawPath:", u.RawPath)
+fmt.Println("EscapedPath:", u.EscapedPath())
+</pre> <p>Output:</p> <pre class="output" data-language="go">Path: /x/y/z
+RawPath: /x/y%2Fz
+EscapedPath: /x/y%2Fz
+</pre> <h3 id="URL.Hostname">func (*URL) <span>Hostname</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (u *URL) Hostname() string</pre> <p>Hostname returns u.Host, stripping any valid port number if present. </p>
+<p>If the result is enclosed in square brackets, as literal IPv6 addresses are, the square brackets are removed from the result. </p> <h4 id="example_URL_Hostname"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, err := url.Parse("https://example.org:8000/path")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(u.Hostname())
+u, err = url.Parse("https://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:17000")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(u.Hostname())
+</pre> <p>Output:</p> <pre class="output" data-language="go">example.org
+2001:0db8:85a3:0000:0000:8a2e:0370:7334
+</pre> <h3 id="URL.IsAbs">func (*URL) <span>IsAbs</span> </h3> <pre data-language="go">func (u *URL) IsAbs() bool</pre> <p>IsAbs reports whether the <a href="#URL">URL</a> is absolute. Absolute means that it has a non-empty scheme. </p> <h4 id="example_URL_IsAbs"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u := url.URL{Host: "example.com", Path: "foo"}
+fmt.Println(u.IsAbs())
+u.Scheme = "http"
+fmt.Println(u.IsAbs())
+</pre> <p>Output:</p> <pre class="output" data-language="go">false
+true
+</pre> <h3 id="URL.JoinPath">func (*URL) <span>JoinPath</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (u *URL) JoinPath(elem ...string) *URL</pre> <p>JoinPath returns a new <a href="#URL">URL</a> with the provided path elements joined to any existing path and the resulting path cleaned of any ./ or ../ elements. Any sequences of multiple / characters will be reduced to a single /. </p>
+<h3 id="URL.MarshalBinary">func (*URL) <span>MarshalBinary</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (u *URL) MarshalBinary() (text []byte, err error)</pre> <h4 id="example_URL_MarshalBinary"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, _ := url.Parse("https://example.org")
+b, err := u.MarshalBinary()
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s\n", b)
+</pre> <p>Output:</p> <pre class="output" data-language="go">https://example.org
+</pre> <h3 id="URL.Parse">func (*URL) <span>Parse</span> </h3> <pre data-language="go">func (u *URL) Parse(ref string) (*URL, error)</pre> <p>Parse parses a <a href="#URL">URL</a> in the context of the receiver. The provided URL may be relative or absolute. Parse returns nil, err on parse failure, otherwise its return value is the same as <a href="#URL.ResolveReference">URL.ResolveReference</a>. </p> <h4 id="example_URL_Parse"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, err := url.Parse("https://example.org")
+if err != nil {
+ log.Fatal(err)
+}
+rel, err := u.Parse("/foo")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(rel)
+_, err = u.Parse(":foo")
+if _, ok := err.(*url.Error); !ok {
+ log.Fatal(err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">https://example.org/foo
+</pre> <h3 id="URL.Port">func (*URL) <span>Port</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (u *URL) Port() string</pre> <p>Port returns the port part of u.Host, without the leading colon. </p>
+<p>If u.Host doesn't contain a valid numeric port, Port returns an empty string. </p> <h4 id="example_URL_Port"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, err := url.Parse("https://example.org")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(u.Port())
+u, err = url.Parse("https://example.org:8080")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(u.Port())
+</pre> <p>Output:</p> <pre class="output" data-language="go">
+8080
+</pre> <h3 id="URL.Query">func (*URL) <span>Query</span> </h3> <pre data-language="go">func (u *URL) Query() Values</pre> <p>Query parses RawQuery and returns the corresponding values. It silently discards malformed value pairs. To check errors use <a href="#ParseQuery">ParseQuery</a>. </p> <h4 id="example_URL_Query"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, err := url.Parse("https://example.org/?a=1&amp;a=2&amp;b=&amp;=3&amp;&amp;&amp;&amp;")
+if err != nil {
+ log.Fatal(err)
+}
+q := u.Query()
+fmt.Println(q["a"])
+fmt.Println(q.Get("b"))
+fmt.Println(q.Get(""))
+</pre> <p>Output:</p> <pre class="output" data-language="go">[1 2]
+
+3
+</pre> <h3 id="URL.Redacted">func (*URL) <span>Redacted</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (u *URL) Redacted() string</pre> <p>Redacted is like <a href="#URL.String">URL.String</a> but replaces any password with "xxxxx". Only the password in u.User is redacted. </p> <h4 id="example_URL_Redacted"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u := &amp;url.URL{
+ Scheme: "https",
+ User: url.UserPassword("user", "password"),
+ Host: "example.com",
+ Path: "foo/bar",
+}
+fmt.Println(u.Redacted())
+u.User = url.UserPassword("me", "newerPassword")
+fmt.Println(u.Redacted())
+</pre> <p>Output:</p> <pre class="output" data-language="go">https://user:xxxxx@example.com/foo/bar
+https://me:xxxxx@example.com/foo/bar
+</pre> <h3 id="URL.RequestURI">func (*URL) <span>RequestURI</span> </h3> <pre data-language="go">func (u *URL) RequestURI() string</pre> <p>RequestURI returns the encoded path?query or opaque?query string that would be used in an HTTP request for u. </p> <h4 id="example_URL_RequestURI"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, err := url.Parse("https://example.org/path?foo=bar")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(u.RequestURI())
+</pre> <p>Output:</p> <pre class="output" data-language="go">/path?foo=bar
+</pre> <h3 id="URL.ResolveReference">func (*URL) <span>ResolveReference</span> </h3> <pre data-language="go">func (u *URL) ResolveReference(ref *URL) *URL</pre> <p>ResolveReference resolves a URI reference to an absolute URI from an absolute base URI u, per RFC 3986 Section 5.2. The URI reference may be relative or absolute. ResolveReference always returns a new <a href="#URL">URL</a> instance, even if the returned URL is identical to either the base or reference. If ref is an absolute URL, then ResolveReference ignores base and returns a copy of ref. </p> <h4 id="example_URL_ResolveReference"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, err := url.Parse("../../..//search?q=dotnet")
+if err != nil {
+ log.Fatal(err)
+}
+base, err := url.Parse("http://example.com/directory/")
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(base.ResolveReference(u))
+</pre> <p>Output:</p> <pre class="output" data-language="go">http://example.com/search?q=dotnet
+</pre> <h3 id="URL.String">func (*URL) <span>String</span> </h3> <pre data-language="go">func (u *URL) String() string</pre> <p>String reassembles the <a href="#URL">URL</a> into a valid URL string. The general form of the result is one of: </p>
+<pre data-language="go">scheme:opaque?query#fragment
+scheme://userinfo@host/path?query#fragment
+</pre> <p>If u.Opaque is non-empty, String uses the first form; otherwise it uses the second form. Any non-ASCII characters in host are escaped. To obtain the path, String uses u.EscapedPath(). </p>
+<p>In the second form, the following rules apply: </p>
+<ul> <li>if u.Scheme is empty, scheme: is omitted. </li>
+<li>if u.User is nil, userinfo@ is omitted. </li>
+<li>if u.Host is empty, host/ is omitted. </li>
+<li>if u.Scheme and u.Host are empty and u.User is nil, the entire scheme://userinfo@host/ is omitted. </li>
+<li>if u.Host is non-empty and u.Path begins with a /, the form host/path does not add its own /. </li>
+<li>if u.RawQuery is empty, ?query is omitted. </li>
+<li>if u.Fragment is empty, #fragment is omitted. </li>
+</ul> <h4 id="example_URL_String"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u := &amp;url.URL{
+ Scheme: "https",
+ User: url.UserPassword("me", "pass"),
+ Host: "example.com",
+ Path: "foo/bar",
+ RawQuery: "x=1&amp;y=2",
+ Fragment: "anchor",
+}
+fmt.Println(u.String())
+u.Opaque = "opaque"
+fmt.Println(u.String())
+</pre> <p>Output:</p> <pre class="output" data-language="go">https://me:pass@example.com/foo/bar?x=1&amp;y=2#anchor
+https:opaque?x=1&amp;y=2#anchor
+</pre> <h3 id="URL.UnmarshalBinary">func (*URL) <span>UnmarshalBinary</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (u *URL) UnmarshalBinary(text []byte) error</pre> <h4 id="example_URL_UnmarshalBinary"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u := &amp;url.URL{}
+err := u.UnmarshalBinary([]byte("https://example.org/foo"))
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s\n", u)
+</pre> <p>Output:</p> <pre class="output" data-language="go">https://example.org/foo
+</pre> <h2 id="Userinfo">type <span>Userinfo</span> </h2> <p>The Userinfo type is an immutable encapsulation of username and password details for a <a href="#URL">URL</a>. An existing Userinfo value is guaranteed to have a username set (potentially empty, as allowed by RFC 2396), and optionally a password. </p>
+<pre data-language="go">type Userinfo struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="User">func <span>User</span> </h3> <pre data-language="go">func User(username string) *Userinfo</pre> <p>User returns a <a href="#Userinfo">Userinfo</a> containing the provided username and no password set. </p>
+<h3 id="UserPassword">func <span>UserPassword</span> </h3> <pre data-language="go">func UserPassword(username, password string) *Userinfo</pre> <p>UserPassword returns a <a href="#Userinfo">Userinfo</a> containing the provided username and password. </p>
+<p>This functionality should only be used with legacy web sites. RFC 2396 warns that interpreting Userinfo this way “is NOT RECOMMENDED, because the passing of authentication information in clear text (such as URI) has proven to be a security risk in almost every case where it has been used.” </p>
+<h3 id="Userinfo.Password">func (*Userinfo) <span>Password</span> </h3> <pre data-language="go">func (u *Userinfo) Password() (string, bool)</pre> <p>Password returns the password in case it is set, and whether it is set. </p>
+<h3 id="Userinfo.String">func (*Userinfo) <span>String</span> </h3> <pre data-language="go">func (u *Userinfo) String() string</pre> <p>String returns the encoded userinfo information in the standard form of "username[:password]". </p>
+<h3 id="Userinfo.Username">func (*Userinfo) <span>Username</span> </h3> <pre data-language="go">func (u *Userinfo) Username() string</pre> <p>Username returns the username. </p>
+<h2 id="Values">type <span>Values</span> </h2> <p>Values maps a string key to a list of values. It is typically used for query parameters and form values. Unlike in the http.Header map, the keys in a Values map are case-sensitive. </p>
+<pre data-language="go">type Values map[string][]string</pre> <h4 id="example_Values"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := url.Values{}
+v.Set("name", "Ava")
+v.Add("friend", "Jess")
+v.Add("friend", "Sarah")
+v.Add("friend", "Zoe")
+// v.Encode() == "name=Ava&amp;friend=Jess&amp;friend=Sarah&amp;friend=Zoe"
+fmt.Println(v.Get("name"))
+fmt.Println(v.Get("friend"))
+fmt.Println(v["friend"])
+</pre> <p>Output:</p> <pre class="output" data-language="go">Ava
+Jess
+[Jess Sarah Zoe]
+</pre> <h3 id="ParseQuery">func <span>ParseQuery</span> </h3> <pre data-language="go">func ParseQuery(query string) (Values, error)</pre> <p>ParseQuery parses the URL-encoded query string and returns a map listing the values specified for each key. ParseQuery always returns a non-nil map containing all the valid query parameters found; err describes the first decoding error encountered, if any. </p>
+<p>Query is expected to be a list of key=value settings separated by ampersands. A setting without an equals sign is interpreted as a key set to an empty value. Settings containing a non-URL-encoded semicolon are considered invalid. </p> <h4 id="example_ParseQuery"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">m, err := url.ParseQuery(`x=1&amp;y=2&amp;y=3`)
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Println(toJSON(m))
+</pre> <p>Output:</p> <pre class="output" data-language="go">{"x":["1"], "y":["2", "3"]}
+</pre> <h3 id="Values.Add">func (Values) <span>Add</span> </h3> <pre data-language="go">func (v Values) Add(key, value string)</pre> <p>Add adds the value to key. It appends to any existing values associated with key. </p> <h4 id="example_Values_Add"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := url.Values{}
+v.Add("cat sounds", "meow")
+v.Add("cat sounds", "mew")
+v.Add("cat sounds", "mau")
+fmt.Println(v["cat sounds"])
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">[meow mew mau]
+</pre> <h3 id="Values.Del">func (Values) <span>Del</span> </h3> <pre data-language="go">func (v Values) Del(key string)</pre> <p>Del deletes the values associated with key. </p> <h4 id="example_Values_Del"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := url.Values{}
+v.Add("cat sounds", "meow")
+v.Add("cat sounds", "mew")
+v.Add("cat sounds", "mau")
+fmt.Println(v["cat sounds"])
+
+v.Del("cat sounds")
+fmt.Println(v["cat sounds"])
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">[meow mew mau]
+[]
+</pre> <h3 id="Values.Encode">func (Values) <span>Encode</span> </h3> <pre data-language="go">func (v Values) Encode() string</pre> <p>Encode encodes the values into “URL encoded” form ("bar=baz&amp;foo=quux") sorted by key. </p> <h4 id="example_Values_Encode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := url.Values{}
+v.Add("cat sounds", "meow")
+v.Add("cat sounds", "mew/")
+v.Add("cat sounds", "mau$")
+fmt.Println(v.Encode())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">cat+sounds=meow&amp;cat+sounds=mew%2F&amp;cat+sounds=mau%24
+</pre> <h3 id="Values.Get">func (Values) <span>Get</span> </h3> <pre data-language="go">func (v Values) Get(key string) string</pre> <p>Get gets the first value associated with the given key. If there are no values associated with the key, Get returns the empty string. To access multiple values, use the map directly. </p> <h4 id="example_Values_Get"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := url.Values{}
+v.Add("cat sounds", "meow")
+v.Add("cat sounds", "mew")
+v.Add("cat sounds", "mau")
+fmt.Printf("%q\n", v.Get("cat sounds"))
+fmt.Printf("%q\n", v.Get("dog sounds"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"meow"
+""
+</pre> <h3 id="Values.Has">func (Values) <span>Has</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (v Values) Has(key string) bool</pre> <p>Has checks whether a given key is set. </p> <h4 id="example_Values_Has"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := url.Values{}
+v.Add("cat sounds", "meow")
+v.Add("cat sounds", "mew")
+v.Add("cat sounds", "mau")
+fmt.Println(v.Has("cat sounds"))
+fmt.Println(v.Has("dog sounds"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h3 id="Values.Set">func (Values) <span>Set</span> </h3> <pre data-language="go">func (v Values) Set(key, value string)</pre> <p>Set sets the key to value. It replaces any existing values. </p> <h4 id="example_Values_Set"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := url.Values{}
+v.Add("cat sounds", "meow")
+v.Add("cat sounds", "mew")
+v.Add("cat sounds", "mau")
+fmt.Println(v["cat sounds"])
+
+v.Set("cat sounds", "meow")
+fmt.Println(v["cat sounds"])
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">[meow mew mau]
+[meow]
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/net/url/" class="_attribution-link">http://golang.org/pkg/net/url/</a>
+ </p>
+</div>
diff --git a/devdocs/go/os%2Fexec%2Findex.html b/devdocs/go/os%2Fexec%2Findex.html
new file mode 100644
index 00000000..ab15963c
--- /dev/null
+++ b/devdocs/go/os%2Fexec%2Findex.html
@@ -0,0 +1,413 @@
+<h1> Package exec </h1> <ul id="short-nav">
+<li><code>import "os/exec"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package exec runs external commands. It wraps os.StartProcess to make it easier to remap stdin and stdout, connect I/O with pipes, and do other adjustments. </p>
+<p>Unlike the "system" library call from C and other languages, the os/exec package intentionally does not invoke the system shell and does not expand any glob patterns or handle other expansions, pipelines, or redirections typically done by shells. The package behaves more like C's "exec" family of functions. To expand glob patterns, either call the shell directly, taking care to escape any dangerous input, or use the path/filepath package's Glob function. To expand environment variables, use package os's ExpandEnv. </p>
+<p>Note that the examples in this package assume a Unix system. They may not run on Windows, and they do not run in the Go Playground used by golang.org and godoc.org. </p>
+<h3 id="hdr-Executables_in_the_current_directory">Executables in the current directory</h3> <p>The functions Command and LookPath look for a program in the directories listed in the current path, following the conventions of the host operating system. Operating systems have for decades included the current directory in this search, sometimes implicitly and sometimes configured explicitly that way by default. Modern practice is that including the current directory is usually unexpected and often leads to security problems. </p>
+<p>To avoid those security problems, as of Go 1.19, this package will not resolve a program using an implicit or explicit path entry relative to the current directory. That is, if you run exec.LookPath("go"), it will not successfully return ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. Instead, if the usual path algorithms would result in that answer, these functions return an error err satisfying errors.Is(err, ErrDot). </p>
+<p>For example, consider these two program snippets: </p>
+<pre data-language="go">path, err := exec.LookPath("prog")
+if err != nil {
+ log.Fatal(err)
+}
+use(path)
+</pre> <p>and </p>
+<pre data-language="go">cmd := exec.Command("prog")
+if err := cmd.Run(); err != nil {
+ log.Fatal(err)
+}
+</pre> <p>These will not find and run ./prog or .\prog.exe, no matter how the current path is configured. </p>
+<p>Code that always wants to run a program from the current directory can be rewritten to say "./prog" instead of "prog". </p>
+<p>Code that insists on including results from relative path entries can instead override the error using an errors.Is check: </p>
+<pre data-language="go">path, err := exec.LookPath("prog")
+if errors.Is(err, exec.ErrDot) {
+ err = nil
+}
+if err != nil {
+ log.Fatal(err)
+}
+use(path)
+</pre> <p>and </p>
+<pre data-language="go">cmd := exec.Command("prog")
+if errors.Is(cmd.Err, exec.ErrDot) {
+ cmd.Err = nil
+}
+if err := cmd.Run(); err != nil {
+ log.Fatal(err)
+}
+</pre> <p>Setting the environment variable GODEBUG=execerrdot=0 disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 behavior for programs that are unable to apply more targeted fixes. A future version of Go may remove support for this variable. </p>
+<p>Before adding such overrides, make sure you understand the security implications of doing so. See <a href="https://go.dev/blog/path-security">https://go.dev/blog/path-security</a> for more information. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#LookPath">func LookPath(file string) (string, error)</a></li>
+<li><a href="#Cmd">type Cmd</a></li>
+<li> <a href="#Command">func Command(name string, arg ...string) *Cmd</a>
+</li>
+<li> <a href="#CommandContext">func CommandContext(ctx context.Context, name string, arg ...string) *Cmd</a>
+</li>
+<li> <a href="#Cmd.CombinedOutput">func (c *Cmd) CombinedOutput() ([]byte, error)</a>
+</li>
+<li> <a href="#Cmd.Environ">func (c *Cmd) Environ() []string</a>
+</li>
+<li> <a href="#Cmd.Output">func (c *Cmd) Output() ([]byte, error)</a>
+</li>
+<li> <a href="#Cmd.Run">func (c *Cmd) Run() error</a>
+</li>
+<li> <a href="#Cmd.Start">func (c *Cmd) Start() error</a>
+</li>
+<li> <a href="#Cmd.StderrPipe">func (c *Cmd) StderrPipe() (io.ReadCloser, error)</a>
+</li>
+<li> <a href="#Cmd.StdinPipe">func (c *Cmd) StdinPipe() (io.WriteCloser, error)</a>
+</li>
+<li> <a href="#Cmd.StdoutPipe">func (c *Cmd) StdoutPipe() (io.ReadCloser, error)</a>
+</li>
+<li> <a href="#Cmd.String">func (c *Cmd) String() string</a>
+</li>
+<li> <a href="#Cmd.Wait">func (c *Cmd) Wait() error</a>
+</li>
+<li><a href="#Error">type Error</a></li>
+<li> <a href="#Error.Error">func (e *Error) Error() string</a>
+</li>
+<li> <a href="#Error.Unwrap">func (e *Error) Unwrap() error</a>
+</li>
+<li><a href="#ExitError">type ExitError</a></li>
+<li> <a href="#ExitError.Error">func (e *ExitError) Error() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Cmd_CombinedOutput">Cmd.CombinedOutput</a></dd> <dd><a class="exampleLink" href="#example_Cmd_Environ">Cmd.Environ</a></dd> <dd><a class="exampleLink" href="#example_Cmd_Output">Cmd.Output</a></dd> <dd><a class="exampleLink" href="#example_Cmd_Run">Cmd.Run</a></dd> <dd><a class="exampleLink" href="#example_Cmd_Start">Cmd.Start</a></dd> <dd><a class="exampleLink" href="#example_Cmd_StderrPipe">Cmd.StderrPipe</a></dd> <dd><a class="exampleLink" href="#example_Cmd_StdinPipe">Cmd.StdinPipe</a></dd> <dd><a class="exampleLink" href="#example_Cmd_StdoutPipe">Cmd.StdoutPipe</a></dd> <dd><a class="exampleLink" href="#example_Command">Command</a></dd> <dd><a class="exampleLink" href="#example_CommandContext">CommandContext</a></dd> <dd><a class="exampleLink" href="#example_Command_environment">Command (Environment)</a></dd> <dd><a class="exampleLink" href="#example_LookPath">LookPath</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>exec.go</span> <span>exec_unix.go</span> <span>lp_unix.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrDot indicates that a path lookup resolved to an executable in the current directory due to ‘.’ being in the path, either implicitly or explicitly. See the package documentation for details. </p>
+<p>Note that functions in this package do not return ErrDot directly. Code should use errors.Is(err, ErrDot), not err == ErrDot, to test whether a returned error err is due to this condition. </p>
+<pre data-language="go">var ErrDot = errors.New("cannot run executable found relative to current directory")</pre> <p>ErrNotFound is the error resulting if a path search failed to find an executable file. </p>
+<pre data-language="go">var ErrNotFound = errors.New("executable file not found in $PATH")</pre> <p>ErrWaitDelay is returned by (*Cmd).Wait if the process exits with a successful status code but its output pipes are not closed before the command's WaitDelay expires. </p>
+<pre data-language="go">var ErrWaitDelay = errors.New("exec: WaitDelay expired before I/O complete")</pre> <h2 id="LookPath">func <span>LookPath</span> </h2> <pre data-language="go">func LookPath(file string) (string, error)</pre> <p>LookPath searches for an executable named file in the directories named by the PATH environment variable. If file contains a slash, it is tried directly and the PATH is not consulted. Otherwise, on success, the result is an absolute path. </p>
+<p>In older versions of Go, LookPath could return a path relative to the current directory. As of Go 1.19, LookPath will instead return that path along with an error satisfying errors.Is(err, ErrDot). See the package documentation for more details. </p> <h4 id="example_LookPath"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+path, err := exec.LookPath("fortune")
+if err != nil {
+ log.Fatal("installing fortune is in your future")
+}
+fmt.Printf("fortune is available at %s\n", path)
+</pre> <h2 id="Cmd">type <span>Cmd</span> </h2> <p>Cmd represents an external command being prepared or run. </p>
+<p>A Cmd cannot be reused after calling its Run, Output or CombinedOutput methods. </p>
+<pre data-language="go">type Cmd struct {
+ // Path is the path of the command to run.
+ //
+ // This is the only field that must be set to a non-zero
+ // value. If Path is relative, it is evaluated relative
+ // to Dir.
+ Path string
+
+ // Args holds command line arguments, including the command as Args[0].
+ // If the Args field is empty or nil, Run uses {Path}.
+ //
+ // In typical use, both Path and Args are set by calling Command.
+ Args []string
+
+ // Env specifies the environment of the process.
+ // Each entry is of the form "key=value".
+ // If Env is nil, the new process uses the current process's
+ // environment.
+ // If Env contains duplicate environment keys, only the last
+ // value in the slice for each duplicate key is used.
+ // As a special case on Windows, SYSTEMROOT is always added if
+ // missing and not explicitly set to the empty string.
+ Env []string
+
+ // Dir specifies the working directory of the command.
+ // If Dir is the empty string, Run runs the command in the
+ // calling process's current directory.
+ Dir string
+
+ // Stdin specifies the process's standard input.
+ //
+ // If Stdin is nil, the process reads from the null device (os.DevNull).
+ //
+ // If Stdin is an *os.File, the process's standard input is connected
+ // directly to that file.
+ //
+ // Otherwise, during the execution of the command a separate
+ // goroutine reads from Stdin and delivers that data to the command
+ // over a pipe. In this case, Wait does not complete until the goroutine
+ // stops copying, either because it has reached the end of Stdin
+ // (EOF or a read error), or because writing to the pipe returned an error,
+ // or because a nonzero WaitDelay was set and expired.
+ Stdin io.Reader
+
+ // Stdout and Stderr specify the process's standard output and error.
+ //
+ // If either is nil, Run connects the corresponding file descriptor
+ // to the null device (os.DevNull).
+ //
+ // If either is an *os.File, the corresponding output from the process
+ // is connected directly to that file.
+ //
+ // Otherwise, during the execution of the command a separate goroutine
+ // reads from the process over a pipe and delivers that data to the
+ // corresponding Writer. In this case, Wait does not complete until the
+ // goroutine reaches EOF or encounters an error or a nonzero WaitDelay
+ // expires.
+ //
+ // If Stdout and Stderr are the same writer, and have a type that can
+ // be compared with ==, at most one goroutine at a time will call Write.
+ Stdout io.Writer
+ Stderr io.Writer
+
+ // ExtraFiles specifies additional open files to be inherited by the
+ // new process. It does not include standard input, standard output, or
+ // standard error. If non-nil, entry i becomes file descriptor 3+i.
+ //
+ // ExtraFiles is not supported on Windows.
+ ExtraFiles []*os.File
+
+ // SysProcAttr holds optional, operating system-specific attributes.
+ // Run passes it to os.StartProcess as the os.ProcAttr's Sys field.
+ SysProcAttr *syscall.SysProcAttr
+
+ // Process is the underlying process, once started.
+ Process *os.Process
+
+ // ProcessState contains information about an exited process.
+ // If the process was started successfully, Wait or Run will
+ // populate its ProcessState when the command completes.
+ ProcessState *os.ProcessState
+
+ Err error // LookPath error, if any; added in Go 1.19
+
+ // If Cancel is non-nil, the command must have been created with
+ // CommandContext and Cancel will be called when the command's
+ // Context is done. By default, CommandContext sets Cancel to
+ // call the Kill method on the command's Process.
+ //
+ // Typically a custom Cancel will send a signal to the command's
+ // Process, but it may instead take other actions to initiate cancellation,
+ // such as closing a stdin or stdout pipe or sending a shutdown request on a
+ // network socket.
+ //
+ // If the command exits with a success status after Cancel is
+ // called, and Cancel does not return an error equivalent to
+ // os.ErrProcessDone, then Wait and similar methods will return a non-nil
+ // error: either an error wrapping the one returned by Cancel,
+ // or the error from the Context.
+ // (If the command exits with a non-success status, or Cancel
+ // returns an error that wraps os.ErrProcessDone, Wait and similar methods
+ // continue to return the command's usual exit status.)
+ //
+ // If Cancel is set to nil, nothing will happen immediately when the command's
+ // Context is done, but a nonzero WaitDelay will still take effect. That may
+ // be useful, for example, to work around deadlocks in commands that do not
+ // support shutdown signals but are expected to always finish quickly.
+ //
+ // Cancel will not be called if Start returns a non-nil error.
+ Cancel func() error // Go 1.20
+
+ // If WaitDelay is non-zero, it bounds the time spent waiting on two sources
+ // of unexpected delay in Wait: a child process that fails to exit after the
+ // associated Context is canceled, and a child process that exits but leaves
+ // its I/O pipes unclosed.
+ //
+ // The WaitDelay timer starts when either the associated Context is done or a
+ // call to Wait observes that the child process has exited, whichever occurs
+ // first. When the delay has elapsed, the command shuts down the child process
+ // and/or its I/O pipes.
+ //
+ // If the child process has failed to exit — perhaps because it ignored or
+ // failed to receive a shutdown signal from a Cancel function, or because no
+ // Cancel function was set — then it will be terminated using os.Process.Kill.
+ //
+ // Then, if the I/O pipes communicating with the child process are still open,
+ // those pipes are closed in order to unblock any goroutines currently blocked
+ // on Read or Write calls.
+ //
+ // If pipes are closed due to WaitDelay, no Cancel call has occurred,
+ // and the command has otherwise exited with a successful status, Wait and
+ // similar methods will return ErrWaitDelay instead of nil.
+ //
+ // If WaitDelay is zero (the default), I/O pipes will be read until EOF,
+ // which might not occur until orphaned subprocesses of the command have
+ // also closed their descriptors for the pipes.
+ WaitDelay time.Duration // Go 1.20
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Command">func <span>Command</span> </h3> <pre data-language="go">func Command(name string, arg ...string) *Cmd</pre> <p>Command returns the Cmd struct to execute the named program with the given arguments. </p>
+<p>It sets only the Path and Args in the returned structure. </p>
+<p>If name contains no path separators, Command uses LookPath to resolve name to a complete path if possible. Otherwise it uses name directly as Path. </p>
+<p>The returned Cmd's Args field is constructed from the command name followed by the elements of arg, so arg should not include the command name itself. For example, Command("echo", "hello"). Args[0] is always name, not the possibly resolved Path. </p>
+<p>On Windows, processes receive the whole command line as a single string and do their own parsing. Command combines and quotes Args into a command line string with an algorithm compatible with applications using CommandLineToArgvW (which is the most common way). Notable exceptions are msiexec.exe and cmd.exe (and thus, all batch files), which have a different unquoting algorithm. In these or other similar cases, you can do the quoting yourself and provide the full command line in SysProcAttr.CmdLine, leaving Args empty. </p> <h4 id="example_Command"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cmd := exec.Command("tr", "a-z", "A-Z")
+cmd.Stdin = strings.NewReader("some input")
+var out strings.Builder
+cmd.Stdout = &amp;out
+err := cmd.Run()
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("in all caps: %q\n", out.String())
+</pre> <h4 id="example_Command_environment"> <span class="text">Example (Environment)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cmd := exec.Command("prog")
+cmd.Env = append(os.Environ(),
+ "FOO=duplicate_value", // ignored
+ "FOO=actual_value", // this value is used
+)
+if err := cmd.Run(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="CommandContext">func <span>CommandContext</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func CommandContext(ctx context.Context, name string, arg ...string) *Cmd</pre> <p>CommandContext is like Command but includes a context. </p>
+<p>The provided context is used to interrupt the process (by calling cmd.Cancel or os.Process.Kill) if the context becomes done before the command completes on its own. </p>
+<p>CommandContext sets the command's Cancel function to invoke the Kill method on its Process, and leaves its WaitDelay unset. The caller may change the cancellation behavior by modifying those fields before starting the command. </p> <h4 id="example_CommandContext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
+defer cancel()
+
+if err := exec.CommandContext(ctx, "sleep", "5").Run(); err != nil {
+ // This will fail after 100 milliseconds. The 5 second sleep
+ // will be interrupted.
+}
+</pre> <h3 id="Cmd.CombinedOutput">func (*Cmd) <span>CombinedOutput</span> </h3> <pre data-language="go">func (c *Cmd) CombinedOutput() ([]byte, error)</pre> <p>CombinedOutput runs the command and returns its combined standard output and standard error. </p> <h4 id="example_Cmd_CombinedOutput"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cmd := exec.Command("sh", "-c", "echo stdout; echo 1&gt;&amp;2 stderr")
+stdoutStderr, err := cmd.CombinedOutput()
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s\n", stdoutStderr)
+</pre> <h3 id="Cmd.Environ">func (*Cmd) <span>Environ</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (c *Cmd) Environ() []string</pre> <p>Environ returns a copy of the environment in which the command would be run as it is currently configured. </p> <h4 id="example_Cmd_Environ"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cmd := exec.Command("pwd")
+
+// Set Dir before calling cmd.Environ so that it will include an
+// updated PWD variable (on platforms where that is used).
+cmd.Dir = ".."
+cmd.Env = append(cmd.Environ(), "POSIXLY_CORRECT=1")
+
+out, err := cmd.Output()
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s\n", out)
+</pre> <h3 id="Cmd.Output">func (*Cmd) <span>Output</span> </h3> <pre data-language="go">func (c *Cmd) Output() ([]byte, error)</pre> <p>Output runs the command and returns its standard output. Any returned error will usually be of type *ExitError. If c.Stderr was nil, Output populates ExitError.Stderr. </p> <h4 id="example_Cmd_Output"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+out, err := exec.Command("date").Output()
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("The date is %s\n", out)
+</pre> <h3 id="Cmd.Run">func (*Cmd) <span>Run</span> </h3> <pre data-language="go">func (c *Cmd) Run() error</pre> <p>Run starts the specified command and waits for it to complete. </p>
+<p>The returned error is nil if the command runs, has no problems copying stdin, stdout, and stderr, and exits with a zero exit status. </p>
+<p>If the command starts but does not complete successfully, the error is of type *ExitError. Other error types may be returned for other situations. </p>
+<p>If the calling goroutine has locked the operating system thread with runtime.LockOSThread and modified any inheritable OS-level thread state (for example, Linux or Plan 9 name spaces), the new process will inherit the caller's thread state. </p> <h4 id="example_Cmd_Run"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cmd := exec.Command("sleep", "1")
+log.Printf("Running command and waiting for it to finish...")
+err := cmd.Run()
+log.Printf("Command finished with error: %v", err)
+</pre> <h3 id="Cmd.Start">func (*Cmd) <span>Start</span> </h3> <pre data-language="go">func (c *Cmd) Start() error</pre> <p>Start starts the specified command but does not wait for it to complete. </p>
+<p>If Start returns successfully, the c.Process field will be set. </p>
+<p>After a successful call to Start the Wait method must be called in order to release associated system resources. </p> <h4 id="example_Cmd_Start"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cmd := exec.Command("sleep", "5")
+err := cmd.Start()
+if err != nil {
+ log.Fatal(err)
+}
+log.Printf("Waiting for command to finish...")
+err = cmd.Wait()
+log.Printf("Command finished with error: %v", err)
+</pre> <h3 id="Cmd.StderrPipe">func (*Cmd) <span>StderrPipe</span> </h3> <pre data-language="go">func (c *Cmd) StderrPipe() (io.ReadCloser, error)</pre> <p>StderrPipe returns a pipe that will be connected to the command's standard error when the command starts. </p>
+<p>Wait will close the pipe after seeing the command exit, so most callers need not close the pipe themselves. It is thus incorrect to call Wait before all reads from the pipe have completed. For the same reason, it is incorrect to use Run when using StderrPipe. See the StdoutPipe example for idiomatic usage. </p> <h4 id="example_Cmd_StderrPipe"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cmd := exec.Command("sh", "-c", "echo stdout; echo 1&gt;&amp;2 stderr")
+stderr, err := cmd.StderrPipe()
+if err != nil {
+ log.Fatal(err)
+}
+
+if err := cmd.Start(); err != nil {
+ log.Fatal(err)
+}
+
+slurp, _ := io.ReadAll(stderr)
+fmt.Printf("%s\n", slurp)
+
+if err := cmd.Wait(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="Cmd.StdinPipe">func (*Cmd) <span>StdinPipe</span> </h3> <pre data-language="go">func (c *Cmd) StdinPipe() (io.WriteCloser, error)</pre> <p>StdinPipe returns a pipe that will be connected to the command's standard input when the command starts. The pipe will be closed automatically after Wait sees the command exit. A caller need only call Close to force the pipe to close sooner. For example, if the command being run will not exit until standard input is closed, the caller must close the pipe. </p> <h4 id="example_Cmd_StdinPipe"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cmd := exec.Command("cat")
+stdin, err := cmd.StdinPipe()
+if err != nil {
+ log.Fatal(err)
+}
+
+go func() {
+ defer stdin.Close()
+ io.WriteString(stdin, "values written to stdin are passed to cmd's standard input")
+}()
+
+out, err := cmd.CombinedOutput()
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("%s\n", out)
+</pre> <h3 id="Cmd.StdoutPipe">func (*Cmd) <span>StdoutPipe</span> </h3> <pre data-language="go">func (c *Cmd) StdoutPipe() (io.ReadCloser, error)</pre> <p>StdoutPipe returns a pipe that will be connected to the command's standard output when the command starts. </p>
+<p>Wait will close the pipe after seeing the command exit, so most callers need not close the pipe themselves. It is thus incorrect to call Wait before all reads from the pipe have completed. For the same reason, it is incorrect to call Run when using StdoutPipe. See the example for idiomatic usage. </p> <h4 id="example_Cmd_StdoutPipe"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+cmd := exec.Command("echo", "-n", `{"Name": "Bob", "Age": 32}`)
+stdout, err := cmd.StdoutPipe()
+if err != nil {
+ log.Fatal(err)
+}
+if err := cmd.Start(); err != nil {
+ log.Fatal(err)
+}
+var person struct {
+ Name string
+ Age int
+}
+if err := json.NewDecoder(stdout).Decode(&amp;person); err != nil {
+ log.Fatal(err)
+}
+if err := cmd.Wait(); err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s is %d years old\n", person.Name, person.Age)
+</pre> <h3 id="Cmd.String">func (*Cmd) <span>String</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (c *Cmd) String() string</pre> <p>String returns a human-readable description of c. It is intended only for debugging. In particular, it is not suitable for use as input to a shell. The output of String may vary across Go releases. </p>
+<h3 id="Cmd.Wait">func (*Cmd) <span>Wait</span> </h3> <pre data-language="go">func (c *Cmd) Wait() error</pre> <p>Wait waits for the command to exit and waits for any copying to stdin or copying from stdout or stderr to complete. </p>
+<p>The command must have been started by Start. </p>
+<p>The returned error is nil if the command runs, has no problems copying stdin, stdout, and stderr, and exits with a zero exit status. </p>
+<p>If the command fails to run or doesn't complete successfully, the error is of type *ExitError. Other error types may be returned for I/O problems. </p>
+<p>If any of c.Stdin, c.Stdout or c.Stderr are not an *os.File, Wait also waits for the respective I/O loop copying to or from the process to complete. </p>
+<p>Wait releases any resources associated with the Cmd. </p>
+<h2 id="Error">type <span>Error</span> </h2> <p>Error is returned by LookPath when it fails to classify a file as an executable. </p>
+<pre data-language="go">type Error struct {
+ // Name is the file name for which the error occurred.
+ Name string
+ // Err is the underlying error.
+ Err error
+}
+</pre> <h3 id="Error.Error">func (*Error) <span>Error</span> </h3> <pre data-language="go">func (e *Error) Error() string</pre> <h3 id="Error.Unwrap">func (*Error) <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e *Error) Unwrap() error</pre> <h2 id="ExitError">type <span>ExitError</span> </h2> <p>An ExitError reports an unsuccessful exit by a command. </p>
+<pre data-language="go">type ExitError struct {
+ *os.ProcessState
+
+ // Stderr holds a subset of the standard error output from the
+ // Cmd.Output method if standard error was not otherwise being
+ // collected.
+ //
+ // If the error output is long, Stderr may contain only a prefix
+ // and suffix of the output, with the middle replaced with
+ // text about the number of omitted bytes.
+ //
+ // Stderr is provided for debugging, for inclusion in error messages.
+ // Users with other needs should redirect Cmd.Stderr as needed.
+ Stderr []byte // Go 1.6
+}
+</pre> <h3 id="ExitError.Error">func (*ExitError) <span>Error</span> </h3> <pre data-language="go">func (e *ExitError) Error() string</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/os/exec/" class="_attribution-link">http://golang.org/pkg/os/exec/</a>
+ </p>
+</div>
diff --git a/devdocs/go/os%2Findex.html b/devdocs/go/os%2Findex.html
new file mode 100644
index 00000000..148102b9
--- /dev/null
+++ b/devdocs/go/os%2Findex.html
@@ -0,0 +1,787 @@
+<h1> Package os </h1> <ul id="short-nav">
+<li><code>import "os"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package os provides a platform-independent interface to operating system functionality. The design is Unix-like, although the error handling is Go-like; failing calls return values of type error rather than error numbers. Often, more information is available within the error. For example, if a call that takes a file name fails, such as Open or Stat, the error will include the failing file name when printed and will be of type *PathError, which may be unpacked for more information. </p>
+<p>The os interface is intended to be uniform across all operating systems. Features not generally available appear in the system-specific package syscall. </p>
+<p>Here is a simple example, opening a file and reading some of it. </p>
+<pre data-language="go">file, err := os.Open("file.go") // For read access.
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <p>If the open fails, the error string will be self-explanatory, like </p>
+<pre data-language="go">open file.go: no such file or directory
+</pre> <p>The file's data can then be read into a slice of bytes. Read and Write take their byte counts from the length of the argument slice. </p>
+<pre data-language="go">data := make([]byte, 100)
+count, err := file.Read(data)
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("read %d bytes: %q\n", count, data[:count])
+</pre> <p>Note: The maximum number of concurrent operations on a File may be limited by the OS or the system. The number should be high, but exceeding it may degrade performance or cause other issues. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Chdir">func Chdir(dir string) error</a></li>
+<li><a href="#Chmod">func Chmod(name string, mode FileMode) error</a></li>
+<li><a href="#Chown">func Chown(name string, uid, gid int) error</a></li>
+<li><a href="#Chtimes">func Chtimes(name string, atime time.Time, mtime time.Time) error</a></li>
+<li><a href="#Clearenv">func Clearenv()</a></li>
+<li><a href="#DirFS">func DirFS(dir string) fs.FS</a></li>
+<li><a href="#Environ">func Environ() []string</a></li>
+<li><a href="#Executable">func Executable() (string, error)</a></li>
+<li><a href="#Exit">func Exit(code int)</a></li>
+<li><a href="#Expand">func Expand(s string, mapping func(string) string) string</a></li>
+<li><a href="#ExpandEnv">func ExpandEnv(s string) string</a></li>
+<li><a href="#Getegid">func Getegid() int</a></li>
+<li><a href="#Getenv">func Getenv(key string) string</a></li>
+<li><a href="#Geteuid">func Geteuid() int</a></li>
+<li><a href="#Getgid">func Getgid() int</a></li>
+<li><a href="#Getgroups">func Getgroups() ([]int, error)</a></li>
+<li><a href="#Getpagesize">func Getpagesize() int</a></li>
+<li><a href="#Getpid">func Getpid() int</a></li>
+<li><a href="#Getppid">func Getppid() int</a></li>
+<li><a href="#Getuid">func Getuid() int</a></li>
+<li><a href="#Getwd">func Getwd() (dir string, err error)</a></li>
+<li><a href="#Hostname">func Hostname() (name string, err error)</a></li>
+<li><a href="#IsExist">func IsExist(err error) bool</a></li>
+<li><a href="#IsNotExist">func IsNotExist(err error) bool</a></li>
+<li><a href="#IsPathSeparator">func IsPathSeparator(c uint8) bool</a></li>
+<li><a href="#IsPermission">func IsPermission(err error) bool</a></li>
+<li><a href="#IsTimeout">func IsTimeout(err error) bool</a></li>
+<li><a href="#Lchown">func Lchown(name string, uid, gid int) error</a></li>
+<li><a href="#Link">func Link(oldname, newname string) error</a></li>
+<li><a href="#LookupEnv">func LookupEnv(key string) (string, bool)</a></li>
+<li><a href="#Mkdir">func Mkdir(name string, perm FileMode) error</a></li>
+<li><a href="#MkdirAll">func MkdirAll(path string, perm FileMode) error</a></li>
+<li><a href="#MkdirTemp">func MkdirTemp(dir, pattern string) (string, error)</a></li>
+<li><a href="#NewSyscallError">func NewSyscallError(syscall string, err error) error</a></li>
+<li><a href="#Pipe">func Pipe() (r *File, w *File, err error)</a></li>
+<li><a href="#ReadFile">func ReadFile(name string) ([]byte, error)</a></li>
+<li><a href="#Readlink">func Readlink(name string) (string, error)</a></li>
+<li><a href="#Remove">func Remove(name string) error</a></li>
+<li><a href="#RemoveAll">func RemoveAll(path string) error</a></li>
+<li><a href="#Rename">func Rename(oldpath, newpath string) error</a></li>
+<li><a href="#SameFile">func SameFile(fi1, fi2 FileInfo) bool</a></li>
+<li><a href="#Setenv">func Setenv(key, value string) error</a></li>
+<li><a href="#Symlink">func Symlink(oldname, newname string) error</a></li>
+<li><a href="#TempDir">func TempDir() string</a></li>
+<li><a href="#Truncate">func Truncate(name string, size int64) error</a></li>
+<li><a href="#Unsetenv">func Unsetenv(key string) error</a></li>
+<li><a href="#UserCacheDir">func UserCacheDir() (string, error)</a></li>
+<li><a href="#UserConfigDir">func UserConfigDir() (string, error)</a></li>
+<li><a href="#UserHomeDir">func UserHomeDir() (string, error)</a></li>
+<li><a href="#WriteFile">func WriteFile(name string, data []byte, perm FileMode) error</a></li>
+<li><a href="#DirEntry">type DirEntry</a></li>
+<li> <a href="#ReadDir">func ReadDir(name string) ([]DirEntry, error)</a>
+</li>
+<li><a href="#File">type File</a></li>
+<li> <a href="#Create">func Create(name string) (*File, error)</a>
+</li>
+<li> <a href="#CreateTemp">func CreateTemp(dir, pattern string) (*File, error)</a>
+</li>
+<li> <a href="#NewFile">func NewFile(fd uintptr, name string) *File</a>
+</li>
+<li> <a href="#Open">func Open(name string) (*File, error)</a>
+</li>
+<li> <a href="#OpenFile">func OpenFile(name string, flag int, perm FileMode) (*File, error)</a>
+</li>
+<li> <a href="#File.Chdir">func (f *File) Chdir() error</a>
+</li>
+<li> <a href="#File.Chmod">func (f *File) Chmod(mode FileMode) error</a>
+</li>
+<li> <a href="#File.Chown">func (f *File) Chown(uid, gid int) error</a>
+</li>
+<li> <a href="#File.Close">func (f *File) Close() error</a>
+</li>
+<li> <a href="#File.Fd">func (f *File) Fd() uintptr</a>
+</li>
+<li> <a href="#File.Name">func (f *File) Name() string</a>
+</li>
+<li> <a href="#File.Read">func (f *File) Read(b []byte) (n int, err error)</a>
+</li>
+<li> <a href="#File.ReadAt">func (f *File) ReadAt(b []byte, off int64) (n int, err error)</a>
+</li>
+<li> <a href="#File.ReadDir">func (f *File) ReadDir(n int) ([]DirEntry, error)</a>
+</li>
+<li> <a href="#File.ReadFrom">func (f *File) ReadFrom(r io.Reader) (n int64, err error)</a>
+</li>
+<li> <a href="#File.Readdir">func (f *File) Readdir(n int) ([]FileInfo, error)</a>
+</li>
+<li> <a href="#File.Readdirnames">func (f *File) Readdirnames(n int) (names []string, err error)</a>
+</li>
+<li> <a href="#File.Seek">func (f *File) Seek(offset int64, whence int) (ret int64, err error)</a>
+</li>
+<li> <a href="#File.SetDeadline">func (f *File) SetDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#File.SetReadDeadline">func (f *File) SetReadDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#File.SetWriteDeadline">func (f *File) SetWriteDeadline(t time.Time) error</a>
+</li>
+<li> <a href="#File.Stat">func (f *File) Stat() (FileInfo, error)</a>
+</li>
+<li> <a href="#File.Sync">func (f *File) Sync() error</a>
+</li>
+<li> <a href="#File.SyscallConn">func (f *File) SyscallConn() (syscall.RawConn, error)</a>
+</li>
+<li> <a href="#File.Truncate">func (f *File) Truncate(size int64) error</a>
+</li>
+<li> <a href="#File.Write">func (f *File) Write(b []byte) (n int, err error)</a>
+</li>
+<li> <a href="#File.WriteAt">func (f *File) WriteAt(b []byte, off int64) (n int, err error)</a>
+</li>
+<li> <a href="#File.WriteString">func (f *File) WriteString(s string) (n int, err error)</a>
+</li>
+<li> <a href="#File.WriteTo">func (f *File) WriteTo(w io.Writer) (n int64, err error)</a>
+</li>
+<li><a href="#FileInfo">type FileInfo</a></li>
+<li> <a href="#Lstat">func Lstat(name string) (FileInfo, error)</a>
+</li>
+<li> <a href="#Stat">func Stat(name string) (FileInfo, error)</a>
+</li>
+<li><a href="#FileMode">type FileMode</a></li>
+<li><a href="#LinkError">type LinkError</a></li>
+<li> <a href="#LinkError.Error">func (e *LinkError) Error() string</a>
+</li>
+<li> <a href="#LinkError.Unwrap">func (e *LinkError) Unwrap() error</a>
+</li>
+<li><a href="#PathError">type PathError</a></li>
+<li><a href="#ProcAttr">type ProcAttr</a></li>
+<li><a href="#Process">type Process</a></li>
+<li> <a href="#FindProcess">func FindProcess(pid int) (*Process, error)</a>
+</li>
+<li> <a href="#StartProcess">func StartProcess(name string, argv []string, attr *ProcAttr) (*Process, error)</a>
+</li>
+<li> <a href="#Process.Kill">func (p *Process) Kill() error</a>
+</li>
+<li> <a href="#Process.Release">func (p *Process) Release() error</a>
+</li>
+<li> <a href="#Process.Signal">func (p *Process) Signal(sig Signal) error</a>
+</li>
+<li> <a href="#Process.Wait">func (p *Process) Wait() (*ProcessState, error)</a>
+</li>
+<li><a href="#ProcessState">type ProcessState</a></li>
+<li> <a href="#ProcessState.ExitCode">func (p *ProcessState) ExitCode() int</a>
+</li>
+<li> <a href="#ProcessState.Exited">func (p *ProcessState) Exited() bool</a>
+</li>
+<li> <a href="#ProcessState.Pid">func (p *ProcessState) Pid() int</a>
+</li>
+<li> <a href="#ProcessState.String">func (p *ProcessState) String() string</a>
+</li>
+<li> <a href="#ProcessState.Success">func (p *ProcessState) Success() bool</a>
+</li>
+<li> <a href="#ProcessState.Sys">func (p *ProcessState) Sys() any</a>
+</li>
+<li> <a href="#ProcessState.SysUsage">func (p *ProcessState) SysUsage() any</a>
+</li>
+<li> <a href="#ProcessState.SystemTime">func (p *ProcessState) SystemTime() time.Duration</a>
+</li>
+<li> <a href="#ProcessState.UserTime">func (p *ProcessState) UserTime() time.Duration</a>
+</li>
+<li><a href="#Signal">type Signal</a></li>
+<li><a href="#SyscallError">type SyscallError</a></li>
+<li> <a href="#SyscallError.Error">func (e *SyscallError) Error() string</a>
+</li>
+<li> <a href="#SyscallError.Timeout">func (e *SyscallError) Timeout() bool</a>
+</li>
+<li> <a href="#SyscallError.Unwrap">func (e *SyscallError) Unwrap() error</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Chmod">Chmod</a></dd> <dd><a class="exampleLink" href="#example_Chtimes">Chtimes</a></dd> <dd><a class="exampleLink" href="#example_CreateTemp">CreateTemp</a></dd> <dd><a class="exampleLink" href="#example_CreateTemp_suffix">CreateTemp (Suffix)</a></dd> <dd><a class="exampleLink" href="#example_ErrNotExist">ErrNotExist</a></dd> <dd><a class="exampleLink" href="#example_Expand">Expand</a></dd> <dd><a class="exampleLink" href="#example_ExpandEnv">ExpandEnv</a></dd> <dd><a class="exampleLink" href="#example_FileMode">FileMode</a></dd> <dd><a class="exampleLink" href="#example_Getenv">Getenv</a></dd> <dd><a class="exampleLink" href="#example_LookupEnv">LookupEnv</a></dd> <dd><a class="exampleLink" href="#example_Mkdir">Mkdir</a></dd> <dd><a class="exampleLink" href="#example_MkdirAll">MkdirAll</a></dd> <dd><a class="exampleLink" href="#example_MkdirTemp">MkdirTemp</a></dd> <dd><a class="exampleLink" href="#example_MkdirTemp_suffix">MkdirTemp (Suffix)</a></dd> <dd><a class="exampleLink" href="#example_OpenFile">OpenFile</a></dd> <dd><a class="exampleLink" href="#example_OpenFile_append">OpenFile (Append)</a></dd> <dd><a class="exampleLink" href="#example_ReadDir">ReadDir</a></dd> <dd><a class="exampleLink" href="#example_ReadFile">ReadFile</a></dd> <dd><a class="exampleLink" href="#example_Readlink">Readlink</a></dd> <dd><a class="exampleLink" href="#example_Unsetenv">Unsetenv</a></dd> <dd><a class="exampleLink" href="#example_UserCacheDir">UserCacheDir</a></dd> <dd><a class="exampleLink" href="#example_UserConfigDir">UserConfigDir</a></dd> <dd><a class="exampleLink" href="#example_WriteFile">WriteFile</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>dir.go</span> <span>dir_unix.go</span> <span>dirent_linux.go</span> <span>endian_little.go</span> <span>env.go</span> <span>error.go</span> <span>error_errno.go</span> <span>error_posix.go</span> <span>exec.go</span> <span>exec_posix.go</span> <span>exec_unix.go</span> <span>executable.go</span> <span>executable_procfs.go</span> <span>file.go</span> <span>file_open_unix.go</span> <span>file_posix.go</span> <span>file_unix.go</span> <span>getwd.go</span> <span>path.go</span> <span>path_unix.go</span> <span>pipe2_unix.go</span> <span>proc.go</span> <span>rawconn.go</span> <span>removeall_at.go</span> <span>stat.go</span> <span>stat_linux.go</span> <span>stat_unix.go</span> <span>sticky_notbsd.go</span> <span>sys.go</span> <span>sys_linux.go</span> <span>sys_unix.go</span> <span>tempfile.go</span> <span>types.go</span> <span>types_unix.go</span> <span>wait_waitid.go</span> <span>zero_copy_linux.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Flags to OpenFile wrapping those of the underlying system. Not all flags may be implemented on a given system. </p>
+<pre data-language="go">const (
+ // Exactly one of O_RDONLY, O_WRONLY, or O_RDWR must be specified.
+ O_RDONLY int = syscall.O_RDONLY // open the file read-only.
+ O_WRONLY int = syscall.O_WRONLY // open the file write-only.
+ O_RDWR int = syscall.O_RDWR // open the file read-write.
+ // The remaining values may be or'ed in to control behavior.
+ O_APPEND int = syscall.O_APPEND // append data to the file when writing.
+ O_CREATE int = syscall.O_CREAT // create a new file if none exists.
+ O_EXCL int = syscall.O_EXCL // used with O_CREATE, file must not exist.
+ O_SYNC int = syscall.O_SYNC // open for synchronous I/O.
+ O_TRUNC int = syscall.O_TRUNC // truncate regular writable file when opened.
+)</pre> <p>Seek whence values. </p>
+<p>Deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd. </p>
+<pre data-language="go">const (
+ SEEK_SET int = 0 // seek relative to the origin of the file
+ SEEK_CUR int = 1 // seek relative to the current offset
+ SEEK_END int = 2 // seek relative to the end
+)</pre> <pre data-language="go">const (
+ PathSeparator = '/' // OS-specific path separator
+ PathListSeparator = ':' // OS-specific path list separator
+)</pre> <p>The defined file mode bits are the most significant bits of the FileMode. The nine least-significant bits are the standard Unix rwxrwxrwx permissions. The values of these bits should be considered part of the public API and may be used in wire protocols or disk representations: they must not be changed, although new bits might be added. </p>
+<pre data-language="go">const (
+ // The single letters are the abbreviations
+ // used by the String method's formatting.
+ ModeDir = fs.ModeDir // d: is a directory
+ ModeAppend = fs.ModeAppend // a: append-only
+ ModeExclusive = fs.ModeExclusive // l: exclusive use
+ ModeTemporary = fs.ModeTemporary // T: temporary file; Plan 9 only
+ ModeSymlink = fs.ModeSymlink // L: symbolic link
+ ModeDevice = fs.ModeDevice // D: device file
+ ModeNamedPipe = fs.ModeNamedPipe // p: named pipe (FIFO)
+ ModeSocket = fs.ModeSocket // S: Unix domain socket
+ ModeSetuid = fs.ModeSetuid // u: setuid
+ ModeSetgid = fs.ModeSetgid // g: setgid
+ ModeCharDevice = fs.ModeCharDevice // c: Unix character device, when ModeDevice is set
+ ModeSticky = fs.ModeSticky // t: sticky
+ ModeIrregular = fs.ModeIrregular // ?: non-regular file; nothing else is known about this file
+
+ // Mask for the type bits. For regular files, none will be set.
+ ModeType = fs.ModeType
+
+ ModePerm = fs.ModePerm // Unix permission bits, 0o777
+)</pre> <p>DevNull is the name of the operating system's “null device.” On Unix-like systems, it is "/dev/null"; on Windows, "NUL". </p>
+<pre data-language="go">const DevNull = "/dev/null"</pre> <h2 id="pkg-variables">Variables</h2> <p>Portable analogs of some common system call errors. </p>
+<p>Errors returned from this package may be tested against these errors with errors.Is. </p>
+<pre data-language="go">var (
+ // ErrInvalid indicates an invalid argument.
+ // Methods on File will return this error when the receiver is nil.
+ ErrInvalid = fs.ErrInvalid // "invalid argument"
+
+ ErrPermission = fs.ErrPermission // "permission denied"
+ ErrExist = fs.ErrExist // "file already exists"
+ ErrNotExist = fs.ErrNotExist // "file does not exist"
+ ErrClosed = fs.ErrClosed // "file already closed"
+
+ ErrNoDeadline = errNoDeadline() // "file type does not support deadline"
+ ErrDeadlineExceeded = errDeadlineExceeded() // "i/o timeout"
+)</pre> <p>Stdin, Stdout, and Stderr are open Files pointing to the standard input, standard output, and standard error file descriptors. </p>
+<p>Note that the Go runtime writes to standard error for panics and crashes; closing Stderr may cause those messages to go elsewhere, perhaps to a file opened later. </p>
+<pre data-language="go">var (
+ Stdin = NewFile(uintptr(syscall.Stdin), "/dev/stdin")
+ Stdout = NewFile(uintptr(syscall.Stdout), "/dev/stdout")
+ Stderr = NewFile(uintptr(syscall.Stderr), "/dev/stderr")
+)</pre> <p>Args hold the command-line arguments, starting with the program name. </p>
+<pre data-language="go">var Args []string</pre> <p>ErrProcessDone indicates a Process has finished. </p>
+<pre data-language="go">var ErrProcessDone = errors.New("os: process already finished")</pre> <h2 id="Chdir">func <span>Chdir</span> </h2> <pre data-language="go">func Chdir(dir string) error</pre> <p>Chdir changes the current working directory to the named directory. If there is an error, it will be of type *PathError. </p>
+<h2 id="Chmod">func <span>Chmod</span> </h2> <pre data-language="go">func Chmod(name string, mode FileMode) error</pre> <p>Chmod changes the mode of the named file to mode. If the file is a symbolic link, it changes the mode of the link's target. If there is an error, it will be of type *PathError. </p>
+<p>A different subset of the mode bits are used, depending on the operating system. </p>
+<p>On Unix, the mode's permission bits, ModeSetuid, ModeSetgid, and ModeSticky are used. </p>
+<p>On Windows, only the 0200 bit (owner writable) of mode is used; it controls whether the file's read-only attribute is set or cleared. The other bits are currently unused. For compatibility with Go 1.12 and earlier, use a non-zero mode. Use mode 0400 for a read-only file and 0600 for a readable+writable file. </p>
+<p>On Plan 9, the mode's permission bits, ModeAppend, ModeExclusive, and ModeTemporary are used. </p> <h4 id="example_Chmod"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+if err := os.Chmod("some-filename", 0644); err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="Chown">func <span>Chown</span> </h2> <pre data-language="go">func Chown(name string, uid, gid int) error</pre> <p>Chown changes the numeric uid and gid of the named file. If the file is a symbolic link, it changes the uid and gid of the link's target. A uid or gid of -1 means to not change that value. If there is an error, it will be of type *PathError. </p>
+<p>On Windows or Plan 9, Chown always returns the syscall.EWINDOWS or EPLAN9 error, wrapped in *PathError. </p>
+<h2 id="Chtimes">func <span>Chtimes</span> </h2> <pre data-language="go">func Chtimes(name string, atime time.Time, mtime time.Time) error</pre> <p>Chtimes changes the access and modification times of the named file, similar to the Unix utime() or utimes() functions. A zero time.Time value will leave the corresponding file time unchanged. </p>
+<p>The underlying filesystem may truncate or round the values to a less precise time unit. If there is an error, it will be of type *PathError. </p> <h4 id="example_Chtimes"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+mtime := time.Date(2006, time.February, 1, 3, 4, 5, 0, time.UTC)
+atime := time.Date(2007, time.March, 2, 4, 5, 6, 0, time.UTC)
+if err := os.Chtimes("some-filename", atime, mtime); err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="Clearenv">func <span>Clearenv</span> </h2> <pre data-language="go">func Clearenv()</pre> <p>Clearenv deletes all environment variables. </p>
+<h2 id="DirFS">func <span>DirFS</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func DirFS(dir string) fs.FS</pre> <p>DirFS returns a file system (an fs.FS) for the tree of files rooted at the directory dir. </p>
+<p>Note that DirFS("/prefix") only guarantees that the Open calls it makes to the operating system will begin with "/prefix": DirFS("/prefix").Open("file") is the same as os.Open("/prefix/file"). So if /prefix/file is a symbolic link pointing outside the /prefix tree, then using DirFS does not stop the access any more than using os.Open does. Additionally, the root of the fs.FS returned for a relative path, DirFS("prefix"), will be affected by later calls to Chdir. DirFS is therefore not a general substitute for a chroot-style security mechanism when the directory tree contains arbitrary content. </p>
+<p>The directory dir must not be "". </p>
+<p>The result implements <span>io/fs.StatFS</span>, <span>io/fs.ReadFileFS</span> and <span>io/fs.ReadDirFS</span>. </p>
+<h2 id="Environ">func <span>Environ</span> </h2> <pre data-language="go">func Environ() []string</pre> <p>Environ returns a copy of strings representing the environment, in the form "key=value". </p>
+<h2 id="Executable">func <span>Executable</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func Executable() (string, error)</pre> <p>Executable returns the path name for the executable that started the current process. There is no guarantee that the path is still pointing to the correct executable. If a symlink was used to start the process, depending on the operating system, the result might be the symlink or the path it pointed to. If a stable result is needed, path/filepath.EvalSymlinks might help. </p>
+<p>Executable returns an absolute path unless an error occurred. </p>
+<p>The main use case is finding resources located relative to an executable. </p>
+<h2 id="Exit">func <span>Exit</span> </h2> <pre data-language="go">func Exit(code int)</pre> <p>Exit causes the current program to exit with the given status code. Conventionally, code zero indicates success, non-zero an error. The program terminates immediately; deferred functions are not run. </p>
+<p>For portability, the status code should be in the range [0, 125]. </p>
+<h2 id="Expand">func <span>Expand</span> </h2> <pre data-language="go">func Expand(s string, mapping func(string) string) string</pre> <p>Expand replaces ${var} or $var in the string based on the mapping function. For example, os.ExpandEnv(s) is equivalent to os.Expand(s, os.Getenv). </p> <h4 id="example_Expand"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">mapper := func(placeholderName string) string {
+ switch placeholderName {
+ case "DAY_PART":
+ return "morning"
+ case "NAME":
+ return "Gopher"
+ }
+
+ return ""
+}
+
+fmt.Println(os.Expand("Good ${DAY_PART}, $NAME!", mapper))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Good morning, Gopher!
+</pre> <h2 id="ExpandEnv">func <span>ExpandEnv</span> </h2> <pre data-language="go">func ExpandEnv(s string) string</pre> <p>ExpandEnv replaces ${var} or $var in the string according to the values of the current environment variables. References to undefined variables are replaced by the empty string. </p> <h4 id="example_ExpandEnv"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">os.Setenv("NAME", "gopher")
+os.Setenv("BURROW", "/usr/gopher")
+
+fmt.Println(os.ExpandEnv("$NAME lives in ${BURROW}."))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">gopher lives in /usr/gopher.
+</pre> <h2 id="Getegid">func <span>Getegid</span> </h2> <pre data-language="go">func Getegid() int</pre> <p>Getegid returns the numeric effective group id of the caller. </p>
+<p>On Windows, it returns -1. </p>
+<h2 id="Getenv">func <span>Getenv</span> </h2> <pre data-language="go">func Getenv(key string) string</pre> <p>Getenv retrieves the value of the environment variable named by the key. It returns the value, which will be empty if the variable is not present. To distinguish between an empty value and an unset value, use LookupEnv. </p> <h4 id="example_Getenv"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">os.Setenv("NAME", "gopher")
+os.Setenv("BURROW", "/usr/gopher")
+
+fmt.Printf("%s lives in %s.\n", os.Getenv("NAME"), os.Getenv("BURROW"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">gopher lives in /usr/gopher.
+</pre> <h2 id="Geteuid">func <span>Geteuid</span> </h2> <pre data-language="go">func Geteuid() int</pre> <p>Geteuid returns the numeric effective user id of the caller. </p>
+<p>On Windows, it returns -1. </p>
+<h2 id="Getgid">func <span>Getgid</span> </h2> <pre data-language="go">func Getgid() int</pre> <p>Getgid returns the numeric group id of the caller. </p>
+<p>On Windows, it returns -1. </p>
+<h2 id="Getgroups">func <span>Getgroups</span> </h2> <pre data-language="go">func Getgroups() ([]int, error)</pre> <p>Getgroups returns a list of the numeric ids of groups that the caller belongs to. </p>
+<p>On Windows, it returns syscall.EWINDOWS. See the os/user package for a possible alternative. </p>
+<h2 id="Getpagesize">func <span>Getpagesize</span> </h2> <pre data-language="go">func Getpagesize() int</pre> <p>Getpagesize returns the underlying system's memory page size. </p>
+<h2 id="Getpid">func <span>Getpid</span> </h2> <pre data-language="go">func Getpid() int</pre> <p>Getpid returns the process id of the caller. </p>
+<h2 id="Getppid">func <span>Getppid</span> </h2> <pre data-language="go">func Getppid() int</pre> <p>Getppid returns the process id of the caller's parent. </p>
+<h2 id="Getuid">func <span>Getuid</span> </h2> <pre data-language="go">func Getuid() int</pre> <p>Getuid returns the numeric user id of the caller. </p>
+<p>On Windows, it returns -1. </p>
+<h2 id="Getwd">func <span>Getwd</span> </h2> <pre data-language="go">func Getwd() (dir string, err error)</pre> <p>Getwd returns a rooted path name corresponding to the current directory. If the current directory can be reached via multiple paths (due to symbolic links), Getwd may return any one of them. </p>
+<h2 id="Hostname">func <span>Hostname</span> </h2> <pre data-language="go">func Hostname() (name string, err error)</pre> <p>Hostname returns the host name reported by the kernel. </p>
+<h2 id="IsExist">func <span>IsExist</span> </h2> <pre data-language="go">func IsExist(err error) bool</pre> <p>IsExist returns a boolean indicating whether the error is known to report that a file or directory already exists. It is satisfied by ErrExist as well as some syscall errors. </p>
+<p>This function predates errors.Is. It only supports errors returned by the os package. New code should use errors.Is(err, fs.ErrExist). </p>
+<h2 id="IsNotExist">func <span>IsNotExist</span> </h2> <pre data-language="go">func IsNotExist(err error) bool</pre> <p>IsNotExist returns a boolean indicating whether the error is known to report that a file or directory does not exist. It is satisfied by ErrNotExist as well as some syscall errors. </p>
+<p>This function predates errors.Is. It only supports errors returned by the os package. New code should use errors.Is(err, fs.ErrNotExist). </p>
+<h2 id="IsPathSeparator">func <span>IsPathSeparator</span> </h2> <pre data-language="go">func IsPathSeparator(c uint8) bool</pre> <p>IsPathSeparator reports whether c is a directory separator character. </p>
+<h2 id="IsPermission">func <span>IsPermission</span> </h2> <pre data-language="go">func IsPermission(err error) bool</pre> <p>IsPermission returns a boolean indicating whether the error is known to report that permission is denied. It is satisfied by ErrPermission as well as some syscall errors. </p>
+<p>This function predates errors.Is. It only supports errors returned by the os package. New code should use errors.Is(err, fs.ErrPermission). </p>
+<h2 id="IsTimeout">func <span>IsTimeout</span> <span title="Added in Go 1.10">1.10</span> </h2> <pre data-language="go">func IsTimeout(err error) bool</pre> <p>IsTimeout returns a boolean indicating whether the error is known to report that a timeout occurred. </p>
+<p>This function predates errors.Is, and the notion of whether an error indicates a timeout can be ambiguous. For example, the Unix error EWOULDBLOCK sometimes indicates a timeout and sometimes does not. New code should use errors.Is with a value appropriate to the call returning the error, such as os.ErrDeadlineExceeded. </p>
+<h2 id="Lchown">func <span>Lchown</span> </h2> <pre data-language="go">func Lchown(name string, uid, gid int) error</pre> <p>Lchown changes the numeric uid and gid of the named file. If the file is a symbolic link, it changes the uid and gid of the link itself. If there is an error, it will be of type *PathError. </p>
+<p>On Windows, it always returns the syscall.EWINDOWS error, wrapped in *PathError. </p>
+<h2 id="Link">func <span>Link</span> </h2> <pre data-language="go">func Link(oldname, newname string) error</pre> <p>Link creates newname as a hard link to the oldname file. If there is an error, it will be of type *LinkError. </p>
+<h2 id="LookupEnv">func <span>LookupEnv</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func LookupEnv(key string) (string, bool)</pre> <p>LookupEnv retrieves the value of the environment variable named by the key. If the variable is present in the environment the value (which may be empty) is returned and the boolean is true. Otherwise the returned value will be empty and the boolean will be false. </p> <h4 id="example_LookupEnv"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">show := func(key string) {
+ val, ok := os.LookupEnv(key)
+ if !ok {
+ fmt.Printf("%s not set\n", key)
+ } else {
+ fmt.Printf("%s=%s\n", key, val)
+ }
+}
+
+os.Setenv("SOME_KEY", "value")
+os.Setenv("EMPTY_KEY", "")
+
+show("SOME_KEY")
+show("EMPTY_KEY")
+show("MISSING_KEY")
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">SOME_KEY=value
+EMPTY_KEY=
+MISSING_KEY not set
+</pre> <h2 id="Mkdir">func <span>Mkdir</span> </h2> <pre data-language="go">func Mkdir(name string, perm FileMode) error</pre> <p>Mkdir creates a new directory with the specified name and permission bits (before umask). If there is an error, it will be of type *PathError. </p> <h4 id="example_Mkdir"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+err := os.Mkdir("testdir", 0750)
+if err != nil &amp;&amp; !os.IsExist(err) {
+ log.Fatal(err)
+}
+err = os.WriteFile("testdir/testfile.txt", []byte("Hello, Gophers!"), 0660)
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="MkdirAll">func <span>MkdirAll</span> </h2> <pre data-language="go">func MkdirAll(path string, perm FileMode) error</pre> <p>MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm (before umask) are used for all directories that MkdirAll creates. If path is already a directory, MkdirAll does nothing and returns nil. </p> <h4 id="example_MkdirAll"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+err := os.MkdirAll("test/subdir", 0750)
+if err != nil {
+ log.Fatal(err)
+}
+err = os.WriteFile("test/subdir/testfile.txt", []byte("Hello, Gophers!"), 0660)
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="MkdirTemp">func <span>MkdirTemp</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func MkdirTemp(dir, pattern string) (string, error)</pre> <p>MkdirTemp creates a new temporary directory in the directory dir and returns the pathname of the new directory. The new directory's name is generated by adding a random string to the end of pattern. If pattern includes a "*", the random string replaces the last "*" instead. If dir is the empty string, MkdirTemp uses the default directory for temporary files, as returned by TempDir. Multiple programs or goroutines calling MkdirTemp simultaneously will not choose the same directory. It is the caller's responsibility to remove the directory when it is no longer needed. </p> <h4 id="example_MkdirTemp"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+dir, err := os.MkdirTemp("", "example")
+if err != nil {
+ log.Fatal(err)
+}
+defer os.RemoveAll(dir) // clean up
+
+file := filepath.Join(dir, "tmpfile")
+if err := os.WriteFile(file, []byte("content"), 0666); err != nil {
+ log.Fatal(err)
+}
+</pre> <h4 id="example_MkdirTemp_suffix"> <span class="text">Example (Suffix)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+logsDir, err := os.MkdirTemp("", "*-logs")
+if err != nil {
+ log.Fatal(err)
+}
+defer os.RemoveAll(logsDir) // clean up
+
+// Logs can be cleaned out earlier if needed by searching
+// for all directories whose suffix ends in *-logs.
+globPattern := filepath.Join(os.TempDir(), "*-logs")
+matches, err := filepath.Glob(globPattern)
+if err != nil {
+ log.Fatalf("Failed to match %q: %v", globPattern, err)
+}
+
+for _, match := range matches {
+ if err := os.RemoveAll(match); err != nil {
+ log.Printf("Failed to remove %q: %v", match, err)
+ }
+}
+</pre> <h2 id="NewSyscallError">func <span>NewSyscallError</span> </h2> <pre data-language="go">func NewSyscallError(syscall string, err error) error</pre> <p>NewSyscallError returns, as an error, a new SyscallError with the given system call name and error details. As a convenience, if err is nil, NewSyscallError returns nil. </p>
+<h2 id="Pipe">func <span>Pipe</span> </h2> <pre data-language="go">func Pipe() (r *File, w *File, err error)</pre> <p>Pipe returns a connected pair of Files; reads from r return bytes written to w. It returns the files and an error, if any. </p>
+<h2 id="ReadFile">func <span>ReadFile</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func ReadFile(name string) ([]byte, error)</pre> <p>ReadFile reads the named file and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads the whole file, it does not treat an EOF from Read as an error to be reported. </p> <h4 id="example_ReadFile"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">data, err := os.ReadFile("testdata/hello")
+if err != nil {
+ log.Fatal(err)
+}
+os.Stdout.Write(data)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, Gophers!
+</pre> <h2 id="Readlink">func <span>Readlink</span> </h2> <pre data-language="go">func Readlink(name string) (string, error)</pre> <p>Readlink returns the destination of the named symbolic link. If there is an error, it will be of type *PathError. </p>
+<p>If the link destination is relative, Readlink returns the relative path without resolving it to an absolute one. </p> <h4 id="example_Readlink"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// First, we create a relative symlink to a file.
+d, err := os.MkdirTemp("", "")
+if err != nil {
+ log.Fatal(err)
+}
+defer os.RemoveAll(d)
+targetPath := filepath.Join(d, "hello.txt")
+if err := os.WriteFile(targetPath, []byte("Hello, Gophers!"), 0644); err != nil {
+ log.Fatal(err)
+}
+linkPath := filepath.Join(d, "hello.link")
+if err := os.Symlink("hello.txt", filepath.Join(d, "hello.link")); err != nil {
+ if errors.Is(err, errors.ErrUnsupported) {
+ // Allow the example to run on platforms that do not support symbolic links.
+ fmt.Printf("%s links to %s\n", filepath.Base(linkPath), "hello.txt")
+ return
+ }
+ log.Fatal(err)
+}
+
+// Readlink returns the relative path as passed to os.Symlink.
+dst, err := os.Readlink(linkPath)
+if err != nil {
+ log.Fatal(err)
+}
+fmt.Printf("%s links to %s\n", filepath.Base(linkPath), dst)
+
+var dstAbs string
+if filepath.IsAbs(dst) {
+ dstAbs = dst
+} else {
+ // Symlink targets are relative to the directory containing the link.
+ dstAbs = filepath.Join(filepath.Dir(linkPath), dst)
+}
+
+// Check that the target is correct by comparing it with os.Stat
+// on the original target path.
+dstInfo, err := os.Stat(dstAbs)
+if err != nil {
+ log.Fatal(err)
+}
+targetInfo, err := os.Stat(targetPath)
+if err != nil {
+ log.Fatal(err)
+}
+if !os.SameFile(dstInfo, targetInfo) {
+ log.Fatalf("link destination (%s) is not the same file as %s", dstAbs, targetPath)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">hello.link links to hello.txt
+</pre> <h2 id="Remove">func <span>Remove</span> </h2> <pre data-language="go">func Remove(name string) error</pre> <p>Remove removes the named file or (empty) directory. If there is an error, it will be of type *PathError. </p>
+<h2 id="RemoveAll">func <span>RemoveAll</span> </h2> <pre data-language="go">func RemoveAll(path string) error</pre> <p>RemoveAll removes path and any children it contains. It removes everything it can but returns the first error it encounters. If the path does not exist, RemoveAll returns nil (no error). If there is an error, it will be of type *PathError. </p>
+<h2 id="Rename">func <span>Rename</span> </h2> <pre data-language="go">func Rename(oldpath, newpath string) error</pre> <p>Rename renames (moves) oldpath to newpath. If newpath already exists and is not a directory, Rename replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories. Even within the same directory, on non-Unix platforms Rename is not an atomic operation. If there is an error, it will be of type *LinkError. </p>
+<h2 id="SameFile">func <span>SameFile</span> </h2> <pre data-language="go">func SameFile(fi1, fi2 FileInfo) bool</pre> <p>SameFile reports whether fi1 and fi2 describe the same file. For example, on Unix this means that the device and inode fields of the two underlying structures are identical; on other systems the decision may be based on the path names. SameFile only applies to results returned by this package's Stat. It returns false in other cases. </p>
+<h2 id="Setenv">func <span>Setenv</span> </h2> <pre data-language="go">func Setenv(key, value string) error</pre> <p>Setenv sets the value of the environment variable named by the key. It returns an error, if any. </p>
+<h2 id="Symlink">func <span>Symlink</span> </h2> <pre data-language="go">func Symlink(oldname, newname string) error</pre> <p>Symlink creates newname as a symbolic link to oldname. On Windows, a symlink to a non-existent oldname creates a file symlink; if oldname is later created as a directory the symlink will not work. If there is an error, it will be of type *LinkError. </p>
+<h2 id="TempDir">func <span>TempDir</span> </h2> <pre data-language="go">func TempDir() string</pre> <p>TempDir returns the default directory to use for temporary files. </p>
+<p>On Unix systems, it returns $TMPDIR if non-empty, else /tmp. On Windows, it uses GetTempPath, returning the first non-empty value from %TMP%, %TEMP%, %USERPROFILE%, or the Windows directory. On Plan 9, it returns /tmp. </p>
+<p>The directory is neither guaranteed to exist nor have accessible permissions. </p>
+<h2 id="Truncate">func <span>Truncate</span> </h2> <pre data-language="go">func Truncate(name string, size int64) error</pre> <p>Truncate changes the size of the named file. If the file is a symbolic link, it changes the size of the link's target. If there is an error, it will be of type *PathError. </p>
+<h2 id="Unsetenv">func <span>Unsetenv</span> <span title="Added in Go 1.4">1.4</span> </h2> <pre data-language="go">func Unsetenv(key string) error</pre> <p>Unsetenv unsets a single environment variable. </p> <h4 id="example_Unsetenv"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+os.Setenv("TMPDIR", "/my/tmp")
+defer os.Unsetenv("TMPDIR")
+</pre> <h2 id="UserCacheDir">func <span>UserCacheDir</span> <span title="Added in Go 1.11">1.11</span> </h2> <pre data-language="go">func UserCacheDir() (string, error)</pre> <p>UserCacheDir returns the default root directory to use for user-specific cached data. Users should create their own application-specific subdirectory within this one and use that. </p>
+<p>On Unix systems, it returns $XDG_CACHE_HOME as specified by <a href="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html">https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html</a> if non-empty, else $HOME/.cache. On Darwin, it returns $HOME/Library/Caches. On Windows, it returns %LocalAppData%. On Plan 9, it returns $home/lib/cache. </p>
+<p>If the location cannot be determined (for example, $HOME is not defined), then it will return an error. </p> <h4 id="example_UserCacheDir"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">dir, dirErr := os.UserCacheDir()
+if dirErr == nil {
+ dir = filepath.Join(dir, "ExampleUserCacheDir")
+}
+
+getCache := func(name string) ([]byte, error) {
+ if dirErr != nil {
+ return nil, &amp;os.PathError{Op: "getCache", Path: name, Err: os.ErrNotExist}
+ }
+ return os.ReadFile(filepath.Join(dir, name))
+}
+
+var mkdirOnce sync.Once
+putCache := func(name string, b []byte) error {
+ if dirErr != nil {
+ return &amp;os.PathError{Op: "putCache", Path: name, Err: dirErr}
+ }
+ mkdirOnce.Do(func() {
+ if err := os.MkdirAll(dir, 0700); err != nil {
+ log.Printf("can't create user cache dir: %v", err)
+ }
+ })
+ return os.WriteFile(filepath.Join(dir, name), b, 0600)
+}
+
+// Read and store cached data.
+// …
+_ = getCache
+_ = putCache
+
+</pre> <h2 id="UserConfigDir">func <span>UserConfigDir</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func UserConfigDir() (string, error)</pre> <p>UserConfigDir returns the default root directory to use for user-specific configuration data. Users should create their own application-specific subdirectory within this one and use that. </p>
+<p>On Unix systems, it returns $XDG_CONFIG_HOME as specified by <a href="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html">https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html</a> if non-empty, else $HOME/.config. On Darwin, it returns $HOME/Library/Application Support. On Windows, it returns %AppData%. On Plan 9, it returns $home/lib. </p>
+<p>If the location cannot be determined (for example, $HOME is not defined), then it will return an error. </p> <h4 id="example_UserConfigDir"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">dir, dirErr := os.UserConfigDir()
+
+var (
+ configPath string
+ origConfig []byte
+)
+if dirErr == nil {
+ configPath = filepath.Join(dir, "ExampleUserConfigDir", "example.conf")
+ var err error
+ origConfig, err = os.ReadFile(configPath)
+ if err != nil &amp;&amp; !os.IsNotExist(err) {
+ // The user has a config file but we couldn't read it.
+ // Report the error instead of ignoring their configuration.
+ log.Fatal(err)
+ }
+}
+
+// Use and perhaps make changes to the config.
+config := bytes.Clone(origConfig)
+// …
+
+// Save changes.
+if !bytes.Equal(config, origConfig) {
+ if configPath == "" {
+ log.Printf("not saving config changes: %v", dirErr)
+ } else {
+ err := os.MkdirAll(filepath.Dir(configPath), 0700)
+ if err == nil {
+ err = os.WriteFile(configPath, config, 0600)
+ }
+ if err != nil {
+ log.Printf("error saving config changes: %v", err)
+ }
+ }
+}
+
+</pre> <h2 id="UserHomeDir">func <span>UserHomeDir</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func UserHomeDir() (string, error)</pre> <p>UserHomeDir returns the current user's home directory. </p>
+<p>On Unix, including macOS, it returns the $HOME environment variable. On Windows, it returns %USERPROFILE%. On Plan 9, it returns the $home environment variable. </p>
+<p>If the expected variable is not set in the environment, UserHomeDir returns either a platform-specific default value or a non-nil error. </p>
+<h2 id="WriteFile">func <span>WriteFile</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func WriteFile(name string, data []byte, perm FileMode) error</pre> <p>WriteFile writes data to the named file, creating it if necessary. If the file does not exist, WriteFile creates it with permissions perm (before umask); otherwise WriteFile truncates it before writing, without changing permissions. Since WriteFile requires multiple system calls to complete, a failure mid-operation can leave the file in a partially written state. </p> <h4 id="example_WriteFile"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+err := os.WriteFile("testdata/hello", []byte("Hello, Gophers!"), 0666)
+if err != nil {
+ log.Fatal(err)
+}
+</pre> <h2 id="DirEntry">type <span>DirEntry</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A DirEntry is an entry read from a directory (using the ReadDir function or a File's ReadDir method). </p>
+<pre data-language="go">type DirEntry = fs.DirEntry</pre> <h3 id="ReadDir">func <span>ReadDir</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func ReadDir(name string) ([]DirEntry, error)</pre> <p>ReadDir reads the named directory, returning all its directory entries sorted by filename. If an error occurs reading the directory, ReadDir returns the entries it was able to read before the error, along with the error. </p> <h4 id="example_ReadDir"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+files, err := os.ReadDir(".")
+if err != nil {
+ log.Fatal(err)
+}
+
+for _, file := range files {
+ fmt.Println(file.Name())
+}
+</pre> <h2 id="File">type <span>File</span> </h2> <p>File represents an open file descriptor. </p>
+<pre data-language="go">type File struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Create">func <span>Create</span> </h3> <pre data-language="go">func Create(name string) (*File, error)</pre> <p>Create creates or truncates the named file. If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask). If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. If there is an error, it will be of type *PathError. </p>
+<h3 id="CreateTemp">func <span>CreateTemp</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func CreateTemp(dir, pattern string) (*File, error)</pre> <p>CreateTemp creates a new temporary file in the directory dir, opens the file for reading and writing, and returns the resulting file. The filename is generated by taking pattern and adding a random string to the end. If pattern includes a "*", the random string replaces the last "*". If dir is the empty string, CreateTemp uses the default directory for temporary files, as returned by TempDir. Multiple programs or goroutines calling CreateTemp simultaneously will not choose the same file. The caller can use the file's Name method to find the pathname of the file. It is the caller's responsibility to remove the file when it is no longer needed. </p> <h4 id="example_CreateTemp"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+f, err := os.CreateTemp("", "example")
+if err != nil {
+ log.Fatal(err)
+}
+defer os.Remove(f.Name()) // clean up
+
+if _, err := f.Write([]byte("content")); err != nil {
+ log.Fatal(err)
+}
+if err := f.Close(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h4 id="example_CreateTemp_suffix"> <span class="text">Example (Suffix)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+f, err := os.CreateTemp("", "example.*.txt")
+if err != nil {
+ log.Fatal(err)
+}
+defer os.Remove(f.Name()) // clean up
+
+if _, err := f.Write([]byte("content")); err != nil {
+ f.Close()
+ log.Fatal(err)
+}
+if err := f.Close(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="NewFile">func <span>NewFile</span> </h3> <pre data-language="go">func NewFile(fd uintptr, name string) *File</pre> <p>NewFile returns a new File with the given file descriptor and name. The returned value will be nil if fd is not a valid file descriptor. On Unix systems, if the file descriptor is in non-blocking mode, NewFile will attempt to return a pollable File (one for which the SetDeadline methods work). </p>
+<p>After passing it to NewFile, fd may become invalid under the same conditions described in the comments of the Fd method, and the same constraints apply. </p>
+<h3 id="Open">func <span>Open</span> </h3> <pre data-language="go">func Open(name string) (*File, error)</pre> <p>Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError. </p>
+<h3 id="OpenFile">func <span>OpenFile</span> </h3> <pre data-language="go">func OpenFile(name string, flag int, perm FileMode) (*File, error)</pre> <p>OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.). If the file does not exist, and the O_CREATE flag is passed, it is created with mode perm (before umask). If successful, methods on the returned File can be used for I/O. If there is an error, it will be of type *PathError. </p> <h4 id="example_OpenFile"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+f, err := os.OpenFile("notes.txt", os.O_RDWR|os.O_CREATE, 0644)
+if err != nil {
+ log.Fatal(err)
+}
+if err := f.Close(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h4 id="example_OpenFile_append"> <span class="text">Example (Append)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// If the file doesn't exist, create it, or append to the file
+f, err := os.OpenFile("access.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
+if err != nil {
+ log.Fatal(err)
+}
+if _, err := f.Write([]byte("appended some data\n")); err != nil {
+ f.Close() // ignore error; Write error takes precedence
+ log.Fatal(err)
+}
+if err := f.Close(); err != nil {
+ log.Fatal(err)
+}
+</pre> <h3 id="File.Chdir">func (*File) <span>Chdir</span> </h3> <pre data-language="go">func (f *File) Chdir() error</pre> <p>Chdir changes the current working directory to the file, which must be a directory. If there is an error, it will be of type *PathError. </p>
+<h3 id="File.Chmod">func (*File) <span>Chmod</span> </h3> <pre data-language="go">func (f *File) Chmod(mode FileMode) error</pre> <p>Chmod changes the mode of the file to mode. If there is an error, it will be of type *PathError. </p>
+<h3 id="File.Chown">func (*File) <span>Chown</span> </h3> <pre data-language="go">func (f *File) Chown(uid, gid int) error</pre> <p>Chown changes the numeric uid and gid of the named file. If there is an error, it will be of type *PathError. </p>
+<p>On Windows, it always returns the syscall.EWINDOWS error, wrapped in *PathError. </p>
+<h3 id="File.Close">func (*File) <span>Close</span> </h3> <pre data-language="go">func (f *File) Close() error</pre> <p>Close closes the File, rendering it unusable for I/O. On files that support SetDeadline, any pending I/O operations will be canceled and return immediately with an ErrClosed error. Close will return an error if it has already been called. </p>
+<h3 id="File.Fd">func (*File) <span>Fd</span> </h3> <pre data-language="go">func (f *File) Fd() uintptr</pre> <p>Fd returns the integer Unix file descriptor referencing the open file. If f is closed, the file descriptor becomes invalid. If f is garbage collected, a finalizer may close the file descriptor, making it invalid; see runtime.SetFinalizer for more information on when a finalizer might be run. On Unix systems this will cause the SetDeadline methods to stop working. Because file descriptors can be reused, the returned file descriptor may only be closed through the Close method of f, or by its finalizer during garbage collection. Otherwise, during garbage collection the finalizer may close an unrelated file descriptor with the same (reused) number. </p>
+<p>As an alternative, see the f.SyscallConn method. </p>
+<h3 id="File.Name">func (*File) <span>Name</span> </h3> <pre data-language="go">func (f *File) Name() string</pre> <p>Name returns the name of the file as presented to Open. </p>
+<h3 id="File.Read">func (*File) <span>Read</span> </h3> <pre data-language="go">func (f *File) Read(b []byte) (n int, err error)</pre> <p>Read reads up to len(b) bytes from the File and stores them in b. It returns the number of bytes read and any error encountered. At end of file, Read returns 0, io.EOF. </p>
+<h3 id="File.ReadAt">func (*File) <span>ReadAt</span> </h3> <pre data-language="go">func (f *File) ReadAt(b []byte, off int64) (n int, err error)</pre> <p>ReadAt reads len(b) bytes from the File starting at byte offset off. It returns the number of bytes read and the error, if any. ReadAt always returns a non-nil error when n &lt; len(b). At end of file, that error is io.EOF. </p>
+<h3 id="File.ReadDir">func (*File) <span>ReadDir</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (f *File) ReadDir(n int) ([]DirEntry, error)</pre> <p>ReadDir reads the contents of the directory associated with the file f and returns a slice of DirEntry values in directory order. Subsequent calls on the same file will yield later DirEntry records in the directory. </p>
+<p>If n &gt; 0, ReadDir returns at most n DirEntry records. In this case, if ReadDir returns an empty slice, it will return an error explaining why. At the end of a directory, the error is io.EOF. </p>
+<p>If n &lt;= 0, ReadDir returns all the DirEntry records remaining in the directory. When it succeeds, it returns a nil error (not io.EOF). </p>
+<h3 id="File.ReadFrom">func (*File) <span>ReadFrom</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (f *File) ReadFrom(r io.Reader) (n int64, err error)</pre> <p>ReadFrom implements io.ReaderFrom. </p>
+<h3 id="File.Readdir">func (*File) <span>Readdir</span> </h3> <pre data-language="go">func (f *File) Readdir(n int) ([]FileInfo, error)</pre> <p>Readdir reads the contents of the directory associated with file and returns a slice of up to n FileInfo values, as would be returned by Lstat, in directory order. Subsequent calls on the same file will yield further FileInfos. </p>
+<p>If n &gt; 0, Readdir returns at most n FileInfo structures. In this case, if Readdir returns an empty slice, it will return a non-nil error explaining why. At the end of a directory, the error is io.EOF. </p>
+<p>If n &lt;= 0, Readdir returns all the FileInfo from the directory in a single slice. In this case, if Readdir succeeds (reads all the way to the end of the directory), it returns the slice and a nil error. If it encounters an error before the end of the directory, Readdir returns the FileInfo read until that point and a non-nil error. </p>
+<p>Most clients are better served by the more efficient ReadDir method. </p>
+<h3 id="File.Readdirnames">func (*File) <span>Readdirnames</span> </h3> <pre data-language="go">func (f *File) Readdirnames(n int) (names []string, err error)</pre> <p>Readdirnames reads the contents of the directory associated with file and returns a slice of up to n names of files in the directory, in directory order. Subsequent calls on the same file will yield further names. </p>
+<p>If n &gt; 0, Readdirnames returns at most n names. In this case, if Readdirnames returns an empty slice, it will return a non-nil error explaining why. At the end of a directory, the error is io.EOF. </p>
+<p>If n &lt;= 0, Readdirnames returns all the names from the directory in a single slice. In this case, if Readdirnames succeeds (reads all the way to the end of the directory), it returns the slice and a nil error. If it encounters an error before the end of the directory, Readdirnames returns the names read until that point and a non-nil error. </p>
+<h3 id="File.Seek">func (*File) <span>Seek</span> </h3> <pre data-language="go">func (f *File) Seek(offset int64, whence int) (ret int64, err error)</pre> <p>Seek sets the offset for the next Read or Write on file to offset, interpreted according to whence: 0 means relative to the origin of the file, 1 means relative to the current offset, and 2 means relative to the end. It returns the new offset and an error, if any. The behavior of Seek on a file opened with O_APPEND is not specified. </p>
+<h3 id="File.SetDeadline">func (*File) <span>SetDeadline</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (f *File) SetDeadline(t time.Time) error</pre> <p>SetDeadline sets the read and write deadlines for a File. It is equivalent to calling both SetReadDeadline and SetWriteDeadline. </p>
+<p>Only some kinds of files support setting a deadline. Calls to SetDeadline for files that do not support deadlines will return ErrNoDeadline. On most systems ordinary files do not support deadlines, but pipes do. </p>
+<p>A deadline is an absolute time after which I/O operations fail with an error instead of blocking. The deadline applies to all future and pending I/O, not just the immediately following call to Read or Write. After a deadline has been exceeded, the connection can be refreshed by setting a deadline in the future. </p>
+<p>If the deadline is exceeded a call to Read or Write or to other I/O methods will return an error that wraps ErrDeadlineExceeded. This can be tested using errors.Is(err, os.ErrDeadlineExceeded). That error implements the Timeout method, and calling the Timeout method will return true, but there are other possible errors for which the Timeout will return true even if the deadline has not been exceeded. </p>
+<p>An idle timeout can be implemented by repeatedly extending the deadline after successful Read or Write calls. </p>
+<p>A zero value for t means I/O operations will not time out. </p>
+<h3 id="File.SetReadDeadline">func (*File) <span>SetReadDeadline</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (f *File) SetReadDeadline(t time.Time) error</pre> <p>SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call. A zero value for t means Read will not time out. Not all files support setting deadlines; see SetDeadline. </p>
+<h3 id="File.SetWriteDeadline">func (*File) <span>SetWriteDeadline</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (f *File) SetWriteDeadline(t time.Time) error</pre> <p>SetWriteDeadline sets the deadline for any future Write calls and any currently-blocked Write call. Even if Write times out, it may return n &gt; 0, indicating that some of the data was successfully written. A zero value for t means Write will not time out. Not all files support setting deadlines; see SetDeadline. </p>
+<h3 id="File.Stat">func (*File) <span>Stat</span> </h3> <pre data-language="go">func (f *File) Stat() (FileInfo, error)</pre> <p>Stat returns the FileInfo structure describing file. If there is an error, it will be of type *PathError. </p>
+<h3 id="File.Sync">func (*File) <span>Sync</span> </h3> <pre data-language="go">func (f *File) Sync() error</pre> <p>Sync commits the current contents of the file to stable storage. Typically, this means flushing the file system's in-memory copy of recently written data to disk. </p>
+<h3 id="File.SyscallConn">func (*File) <span>SyscallConn</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (f *File) SyscallConn() (syscall.RawConn, error)</pre> <p>SyscallConn returns a raw file. This implements the syscall.Conn interface. </p>
+<h3 id="File.Truncate">func (*File) <span>Truncate</span> </h3> <pre data-language="go">func (f *File) Truncate(size int64) error</pre> <p>Truncate changes the size of the file. It does not change the I/O offset. If there is an error, it will be of type *PathError. </p>
+<h3 id="File.Write">func (*File) <span>Write</span> </h3> <pre data-language="go">func (f *File) Write(b []byte) (n int, err error)</pre> <p>Write writes len(b) bytes from b to the File. It returns the number of bytes written and an error, if any. Write returns a non-nil error when n != len(b). </p>
+<h3 id="File.WriteAt">func (*File) <span>WriteAt</span> </h3> <pre data-language="go">func (f *File) WriteAt(b []byte, off int64) (n int, err error)</pre> <p>WriteAt writes len(b) bytes to the File starting at byte offset off. It returns the number of bytes written and an error, if any. WriteAt returns a non-nil error when n != len(b). </p>
+<p>If file was opened with the O_APPEND flag, WriteAt returns an error. </p>
+<h3 id="File.WriteString">func (*File) <span>WriteString</span> </h3> <pre data-language="go">func (f *File) WriteString(s string) (n int, err error)</pre> <p>WriteString is like Write, but writes the contents of string s rather than a slice of bytes. </p>
+<h3 id="File.WriteTo">func (*File) <span>WriteTo</span> <span title="Added in Go 1.22">1.22</span> </h3> <pre data-language="go">func (f *File) WriteTo(w io.Writer) (n int64, err error)</pre> <p>WriteTo implements io.WriterTo. </p>
+<h2 id="FileInfo">type <span>FileInfo</span> </h2> <p>A FileInfo describes a file and is returned by Stat and Lstat. </p>
+<pre data-language="go">type FileInfo = fs.FileInfo</pre> <h3 id="Lstat">func <span>Lstat</span> </h3> <pre data-language="go">func Lstat(name string) (FileInfo, error)</pre> <p>Lstat returns a FileInfo describing the named file. If the file is a symbolic link, the returned FileInfo describes the symbolic link. Lstat makes no attempt to follow the link. If there is an error, it will be of type *PathError. </p>
+<p>On Windows, if the file is a reparse point that is a surrogate for another named entity (such as a symbolic link or mounted folder), the returned FileInfo describes the reparse point, and makes no attempt to resolve it. </p>
+<h3 id="Stat">func <span>Stat</span> </h3> <pre data-language="go">func Stat(name string) (FileInfo, error)</pre> <p>Stat returns a FileInfo describing the named file. If there is an error, it will be of type *PathError. </p>
+<h2 id="FileMode">type <span>FileMode</span> </h2> <p>A FileMode represents a file's mode and permission bits. The bits have the same definition on all systems, so that information about files can be moved from one system to another portably. Not all bits apply to all systems. The only required bit is ModeDir for directories. </p>
+<pre data-language="go">type FileMode = fs.FileMode</pre> <h4 id="example_FileMode"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+fi, err := os.Lstat("some-filename")
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Printf("permissions: %#o\n", fi.Mode().Perm()) // 0400, 0777, etc.
+switch mode := fi.Mode(); {
+case mode.IsRegular():
+ fmt.Println("regular file")
+case mode.IsDir():
+ fmt.Println("directory")
+case mode&amp;fs.ModeSymlink != 0:
+ fmt.Println("symbolic link")
+case mode&amp;fs.ModeNamedPipe != 0:
+ fmt.Println("named pipe")
+}
+</pre> <h2 id="LinkError">type <span>LinkError</span> </h2> <p>LinkError records an error during a link or symlink or rename system call and the paths that caused it. </p>
+<pre data-language="go">type LinkError struct {
+ Op string
+ Old string
+ New string
+ Err error
+}
+</pre> <h3 id="LinkError.Error">func (*LinkError) <span>Error</span> </h3> <pre data-language="go">func (e *LinkError) Error() string</pre> <h3 id="LinkError.Unwrap">func (*LinkError) <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e *LinkError) Unwrap() error</pre> <h2 id="PathError">type <span>PathError</span> </h2> <p>PathError records an error and the operation and file path that caused it. </p>
+<pre data-language="go">type PathError = fs.PathError</pre> <h2 id="ProcAttr">type <span>ProcAttr</span> </h2> <p>ProcAttr holds the attributes that will be applied to a new process started by StartProcess. </p>
+<pre data-language="go">type ProcAttr struct {
+ // If Dir is non-empty, the child changes into the directory before
+ // creating the process.
+ Dir string
+ // If Env is non-nil, it gives the environment variables for the
+ // new process in the form returned by Environ.
+ // If it is nil, the result of Environ will be used.
+ Env []string
+ // Files specifies the open files inherited by the new process. The
+ // first three entries correspond to standard input, standard output, and
+ // standard error. An implementation may support additional entries,
+ // depending on the underlying operating system. A nil entry corresponds
+ // to that file being closed when the process starts.
+ // On Unix systems, StartProcess will change these File values
+ // to blocking mode, which means that SetDeadline will stop working
+ // and calling Close will not interrupt a Read or Write.
+ Files []*File
+
+ // Operating system-specific process creation attributes.
+ // Note that setting this field means that your program
+ // may not execute properly or even compile on some
+ // operating systems.
+ Sys *syscall.SysProcAttr
+}
+</pre> <h2 id="Process">type <span>Process</span> </h2> <p>Process stores the information about a process created by StartProcess. </p>
+<pre data-language="go">type Process struct {
+ Pid int
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="FindProcess">func <span>FindProcess</span> </h3> <pre data-language="go">func FindProcess(pid int) (*Process, error)</pre> <p>FindProcess looks for a running process by its pid. </p>
+<p>The Process it returns can be used to obtain information about the underlying operating system process. </p>
+<p>On Unix systems, FindProcess always succeeds and returns a Process for the given pid, regardless of whether the process exists. To test whether the process actually exists, see whether p.Signal(syscall.Signal(0)) reports an error. </p>
+<h3 id="StartProcess">func <span>StartProcess</span> </h3> <pre data-language="go">func StartProcess(name string, argv []string, attr *ProcAttr) (*Process, error)</pre> <p>StartProcess starts a new process with the program, arguments and attributes specified by name, argv and attr. The argv slice will become os.Args in the new process, so it normally starts with the program name. </p>
+<p>If the calling goroutine has locked the operating system thread with runtime.LockOSThread and modified any inheritable OS-level thread state (for example, Linux or Plan 9 name spaces), the new process will inherit the caller's thread state. </p>
+<p>StartProcess is a low-level interface. The os/exec package provides higher-level interfaces. </p>
+<p>If there is an error, it will be of type *PathError. </p>
+<h3 id="Process.Kill">func (*Process) <span>Kill</span> </h3> <pre data-language="go">func (p *Process) Kill() error</pre> <p>Kill causes the Process to exit immediately. Kill does not wait until the Process has actually exited. This only kills the Process itself, not any other processes it may have started. </p>
+<h3 id="Process.Release">func (*Process) <span>Release</span> </h3> <pre data-language="go">func (p *Process) Release() error</pre> <p>Release releases any resources associated with the Process p, rendering it unusable in the future. Release only needs to be called if Wait is not. </p>
+<h3 id="Process.Signal">func (*Process) <span>Signal</span> </h3> <pre data-language="go">func (p *Process) Signal(sig Signal) error</pre> <p>Signal sends a signal to the Process. Sending Interrupt on Windows is not implemented. </p>
+<h3 id="Process.Wait">func (*Process) <span>Wait</span> </h3> <pre data-language="go">func (p *Process) Wait() (*ProcessState, error)</pre> <p>Wait waits for the Process to exit, and then returns a ProcessState describing its status and an error, if any. Wait releases any resources associated with the Process. On most operating systems, the Process must be a child of the current process or an error will be returned. </p>
+<h2 id="ProcessState">type <span>ProcessState</span> </h2> <p>ProcessState stores information about a process, as reported by Wait. </p>
+<pre data-language="go">type ProcessState struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ProcessState.ExitCode">func (*ProcessState) <span>ExitCode</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (p *ProcessState) ExitCode() int</pre> <p>ExitCode returns the exit code of the exited process, or -1 if the process hasn't exited or was terminated by a signal. </p>
+<h3 id="ProcessState.Exited">func (*ProcessState) <span>Exited</span> </h3> <pre data-language="go">func (p *ProcessState) Exited() bool</pre> <p>Exited reports whether the program has exited. On Unix systems this reports true if the program exited due to calling exit, but false if the program terminated due to a signal. </p>
+<h3 id="ProcessState.Pid">func (*ProcessState) <span>Pid</span> </h3> <pre data-language="go">func (p *ProcessState) Pid() int</pre> <p>Pid returns the process id of the exited process. </p>
+<h3 id="ProcessState.String">func (*ProcessState) <span>String</span> </h3> <pre data-language="go">func (p *ProcessState) String() string</pre> <h3 id="ProcessState.Success">func (*ProcessState) <span>Success</span> </h3> <pre data-language="go">func (p *ProcessState) Success() bool</pre> <p>Success reports whether the program exited successfully, such as with exit status 0 on Unix. </p>
+<h3 id="ProcessState.Sys">func (*ProcessState) <span>Sys</span> </h3> <pre data-language="go">func (p *ProcessState) Sys() any</pre> <p>Sys returns system-dependent exit information about the process. Convert it to the appropriate underlying type, such as syscall.WaitStatus on Unix, to access its contents. </p>
+<h3 id="ProcessState.SysUsage">func (*ProcessState) <span>SysUsage</span> </h3> <pre data-language="go">func (p *ProcessState) SysUsage() any</pre> <p>SysUsage returns system-dependent resource usage information about the exited process. Convert it to the appropriate underlying type, such as *syscall.Rusage on Unix, to access its contents. (On Unix, *syscall.Rusage matches struct rusage as defined in the getrusage(2) manual page.) </p>
+<h3 id="ProcessState.SystemTime">func (*ProcessState) <span>SystemTime</span> </h3> <pre data-language="go">func (p *ProcessState) SystemTime() time.Duration</pre> <p>SystemTime returns the system CPU time of the exited process and its children. </p>
+<h3 id="ProcessState.UserTime">func (*ProcessState) <span>UserTime</span> </h3> <pre data-language="go">func (p *ProcessState) UserTime() time.Duration</pre> <p>UserTime returns the user CPU time of the exited process and its children. </p>
+<h2 id="Signal">type <span>Signal</span> </h2> <p>A Signal represents an operating system signal. The usual underlying implementation is operating system-dependent: on Unix it is syscall.Signal. </p>
+<pre data-language="go">type Signal interface {
+ String() string
+ Signal() // to distinguish from other Stringers
+}</pre> <p>The only signal values guaranteed to be present in the os package on all systems are os.Interrupt (send the process an interrupt) and os.Kill (force the process to exit). On Windows, sending os.Interrupt to a process with os.Process.Signal is not implemented; it will return an error instead of sending a signal. </p>
+<pre data-language="go">var (
+ Interrupt Signal = syscall.SIGINT
+ Kill Signal = syscall.SIGKILL
+)</pre> <h2 id="SyscallError">type <span>SyscallError</span> </h2> <p>SyscallError records an error from a specific system call. </p>
+<pre data-language="go">type SyscallError struct {
+ Syscall string
+ Err error
+}
+</pre> <h3 id="SyscallError.Error">func (*SyscallError) <span>Error</span> </h3> <pre data-language="go">func (e *SyscallError) Error() string</pre> <h3 id="SyscallError.Timeout">func (*SyscallError) <span>Timeout</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (e *SyscallError) Timeout() bool</pre> <p>Timeout reports whether this error represents a timeout. </p>
+<h3 id="SyscallError.Unwrap">func (*SyscallError) <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e *SyscallError) Unwrap() error</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="exec/index">exec</a> </td> <td class="pkg-synopsis"> Package exec runs external commands. </td> </tr> <tr> <td class="pkg-name"> <a href="signal/index">signal</a> </td> <td class="pkg-synopsis"> Package signal implements access to incoming signals. </td> </tr> <tr> <td class="pkg-name"> <a href="user/index">user</a> </td> <td class="pkg-synopsis"> Package user allows user account lookups by name or id. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/os/" class="_attribution-link">http://golang.org/pkg/os/</a>
+ </p>
+</div>
diff --git a/devdocs/go/os%2Fsignal%2Findex.html b/devdocs/go/os%2Fsignal%2Findex.html
new file mode 100644
index 00000000..6156a266
--- /dev/null
+++ b/devdocs/go/os%2Fsignal%2Findex.html
@@ -0,0 +1,127 @@
+<h1> Package signal </h1> <ul id="short-nav">
+<li><code>import "os/signal"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package signal implements access to incoming signals. </p>
+<p>Signals are primarily used on Unix-like systems. For the use of this package on Windows and Plan 9, see below. </p>
+<h3 id="hdr-Types_of_signals">Types of signals</h3> <p>The signals SIGKILL and SIGSTOP may not be caught by a program, and therefore cannot be affected by this package. </p>
+<p>Synchronous signals are signals triggered by errors in program execution: SIGBUS, SIGFPE, and SIGSEGV. These are only considered synchronous when caused by program execution, not when sent using <span>os.Process.Kill</span> or the kill program or some similar mechanism. In general, except as discussed below, Go programs will convert a synchronous signal into a run-time panic. </p>
+<p>The remaining signals are asynchronous signals. They are not triggered by program errors, but are instead sent from the kernel or from some other program. </p>
+<p>Of the asynchronous signals, the SIGHUP signal is sent when a program loses its controlling terminal. The SIGINT signal is sent when the user at the controlling terminal presses the interrupt character, which by default is ^C (Control-C). The SIGQUIT signal is sent when the user at the controlling terminal presses the quit character, which by default is ^\ (Control-Backslash). In general you can cause a program to simply exit by pressing ^C, and you can cause it to exit with a stack dump by pressing ^\. </p>
+<h3 id="hdr-Default_behavior_of_signals_in_Go_programs">Default behavior of signals in Go programs</h3> <p>By default, a synchronous signal is converted into a run-time panic. A SIGHUP, SIGINT, or SIGTERM signal causes the program to exit. A SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGSTKFLT, SIGEMT, or SIGSYS signal causes the program to exit with a stack dump. A SIGTSTP, SIGTTIN, or SIGTTOU signal gets the system default behavior (these signals are used by the shell for job control). The SIGPROF signal is handled directly by the Go runtime to implement runtime.CPUProfile. Other signals will be caught but no action will be taken. </p>
+<p>If the Go program is started with either SIGHUP or SIGINT ignored (signal handler set to SIG_IGN), they will remain ignored. </p>
+<p>If the Go program is started with a non-empty signal mask, that will generally be honored. However, some signals are explicitly unblocked: the synchronous signals, SIGILL, SIGTRAP, SIGSTKFLT, SIGCHLD, SIGPROF, and, on Linux, signals 32 (SIGCANCEL) and 33 (SIGSETXID) (SIGCANCEL and SIGSETXID are used internally by glibc). Subprocesses started by <span>os.Exec</span>, or by <span>os/exec</span>, will inherit the modified signal mask. </p>
+<h3 id="hdr-Changing_the_behavior_of_signals_in_Go_programs">Changing the behavior of signals in Go programs</h3> <p>The functions in this package allow a program to change the way Go programs handle signals. </p>
+<p>Notify disables the default behavior for a given set of asynchronous signals and instead delivers them over one or more registered channels. Specifically, it applies to the signals SIGHUP, SIGINT, SIGQUIT, SIGABRT, and SIGTERM. It also applies to the job control signals SIGTSTP, SIGTTIN, and SIGTTOU, in which case the system default behavior does not occur. It also applies to some signals that otherwise cause no action: SIGUSR1, SIGUSR2, SIGPIPE, SIGALRM, SIGCHLD, SIGCONT, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, SIGWINCH, SIGIO, SIGPWR, SIGSYS, SIGINFO, SIGTHR, SIGWAITING, SIGLWP, SIGFREEZE, SIGTHAW, SIGLOST, SIGXRES, SIGJVM1, SIGJVM2, and any real time signals used on the system. Note that not all of these signals are available on all systems. </p>
+<p>If the program was started with SIGHUP or SIGINT ignored, and Notify is called for either signal, a signal handler will be installed for that signal and it will no longer be ignored. If, later, Reset or Ignore is called for that signal, or Stop is called on all channels passed to Notify for that signal, the signal will once again be ignored. Reset will restore the system default behavior for the signal, while Ignore will cause the system to ignore the signal entirely. </p>
+<p>If the program is started with a non-empty signal mask, some signals will be explicitly unblocked as described above. If Notify is called for a blocked signal, it will be unblocked. If, later, Reset is called for that signal, or Stop is called on all channels passed to Notify for that signal, the signal will once again be blocked. </p>
+<h3 id="hdr-SIGPIPE">SIGPIPE</h3> <p>When a Go program writes to a broken pipe, the kernel will raise a SIGPIPE signal. </p>
+<p>If the program has not called Notify to receive SIGPIPE signals, then the behavior depends on the file descriptor number. A write to a broken pipe on file descriptors 1 or 2 (standard output or standard error) will cause the program to exit with a SIGPIPE signal. A write to a broken pipe on some other file descriptor will take no action on the SIGPIPE signal, and the write will fail with an EPIPE error. </p>
+<p>If the program has called Notify to receive SIGPIPE signals, the file descriptor number does not matter. The SIGPIPE signal will be delivered to the Notify channel, and the write will fail with an EPIPE error. </p>
+<p>This means that, by default, command line programs will behave like typical Unix command line programs, while other programs will not crash with SIGPIPE when writing to a closed network connection. </p>
+<h3 id="hdr-Go_programs_that_use_cgo_or_SWIG">Go programs that use cgo or SWIG</h3> <p>In a Go program that includes non-Go code, typically C/C++ code accessed using cgo or SWIG, Go's startup code normally runs first. It configures the signal handlers as expected by the Go runtime, before the non-Go startup code runs. If the non-Go startup code wishes to install its own signal handlers, it must take certain steps to keep Go working well. This section documents those steps and the overall effect changes to signal handler settings by the non-Go code can have on Go programs. In rare cases, the non-Go code may run before the Go code, in which case the next section also applies. </p>
+<p>If the non-Go code called by the Go program does not change any signal handlers or masks, then the behavior is the same as for a pure Go program. </p>
+<p>If the non-Go code installs any signal handlers, it must use the SA_ONSTACK flag with sigaction. Failing to do so is likely to cause the program to crash if the signal is received. Go programs routinely run with a limited stack, and therefore set up an alternate signal stack. </p>
+<p>If the non-Go code installs a signal handler for any of the synchronous signals (SIGBUS, SIGFPE, SIGSEGV), then it should record the existing Go signal handler. If those signals occur while executing Go code, it should invoke the Go signal handler (whether the signal occurs while executing Go code can be determined by looking at the PC passed to the signal handler). Otherwise some Go run-time panics will not occur as expected. </p>
+<p>If the non-Go code installs a signal handler for any of the asynchronous signals, it may invoke the Go signal handler or not as it chooses. Naturally, if it does not invoke the Go signal handler, the Go behavior described above will not occur. This can be an issue with the SIGPROF signal in particular. </p>
+<p>The non-Go code should not change the signal mask on any threads created by the Go runtime. If the non-Go code starts new threads of its own, it may set the signal mask as it pleases. </p>
+<p>If the non-Go code starts a new thread, changes the signal mask, and then invokes a Go function in that thread, the Go runtime will automatically unblock certain signals: the synchronous signals, SIGILL, SIGTRAP, SIGSTKFLT, SIGCHLD, SIGPROF, SIGCANCEL, and SIGSETXID. When the Go function returns, the non-Go signal mask will be restored. </p>
+<p>If the Go signal handler is invoked on a non-Go thread not running Go code, the handler generally forwards the signal to the non-Go code, as follows. If the signal is SIGPROF, the Go handler does nothing. Otherwise, the Go handler removes itself, unblocks the signal, and raises it again, to invoke any non-Go handler or default system handler. If the program does not exit, the Go handler then reinstalls itself and continues execution of the program. </p>
+<p>If a SIGPIPE signal is received, the Go program will invoke the special handling described above if the SIGPIPE is received on a Go thread. If the SIGPIPE is received on a non-Go thread the signal will be forwarded to the non-Go handler, if any; if there is none the default system handler will cause the program to terminate. </p>
+<h3 id="hdr-Non_Go_programs_that_call_Go_code">Non-Go programs that call Go code</h3> <p>When Go code is built with options like -buildmode=c-shared, it will be run as part of an existing non-Go program. The non-Go code may have already installed signal handlers when the Go code starts (that may also happen in unusual cases when using cgo or SWIG; in that case, the discussion here applies). For -buildmode=c-archive the Go runtime will initialize signals at global constructor time. For -buildmode=c-shared the Go runtime will initialize signals when the shared library is loaded. </p>
+<p>If the Go runtime sees an existing signal handler for the SIGCANCEL or SIGSETXID signals (which are used only on Linux), it will turn on the SA_ONSTACK flag and otherwise keep the signal handler. </p>
+<p>For the synchronous signals and SIGPIPE, the Go runtime will install a signal handler. It will save any existing signal handler. If a synchronous signal arrives while executing non-Go code, the Go runtime will invoke the existing signal handler instead of the Go signal handler. </p>
+<p>Go code built with -buildmode=c-archive or -buildmode=c-shared will not install any other signal handlers by default. If there is an existing signal handler, the Go runtime will turn on the SA_ONSTACK flag and otherwise keep the signal handler. If Notify is called for an asynchronous signal, a Go signal handler will be installed for that signal. If, later, Reset is called for that signal, the original handling for that signal will be reinstalled, restoring the non-Go signal handler if any. </p>
+<p>Go code built without -buildmode=c-archive or -buildmode=c-shared will install a signal handler for the asynchronous signals listed above, and save any existing signal handler. If a signal is delivered to a non-Go thread, it will act as described above, except that if there is an existing non-Go signal handler, that handler will be installed before raising the signal. </p>
+<h3 id="hdr-Windows">Windows</h3> <p>On Windows a ^C (Control-C) or ^BREAK (Control-Break) normally cause the program to exit. If Notify is called for <span>os.Interrupt</span>, ^C or ^BREAK will cause <span>os.Interrupt</span> to be sent on the channel, and the program will not exit. If Reset is called, or Stop is called on all channels passed to Notify, then the default behavior will be restored. </p>
+<p>Additionally, if Notify is called, and Windows sends CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT or CTRL_SHUTDOWN_EVENT to the process, Notify will return syscall.SIGTERM. Unlike Control-C and Control-Break, Notify does not change process behavior when either CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT or CTRL_SHUTDOWN_EVENT is received - the process will still get terminated unless it exits. But receiving syscall.SIGTERM will give the process an opportunity to clean up before termination. </p>
+<h3 id="hdr-Plan_9">Plan 9</h3> <p>On Plan 9, signals have type syscall.Note, which is a string. Calling Notify with a syscall.Note will cause that value to be sent on the channel when that string is posted as a note. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Ignore">func Ignore(sig ...os.Signal)</a></li>
+<li><a href="#Ignored">func Ignored(sig os.Signal) bool</a></li>
+<li><a href="#Notify">func Notify(c chan&lt;- os.Signal, sig ...os.Signal)</a></li>
+<li><a href="#NotifyContext">func NotifyContext(parent context.Context, signals ...os.Signal) (ctx context.Context, stop context.CancelFunc)</a></li>
+<li><a href="#Reset">func Reset(sig ...os.Signal)</a></li>
+<li><a href="#Stop">func Stop(c chan&lt;- os.Signal)</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Notify">Notify</a></dd> <dd><a class="exampleLink" href="#example_NotifyContext">NotifyContext</a></dd> <dd><a class="exampleLink" href="#example_Notify_allSignals">Notify (AllSignals)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>doc.go</span> <span>signal.go</span> <span>signal_unix.go</span> </p> <h2 id="Ignore">func <span>Ignore</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Ignore(sig ...os.Signal)</pre> <p>Ignore causes the provided signals to be ignored. If they are received by the program, nothing will happen. Ignore undoes the effect of any prior calls to Notify for the provided signals. If no signals are provided, all incoming signals will be ignored. </p>
+<h2 id="Ignored">func <span>Ignored</span> <span title="Added in Go 1.11">1.11</span> </h2> <pre data-language="go">func Ignored(sig os.Signal) bool</pre> <p>Ignored reports whether sig is currently ignored. </p>
+<h2 id="Notify">func <span>Notify</span> </h2> <pre data-language="go">func Notify(c chan&lt;- os.Signal, sig ...os.Signal)</pre> <p>Notify causes package signal to relay incoming signals to c. If no signals are provided, all incoming signals will be relayed to c. Otherwise, just the provided signals will. </p>
+<p>Package signal will not block sending to c: the caller must ensure that c has sufficient buffer space to keep up with the expected signal rate. For a channel used for notification of just one signal value, a buffer of size 1 is sufficient. </p>
+<p>It is allowed to call Notify multiple times with the same channel: each call expands the set of signals sent to that channel. The only way to remove signals from the set is to call Stop. </p>
+<p>It is allowed to call Notify multiple times with different channels and the same signals: each channel receives copies of incoming signals independently. </p> <h4 id="example_Notify"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Set up channel on which to send signal notifications.
+// We must use a buffered channel or risk missing the signal
+// if we're not ready to receive when the signal is sent.
+c := make(chan os.Signal, 1)
+signal.Notify(c, os.Interrupt)
+
+// Block until a signal is received.
+s := &lt;-c
+fmt.Println("Got signal:", s)
+</pre> <h4 id="example_Notify_allSignals"> <span class="text">Example (AllSignals)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Set up channel on which to send signal notifications.
+// We must use a buffered channel or risk missing the signal
+// if we're not ready to receive when the signal is sent.
+c := make(chan os.Signal, 1)
+
+// Passing no signals to Notify means that
+// all signals will be sent to the channel.
+signal.Notify(c)
+
+// Block until any signal is received.
+s := &lt;-c
+fmt.Println("Got signal:", s)
+</pre> <h2 id="NotifyContext">func <span>NotifyContext</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func NotifyContext(parent context.Context, signals ...os.Signal) (ctx context.Context, stop context.CancelFunc)</pre> <p>NotifyContext returns a copy of the parent context that is marked done (its Done channel is closed) when one of the listed signals arrives, when the returned stop function is called, or when the parent context's Done channel is closed, whichever happens first. </p>
+<p>The stop function unregisters the signal behavior, which, like signal.Reset, may restore the default behavior for a given signal. For example, the default behavior of a Go program receiving os.Interrupt is to exit. Calling NotifyContext(parent, os.Interrupt) will change the behavior to cancel the returned context. Future interrupts received will not trigger the default (exit) behavior until the returned stop function is called. </p>
+<p>The stop function releases resources associated with it, so code should call stop as soon as the operations running in this Context complete and signals no longer need to be diverted to the context. </p> <h4 id="example_NotifyContext"> <span class="text">Example</span>
+</h4> <p>This example passes a context with a signal to tell a blocking function that it should abandon its work after a signal is received. </p> <p>Code:</p> <pre class="code" data-language="go">package signal_test
+
+import (
+ "context"
+ "fmt"
+ "log"
+ "os"
+ "os/signal"
+)
+
+var neverReady = make(chan struct{}) // never closed
+
+// This example passes a context with a signal to tell a blocking function that
+// it should abandon its work after a signal is received.
+func ExampleNotifyContext() {
+ ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
+ defer stop()
+
+ p, err := os.FindProcess(os.Getpid())
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // On a Unix-like system, pressing Ctrl+C on a keyboard sends a
+ // SIGINT signal to the process of the program in execution.
+ //
+ // This example simulates that by sending a SIGINT signal to itself.
+ if err := p.Signal(os.Interrupt); err != nil {
+ log.Fatal(err)
+ }
+
+ select {
+ case &lt;-neverReady:
+ fmt.Println("ready")
+ case &lt;-ctx.Done():
+ fmt.Println(ctx.Err()) // prints "context canceled"
+ stop() // stop receiving signal notifications as soon as possible.
+ }
+
+ // Output:
+ // context canceled
+}
+</pre> <h2 id="Reset">func <span>Reset</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Reset(sig ...os.Signal)</pre> <p>Reset undoes the effect of any prior calls to Notify for the provided signals. If no signals are provided, all signal handlers will be reset. </p>
+<h2 id="Stop">func <span>Stop</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func Stop(c chan&lt;- os.Signal)</pre> <p>Stop causes package signal to stop relaying incoming signals to c. It undoes the effect of all prior calls to Notify using c. When Stop returns, it is guaranteed that c will receive no more signals. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/os/signal/" class="_attribution-link">http://golang.org/pkg/os/signal/</a>
+ </p>
+</div>
diff --git a/devdocs/go/os%2Fuser%2Findex.html b/devdocs/go/os%2Fuser%2Findex.html
new file mode 100644
index 00000000..a69f79e8
--- /dev/null
+++ b/devdocs/go/os%2Fuser%2Findex.html
@@ -0,0 +1,79 @@
+<h1> Package user </h1> <ul id="short-nav">
+<li><code>import "os/user"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package user allows user account lookups by name or id. </p>
+<p>For most Unix systems, this package has two internal implementations of resolving user and group ids to names, and listing supplementary group IDs. One is written in pure Go and parses /etc/passwd and /etc/group. The other is cgo-based and relies on the standard C library (libc) routines such as getpwuid_r, getgrnam_r, and getgrouplist. </p>
+<p>When cgo is available, and the required routines are implemented in libc for a particular platform, cgo-based (libc-backed) code is used. This can be overridden by using osusergo build tag, which enforces the pure Go implementation. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Group">type Group</a></li>
+<li> <a href="#LookupGroup">func LookupGroup(name string) (*Group, error)</a>
+</li>
+<li> <a href="#LookupGroupId">func LookupGroupId(gid string) (*Group, error)</a>
+</li>
+<li><a href="#UnknownGroupError">type UnknownGroupError</a></li>
+<li> <a href="#UnknownGroupError.Error">func (e UnknownGroupError) Error() string</a>
+</li>
+<li><a href="#UnknownGroupIdError">type UnknownGroupIdError</a></li>
+<li> <a href="#UnknownGroupIdError.Error">func (e UnknownGroupIdError) Error() string</a>
+</li>
+<li><a href="#UnknownUserError">type UnknownUserError</a></li>
+<li> <a href="#UnknownUserError.Error">func (e UnknownUserError) Error() string</a>
+</li>
+<li><a href="#UnknownUserIdError">type UnknownUserIdError</a></li>
+<li> <a href="#UnknownUserIdError.Error">func (e UnknownUserIdError) Error() string</a>
+</li>
+<li><a href="#User">type User</a></li>
+<li> <a href="#Current">func Current() (*User, error)</a>
+</li>
+<li> <a href="#Lookup">func Lookup(username string) (*User, error)</a>
+</li>
+<li> <a href="#LookupId">func LookupId(uid string) (*User, error)</a>
+</li>
+<li> <a href="#User.GroupIds">func (u *User) GroupIds() ([]string, error)</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>cgo_listgroups_unix.go</span> <span>cgo_lookup_cgo.go</span> <span>cgo_lookup_unix.go</span> <span>getgrouplist_unix.go</span> <span>lookup.go</span> <span>user.go</span> </p> <h2 id="Group">type <span>Group</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>Group represents a grouping of users. </p>
+<p>On POSIX systems Gid contains a decimal number representing the group ID. </p>
+<pre data-language="go">type Group struct {
+ Gid string // group ID
+ Name string // group name
+}
+</pre> <h3 id="LookupGroup">func <span>LookupGroup</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func LookupGroup(name string) (*Group, error)</pre> <p>LookupGroup looks up a group by name. If the group cannot be found, the returned error is of type UnknownGroupError. </p>
+<h3 id="LookupGroupId">func <span>LookupGroupId</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func LookupGroupId(gid string) (*Group, error)</pre> <p>LookupGroupId looks up a group by groupid. If the group cannot be found, the returned error is of type UnknownGroupIdError. </p>
+<h2 id="UnknownGroupError">type <span>UnknownGroupError</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>UnknownGroupError is returned by LookupGroup when a group cannot be found. </p>
+<pre data-language="go">type UnknownGroupError string</pre> <h3 id="UnknownGroupError.Error">func (UnknownGroupError) <span>Error</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (e UnknownGroupError) Error() string</pre> <h2 id="UnknownGroupIdError">type <span>UnknownGroupIdError</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>UnknownGroupIdError is returned by LookupGroupId when a group cannot be found. </p>
+<pre data-language="go">type UnknownGroupIdError string</pre> <h3 id="UnknownGroupIdError.Error">func (UnknownGroupIdError) <span>Error</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (e UnknownGroupIdError) Error() string</pre> <h2 id="UnknownUserError">type <span>UnknownUserError</span> </h2> <p>UnknownUserError is returned by Lookup when a user cannot be found. </p>
+<pre data-language="go">type UnknownUserError string</pre> <h3 id="UnknownUserError.Error">func (UnknownUserError) <span>Error</span> </h3> <pre data-language="go">func (e UnknownUserError) Error() string</pre> <h2 id="UnknownUserIdError">type <span>UnknownUserIdError</span> </h2> <p>UnknownUserIdError is returned by LookupId when a user cannot be found. </p>
+<pre data-language="go">type UnknownUserIdError int</pre> <h3 id="UnknownUserIdError.Error">func (UnknownUserIdError) <span>Error</span> </h3> <pre data-language="go">func (e UnknownUserIdError) Error() string</pre> <h2 id="User">type <span>User</span> </h2> <p>User represents a user account. </p>
+<pre data-language="go">type User struct {
+ // Uid is the user ID.
+ // On POSIX systems, this is a decimal number representing the uid.
+ // On Windows, this is a security identifier (SID) in a string format.
+ // On Plan 9, this is the contents of /dev/user.
+ Uid string
+ // Gid is the primary group ID.
+ // On POSIX systems, this is a decimal number representing the gid.
+ // On Windows, this is a SID in a string format.
+ // On Plan 9, this is the contents of /dev/user.
+ Gid string
+ // Username is the login name.
+ Username string
+ // Name is the user's real or display name.
+ // It might be blank.
+ // On POSIX systems, this is the first (or only) entry in the GECOS field
+ // list.
+ // On Windows, this is the user's display name.
+ // On Plan 9, this is the contents of /dev/user.
+ Name string
+ // HomeDir is the path to the user's home directory (if they have one).
+ HomeDir string
+}
+</pre> <h3 id="Current">func <span>Current</span> </h3> <pre data-language="go">func Current() (*User, error)</pre> <p>Current returns the current user. </p>
+<p>The first call will cache the current user information. Subsequent calls will return the cached value and will not reflect changes to the current user. </p>
+<h3 id="Lookup">func <span>Lookup</span> </h3> <pre data-language="go">func Lookup(username string) (*User, error)</pre> <p>Lookup looks up a user by username. If the user cannot be found, the returned error is of type UnknownUserError. </p>
+<h3 id="LookupId">func <span>LookupId</span> </h3> <pre data-language="go">func LookupId(uid string) (*User, error)</pre> <p>LookupId looks up a user by userid. If the user cannot be found, the returned error is of type UnknownUserIdError. </p>
+<h3 id="User.GroupIds">func (*User) <span>GroupIds</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (u *User) GroupIds() ([]string, error)</pre> <p>GroupIds returns the list of group IDs that the user is a member of. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/os/user/" class="_attribution-link">http://golang.org/pkg/os/user/</a>
+ </p>
+</div>
diff --git a/devdocs/go/path%2Ffilepath%2Findex.html b/devdocs/go/path%2Ffilepath%2Findex.html
new file mode 100644
index 00000000..f93880d1
--- /dev/null
+++ b/devdocs/go/path%2Ffilepath%2Findex.html
@@ -0,0 +1,305 @@
+<h1> Package filepath </h1> <ul id="short-nav">
+<li><code>import "path/filepath"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package filepath implements utility routines for manipulating filename paths in a way compatible with the target operating system-defined file paths. </p>
+<p>The filepath package uses either forward slashes or backslashes, depending on the operating system. To process paths such as URLs that always use forward slashes regardless of the operating system, see the <span>path</span> package. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Abs">func Abs(path string) (string, error)</a></li>
+<li><a href="#Base">func Base(path string) string</a></li>
+<li><a href="#Clean">func Clean(path string) string</a></li>
+<li><a href="#Dir">func Dir(path string) string</a></li>
+<li><a href="#EvalSymlinks">func EvalSymlinks(path string) (string, error)</a></li>
+<li><a href="#Ext">func Ext(path string) string</a></li>
+<li><a href="#FromSlash">func FromSlash(path string) string</a></li>
+<li><a href="#Glob">func Glob(pattern string) (matches []string, err error)</a></li>
+<li><a href="#HasPrefix">func HasPrefix(p, prefix string) bool</a></li>
+<li><a href="#IsAbs">func IsAbs(path string) bool</a></li>
+<li><a href="#IsLocal">func IsLocal(path string) bool</a></li>
+<li><a href="#Join">func Join(elem ...string) string</a></li>
+<li><a href="#Match">func Match(pattern, name string) (matched bool, err error)</a></li>
+<li><a href="#Rel">func Rel(basepath, targpath string) (string, error)</a></li>
+<li><a href="#Split">func Split(path string) (dir, file string)</a></li>
+<li><a href="#SplitList">func SplitList(path string) []string</a></li>
+<li><a href="#ToSlash">func ToSlash(path string) string</a></li>
+<li><a href="#VolumeName">func VolumeName(path string) string</a></li>
+<li><a href="#Walk">func Walk(root string, fn WalkFunc) error</a></li>
+<li><a href="#WalkDir">func WalkDir(root string, fn fs.WalkDirFunc) error</a></li>
+<li><a href="#WalkFunc">type WalkFunc</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Base">Base</a></dd> <dd><a class="exampleLink" href="#example_Dir">Dir</a></dd> <dd><a class="exampleLink" href="#example_Ext">Ext</a></dd> <dd><a class="exampleLink" href="#example_IsAbs">IsAbs</a></dd> <dd><a class="exampleLink" href="#example_Join">Join</a></dd> <dd><a class="exampleLink" href="#example_Match">Match</a></dd> <dd><a class="exampleLink" href="#example_Rel">Rel</a></dd> <dd><a class="exampleLink" href="#example_Split">Split</a></dd> <dd><a class="exampleLink" href="#example_SplitList">SplitList</a></dd> <dd><a class="exampleLink" href="#example_Walk">Walk</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>match.go</span> <span>path.go</span> <span>path_nonwindows.go</span> <span>path_unix.go</span> <span>symlink.go</span> <span>symlink_unix.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ Separator = os.PathSeparator
+ ListSeparator = os.PathListSeparator
+)</pre> <h2 id="pkg-variables">Variables</h2> <p>ErrBadPattern indicates a pattern was malformed. </p>
+<pre data-language="go">var ErrBadPattern = errors.New("syntax error in pattern")</pre> <p>SkipAll is used as a return value from <a href="#WalkFunc">WalkFunc</a> to indicate that all remaining files and directories are to be skipped. It is not returned as an error by any function. </p>
+<pre data-language="go">var SkipAll error = fs.SkipAll</pre> <p>SkipDir is used as a return value from <a href="#WalkFunc">WalkFunc</a> to indicate that the directory named in the call is to be skipped. It is not returned as an error by any function. </p>
+<pre data-language="go">var SkipDir error = fs.SkipDir</pre> <h2 id="Abs">func <span>Abs</span> </h2> <pre data-language="go">func Abs(path string) (string, error)</pre> <p>Abs returns an absolute representation of path. If the path is not absolute it will be joined with the current working directory to turn it into an absolute path. The absolute path name for a given file is not guaranteed to be unique. Abs calls <a href="#Clean">Clean</a> on the result. </p>
+<h2 id="Base">func <span>Base</span> </h2> <pre data-language="go">func Base(path string) string</pre> <p>Base returns the last element of path. Trailing path separators are removed before extracting the last element. If the path is empty, Base returns ".". If the path consists entirely of separators, Base returns a single separator. </p> <h4 id="example_Base"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println("On Unix:")
+fmt.Println(filepath.Base("/foo/bar/baz.js"))
+fmt.Println(filepath.Base("/foo/bar/baz"))
+fmt.Println(filepath.Base("/foo/bar/baz/"))
+fmt.Println(filepath.Base("dev.txt"))
+fmt.Println(filepath.Base("../todo.txt"))
+fmt.Println(filepath.Base(".."))
+fmt.Println(filepath.Base("."))
+fmt.Println(filepath.Base("/"))
+fmt.Println(filepath.Base(""))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">On Unix:
+baz.js
+baz
+baz
+dev.txt
+todo.txt
+..
+.
+/
+.
+</pre> <h2 id="Clean">func <span>Clean</span> </h2> <pre data-language="go">func Clean(path string) string</pre> <p>Clean returns the shortest path name equivalent to path by purely lexical processing. It applies the following rules iteratively until no further processing can be done: </p>
+<ol> <li>Replace multiple <a href="#Separator">Separator</a> elements with a single one. </li>
+<li>Eliminate each . path name element (the current directory). </li>
+<li>Eliminate each inner .. path name element (the parent directory) along with the non-.. element that precedes it. </li>
+<li>Eliminate .. elements that begin a rooted path: that is, replace "/.." by "/" at the beginning of a path, assuming Separator is '/'. </li>
+</ol> <p>The returned path ends in a slash only if it represents a root directory, such as "/" on Unix or `C:\` on Windows. </p>
+<p>Finally, any occurrences of slash are replaced by Separator. </p>
+<p>If the result of this process is an empty string, Clean returns the string ".". </p>
+<p>On Windows, Clean does not modify the volume name other than to replace occurrences of "/" with `\`. For example, Clean("//host/share/../x") returns `\\host\share\x`. </p>
+<p>See also Rob Pike, “Lexical File Names in Plan 9 or Getting Dot-Dot Right,” <a href="https://9p.io/sys/doc/lexnames.html">https://9p.io/sys/doc/lexnames.html</a> </p>
+<h2 id="Dir">func <span>Dir</span> </h2> <pre data-language="go">func Dir(path string) string</pre> <p>Dir returns all but the last element of path, typically the path's directory. After dropping the final element, Dir calls <a href="#Clean">Clean</a> on the path and trailing slashes are removed. If the path is empty, Dir returns ".". If the path consists entirely of separators, Dir returns a single separator. The returned path does not end in a separator unless it is the root directory. </p> <h4 id="example_Dir"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println("On Unix:")
+fmt.Println(filepath.Dir("/foo/bar/baz.js"))
+fmt.Println(filepath.Dir("/foo/bar/baz"))
+fmt.Println(filepath.Dir("/foo/bar/baz/"))
+fmt.Println(filepath.Dir("/dirty//path///"))
+fmt.Println(filepath.Dir("dev.txt"))
+fmt.Println(filepath.Dir("../todo.txt"))
+fmt.Println(filepath.Dir(".."))
+fmt.Println(filepath.Dir("."))
+fmt.Println(filepath.Dir("/"))
+fmt.Println(filepath.Dir(""))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">On Unix:
+/foo/bar
+/foo/bar
+/foo/bar/baz
+/dirty/path
+.
+..
+.
+.
+/
+.
+</pre> <h2 id="EvalSymlinks">func <span>EvalSymlinks</span> </h2> <pre data-language="go">func EvalSymlinks(path string) (string, error)</pre> <p>EvalSymlinks returns the path name after the evaluation of any symbolic links. If path is relative the result will be relative to the current directory, unless one of the components is an absolute symbolic link. EvalSymlinks calls <a href="#Clean">Clean</a> on the result. </p>
+<h2 id="Ext">func <span>Ext</span> </h2> <pre data-language="go">func Ext(path string) string</pre> <p>Ext returns the file name extension used by path. The extension is the suffix beginning at the final dot in the final element of path; it is empty if there is no dot. </p> <h4 id="example_Ext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("No dots: %q\n", filepath.Ext("index"))
+fmt.Printf("One dot: %q\n", filepath.Ext("index.js"))
+fmt.Printf("Two dots: %q\n", filepath.Ext("main.test.js"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">No dots: ""
+One dot: ".js"
+Two dots: ".js"
+</pre> <h2 id="FromSlash">func <span>FromSlash</span> </h2> <pre data-language="go">func FromSlash(path string) string</pre> <p>FromSlash returns the result of replacing each slash ('/') character in path with a separator character. Multiple slashes are replaced by multiple separators. </p>
+<h2 id="Glob">func <span>Glob</span> </h2> <pre data-language="go">func Glob(pattern string) (matches []string, err error)</pre> <p>Glob returns the names of all files matching pattern or nil if there is no matching file. The syntax of patterns is the same as in <a href="#Match">Match</a>. The pattern may describe hierarchical names such as /usr/*/bin/ed (assuming the <a href="#Separator">Separator</a> is '/'). </p>
+<p>Glob ignores file system errors such as I/O errors reading directories. The only possible returned error is <a href="#ErrBadPattern">ErrBadPattern</a>, when pattern is malformed. </p>
+<h2 id="HasPrefix">func <span>HasPrefix</span> </h2> <pre data-language="go">func HasPrefix(p, prefix string) bool</pre> <p>HasPrefix exists for historical compatibility and should not be used. </p>
+<p>Deprecated: HasPrefix does not respect path boundaries and does not ignore case when required. </p>
+<h2 id="IsAbs">func <span>IsAbs</span> </h2> <pre data-language="go">func IsAbs(path string) bool</pre> <p>IsAbs reports whether the path is absolute. </p> <h4 id="example_IsAbs"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println("On Unix:")
+fmt.Println(filepath.IsAbs("/home/gopher"))
+fmt.Println(filepath.IsAbs(".bashrc"))
+fmt.Println(filepath.IsAbs(".."))
+fmt.Println(filepath.IsAbs("."))
+fmt.Println(filepath.IsAbs("/"))
+fmt.Println(filepath.IsAbs(""))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">On Unix:
+true
+false
+false
+false
+true
+false
+</pre> <h2 id="IsLocal">func <span>IsLocal</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func IsLocal(path string) bool</pre> <p>IsLocal reports whether path, using lexical analysis only, has all of these properties: </p>
+<ul> <li>is within the subtree rooted at the directory in which path is evaluated </li>
+<li>is not an absolute path </li>
+<li>is not empty </li>
+<li>on Windows, is not a reserved name such as "NUL" </li>
+</ul> <p>If IsLocal(path) returns true, then Join(base, path) will always produce a path contained within base and Clean(path) will always produce an unrooted path with no ".." path elements. </p>
+<p>IsLocal is a purely lexical operation. In particular, it does not account for the effect of any symbolic links that may exist in the filesystem. </p>
+<h2 id="Join">func <span>Join</span> </h2> <pre data-language="go">func Join(elem ...string) string</pre> <p>Join joins any number of path elements into a single path, separating them with an OS specific <a href="#Separator">Separator</a>. Empty elements are ignored. The result is Cleaned. However, if the argument list is empty or all its elements are empty, Join returns an empty string. On Windows, the result will only be a UNC path if the first non-empty element is a UNC path. </p> <h4 id="example_Join"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println("On Unix:")
+fmt.Println(filepath.Join("a", "b", "c"))
+fmt.Println(filepath.Join("a", "b/c"))
+fmt.Println(filepath.Join("a/b", "c"))
+fmt.Println(filepath.Join("a/b", "/c"))
+
+fmt.Println(filepath.Join("a/b", "../../../xyz"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">On Unix:
+a/b/c
+a/b/c
+a/b/c
+a/b/c
+../xyz
+</pre> <h2 id="Match">func <span>Match</span> </h2> <pre data-language="go">func Match(pattern, name string) (matched bool, err error)</pre> <p>Match reports whether name matches the shell file name pattern. The pattern syntax is: </p>
+<pre data-language="go">pattern:
+ { term }
+term:
+ '*' matches any sequence of non-Separator characters
+ '?' matches any single non-Separator character
+ '[' [ '^' ] { character-range } ']'
+ character class (must be non-empty)
+ c matches character c (c != '*', '?', '\\', '[')
+ '\\' c matches character c
+
+character-range:
+ c matches character c (c != '\\', '-', ']')
+ '\\' c matches character c
+ lo '-' hi matches character c for lo &lt;= c &lt;= hi
+</pre> <p>Match requires pattern to match all of name, not just a substring. The only possible returned error is <a href="#ErrBadPattern">ErrBadPattern</a>, when pattern is malformed. </p>
+<p>On Windows, escaping is disabled. Instead, '\\' is treated as path separator. </p> <h4 id="example_Match"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println("On Unix:")
+fmt.Println(filepath.Match("/home/catch/*", "/home/catch/foo"))
+fmt.Println(filepath.Match("/home/catch/*", "/home/catch/foo/bar"))
+fmt.Println(filepath.Match("/home/?opher", "/home/gopher"))
+fmt.Println(filepath.Match("/home/\\*", "/home/*"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">On Unix:
+true &lt;nil&gt;
+false &lt;nil&gt;
+true &lt;nil&gt;
+true &lt;nil&gt;
+</pre> <h2 id="Rel">func <span>Rel</span> </h2> <pre data-language="go">func Rel(basepath, targpath string) (string, error)</pre> <p>Rel returns a relative path that is lexically equivalent to targpath when joined to basepath with an intervening separator. That is, <a href="#Join">Join</a>(basepath, Rel(basepath, targpath)) is equivalent to targpath itself. On success, the returned path will always be relative to basepath, even if basepath and targpath share no elements. An error is returned if targpath can't be made relative to basepath or if knowing the current working directory would be necessary to compute it. Rel calls <a href="#Clean">Clean</a> on the result. </p> <h4 id="example_Rel"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">paths := []string{
+ "/a/b/c",
+ "/b/c",
+ "./b/c",
+}
+base := "/a"
+
+fmt.Println("On Unix:")
+for _, p := range paths {
+ rel, err := filepath.Rel(base, p)
+ fmt.Printf("%q: %q %v\n", p, rel, err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">On Unix:
+"/a/b/c": "b/c" &lt;nil&gt;
+"/b/c": "../b/c" &lt;nil&gt;
+"./b/c": "" Rel: can't make ./b/c relative to /a
+</pre> <h2 id="Split">func <span>Split</span> </h2> <pre data-language="go">func Split(path string) (dir, file string)</pre> <p>Split splits path immediately following the final <a href="#Separator">Separator</a>, separating it into a directory and file name component. If there is no Separator in path, Split returns an empty dir and file set to path. The returned values have the property that path = dir+file. </p> <h4 id="example_Split"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">paths := []string{
+ "/home/arnie/amelia.jpg",
+ "/mnt/photos/",
+ "rabbit.jpg",
+ "/usr/local//go",
+}
+fmt.Println("On Unix:")
+for _, p := range paths {
+ dir, file := filepath.Split(p)
+ fmt.Printf("input: %q\n\tdir: %q\n\tfile: %q\n", p, dir, file)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">On Unix:
+input: "/home/arnie/amelia.jpg"
+ dir: "/home/arnie/"
+ file: "amelia.jpg"
+input: "/mnt/photos/"
+ dir: "/mnt/photos/"
+ file: ""
+input: "rabbit.jpg"
+ dir: ""
+ file: "rabbit.jpg"
+input: "/usr/local//go"
+ dir: "/usr/local//"
+ file: "go"
+</pre> <h2 id="SplitList">func <span>SplitList</span> </h2> <pre data-language="go">func SplitList(path string) []string</pre> <p>SplitList splits a list of paths joined by the OS-specific <a href="#ListSeparator">ListSeparator</a>, usually found in PATH or GOPATH environment variables. Unlike strings.Split, SplitList returns an empty slice when passed an empty string. </p> <h4 id="example_SplitList"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println("On Unix:", filepath.SplitList("/a/b/c:/usr/bin"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">On Unix: [/a/b/c /usr/bin]
+</pre> <h2 id="ToSlash">func <span>ToSlash</span> </h2> <pre data-language="go">func ToSlash(path string) string</pre> <p>ToSlash returns the result of replacing each separator character in path with a slash ('/') character. Multiple separators are replaced by multiple slashes. </p>
+<h2 id="VolumeName">func <span>VolumeName</span> </h2> <pre data-language="go">func VolumeName(path string) string</pre> <p>VolumeName returns leading volume name. Given "C:\foo\bar" it returns "C:" on Windows. Given "\\host\share\foo" it returns "\\host\share". On other platforms it returns "". </p>
+<h2 id="Walk">func <span>Walk</span> </h2> <pre data-language="go">func Walk(root string, fn WalkFunc) error</pre> <p>Walk walks the file tree rooted at root, calling fn for each file or directory in the tree, including root. </p>
+<p>All errors that arise visiting files and directories are filtered by fn: see the <a href="#WalkFunc">WalkFunc</a> documentation for details. </p>
+<p>The files are walked in lexical order, which makes the output deterministic but requires Walk to read an entire directory into memory before proceeding to walk that directory. </p>
+<p>Walk does not follow symbolic links. </p>
+<p>Walk is less efficient than <a href="#WalkDir">WalkDir</a>, introduced in Go 1.16, which avoids calling os.Lstat on every visited file or directory. </p> <h4 id="example_Walk"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package filepath_test
+
+import (
+ "fmt"
+ "io/fs"
+ "os"
+ "path/filepath"
+)
+
+func prepareTestDirTree(tree string) (string, error) {
+ tmpDir, err := os.MkdirTemp("", "")
+ if err != nil {
+ return "", fmt.Errorf("error creating temp directory: %v\n", err)
+ }
+
+ err = os.MkdirAll(filepath.Join(tmpDir, tree), 0755)
+ if err != nil {
+ os.RemoveAll(tmpDir)
+ return "", err
+ }
+
+ return tmpDir, nil
+}
+
+func ExampleWalk() {
+ tmpDir, err := prepareTestDirTree("dir/to/walk/skip")
+ if err != nil {
+ fmt.Printf("unable to create test dir tree: %v\n", err)
+ return
+ }
+ defer os.RemoveAll(tmpDir)
+ os.Chdir(tmpDir)
+
+ subDirToSkip := "skip"
+
+ fmt.Println("On Unix:")
+ err = filepath.Walk(".", func(path string, info fs.FileInfo, err error) error {
+ if err != nil {
+ fmt.Printf("prevent panic by handling failure accessing a path %q: %v\n", path, err)
+ return err
+ }
+ if info.IsDir() &amp;&amp; info.Name() == subDirToSkip {
+ fmt.Printf("skipping a dir without errors: %+v \n", info.Name())
+ return filepath.SkipDir
+ }
+ fmt.Printf("visited file or dir: %q\n", path)
+ return nil
+ })
+ if err != nil {
+ fmt.Printf("error walking the path %q: %v\n", tmpDir, err)
+ return
+ }
+ // Output:
+ // On Unix:
+ // visited file or dir: "."
+ // visited file or dir: "dir"
+ // visited file or dir: "dir/to"
+ // visited file or dir: "dir/to/walk"
+ // skipping a dir without errors: skip
+}
+</pre> <h2 id="WalkDir">func <span>WalkDir</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func WalkDir(root string, fn fs.WalkDirFunc) error</pre> <p>WalkDir walks the file tree rooted at root, calling fn for each file or directory in the tree, including root. </p>
+<p>All errors that arise visiting files and directories are filtered by fn: see the <span>fs.WalkDirFunc</span> documentation for details. </p>
+<p>The files are walked in lexical order, which makes the output deterministic but requires WalkDir to read an entire directory into memory before proceeding to walk that directory. </p>
+<p>WalkDir does not follow symbolic links. </p>
+<p>WalkDir calls fn with paths that use the separator character appropriate for the operating system. This is unlike <span>io/fs.WalkDir</span>, which always uses slash separated paths. </p>
+<h2 id="WalkFunc">type <span>WalkFunc</span> </h2> <p>WalkFunc is the type of the function called by <a href="#Walk">Walk</a> to visit each file or directory. </p>
+<p>The path argument contains the argument to Walk as a prefix. That is, if Walk is called with root argument "dir" and finds a file named "a" in that directory, the walk function will be called with argument "dir/a". </p>
+<p>The directory and file are joined with Join, which may clean the directory name: if Walk is called with the root argument "x/../dir" and finds a file named "a" in that directory, the walk function will be called with argument "dir/a", not "x/../dir/a". </p>
+<p>The info argument is the fs.FileInfo for the named path. </p>
+<p>The error result returned by the function controls how Walk continues. If the function returns the special value <a href="#SkipDir">SkipDir</a>, Walk skips the current directory (path if info.IsDir() is true, otherwise path's parent directory). If the function returns the special value <a href="#SkipAll">SkipAll</a>, Walk skips all remaining files and directories. Otherwise, if the function returns a non-nil error, Walk stops entirely and returns that error. </p>
+<p>The err argument reports an error related to path, signaling that Walk will not walk into that directory. The function can decide how to handle that error; as described earlier, returning the error will cause Walk to stop walking the entire tree. </p>
+<p>Walk calls the function with a non-nil err argument in two cases. </p>
+<p>First, if an <span>os.Lstat</span> on the root directory or any directory or file in the tree fails, Walk calls the function with path set to that directory or file's path, info set to nil, and err set to the error from os.Lstat. </p>
+<p>Second, if a directory's Readdirnames method fails, Walk calls the function with path set to the directory's path, info, set to an <span>fs.FileInfo</span> describing the directory, and err set to the error from Readdirnames. </p>
+<pre data-language="go">type WalkFunc func(path string, info fs.FileInfo, err error) error</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/path/filepath/" class="_attribution-link">http://golang.org/pkg/path/filepath/</a>
+ </p>
+</div>
diff --git a/devdocs/go/path%2Findex.html b/devdocs/go/path%2Findex.html
new file mode 100644
index 00000000..1a65498c
--- /dev/null
+++ b/devdocs/go/path%2Findex.html
@@ -0,0 +1,132 @@
+<h1> Package path </h1> <ul id="short-nav">
+<li><code>import "path"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package path implements utility routines for manipulating slash-separated paths. </p>
+<p>The path package should only be used for paths separated by forward slashes, such as the paths in URLs. This package does not deal with Windows paths with drive letters or backslashes; to manipulate operating system paths, use the <span>path/filepath</span> package. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Base">func Base(path string) string</a></li>
+<li><a href="#Clean">func Clean(path string) string</a></li>
+<li><a href="#Dir">func Dir(path string) string</a></li>
+<li><a href="#Ext">func Ext(path string) string</a></li>
+<li><a href="#IsAbs">func IsAbs(path string) bool</a></li>
+<li><a href="#Join">func Join(elem ...string) string</a></li>
+<li><a href="#Match">func Match(pattern, name string) (matched bool, err error)</a></li>
+<li><a href="#Split">func Split(path string) (dir, file string)</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Base">Base</a></dd> <dd><a class="exampleLink" href="#example_Clean">Clean</a></dd> <dd><a class="exampleLink" href="#example_Dir">Dir</a></dd> <dd><a class="exampleLink" href="#example_Ext">Ext</a></dd> <dd><a class="exampleLink" href="#example_IsAbs">IsAbs</a></dd> <dd><a class="exampleLink" href="#example_Join">Join</a></dd> <dd><a class="exampleLink" href="#example_Match">Match</a></dd> <dd><a class="exampleLink" href="#example_Split">Split</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>match.go</span> <span>path.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrBadPattern indicates a pattern was malformed. </p>
+<pre data-language="go">var ErrBadPattern = errors.New("syntax error in pattern")</pre> <h2 id="Base">func <span>Base</span> </h2> <pre data-language="go">func Base(path string) string</pre> <p>Base returns the last element of path. Trailing slashes are removed before extracting the last element. If the path is empty, Base returns ".". If the path consists entirely of slashes, Base returns "/". </p> <h4 id="example_Base"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(path.Base("/a/b"))
+fmt.Println(path.Base("/"))
+fmt.Println(path.Base(""))
+</pre> <p>Output:</p> <pre class="output" data-language="go">b
+/
+.
+</pre> <h2 id="Clean">func <span>Clean</span> </h2> <pre data-language="go">func Clean(path string) string</pre> <p>Clean returns the shortest path name equivalent to path by purely lexical processing. It applies the following rules iteratively until no further processing can be done: </p>
+<ol> <li>Replace multiple slashes with a single slash. </li>
+<li>Eliminate each . path name element (the current directory). </li>
+<li>Eliminate each inner .. path name element (the parent directory) along with the non-.. element that precedes it. </li>
+<li>Eliminate .. elements that begin a rooted path: that is, replace "/.." by "/" at the beginning of a path. </li>
+</ol> <p>The returned path ends in a slash only if it is the root "/". </p>
+<p>If the result of this process is an empty string, Clean returns the string ".". </p>
+<p>See also Rob Pike, “Lexical File Names in Plan 9 or Getting Dot-Dot Right,” <a href="https://9p.io/sys/doc/lexnames.html">https://9p.io/sys/doc/lexnames.html</a> </p> <h4 id="example_Clean"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">paths := []string{
+ "a/c",
+ "a//c",
+ "a/c/.",
+ "a/c/b/..",
+ "/../a/c",
+ "/../a/b/../././/c",
+ "",
+}
+
+for _, p := range paths {
+ fmt.Printf("Clean(%q) = %q\n", p, path.Clean(p))
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Clean("a/c") = "a/c"
+Clean("a//c") = "a/c"
+Clean("a/c/.") = "a/c"
+Clean("a/c/b/..") = "a/c"
+Clean("/../a/c") = "/a/c"
+Clean("/../a/b/../././/c") = "/a/c"
+Clean("") = "."
+</pre> <h2 id="Dir">func <span>Dir</span> </h2> <pre data-language="go">func Dir(path string) string</pre> <p>Dir returns all but the last element of path, typically the path's directory. After dropping the final element using <a href="#Split">Split</a>, the path is Cleaned and trailing slashes are removed. If the path is empty, Dir returns ".". If the path consists entirely of slashes followed by non-slash bytes, Dir returns a single slash. In any other case, the returned path does not end in a slash. </p> <h4 id="example_Dir"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(path.Dir("/a/b/c"))
+fmt.Println(path.Dir("a/b/c"))
+fmt.Println(path.Dir("/a/"))
+fmt.Println(path.Dir("a/"))
+fmt.Println(path.Dir("/"))
+fmt.Println(path.Dir(""))
+</pre> <p>Output:</p> <pre class="output" data-language="go">/a/b
+a/b
+/a
+a
+/
+.
+</pre> <h2 id="Ext">func <span>Ext</span> </h2> <pre data-language="go">func Ext(path string) string</pre> <p>Ext returns the file name extension used by path. The extension is the suffix beginning at the final dot in the final slash-separated element of path; it is empty if there is no dot. </p> <h4 id="example_Ext"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(path.Ext("/a/b/c/bar.css"))
+fmt.Println(path.Ext("/"))
+fmt.Println(path.Ext(""))
+</pre> <p>Output:</p> <pre class="output" data-language="go">.css
+</pre> <h2 id="IsAbs">func <span>IsAbs</span> </h2> <pre data-language="go">func IsAbs(path string) bool</pre> <p>IsAbs reports whether the path is absolute. </p> <h4 id="example_IsAbs"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(path.IsAbs("/dev/null"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+</pre> <h2 id="Join">func <span>Join</span> </h2> <pre data-language="go">func Join(elem ...string) string</pre> <p>Join joins any number of path elements into a single path, separating them with slashes. Empty elements are ignored. The result is Cleaned. However, if the argument list is empty or all its elements are empty, Join returns an empty string. </p> <h4 id="example_Join"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(path.Join("a", "b", "c"))
+fmt.Println(path.Join("a", "b/c"))
+fmt.Println(path.Join("a/b", "c"))
+
+fmt.Println(path.Join("a/b", "../../../xyz"))
+
+fmt.Println(path.Join("", ""))
+fmt.Println(path.Join("a", ""))
+fmt.Println(path.Join("", "a"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">a/b/c
+a/b/c
+a/b/c
+../xyz
+
+a
+a
+</pre> <h2 id="Match">func <span>Match</span> </h2> <pre data-language="go">func Match(pattern, name string) (matched bool, err error)</pre> <p>Match reports whether name matches the shell pattern. The pattern syntax is: </p>
+<pre data-language="go">pattern:
+ { term }
+term:
+ '*' matches any sequence of non-/ characters
+ '?' matches any single non-/ character
+ '[' [ '^' ] { character-range } ']'
+ character class (must be non-empty)
+ c matches character c (c != '*', '?', '\\', '[')
+ '\\' c matches character c
+
+character-range:
+ c matches character c (c != '\\', '-', ']')
+ '\\' c matches character c
+ lo '-' hi matches character c for lo &lt;= c &lt;= hi
+</pre> <p>Match requires pattern to match all of name, not just a substring. The only possible returned error is <a href="#ErrBadPattern">ErrBadPattern</a>, when pattern is malformed. </p> <h4 id="example_Match"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(path.Match("abc", "abc"))
+fmt.Println(path.Match("a*", "abc"))
+fmt.Println(path.Match("a*/b", "a/c/b"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true &lt;nil&gt;
+true &lt;nil&gt;
+false &lt;nil&gt;
+</pre> <h2 id="Split">func <span>Split</span> </h2> <pre data-language="go">func Split(path string) (dir, file string)</pre> <p>Split splits path immediately following the final slash, separating it into a directory and file name component. If there is no slash in path, Split returns an empty dir and file set to path. The returned values have the property that path = dir+file. </p> <h4 id="example_Split"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">split := func(s string) {
+ dir, file := path.Split(s)
+ fmt.Printf("path.Split(%q) = dir: %q, file: %q\n", s, dir, file)
+}
+split("static/myfile.css")
+split("myfile.css")
+split("")
+</pre> <p>Output:</p> <pre class="output" data-language="go">path.Split("static/myfile.css") = dir: "static/", file: "myfile.css"
+path.Split("myfile.css") = dir: "", file: "myfile.css"
+path.Split("") = dir: "", file: ""
+</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="filepath/index">filepath</a> </td> <td class="pkg-synopsis"> Package filepath implements utility routines for manipulating filename paths in a way compatible with the target operating system-defined file paths. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/path/" class="_attribution-link">http://golang.org/pkg/path/</a>
+ </p>
+</div>
diff --git a/devdocs/go/plugin%2Findex.html b/devdocs/go/plugin%2Findex.html
new file mode 100644
index 00000000..bc061022
--- /dev/null
+++ b/devdocs/go/plugin%2Findex.html
@@ -0,0 +1,60 @@
+<h1> Package plugin </h1> <ul id="short-nav">
+<li><code>import "plugin"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package plugin implements loading and symbol resolution of Go plugins. </p>
+<p>A plugin is a Go main package with exported functions and variables that has been built with: </p>
+<pre data-language="go">go build -buildmode=plugin
+</pre> <p>When a plugin is first opened, the init functions of all packages not already part of the program are called. The main function is not run. A plugin is only initialized once, and cannot be closed. </p>
+<h3 id="hdr-Warnings">Warnings</h3> <p>The ability to dynamically load parts of an application during execution, perhaps based on user-defined configuration, may be a useful building block in some designs. In particular, because applications and dynamically loaded functions can share data structures directly, plugins may enable very high-performance integration of separate parts. </p>
+<p>However, the plugin mechanism has many significant drawbacks that should be considered carefully during the design. For example: </p>
+<ul> <li><p>Plugins are currently supported only on Linux, FreeBSD, and macOS, making them unsuitable for applications intended to be portable. </p></li>
+<li><p>Applications that use plugins may require careful configuration to ensure that the various parts of the program be made available in the correct location in the file system (or container image). By contrast, deploying an application consisting of a single static executable is straightforward. </p></li>
+<li><p>Reasoning about program initialization is more difficult when some packages may not be initialized until long after the application has started running. </p></li>
+<li><p>Bugs in applications that load plugins could be exploited by an attacker to load dangerous or untrusted libraries. </p></li>
+<li><p>Runtime crashes are likely to occur unless all parts of the program (the application and all its plugins) are compiled using exactly the same version of the toolchain, the same build tags, and the same values of certain flags and environment variables. </p></li>
+<li><p>Similar crashing problems are likely to arise unless all common dependencies of the application and its plugins are built from exactly the same source code. </p></li>
+<li><p>Together, these restrictions mean that, in practice, the application and its plugins must all be built together by a single person or component of a system. In that case, it may be simpler for that person or component to generate Go source files that blank-import the desired set of plugins and then compile a static executable in the usual way. </p></li>
+</ul> <p>For these reasons, many users decide that traditional interprocess communication (IPC) mechanisms such as sockets, pipes, remote procedure call (RPC), shared memory mappings, or file system operations may be more suitable despite the performance overheads. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Plugin">type Plugin</a></li>
+<li> <a href="#Open">func Open(path string) (*Plugin, error)</a>
+</li>
+<li> <a href="#Plugin.Lookup">func (p *Plugin) Lookup(symName string) (Symbol, error)</a>
+</li>
+<li><a href="#Symbol">type Symbol</a></li>
+</ul> <h3>Package files</h3> <p> <span>plugin.go</span> <span>plugin_dlopen.go</span> </p> <h2 id="Plugin">type <span>Plugin</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>Plugin is a loaded Go plugin. </p>
+<pre data-language="go">type Plugin struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Open">func <span>Open</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func Open(path string) (*Plugin, error)</pre> <p>Open opens a Go plugin. If a path has already been opened, then the existing *<a href="#Plugin">Plugin</a> is returned. It is safe for concurrent use by multiple goroutines. </p>
+<h3 id="Plugin.Lookup">func (*Plugin) <span>Lookup</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (p *Plugin) Lookup(symName string) (Symbol, error)</pre> <p>Lookup searches for a symbol named symName in plugin p. A symbol is any exported variable or function. It reports an error if the symbol is not found. It is safe for concurrent use by multiple goroutines. </p>
+<h2 id="Symbol">type <span>Symbol</span> <span title="Added in Go 1.8">1.8</span> </h2> <p>A Symbol is a pointer to a variable or function. </p>
+<p>For example, a plugin defined as </p>
+<pre data-language="go">package main
+
+import "fmt"
+
+var V int
+
+func F() { fmt.Printf("Hello, number %d\n", V) }
+</pre> <p>may be loaded with the <a href="#Open">Open</a> function and then the exported package symbols V and F can be accessed </p>
+<pre data-language="go">p, err := plugin.Open("plugin_name.so")
+if err != nil {
+ panic(err)
+}
+v, err := p.Lookup("V")
+if err != nil {
+ panic(err)
+}
+f, err := p.Lookup("F")
+if err != nil {
+ panic(err)
+}
+*v.(*int) = 7
+f.(func())() // prints "Hello, number 7"
+</pre> <pre data-language="go">type Symbol any</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/plugin/" class="_attribution-link">http://golang.org/pkg/plugin/</a>
+ </p>
+</div>
diff --git a/devdocs/go/reflect%2Findex.html b/devdocs/go/reflect%2Findex.html
new file mode 100644
index 00000000..fe71a6d0
--- /dev/null
+++ b/devdocs/go/reflect%2Findex.html
@@ -0,0 +1,870 @@
+<h1> Package reflect </h1> <ul id="short-nav">
+<li><code>import "reflect"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package reflect implements run-time reflection, allowing a program to manipulate objects with arbitrary types. The typical use is to take a value with static type interface{} and extract its dynamic type information by calling TypeOf, which returns a Type. </p>
+<p>A call to ValueOf returns a Value representing the run-time data. Zero takes a Type and returns a Value representing a zero value for that type. </p>
+<p>See "The Laws of Reflection" for an introduction to reflection in Go: <a href="https://golang.org/doc/articles/laws_of_reflection.html">https://golang.org/doc/articles/laws_of_reflection.html</a> </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Copy">func Copy(dst, src Value) int</a></li>
+<li><a href="#DeepEqual">func DeepEqual(x, y any) bool</a></li>
+<li><a href="#Swapper">func Swapper(slice any) func(i, j int)</a></li>
+<li><a href="#ChanDir">type ChanDir</a></li>
+<li> <a href="#ChanDir.String">func (d ChanDir) String() string</a>
+</li>
+<li><a href="#Kind">type Kind</a></li>
+<li> <a href="#Kind.String">func (k Kind) String() string</a>
+</li>
+<li><a href="#MapIter">type MapIter</a></li>
+<li> <a href="#MapIter.Key">func (iter *MapIter) Key() Value</a>
+</li>
+<li> <a href="#MapIter.Next">func (iter *MapIter) Next() bool</a>
+</li>
+<li> <a href="#MapIter.Reset">func (iter *MapIter) Reset(v Value)</a>
+</li>
+<li> <a href="#MapIter.Value">func (iter *MapIter) Value() Value</a>
+</li>
+<li><a href="#Method">type Method</a></li>
+<li> <a href="#Method.IsExported">func (m Method) IsExported() bool</a>
+</li>
+<li><a href="#SelectCase">type SelectCase</a></li>
+<li><a href="#SelectDir">type SelectDir</a></li>
+<li><a href="#SliceHeader">type SliceHeader</a></li>
+<li><a href="#StringHeader">type StringHeader</a></li>
+<li><a href="#StructField">type StructField</a></li>
+<li> <a href="#VisibleFields">func VisibleFields(t Type) []StructField</a>
+</li>
+<li> <a href="#StructField.IsExported">func (f StructField) IsExported() bool</a>
+</li>
+<li><a href="#StructTag">type StructTag</a></li>
+<li> <a href="#StructTag.Get">func (tag StructTag) Get(key string) string</a>
+</li>
+<li> <a href="#StructTag.Lookup">func (tag StructTag) Lookup(key string) (value string, ok bool)</a>
+</li>
+<li><a href="#Type">type Type</a></li>
+<li> <a href="#ArrayOf">func ArrayOf(length int, elem Type) Type</a>
+</li>
+<li> <a href="#ChanOf">func ChanOf(dir ChanDir, t Type) Type</a>
+</li>
+<li> <a href="#FuncOf">func FuncOf(in, out []Type, variadic bool) Type</a>
+</li>
+<li> <a href="#MapOf">func MapOf(key, elem Type) Type</a>
+</li>
+<li> <a href="#PointerTo">func PointerTo(t Type) Type</a>
+</li>
+<li> <a href="#PtrTo">func PtrTo(t Type) Type</a>
+</li>
+<li> <a href="#SliceOf">func SliceOf(t Type) Type</a>
+</li>
+<li> <a href="#StructOf">func StructOf(fields []StructField) Type</a>
+</li>
+<li> <a href="#TypeFor">func TypeFor[T any]() Type</a>
+</li>
+<li> <a href="#TypeOf">func TypeOf(i any) Type</a>
+</li>
+<li><a href="#Value">type Value</a></li>
+<li> <a href="#Append">func Append(s Value, x ...Value) Value</a>
+</li>
+<li> <a href="#AppendSlice">func AppendSlice(s, t Value) Value</a>
+</li>
+<li> <a href="#Indirect">func Indirect(v Value) Value</a>
+</li>
+<li> <a href="#MakeChan">func MakeChan(typ Type, buffer int) Value</a>
+</li>
+<li> <a href="#MakeFunc">func MakeFunc(typ Type, fn func(args []Value) (results []Value)) Value</a>
+</li>
+<li> <a href="#MakeMap">func MakeMap(typ Type) Value</a>
+</li>
+<li> <a href="#MakeMapWithSize">func MakeMapWithSize(typ Type, n int) Value</a>
+</li>
+<li> <a href="#MakeSlice">func MakeSlice(typ Type, len, cap int) Value</a>
+</li>
+<li> <a href="#New">func New(typ Type) Value</a>
+</li>
+<li> <a href="#NewAt">func NewAt(typ Type, p unsafe.Pointer) Value</a>
+</li>
+<li> <a href="#Select">func Select(cases []SelectCase) (chosen int, recv Value, recvOK bool)</a>
+</li>
+<li> <a href="#ValueOf">func ValueOf(i any) Value</a>
+</li>
+<li> <a href="#Zero">func Zero(typ Type) Value</a>
+</li>
+<li> <a href="#Value.Addr">func (v Value) Addr() Value</a>
+</li>
+<li> <a href="#Value.Bool">func (v Value) Bool() bool</a>
+</li>
+<li> <a href="#Value.Bytes">func (v Value) Bytes() []byte</a>
+</li>
+<li> <a href="#Value.Call">func (v Value) Call(in []Value) []Value</a>
+</li>
+<li> <a href="#Value.CallSlice">func (v Value) CallSlice(in []Value) []Value</a>
+</li>
+<li> <a href="#Value.CanAddr">func (v Value) CanAddr() bool</a>
+</li>
+<li> <a href="#Value.CanComplex">func (v Value) CanComplex() bool</a>
+</li>
+<li> <a href="#Value.CanConvert">func (v Value) CanConvert(t Type) bool</a>
+</li>
+<li> <a href="#Value.CanFloat">func (v Value) CanFloat() bool</a>
+</li>
+<li> <a href="#Value.CanInt">func (v Value) CanInt() bool</a>
+</li>
+<li> <a href="#Value.CanInterface">func (v Value) CanInterface() bool</a>
+</li>
+<li> <a href="#Value.CanSet">func (v Value) CanSet() bool</a>
+</li>
+<li> <a href="#Value.CanUint">func (v Value) CanUint() bool</a>
+</li>
+<li> <a href="#Value.Cap">func (v Value) Cap() int</a>
+</li>
+<li> <a href="#Value.Clear">func (v Value) Clear()</a>
+</li>
+<li> <a href="#Value.Close">func (v Value) Close()</a>
+</li>
+<li> <a href="#Value.Comparable">func (v Value) Comparable() bool</a>
+</li>
+<li> <a href="#Value.Complex">func (v Value) Complex() complex128</a>
+</li>
+<li> <a href="#Value.Convert">func (v Value) Convert(t Type) Value</a>
+</li>
+<li> <a href="#Value.Elem">func (v Value) Elem() Value</a>
+</li>
+<li> <a href="#Value.Equal">func (v Value) Equal(u Value) bool</a>
+</li>
+<li> <a href="#Value.Field">func (v Value) Field(i int) Value</a>
+</li>
+<li> <a href="#Value.FieldByIndex">func (v Value) FieldByIndex(index []int) Value</a>
+</li>
+<li> <a href="#Value.FieldByIndexErr">func (v Value) FieldByIndexErr(index []int) (Value, error)</a>
+</li>
+<li> <a href="#Value.FieldByName">func (v Value) FieldByName(name string) Value</a>
+</li>
+<li> <a href="#Value.FieldByNameFunc">func (v Value) FieldByNameFunc(match func(string) bool) Value</a>
+</li>
+<li> <a href="#Value.Float">func (v Value) Float() float64</a>
+</li>
+<li> <a href="#Value.Grow">func (v Value) Grow(n int)</a>
+</li>
+<li> <a href="#Value.Index">func (v Value) Index(i int) Value</a>
+</li>
+<li> <a href="#Value.Int">func (v Value) Int() int64</a>
+</li>
+<li> <a href="#Value.Interface">func (v Value) Interface() (i any)</a>
+</li>
+<li> <a href="#Value.InterfaceData">func (v Value) InterfaceData() [2]uintptr</a>
+</li>
+<li> <a href="#Value.IsNil">func (v Value) IsNil() bool</a>
+</li>
+<li> <a href="#Value.IsValid">func (v Value) IsValid() bool</a>
+</li>
+<li> <a href="#Value.IsZero">func (v Value) IsZero() bool</a>
+</li>
+<li> <a href="#Value.Kind">func (v Value) Kind() Kind</a>
+</li>
+<li> <a href="#Value.Len">func (v Value) Len() int</a>
+</li>
+<li> <a href="#Value.MapIndex">func (v Value) MapIndex(key Value) Value</a>
+</li>
+<li> <a href="#Value.MapKeys">func (v Value) MapKeys() []Value</a>
+</li>
+<li> <a href="#Value.MapRange">func (v Value) MapRange() *MapIter</a>
+</li>
+<li> <a href="#Value.Method">func (v Value) Method(i int) Value</a>
+</li>
+<li> <a href="#Value.MethodByName">func (v Value) MethodByName(name string) Value</a>
+</li>
+<li> <a href="#Value.NumField">func (v Value) NumField() int</a>
+</li>
+<li> <a href="#Value.NumMethod">func (v Value) NumMethod() int</a>
+</li>
+<li> <a href="#Value.OverflowComplex">func (v Value) OverflowComplex(x complex128) bool</a>
+</li>
+<li> <a href="#Value.OverflowFloat">func (v Value) OverflowFloat(x float64) bool</a>
+</li>
+<li> <a href="#Value.OverflowInt">func (v Value) OverflowInt(x int64) bool</a>
+</li>
+<li> <a href="#Value.OverflowUint">func (v Value) OverflowUint(x uint64) bool</a>
+</li>
+<li> <a href="#Value.Pointer">func (v Value) Pointer() uintptr</a>
+</li>
+<li> <a href="#Value.Recv">func (v Value) Recv() (x Value, ok bool)</a>
+</li>
+<li> <a href="#Value.Send">func (v Value) Send(x Value)</a>
+</li>
+<li> <a href="#Value.Set">func (v Value) Set(x Value)</a>
+</li>
+<li> <a href="#Value.SetBool">func (v Value) SetBool(x bool)</a>
+</li>
+<li> <a href="#Value.SetBytes">func (v Value) SetBytes(x []byte)</a>
+</li>
+<li> <a href="#Value.SetCap">func (v Value) SetCap(n int)</a>
+</li>
+<li> <a href="#Value.SetComplex">func (v Value) SetComplex(x complex128)</a>
+</li>
+<li> <a href="#Value.SetFloat">func (v Value) SetFloat(x float64)</a>
+</li>
+<li> <a href="#Value.SetInt">func (v Value) SetInt(x int64)</a>
+</li>
+<li> <a href="#Value.SetIterKey">func (v Value) SetIterKey(iter *MapIter)</a>
+</li>
+<li> <a href="#Value.SetIterValue">func (v Value) SetIterValue(iter *MapIter)</a>
+</li>
+<li> <a href="#Value.SetLen">func (v Value) SetLen(n int)</a>
+</li>
+<li> <a href="#Value.SetMapIndex">func (v Value) SetMapIndex(key, elem Value)</a>
+</li>
+<li> <a href="#Value.SetPointer">func (v Value) SetPointer(x unsafe.Pointer)</a>
+</li>
+<li> <a href="#Value.SetString">func (v Value) SetString(x string)</a>
+</li>
+<li> <a href="#Value.SetUint">func (v Value) SetUint(x uint64)</a>
+</li>
+<li> <a href="#Value.SetZero">func (v Value) SetZero()</a>
+</li>
+<li> <a href="#Value.Slice">func (v Value) Slice(i, j int) Value</a>
+</li>
+<li> <a href="#Value.Slice3">func (v Value) Slice3(i, j, k int) Value</a>
+</li>
+<li> <a href="#Value.String">func (v Value) String() string</a>
+</li>
+<li> <a href="#Value.TryRecv">func (v Value) TryRecv() (x Value, ok bool)</a>
+</li>
+<li> <a href="#Value.TrySend">func (v Value) TrySend(x Value) bool</a>
+</li>
+<li> <a href="#Value.Type">func (v Value) Type() Type</a>
+</li>
+<li> <a href="#Value.Uint">func (v Value) Uint() uint64</a>
+</li>
+<li> <a href="#Value.UnsafeAddr">func (v Value) UnsafeAddr() uintptr</a>
+</li>
+<li> <a href="#Value.UnsafePointer">func (v Value) UnsafePointer() unsafe.Pointer</a>
+</li>
+<li><a href="#ValueError">type ValueError</a></li>
+<li> <a href="#ValueError.Error">func (e *ValueError) Error() string</a>
+</li>
+<li><a href="#pkg-note-BUG">Bugs</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Kind">Kind</a></dd> <dd><a class="exampleLink" href="#example_MakeFunc">MakeFunc</a></dd> <dd><a class="exampleLink" href="#example_StructOf">StructOf</a></dd> <dd><a class="exampleLink" href="#example_StructTag">StructTag</a></dd> <dd><a class="exampleLink" href="#example_StructTag_Lookup">StructTag.Lookup</a></dd> <dd><a class="exampleLink" href="#example_TypeOf">TypeOf</a></dd> <dd><a class="exampleLink" href="#example_Value_FieldByIndex">Value.FieldByIndex</a></dd> <dd><a class="exampleLink" href="#example_Value_FieldByName">Value.FieldByName</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>abi.go</span> <span>deepequal.go</span> <span>float32reg_generic.go</span> <span>makefunc.go</span> <span>swapper.go</span> <span>type.go</span> <span>value.go</span> <span>visiblefields.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Ptr is the old name for the <a href="#Pointer">Pointer</a> kind. </p>
+<pre data-language="go">const Ptr = Pointer</pre> <h2 id="Copy">func <span>Copy</span> </h2> <pre data-language="go">func Copy(dst, src Value) int</pre> <p>Copy copies the contents of src into dst until either dst has been filled or src has been exhausted. It returns the number of elements copied. Dst and src each must have kind <a href="#Slice">Slice</a> or <a href="#Array">Array</a>, and dst and src must have the same element type. </p>
+<p>As a special case, src can have kind <a href="#String">String</a> if the element type of dst is kind <a href="#Uint8">Uint8</a>. </p>
+<h2 id="DeepEqual">func <span>DeepEqual</span> </h2> <pre data-language="go">func DeepEqual(x, y any) bool</pre> <p>DeepEqual reports whether x and y are “deeply equal,” defined as follows. Two values of identical type are deeply equal if one of the following cases applies. Values of distinct types are never deeply equal. </p>
+<p>Array values are deeply equal when their corresponding elements are deeply equal. </p>
+<p>Struct values are deeply equal if their corresponding fields, both exported and unexported, are deeply equal. </p>
+<p>Func values are deeply equal if both are nil; otherwise they are not deeply equal. </p>
+<p>Interface values are deeply equal if they hold deeply equal concrete values. </p>
+<p>Map values are deeply equal when all of the following are true: they are both nil or both non-nil, they have the same length, and either they are the same map object or their corresponding keys (matched using Go equality) map to deeply equal values. </p>
+<p>Pointer values are deeply equal if they are equal using Go's == operator or if they point to deeply equal values. </p>
+<p>Slice values are deeply equal when all of the following are true: they are both nil or both non-nil, they have the same length, and either they point to the same initial entry of the same underlying array (that is, &amp;x[0] == &amp;y[0]) or their corresponding elements (up to length) are deeply equal. Note that a non-nil empty slice and a nil slice (for example, []byte{} and []byte(nil)) are not deeply equal. </p>
+<p>Other values - numbers, bools, strings, and channels - are deeply equal if they are equal using Go's == operator. </p>
+<p>In general DeepEqual is a recursive relaxation of Go's == operator. However, this idea is impossible to implement without some inconsistency. Specifically, it is possible for a value to be unequal to itself, either because it is of func type (uncomparable in general) or because it is a floating-point NaN value (not equal to itself in floating-point comparison), or because it is an array, struct, or interface containing such a value. On the other hand, pointer values are always equal to themselves, even if they point at or contain such problematic values, because they compare equal using Go's == operator, and that is a sufficient condition to be deeply equal, regardless of content. DeepEqual has been defined so that the same short-cut applies to slices and maps: if x and y are the same slice or the same map, they are deeply equal regardless of content. </p>
+<p>As DeepEqual traverses the data values it may find a cycle. The second and subsequent times that DeepEqual compares two pointer values that have been compared before, it treats the values as equal rather than examining the values to which they point. This ensures that DeepEqual terminates. </p>
+<h2 id="Swapper">func <span>Swapper</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func Swapper(slice any) func(i, j int)</pre> <p>Swapper returns a function that swaps the elements in the provided slice. </p>
+<p>Swapper panics if the provided interface is not a slice. </p>
+<h2 id="ChanDir">type <span>ChanDir</span> </h2> <p>ChanDir represents a channel type's direction. </p>
+<pre data-language="go">type ChanDir int</pre> <pre data-language="go">const (
+ RecvDir ChanDir = 1 &lt;&lt; iota // &lt;-chan
+ SendDir // chan&lt;-
+ BothDir = RecvDir | SendDir // chan
+)</pre> <h3 id="ChanDir.String">func (ChanDir) <span>String</span> </h3> <pre data-language="go">func (d ChanDir) String() string</pre> <h2 id="Kind">type <span>Kind</span> </h2> <p>A Kind represents the specific kind of type that a <a href="#Type">Type</a> represents. The zero Kind is not a valid kind. </p>
+<pre data-language="go">type Kind uint</pre> <pre data-language="go">const (
+ Invalid Kind = iota
+ Bool
+ Int
+ Int8
+ Int16
+ Int32
+ Int64
+ Uint
+ Uint8
+ Uint16
+ Uint32
+ Uint64
+ Uintptr
+ Float32
+ Float64
+ Complex64
+ Complex128
+ Array
+ Chan
+ Func
+ Interface
+ Map
+ Pointer
+ Slice
+ String
+ Struct
+ UnsafePointer
+)</pre> <h4 id="example_Kind"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">for _, v := range []any{"hi", 42, func() {}} {
+ switch v := reflect.ValueOf(v); v.Kind() {
+ case reflect.String:
+ fmt.Println(v.String())
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ fmt.Println(v.Int())
+ default:
+ fmt.Printf("unhandled kind %s", v.Kind())
+ }
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">hi
+42
+unhandled kind func
+</pre> <h3 id="Kind.String">func (Kind) <span>String</span> </h3> <pre data-language="go">func (k Kind) String() string</pre> <p>String returns the name of k. </p>
+<h2 id="MapIter">type <span>MapIter</span> <span title="Added in Go 1.12">1.12</span> </h2> <p>A MapIter is an iterator for ranging over a map. See <a href="#Value.MapRange">Value.MapRange</a>. </p>
+<pre data-language="go">type MapIter struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="MapIter.Key">func (*MapIter) <span>Key</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (iter *MapIter) Key() Value</pre> <p>Key returns the key of iter's current map entry. </p>
+<h3 id="MapIter.Next">func (*MapIter) <span>Next</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (iter *MapIter) Next() bool</pre> <p>Next advances the map iterator and reports whether there is another entry. It returns false when iter is exhausted; subsequent calls to <a href="#MapIter.Key">MapIter.Key</a>, <a href="#MapIter.Value">MapIter.Value</a>, or <a href="#MapIter.Next">MapIter.Next</a> will panic. </p>
+<h3 id="MapIter.Reset">func (*MapIter) <span>Reset</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (iter *MapIter) Reset(v Value)</pre> <p>Reset modifies iter to iterate over v. It panics if v's Kind is not <a href="#Map">Map</a> and v is not the zero Value. Reset(Value{}) causes iter to not to refer to any map, which may allow the previously iterated-over map to be garbage collected. </p>
+<h3 id="MapIter.Value">func (*MapIter) <span>Value</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (iter *MapIter) Value() Value</pre> <p>Value returns the value of iter's current map entry. </p>
+<h2 id="Method">type <span>Method</span> </h2> <p>Method represents a single method. </p>
+<pre data-language="go">type Method struct {
+ // Name is the method name.
+ Name string
+
+ // PkgPath is the package path that qualifies a lower case (unexported)
+ // method name. It is empty for upper case (exported) method names.
+ // The combination of PkgPath and Name uniquely identifies a method
+ // in a method set.
+ // See https://golang.org/ref/spec#Uniqueness_of_identifiers
+ PkgPath string
+
+ Type Type // method type
+ Func Value // func with receiver as first argument
+ Index int // index for Type.Method
+}
+</pre> <h3 id="Method.IsExported">func (Method) <span>IsExported</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (m Method) IsExported() bool</pre> <p>IsExported reports whether the method is exported. </p>
+<h2 id="SelectCase">type <span>SelectCase</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>A SelectCase describes a single case in a select operation. The kind of case depends on Dir, the communication direction. </p>
+<p>If Dir is SelectDefault, the case represents a default case. Chan and Send must be zero Values. </p>
+<p>If Dir is SelectSend, the case represents a send operation. Normally Chan's underlying value must be a channel, and Send's underlying value must be assignable to the channel's element type. As a special case, if Chan is a zero Value, then the case is ignored, and the field Send will also be ignored and may be either zero or non-zero. </p>
+<p>If Dir is SelectRecv, the case represents a receive operation. Normally Chan's underlying value must be a channel and Send must be a zero Value. If Chan is a zero Value, then the case is ignored, but Send must still be a zero Value. When a receive operation is selected, the received Value is returned by Select. </p>
+<pre data-language="go">type SelectCase struct {
+ Dir SelectDir // direction of case
+ Chan Value // channel to use (for send or receive)
+ Send Value // value to send (for send)
+}
+</pre> <h2 id="SelectDir">type <span>SelectDir</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>A SelectDir describes the communication direction of a select case. </p>
+<pre data-language="go">type SelectDir int</pre> <pre data-language="go">const (
+ SelectSend SelectDir // case Chan &lt;- Send
+ SelectRecv // case &lt;-Chan:
+ SelectDefault // default
+)</pre> <h2 id="SliceHeader">type <span>SliceHeader</span> </h2> <p>SliceHeader is the runtime representation of a slice. It cannot be used safely or portably and its representation may change in a later release. Moreover, the Data field is not sufficient to guarantee the data it references will not be garbage collected, so programs must keep a separate, correctly typed pointer to the underlying data. </p>
+<p>Deprecated: Use unsafe.Slice or unsafe.SliceData instead. </p>
+<pre data-language="go">type SliceHeader struct {
+ Data uintptr
+ Len int
+ Cap int
+}
+</pre> <h2 id="StringHeader">type <span>StringHeader</span> </h2> <p>StringHeader is the runtime representation of a string. It cannot be used safely or portably and its representation may change in a later release. Moreover, the Data field is not sufficient to guarantee the data it references will not be garbage collected, so programs must keep a separate, correctly typed pointer to the underlying data. </p>
+<p>Deprecated: Use unsafe.String or unsafe.StringData instead. </p>
+<pre data-language="go">type StringHeader struct {
+ Data uintptr
+ Len int
+}
+</pre> <h2 id="StructField">type <span>StructField</span> </h2> <p>A StructField describes a single field in a struct. </p>
+<pre data-language="go">type StructField struct {
+ // Name is the field name.
+ Name string
+
+ // PkgPath is the package path that qualifies a lower case (unexported)
+ // field name. It is empty for upper case (exported) field names.
+ // See https://golang.org/ref/spec#Uniqueness_of_identifiers
+ PkgPath string
+
+ Type Type // field type
+ Tag StructTag // field tag string
+ Offset uintptr // offset within struct, in bytes
+ Index []int // index sequence for Type.FieldByIndex
+ Anonymous bool // is an embedded field
+}
+</pre> <h3 id="VisibleFields">func <span>VisibleFields</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func VisibleFields(t Type) []StructField</pre> <p>VisibleFields returns all the visible fields in t, which must be a struct type. A field is defined as visible if it's accessible directly with a FieldByName call. The returned fields include fields inside anonymous struct members and unexported fields. They follow the same order found in the struct, with anonymous fields followed immediately by their promoted fields. </p>
+<p>For each element e of the returned slice, the corresponding field can be retrieved from a value v of type t by calling v.FieldByIndex(e.Index). </p>
+<h3 id="StructField.IsExported">func (StructField) <span>IsExported</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (f StructField) IsExported() bool</pre> <p>IsExported reports whether the field is exported. </p>
+<h2 id="StructTag">type <span>StructTag</span> </h2> <p>A StructTag is the tag string in a struct field. </p>
+<p>By convention, tag strings are a concatenation of optionally space-separated key:"value" pairs. Each key is a non-empty string consisting of non-control characters other than space (U+0020 ' '), quote (U+0022 '"'), and colon (U+003A ':'). Each value is quoted using U+0022 '"' characters and Go string literal syntax. </p>
+<pre data-language="go">type StructTag string</pre> <h4 id="example_StructTag"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type S struct {
+ F string `species:"gopher" color:"blue"`
+}
+
+s := S{}
+st := reflect.TypeOf(s)
+field := st.Field(0)
+fmt.Println(field.Tag.Get("color"), field.Tag.Get("species"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">blue gopher
+</pre> <h3 id="StructTag.Get">func (StructTag) <span>Get</span> </h3> <pre data-language="go">func (tag StructTag) Get(key string) string</pre> <p>Get returns the value associated with key in the tag string. If there is no such key in the tag, Get returns the empty string. If the tag does not have the conventional format, the value returned by Get is unspecified. To determine whether a tag is explicitly set to the empty string, use Lookup. </p>
+<h3 id="StructTag.Lookup">func (StructTag) <span>Lookup</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (tag StructTag) Lookup(key string) (value string, ok bool)</pre> <p>Lookup returns the value associated with key in the tag string. If the key is present in the tag the value (which may be empty) is returned. Otherwise the returned value will be the empty string. The ok return value reports whether the value was explicitly set in the tag string. If the tag does not have the conventional format, the value returned by Lookup is unspecified. </p> <h4 id="example_StructTag_Lookup"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type S struct {
+ F0 string `alias:"field_0"`
+ F1 string `alias:""`
+ F2 string
+}
+
+s := S{}
+st := reflect.TypeOf(s)
+for i := 0; i &lt; st.NumField(); i++ {
+ field := st.Field(i)
+ if alias, ok := field.Tag.Lookup("alias"); ok {
+ if alias == "" {
+ fmt.Println("(blank)")
+ } else {
+ fmt.Println(alias)
+ }
+ } else {
+ fmt.Println("(not specified)")
+ }
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">field_0
+(blank)
+(not specified)
+</pre> <h2 id="Type">type <span>Type</span> </h2> <p>Type is the representation of a Go type. </p>
+<p>Not all methods apply to all kinds of types. Restrictions, if any, are noted in the documentation for each method. Use the Kind method to find out the kind of type before calling kind-specific methods. Calling a method inappropriate to the kind of type causes a run-time panic. </p>
+<p>Type values are comparable, such as with the == operator, so they can be used as map keys. Two Type values are equal if they represent identical types. </p>
+<pre data-language="go">type Type interface {
+
+ // Align returns the alignment in bytes of a value of
+ // this type when allocated in memory.
+ Align() int
+
+ // FieldAlign returns the alignment in bytes of a value of
+ // this type when used as a field in a struct.
+ FieldAlign() int
+
+ // Method returns the i'th method in the type's method set.
+ // It panics if i is not in the range [0, NumMethod()).
+ //
+ // For a non-interface type T or *T, the returned Method's Type and Func
+ // fields describe a function whose first argument is the receiver,
+ // and only exported methods are accessible.
+ //
+ // For an interface type, the returned Method's Type field gives the
+ // method signature, without a receiver, and the Func field is nil.
+ //
+ // Methods are sorted in lexicographic order.
+ Method(int) Method
+
+ // MethodByName returns the method with that name in the type's
+ // method set and a boolean indicating if the method was found.
+ //
+ // For a non-interface type T or *T, the returned Method's Type and Func
+ // fields describe a function whose first argument is the receiver.
+ //
+ // For an interface type, the returned Method's Type field gives the
+ // method signature, without a receiver, and the Func field is nil.
+ MethodByName(string) (Method, bool)
+
+ // NumMethod returns the number of methods accessible using Method.
+ //
+ // For a non-interface type, it returns the number of exported methods.
+ //
+ // For an interface type, it returns the number of exported and unexported methods.
+ NumMethod() int
+
+ // Name returns the type's name within its package for a defined type.
+ // For other (non-defined) types it returns the empty string.
+ Name() string
+
+ // PkgPath returns a defined type's package path, that is, the import path
+ // that uniquely identifies the package, such as "encoding/base64".
+ // If the type was predeclared (string, error) or not defined (*T, struct{},
+ // []int, or A where A is an alias for a non-defined type), the package path
+ // will be the empty string.
+ PkgPath() string
+
+ // Size returns the number of bytes needed to store
+ // a value of the given type; it is analogous to unsafe.Sizeof.
+ Size() uintptr
+
+ // String returns a string representation of the type.
+ // The string representation may use shortened package names
+ // (e.g., base64 instead of "encoding/base64") and is not
+ // guaranteed to be unique among types. To test for type identity,
+ // compare the Types directly.
+ String() string
+
+ // Kind returns the specific kind of this type.
+ Kind() Kind
+
+ // Implements reports whether the type implements the interface type u.
+ Implements(u Type) bool
+
+ // AssignableTo reports whether a value of the type is assignable to type u.
+ AssignableTo(u Type) bool
+
+ // ConvertibleTo reports whether a value of the type is convertible to type u.
+ // Even if ConvertibleTo returns true, the conversion may still panic.
+ // For example, a slice of type []T is convertible to *[N]T,
+ // but the conversion will panic if its length is less than N.
+ ConvertibleTo(u Type) bool
+
+ // Comparable reports whether values of this type are comparable.
+ // Even if Comparable returns true, the comparison may still panic.
+ // For example, values of interface type are comparable,
+ // but the comparison will panic if their dynamic type is not comparable.
+ Comparable() bool
+
+ // Bits returns the size of the type in bits.
+ // It panics if the type's Kind is not one of the
+ // sized or unsized Int, Uint, Float, or Complex kinds.
+ Bits() int
+
+ // ChanDir returns a channel type's direction.
+ // It panics if the type's Kind is not Chan.
+ ChanDir() ChanDir
+
+ // IsVariadic reports whether a function type's final input parameter
+ // is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's
+ // implicit actual type []T.
+ //
+ // For concreteness, if t represents func(x int, y ... float64), then
+ //
+ // t.NumIn() == 2
+ // t.In(0) is the reflect.Type for "int"
+ // t.In(1) is the reflect.Type for "[]float64"
+ // t.IsVariadic() == true
+ //
+ // IsVariadic panics if the type's Kind is not Func.
+ IsVariadic() bool
+
+ // Elem returns a type's element type.
+ // It panics if the type's Kind is not Array, Chan, Map, Pointer, or Slice.
+ Elem() Type
+
+ // Field returns a struct type's i'th field.
+ // It panics if the type's Kind is not Struct.
+ // It panics if i is not in the range [0, NumField()).
+ Field(i int) StructField
+
+ // FieldByIndex returns the nested field corresponding
+ // to the index sequence. It is equivalent to calling Field
+ // successively for each index i.
+ // It panics if the type's Kind is not Struct.
+ FieldByIndex(index []int) StructField
+
+ // FieldByName returns the struct field with the given name
+ // and a boolean indicating if the field was found.
+ // If the returned field is promoted from an embedded struct,
+ // then Offset in the returned StructField is the offset in
+ // the embedded struct.
+ FieldByName(name string) (StructField, bool)
+
+ // FieldByNameFunc returns the struct field with a name
+ // that satisfies the match function and a boolean indicating if
+ // the field was found.
+ //
+ // FieldByNameFunc considers the fields in the struct itself
+ // and then the fields in any embedded structs, in breadth first order,
+ // stopping at the shallowest nesting depth containing one or more
+ // fields satisfying the match function. If multiple fields at that depth
+ // satisfy the match function, they cancel each other
+ // and FieldByNameFunc returns no match.
+ // This behavior mirrors Go's handling of name lookup in
+ // structs containing embedded fields.
+ //
+ // If the returned field is promoted from an embedded struct,
+ // then Offset in the returned StructField is the offset in
+ // the embedded struct.
+ FieldByNameFunc(match func(string) bool) (StructField, bool)
+
+ // In returns the type of a function type's i'th input parameter.
+ // It panics if the type's Kind is not Func.
+ // It panics if i is not in the range [0, NumIn()).
+ In(i int) Type
+
+ // Key returns a map type's key type.
+ // It panics if the type's Kind is not Map.
+ Key() Type
+
+ // Len returns an array type's length.
+ // It panics if the type's Kind is not Array.
+ Len() int
+
+ // NumField returns a struct type's field count.
+ // It panics if the type's Kind is not Struct.
+ NumField() int
+
+ // NumIn returns a function type's input parameter count.
+ // It panics if the type's Kind is not Func.
+ NumIn() int
+
+ // NumOut returns a function type's output parameter count.
+ // It panics if the type's Kind is not Func.
+ NumOut() int
+
+ // Out returns the type of a function type's i'th output parameter.
+ // It panics if the type's Kind is not Func.
+ // It panics if i is not in the range [0, NumOut()).
+ Out(i int) Type
+ // contains filtered or unexported methods
+}</pre> <h3 id="ArrayOf">func <span>ArrayOf</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func ArrayOf(length int, elem Type) Type</pre> <p>ArrayOf returns the array type with the given length and element type. For example, if t represents int, ArrayOf(5, t) represents [5]int. </p>
+<p>If the resulting type would be larger than the available address space, ArrayOf panics. </p>
+<h3 id="ChanOf">func <span>ChanOf</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func ChanOf(dir ChanDir, t Type) Type</pre> <p>ChanOf returns the channel type with the given direction and element type. For example, if t represents int, ChanOf(RecvDir, t) represents &lt;-chan int. </p>
+<p>The gc runtime imposes a limit of 64 kB on channel element types. If t's size is equal to or exceeds this limit, ChanOf panics. </p>
+<h3 id="FuncOf">func <span>FuncOf</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func FuncOf(in, out []Type, variadic bool) Type</pre> <p>FuncOf returns the function type with the given argument and result types. For example if k represents int and e represents string, FuncOf([]Type{k}, []Type{e}, false) represents func(int) string. </p>
+<p>The variadic argument controls whether the function is variadic. FuncOf panics if the in[len(in)-1] does not represent a slice and variadic is true. </p>
+<h3 id="MapOf">func <span>MapOf</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func MapOf(key, elem Type) Type</pre> <p>MapOf returns the map type with the given key and element types. For example, if k represents int and e represents string, MapOf(k, e) represents map[int]string. </p>
+<p>If the key type is not a valid map key type (that is, if it does not implement Go's == operator), MapOf panics. </p>
+<h3 id="PointerTo">func <span>PointerTo</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func PointerTo(t Type) Type</pre> <p>PointerTo returns the pointer type with element t. For example, if t represents type Foo, PointerTo(t) represents *Foo. </p>
+<h3 id="PtrTo">func <span>PtrTo</span> </h3> <pre data-language="go">func PtrTo(t Type) Type</pre> <p>PtrTo returns the pointer type with element t. For example, if t represents type Foo, PtrTo(t) represents *Foo. </p>
+<p>PtrTo is the old spelling of <a href="#PointerTo">PointerTo</a>. The two functions behave identically. </p>
+<p>Deprecated: Superseded by <a href="#PointerTo">PointerTo</a>. </p>
+<h3 id="SliceOf">func <span>SliceOf</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func SliceOf(t Type) Type</pre> <p>SliceOf returns the slice type with element type t. For example, if t represents int, SliceOf(t) represents []int. </p>
+<h3 id="StructOf">func <span>StructOf</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func StructOf(fields []StructField) Type</pre> <p>StructOf returns the struct type containing fields. The Offset and Index fields are ignored and computed as they would be by the compiler. </p>
+<p>StructOf currently does not support promoted methods of embedded fields and panics if passed unexported StructFields. </p> <h4 id="example_StructOf"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">typ := reflect.StructOf([]reflect.StructField{
+ {
+ Name: "Height",
+ Type: reflect.TypeOf(float64(0)),
+ Tag: `json:"height"`,
+ },
+ {
+ Name: "Age",
+ Type: reflect.TypeOf(int(0)),
+ Tag: `json:"age"`,
+ },
+})
+
+v := reflect.New(typ).Elem()
+v.Field(0).SetFloat(0.4)
+v.Field(1).SetInt(2)
+s := v.Addr().Interface()
+
+w := new(bytes.Buffer)
+if err := json.NewEncoder(w).Encode(s); err != nil {
+ panic(err)
+}
+
+fmt.Printf("value: %+v\n", s)
+fmt.Printf("json: %s", w.Bytes())
+
+r := bytes.NewReader([]byte(`{"height":1.5,"age":10}`))
+if err := json.NewDecoder(r).Decode(s); err != nil {
+ panic(err)
+}
+fmt.Printf("value: %+v\n", s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">value: &amp;{Height:0.4 Age:2}
+json: {"height":0.4,"age":2}
+value: &amp;{Height:1.5 Age:10}
+</pre> <h3 id="TypeFor">func <span>TypeFor</span> </h3> <pre data-language="go">func TypeFor[T any]() Type</pre> <p>TypeFor returns the <a href="#Type">Type</a> that represents the type argument T. </p>
+<h3 id="TypeOf">func <span>TypeOf</span> </h3> <pre data-language="go">func TypeOf(i any) Type</pre> <p>TypeOf returns the reflection <a href="#Type">Type</a> that represents the dynamic type of i. If i is a nil interface value, TypeOf returns nil. </p> <h4 id="example_TypeOf"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// As interface types are only used for static typing, a
+// common idiom to find the reflection Type for an interface
+// type Foo is to use a *Foo value.
+writerType := reflect.TypeOf((*io.Writer)(nil)).Elem()
+
+fileType := reflect.TypeOf((*os.File)(nil))
+fmt.Println(fileType.Implements(writerType))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+</pre> <h2 id="Value">type <span>Value</span> </h2> <p>Value is the reflection interface to a Go value. </p>
+<p>Not all methods apply to all kinds of values. Restrictions, if any, are noted in the documentation for each method. Use the Kind method to find out the kind of value before calling kind-specific methods. Calling a method inappropriate to the kind of type causes a run time panic. </p>
+<p>The zero Value represents no value. Its IsValid method returns false, its Kind method returns Invalid, its String method returns "&lt;invalid Value&gt;", and all other methods panic. Most functions and methods never return an invalid value. If one does, its documentation states the conditions explicitly. </p>
+<p>A Value can be used concurrently by multiple goroutines provided that the underlying Go value can be used concurrently for the equivalent direct operations. </p>
+<p>To compare two Values, compare the results of the Interface method. Using == on two Values does not compare the underlying values they represent. </p>
+<pre data-language="go">type Value struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Append">func <span>Append</span> </h3> <pre data-language="go">func Append(s Value, x ...Value) Value</pre> <p>Append appends the values x to a slice s and returns the resulting slice. As in Go, each x's value must be assignable to the slice's element type. </p>
+<h3 id="AppendSlice">func <span>AppendSlice</span> </h3> <pre data-language="go">func AppendSlice(s, t Value) Value</pre> <p>AppendSlice appends a slice t to a slice s and returns the resulting slice. The slices s and t must have the same element type. </p>
+<h3 id="Indirect">func <span>Indirect</span> </h3> <pre data-language="go">func Indirect(v Value) Value</pre> <p>Indirect returns the value that v points to. If v is a nil pointer, Indirect returns a zero Value. If v is not a pointer, Indirect returns v. </p>
+<h3 id="MakeChan">func <span>MakeChan</span> </h3> <pre data-language="go">func MakeChan(typ Type, buffer int) Value</pre> <p>MakeChan creates a new channel with the specified type and buffer size. </p>
+<h3 id="MakeFunc">func <span>MakeFunc</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func MakeFunc(typ Type, fn func(args []Value) (results []Value)) Value</pre> <p>MakeFunc returns a new function of the given Type that wraps the function fn. When called, that new function does the following: </p>
+<ul> <li>converts its arguments to a slice of Values. </li>
+<li>runs results := fn(args). </li>
+<li>returns the results as a slice of Values, one per formal result. </li>
+</ul> <p>The implementation fn can assume that the argument Value slice has the number and type of arguments given by typ. If typ describes a variadic function, the final Value is itself a slice representing the variadic arguments, as in the body of a variadic function. The result Value slice returned by fn must have the number and type of results given by typ. </p>
+<p>The Value.Call method allows the caller to invoke a typed function in terms of Values; in contrast, MakeFunc allows the caller to implement a typed function in terms of Values. </p>
+<p>The Examples section of the documentation includes an illustration of how to use MakeFunc to build a swap function for different types. </p> <h4 id="example_MakeFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// swap is the implementation passed to MakeFunc.
+// It must work in terms of reflect.Values so that it is possible
+// to write code without knowing beforehand what the types
+// will be.
+swap := func(in []reflect.Value) []reflect.Value {
+ return []reflect.Value{in[1], in[0]}
+}
+
+// makeSwap expects fptr to be a pointer to a nil function.
+// It sets that pointer to a new function created with MakeFunc.
+// When the function is invoked, reflect turns the arguments
+// into Values, calls swap, and then turns swap's result slice
+// into the values returned by the new function.
+makeSwap := func(fptr any) {
+ // fptr is a pointer to a function.
+ // Obtain the function value itself (likely nil) as a reflect.Value
+ // so that we can query its type and then set the value.
+ fn := reflect.ValueOf(fptr).Elem()
+
+ // Make a function of the right type.
+ v := reflect.MakeFunc(fn.Type(), swap)
+
+ // Assign it to the value fn represents.
+ fn.Set(v)
+}
+
+// Make and call a swap function for ints.
+var intSwap func(int, int) (int, int)
+makeSwap(&amp;intSwap)
+fmt.Println(intSwap(0, 1))
+
+// Make and call a swap function for float64s.
+var floatSwap func(float64, float64) (float64, float64)
+makeSwap(&amp;floatSwap)
+fmt.Println(floatSwap(2.72, 3.14))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1 0
+3.14 2.72
+</pre> <h3 id="MakeMap">func <span>MakeMap</span> </h3> <pre data-language="go">func MakeMap(typ Type) Value</pre> <p>MakeMap creates a new map with the specified type. </p>
+<h3 id="MakeMapWithSize">func <span>MakeMapWithSize</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func MakeMapWithSize(typ Type, n int) Value</pre> <p>MakeMapWithSize creates a new map with the specified type and initial space for approximately n elements. </p>
+<h3 id="MakeSlice">func <span>MakeSlice</span> </h3> <pre data-language="go">func MakeSlice(typ Type, len, cap int) Value</pre> <p>MakeSlice creates a new zero-initialized slice value for the specified slice type, length, and capacity. </p>
+<h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(typ Type) Value</pre> <p>New returns a Value representing a pointer to a new zero value for the specified type. That is, the returned Value's Type is PointerTo(typ). </p>
+<h3 id="NewAt">func <span>NewAt</span> </h3> <pre data-language="go">func NewAt(typ Type, p unsafe.Pointer) Value</pre> <p>NewAt returns a Value representing a pointer to a value of the specified type, using p as that pointer. </p>
+<h3 id="Select">func <span>Select</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func Select(cases []SelectCase) (chosen int, recv Value, recvOK bool)</pre> <p>Select executes a select operation described by the list of cases. Like the Go select statement, it blocks until at least one of the cases can proceed, makes a uniform pseudo-random choice, and then executes that case. It returns the index of the chosen case and, if that case was a receive operation, the value received and a boolean indicating whether the value corresponds to a send on the channel (as opposed to a zero value received because the channel is closed). Select supports a maximum of 65536 cases. </p>
+<h3 id="ValueOf">func <span>ValueOf</span> </h3> <pre data-language="go">func ValueOf(i any) Value</pre> <p>ValueOf returns a new Value initialized to the concrete value stored in the interface i. ValueOf(nil) returns the zero Value. </p>
+<h3 id="Zero">func <span>Zero</span> </h3> <pre data-language="go">func Zero(typ Type) Value</pre> <p>Zero returns a Value representing the zero value for the specified type. The result is different from the zero value of the Value struct, which represents no value at all. For example, Zero(TypeOf(42)) returns a Value with Kind <a href="#Int">Int</a> and value 0. The returned value is neither addressable nor settable. </p>
+<h3 id="Value.Addr">func (Value) <span>Addr</span> </h3> <pre data-language="go">func (v Value) Addr() Value</pre> <p>Addr returns a pointer value representing the address of v. It panics if <a href="#Value.CanAddr">Value.CanAddr</a> returns false. Addr is typically used to obtain a pointer to a struct field or slice element in order to call a method that requires a pointer receiver. </p>
+<h3 id="Value.Bool">func (Value) <span>Bool</span> </h3> <pre data-language="go">func (v Value) Bool() bool</pre> <p>Bool returns v's underlying value. It panics if v's kind is not <a href="#Bool">Bool</a>. </p>
+<h3 id="Value.Bytes">func (Value) <span>Bytes</span> </h3> <pre data-language="go">func (v Value) Bytes() []byte</pre> <p>Bytes returns v's underlying value. It panics if v's underlying value is not a slice of bytes or an addressable array of bytes. </p>
+<h3 id="Value.Call">func (Value) <span>Call</span> </h3> <pre data-language="go">func (v Value) Call(in []Value) []Value</pre> <p>Call calls the function v with the input arguments in. For example, if len(in) == 3, v.Call(in) represents the Go call v(in[0], in[1], in[2]). Call panics if v's Kind is not <a href="#Func">Func</a>. It returns the output results as Values. As in Go, each input argument must be assignable to the type of the function's corresponding input parameter. If v is a variadic function, Call creates the variadic slice parameter itself, copying in the corresponding values. </p>
+<h3 id="Value.CallSlice">func (Value) <span>CallSlice</span> </h3> <pre data-language="go">func (v Value) CallSlice(in []Value) []Value</pre> <p>CallSlice calls the variadic function v with the input arguments in, assigning the slice in[len(in)-1] to v's final variadic argument. For example, if len(in) == 3, v.CallSlice(in) represents the Go call v(in[0], in[1], in[2]...). CallSlice panics if v's Kind is not <a href="#Func">Func</a> or if v is not variadic. It returns the output results as Values. As in Go, each input argument must be assignable to the type of the function's corresponding input parameter. </p>
+<h3 id="Value.CanAddr">func (Value) <span>CanAddr</span> </h3> <pre data-language="go">func (v Value) CanAddr() bool</pre> <p>CanAddr reports whether the value's address can be obtained with <a href="#Value.Addr">Value.Addr</a>. Such values are called addressable. A value is addressable if it is an element of a slice, an element of an addressable array, a field of an addressable struct, or the result of dereferencing a pointer. If CanAddr returns false, calling <a href="#Value.Addr">Value.Addr</a> will panic. </p>
+<h3 id="Value.CanComplex">func (Value) <span>CanComplex</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (v Value) CanComplex() bool</pre> <p>CanComplex reports whether <a href="#Value.Complex">Value.Complex</a> can be used without panicking. </p>
+<h3 id="Value.CanConvert">func (Value) <span>CanConvert</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (v Value) CanConvert(t Type) bool</pre> <p>CanConvert reports whether the value v can be converted to type t. If v.CanConvert(t) returns true then v.Convert(t) will not panic. </p>
+<h3 id="Value.CanFloat">func (Value) <span>CanFloat</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (v Value) CanFloat() bool</pre> <p>CanFloat reports whether <a href="#Value.Float">Value.Float</a> can be used without panicking. </p>
+<h3 id="Value.CanInt">func (Value) <span>CanInt</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (v Value) CanInt() bool</pre> <p>CanInt reports whether Int can be used without panicking. </p>
+<h3 id="Value.CanInterface">func (Value) <span>CanInterface</span> </h3> <pre data-language="go">func (v Value) CanInterface() bool</pre> <p>CanInterface reports whether <a href="#Value.Interface">Value.Interface</a> can be used without panicking. </p>
+<h3 id="Value.CanSet">func (Value) <span>CanSet</span> </h3> <pre data-language="go">func (v Value) CanSet() bool</pre> <p>CanSet reports whether the value of v can be changed. A <a href="#Value">Value</a> can be changed only if it is addressable and was not obtained by the use of unexported struct fields. If CanSet returns false, calling <a href="#Value.Set">Value.Set</a> or any type-specific setter (e.g., <a href="#Value.SetBool">Value.SetBool</a>, <a href="#Value.SetInt">Value.SetInt</a>) will panic. </p>
+<h3 id="Value.CanUint">func (Value) <span>CanUint</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (v Value) CanUint() bool</pre> <p>CanUint reports whether <a href="#Value.Uint">Value.Uint</a> can be used without panicking. </p>
+<h3 id="Value.Cap">func (Value) <span>Cap</span> </h3> <pre data-language="go">func (v Value) Cap() int</pre> <p>Cap returns v's capacity. It panics if v's Kind is not <a href="#Array">Array</a>, <a href="#Chan">Chan</a>, <a href="#Slice">Slice</a> or pointer to <a href="#Array">Array</a>. </p>
+<h3 id="Value.Clear">func (Value) <span>Clear</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (v Value) Clear()</pre> <p>Clear clears the contents of a map or zeros the contents of a slice. </p>
+<p>It panics if v's Kind is not <a href="#Map">Map</a> or <a href="#Slice">Slice</a>. </p>
+<h3 id="Value.Close">func (Value) <span>Close</span> </h3> <pre data-language="go">func (v Value) Close()</pre> <p>Close closes the channel v. It panics if v's Kind is not <a href="#Chan">Chan</a> or v is a receive-only channel. </p>
+<h3 id="Value.Comparable">func (Value) <span>Comparable</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (v Value) Comparable() bool</pre> <p>Comparable reports whether the value v is comparable. If the type of v is an interface, this checks the dynamic type. If this reports true then v.Interface() == x will not panic for any x, nor will v.Equal(u) for any Value u. </p>
+<h3 id="Value.Complex">func (Value) <span>Complex</span> </h3> <pre data-language="go">func (v Value) Complex() complex128</pre> <p>Complex returns v's underlying value, as a complex128. It panics if v's Kind is not <a href="#Complex64">Complex64</a> or <a href="#Complex128">Complex128</a> </p>
+<h3 id="Value.Convert">func (Value) <span>Convert</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (v Value) Convert(t Type) Value</pre> <p>Convert returns the value v converted to type t. If the usual Go conversion rules do not allow conversion of the value v to type t, or if converting v to type t panics, Convert panics. </p>
+<h3 id="Value.Elem">func (Value) <span>Elem</span> </h3> <pre data-language="go">func (v Value) Elem() Value</pre> <p>Elem returns the value that the interface v contains or that the pointer v points to. It panics if v's Kind is not <a href="#Interface">Interface</a> or <a href="#Pointer">Pointer</a>. It returns the zero Value if v is nil. </p>
+<h3 id="Value.Equal">func (Value) <span>Equal</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (v Value) Equal(u Value) bool</pre> <p>Equal reports true if v is equal to u. For two invalid values, Equal will report true. For an interface value, Equal will compare the value within the interface. Otherwise, If the values have different types, Equal will report false. Otherwise, for arrays and structs Equal will compare each element in order, and report false if it finds non-equal elements. During all comparisons, if values of the same type are compared, and the type is not comparable, Equal will panic. </p>
+<h3 id="Value.Field">func (Value) <span>Field</span> </h3> <pre data-language="go">func (v Value) Field(i int) Value</pre> <p>Field returns the i'th field of the struct v. It panics if v's Kind is not <a href="#Struct">Struct</a> or i is out of range. </p>
+<h3 id="Value.FieldByIndex">func (Value) <span>FieldByIndex</span> </h3> <pre data-language="go">func (v Value) FieldByIndex(index []int) Value</pre> <p>FieldByIndex returns the nested field corresponding to index. It panics if evaluation requires stepping through a nil pointer or a field that is not a struct. </p> <h4 id="example_Value_FieldByIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// This example shows a case in which the name of a promoted field
+// is hidden by another field: FieldByName will not work, so
+// FieldByIndex must be used instead.
+type user struct {
+ firstName string
+ lastName string
+}
+
+type data struct {
+ user
+ firstName string
+ lastName string
+}
+
+u := data{
+ user: user{"Embedded John", "Embedded Doe"},
+ firstName: "John",
+ lastName: "Doe",
+}
+
+s := reflect.ValueOf(u).FieldByIndex([]int{0, 1})
+fmt.Println("embedded last name:", s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">embedded last name: Embedded Doe
+</pre> <h3 id="Value.FieldByIndexErr">func (Value) <span>FieldByIndexErr</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (v Value) FieldByIndexErr(index []int) (Value, error)</pre> <p>FieldByIndexErr returns the nested field corresponding to index. It returns an error if evaluation requires stepping through a nil pointer, but panics if it must step through a field that is not a struct. </p>
+<h3 id="Value.FieldByName">func (Value) <span>FieldByName</span> </h3> <pre data-language="go">func (v Value) FieldByName(name string) Value</pre> <p>FieldByName returns the struct field with the given name. It returns the zero Value if no field was found. It panics if v's Kind is not <a href="#Struct">Struct</a>. </p> <h4 id="example_Value_FieldByName"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type user struct {
+ firstName string
+ lastName string
+}
+u := user{firstName: "John", lastName: "Doe"}
+s := reflect.ValueOf(u)
+
+fmt.Println("Name:", s.FieldByName("firstName"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Name: John
+</pre> <h3 id="Value.FieldByNameFunc">func (Value) <span>FieldByNameFunc</span> </h3> <pre data-language="go">func (v Value) FieldByNameFunc(match func(string) bool) Value</pre> <p>FieldByNameFunc returns the struct field with a name that satisfies the match function. It panics if v's Kind is not <a href="#Struct">Struct</a>. It returns the zero Value if no field was found. </p>
+<h3 id="Value.Float">func (Value) <span>Float</span> </h3> <pre data-language="go">func (v Value) Float() float64</pre> <p>Float returns v's underlying value, as a float64. It panics if v's Kind is not <a href="#Float32">Float32</a> or <a href="#Float64">Float64</a> </p>
+<h3 id="Value.Grow">func (Value) <span>Grow</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (v Value) Grow(n int)</pre> <p>Grow increases the slice's capacity, if necessary, to guarantee space for another n elements. After Grow(n), at least n elements can be appended to the slice without another allocation. </p>
+<p>It panics if v's Kind is not a <a href="#Slice">Slice</a> or if n is negative or too large to allocate the memory. </p>
+<h3 id="Value.Index">func (Value) <span>Index</span> </h3> <pre data-language="go">func (v Value) Index(i int) Value</pre> <p>Index returns v's i'th element. It panics if v's Kind is not <a href="#Array">Array</a>, <a href="#Slice">Slice</a>, or <a href="#String">String</a> or i is out of range. </p>
+<h3 id="Value.Int">func (Value) <span>Int</span> </h3> <pre data-language="go">func (v Value) Int() int64</pre> <p>Int returns v's underlying value, as an int64. It panics if v's Kind is not <a href="#Int">Int</a>, <a href="#Int8">Int8</a>, <a href="#Int16">Int16</a>, <a href="#Int32">Int32</a>, or <a href="#Int64">Int64</a>. </p>
+<h3 id="Value.Interface">func (Value) <span>Interface</span> </h3> <pre data-language="go">func (v Value) Interface() (i any)</pre> <p>Interface returns v's current value as an interface{}. It is equivalent to: </p>
+<pre data-language="go">var i interface{} = (v's underlying value)
+</pre> <p>It panics if the Value was obtained by accessing unexported struct fields. </p>
+<h3 id="Value.InterfaceData">func (Value) <span>InterfaceData</span> </h3> <pre data-language="go">func (v Value) InterfaceData() [2]uintptr</pre> <p>InterfaceData returns a pair of unspecified uintptr values. It panics if v's Kind is not Interface. </p>
+<p>In earlier versions of Go, this function returned the interface's value as a uintptr pair. As of Go 1.4, the implementation of interface values precludes any defined use of InterfaceData. </p>
+<p>Deprecated: The memory representation of interface values is not compatible with InterfaceData. </p>
+<h3 id="Value.IsNil">func (Value) <span>IsNil</span> </h3> <pre data-language="go">func (v Value) IsNil() bool</pre> <p>IsNil reports whether its argument v is nil. The argument must be a chan, func, interface, map, pointer, or slice value; if it is not, IsNil panics. Note that IsNil is not always equivalent to a regular comparison with nil in Go. For example, if v was created by calling ValueOf with an uninitialized interface variable i, i==nil will be true but v.IsNil will panic as v will be the zero Value. </p>
+<h3 id="Value.IsValid">func (Value) <span>IsValid</span> </h3> <pre data-language="go">func (v Value) IsValid() bool</pre> <p>IsValid reports whether v represents a value. It returns false if v is the zero Value. If IsValid returns false, all other methods except String panic. Most functions and methods never return an invalid Value. If one does, its documentation states the conditions explicitly. </p>
+<h3 id="Value.IsZero">func (Value) <span>IsZero</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (v Value) IsZero() bool</pre> <p>IsZero reports whether v is the zero value for its type. It panics if the argument is invalid. </p>
+<h3 id="Value.Kind">func (Value) <span>Kind</span> </h3> <pre data-language="go">func (v Value) Kind() Kind</pre> <p>Kind returns v's Kind. If v is the zero Value (<a href="#Value.IsValid">Value.IsValid</a> returns false), Kind returns Invalid. </p>
+<h3 id="Value.Len">func (Value) <span>Len</span> </h3> <pre data-language="go">func (v Value) Len() int</pre> <p>Len returns v's length. It panics if v's Kind is not <a href="#Array">Array</a>, <a href="#Chan">Chan</a>, <a href="#Map">Map</a>, <a href="#Slice">Slice</a>, <a href="#String">String</a>, or pointer to <a href="#Array">Array</a>. </p>
+<h3 id="Value.MapIndex">func (Value) <span>MapIndex</span> </h3> <pre data-language="go">func (v Value) MapIndex(key Value) Value</pre> <p>MapIndex returns the value associated with key in the map v. It panics if v's Kind is not <a href="#Map">Map</a>. It returns the zero Value if key is not found in the map or if v represents a nil map. As in Go, the key's value must be assignable to the map's key type. </p>
+<h3 id="Value.MapKeys">func (Value) <span>MapKeys</span> </h3> <pre data-language="go">func (v Value) MapKeys() []Value</pre> <p>MapKeys returns a slice containing all the keys present in the map, in unspecified order. It panics if v's Kind is not <a href="#Map">Map</a>. It returns an empty slice if v represents a nil map. </p>
+<h3 id="Value.MapRange">func (Value) <span>MapRange</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (v Value) MapRange() *MapIter</pre> <p>MapRange returns a range iterator for a map. It panics if v's Kind is not <a href="#Map">Map</a>. </p>
+<p>Call <a href="#MapIter.Next">MapIter.Next</a> to advance the iterator, and <a href="#MapIter.Key">MapIter.Key</a>/<a href="#MapIter.Value">MapIter.Value</a> to access each entry. <a href="#MapIter.Next">MapIter.Next</a> returns false when the iterator is exhausted. MapRange follows the same iteration semantics as a range statement. </p>
+<p>Example: </p>
+<pre data-language="go">iter := reflect.ValueOf(m).MapRange()
+for iter.Next() {
+ k := iter.Key()
+ v := iter.Value()
+ ...
+}
+</pre> <h3 id="Value.Method">func (Value) <span>Method</span> </h3> <pre data-language="go">func (v Value) Method(i int) Value</pre> <p>Method returns a function value corresponding to v's i'th method. The arguments to a Call on the returned function should not include a receiver; the returned function will always use v as the receiver. Method panics if i is out of range or if v is a nil interface value. </p>
+<h3 id="Value.MethodByName">func (Value) <span>MethodByName</span> </h3> <pre data-language="go">func (v Value) MethodByName(name string) Value</pre> <p>MethodByName returns a function value corresponding to the method of v with the given name. The arguments to a Call on the returned function should not include a receiver; the returned function will always use v as the receiver. It returns the zero Value if no method was found. </p>
+<h3 id="Value.NumField">func (Value) <span>NumField</span> </h3> <pre data-language="go">func (v Value) NumField() int</pre> <p>NumField returns the number of fields in the struct v. It panics if v's Kind is not <a href="#Struct">Struct</a>. </p>
+<h3 id="Value.NumMethod">func (Value) <span>NumMethod</span> </h3> <pre data-language="go">func (v Value) NumMethod() int</pre> <p>NumMethod returns the number of methods in the value's method set. </p>
+<p>For a non-interface type, it returns the number of exported methods. </p>
+<p>For an interface type, it returns the number of exported and unexported methods. </p>
+<h3 id="Value.OverflowComplex">func (Value) <span>OverflowComplex</span> </h3> <pre data-language="go">func (v Value) OverflowComplex(x complex128) bool</pre> <p>OverflowComplex reports whether the complex128 x cannot be represented by v's type. It panics if v's Kind is not <a href="#Complex64">Complex64</a> or <a href="#Complex128">Complex128</a>. </p>
+<h3 id="Value.OverflowFloat">func (Value) <span>OverflowFloat</span> </h3> <pre data-language="go">func (v Value) OverflowFloat(x float64) bool</pre> <p>OverflowFloat reports whether the float64 x cannot be represented by v's type. It panics if v's Kind is not <a href="#Float32">Float32</a> or <a href="#Float64">Float64</a>. </p>
+<h3 id="Value.OverflowInt">func (Value) <span>OverflowInt</span> </h3> <pre data-language="go">func (v Value) OverflowInt(x int64) bool</pre> <p>OverflowInt reports whether the int64 x cannot be represented by v's type. It panics if v's Kind is not <a href="#Int">Int</a>, <a href="#Int8">Int8</a>, <a href="#Int16">Int16</a>, <a href="#Int32">Int32</a>, or <a href="#Int64">Int64</a>. </p>
+<h3 id="Value.OverflowUint">func (Value) <span>OverflowUint</span> </h3> <pre data-language="go">func (v Value) OverflowUint(x uint64) bool</pre> <p>OverflowUint reports whether the uint64 x cannot be represented by v's type. It panics if v's Kind is not <a href="#Uint">Uint</a>, <a href="#Uintptr">Uintptr</a>, <a href="#Uint8">Uint8</a>, <a href="#Uint16">Uint16</a>, <a href="#Uint32">Uint32</a>, or <a href="#Uint64">Uint64</a>. </p>
+<h3 id="Value.Pointer">func (Value) <span>Pointer</span> </h3> <pre data-language="go">func (v Value) Pointer() uintptr</pre> <p>Pointer returns v's value as a uintptr. It panics if v's Kind is not <a href="#Chan">Chan</a>, <a href="#Func">Func</a>, <a href="#Map">Map</a>, <a href="#Pointer">Pointer</a>, <a href="#Slice">Slice</a>, or <a href="#UnsafePointer">UnsafePointer</a>. </p>
+<p>If v's Kind is <a href="#Func">Func</a>, the returned pointer is an underlying code pointer, but not necessarily enough to identify a single function uniquely. The only guarantee is that the result is zero if and only if v is a nil func Value. </p>
+<p>If v's Kind is <a href="#Slice">Slice</a>, the returned pointer is to the first element of the slice. If the slice is nil the returned value is 0. If the slice is empty but non-nil the return value is non-zero. </p>
+<p>It's preferred to use uintptr(Value.UnsafePointer()) to get the equivalent result. </p>
+<h3 id="Value.Recv">func (Value) <span>Recv</span> </h3> <pre data-language="go">func (v Value) Recv() (x Value, ok bool)</pre> <p>Recv receives and returns a value from the channel v. It panics if v's Kind is not <a href="#Chan">Chan</a>. The receive blocks until a value is ready. The boolean value ok is true if the value x corresponds to a send on the channel, false if it is a zero value received because the channel is closed. </p>
+<h3 id="Value.Send">func (Value) <span>Send</span> </h3> <pre data-language="go">func (v Value) Send(x Value)</pre> <p>Send sends x on the channel v. It panics if v's kind is not <a href="#Chan">Chan</a> or if x's type is not the same type as v's element type. As in Go, x's value must be assignable to the channel's element type. </p>
+<h3 id="Value.Set">func (Value) <span>Set</span> </h3> <pre data-language="go">func (v Value) Set(x Value)</pre> <p>Set assigns x to the value v. It panics if <a href="#Value.CanSet">Value.CanSet</a> returns false. As in Go, x's value must be assignable to v's type and must not be derived from an unexported field. </p>
+<h3 id="Value.SetBool">func (Value) <span>SetBool</span> </h3> <pre data-language="go">func (v Value) SetBool(x bool)</pre> <p>SetBool sets v's underlying value. It panics if v's Kind is not <a href="#Bool">Bool</a> or if <a href="#Value.CanSet">Value.CanSet</a> returns false. </p>
+<h3 id="Value.SetBytes">func (Value) <span>SetBytes</span> </h3> <pre data-language="go">func (v Value) SetBytes(x []byte)</pre> <p>SetBytes sets v's underlying value. It panics if v's underlying value is not a slice of bytes. </p>
+<h3 id="Value.SetCap">func (Value) <span>SetCap</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (v Value) SetCap(n int)</pre> <p>SetCap sets v's capacity to n. It panics if v's Kind is not <a href="#Slice">Slice</a> or if n is smaller than the length or greater than the capacity of the slice. </p>
+<h3 id="Value.SetComplex">func (Value) <span>SetComplex</span> </h3> <pre data-language="go">func (v Value) SetComplex(x complex128)</pre> <p>SetComplex sets v's underlying value to x. It panics if v's Kind is not <a href="#Complex64">Complex64</a> or <a href="#Complex128">Complex128</a>, or if <a href="#Value.CanSet">Value.CanSet</a> returns false. </p>
+<h3 id="Value.SetFloat">func (Value) <span>SetFloat</span> </h3> <pre data-language="go">func (v Value) SetFloat(x float64)</pre> <p>SetFloat sets v's underlying value to x. It panics if v's Kind is not <a href="#Float32">Float32</a> or <a href="#Float64">Float64</a>, or if <a href="#Value.CanSet">Value.CanSet</a> returns false. </p>
+<h3 id="Value.SetInt">func (Value) <span>SetInt</span> </h3> <pre data-language="go">func (v Value) SetInt(x int64)</pre> <p>SetInt sets v's underlying value to x. It panics if v's Kind is not <a href="#Int">Int</a>, <a href="#Int8">Int8</a>, <a href="#Int16">Int16</a>, <a href="#Int32">Int32</a>, or <a href="#Int64">Int64</a>, or if <a href="#Value.CanSet">Value.CanSet</a> returns false. </p>
+<h3 id="Value.SetIterKey">func (Value) <span>SetIterKey</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (v Value) SetIterKey(iter *MapIter)</pre> <p>SetIterKey assigns to v the key of iter's current map entry. It is equivalent to v.Set(iter.Key()), but it avoids allocating a new Value. As in Go, the key must be assignable to v's type and must not be derived from an unexported field. </p>
+<h3 id="Value.SetIterValue">func (Value) <span>SetIterValue</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (v Value) SetIterValue(iter *MapIter)</pre> <p>SetIterValue assigns to v the value of iter's current map entry. It is equivalent to v.Set(iter.Value()), but it avoids allocating a new Value. As in Go, the value must be assignable to v's type and must not be derived from an unexported field. </p>
+<h3 id="Value.SetLen">func (Value) <span>SetLen</span> </h3> <pre data-language="go">func (v Value) SetLen(n int)</pre> <p>SetLen sets v's length to n. It panics if v's Kind is not <a href="#Slice">Slice</a> or if n is negative or greater than the capacity of the slice. </p>
+<h3 id="Value.SetMapIndex">func (Value) <span>SetMapIndex</span> </h3> <pre data-language="go">func (v Value) SetMapIndex(key, elem Value)</pre> <p>SetMapIndex sets the element associated with key in the map v to elem. It panics if v's Kind is not <a href="#Map">Map</a>. If elem is the zero Value, SetMapIndex deletes the key from the map. Otherwise if v holds a nil map, SetMapIndex will panic. As in Go, key's elem must be assignable to the map's key type, and elem's value must be assignable to the map's elem type. </p>
+<h3 id="Value.SetPointer">func (Value) <span>SetPointer</span> </h3> <pre data-language="go">func (v Value) SetPointer(x unsafe.Pointer)</pre> <p>SetPointer sets the <span>unsafe.Pointer</span> value v to x. It panics if v's Kind is not UnsafePointer. </p>
+<h3 id="Value.SetString">func (Value) <span>SetString</span> </h3> <pre data-language="go">func (v Value) SetString(x string)</pre> <p>SetString sets v's underlying value to x. It panics if v's Kind is not <a href="#String">String</a> or if <a href="#Value.CanSet">Value.CanSet</a> returns false. </p>
+<h3 id="Value.SetUint">func (Value) <span>SetUint</span> </h3> <pre data-language="go">func (v Value) SetUint(x uint64)</pre> <p>SetUint sets v's underlying value to x. It panics if v's Kind is not <a href="#Uint">Uint</a>, <a href="#Uintptr">Uintptr</a>, <a href="#Uint8">Uint8</a>, <a href="#Uint16">Uint16</a>, <a href="#Uint32">Uint32</a>, or <a href="#Uint64">Uint64</a>, or if <a href="#Value.CanSet">Value.CanSet</a> returns false. </p>
+<h3 id="Value.SetZero">func (Value) <span>SetZero</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (v Value) SetZero()</pre> <p>SetZero sets v to be the zero value of v's type. It panics if <a href="#Value.CanSet">Value.CanSet</a> returns false. </p>
+<h3 id="Value.Slice">func (Value) <span>Slice</span> </h3> <pre data-language="go">func (v Value) Slice(i, j int) Value</pre> <p>Slice returns v[i:j]. It panics if v's Kind is not <a href="#Array">Array</a>, <a href="#Slice">Slice</a> or <a href="#String">String</a>, or if v is an unaddressable array, or if the indexes are out of bounds. </p>
+<h3 id="Value.Slice3">func (Value) <span>Slice3</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (v Value) Slice3(i, j, k int) Value</pre> <p>Slice3 is the 3-index form of the slice operation: it returns v[i:j:k]. It panics if v's Kind is not <a href="#Array">Array</a> or <a href="#Slice">Slice</a>, or if v is an unaddressable array, or if the indexes are out of bounds. </p>
+<h3 id="Value.String">func (Value) <span>String</span> </h3> <pre data-language="go">func (v Value) String() string</pre> <p>String returns the string v's underlying value, as a string. String is a special case because of Go's String method convention. Unlike the other getters, it does not panic if v's Kind is not <a href="#String">String</a>. Instead, it returns a string of the form "&lt;T value&gt;" where T is v's type. The fmt package treats Values specially. It does not call their String method implicitly but instead prints the concrete values they hold. </p>
+<h3 id="Value.TryRecv">func (Value) <span>TryRecv</span> </h3> <pre data-language="go">func (v Value) TryRecv() (x Value, ok bool)</pre> <p>TryRecv attempts to receive a value from the channel v but will not block. It panics if v's Kind is not <a href="#Chan">Chan</a>. If the receive delivers a value, x is the transferred value and ok is true. If the receive cannot finish without blocking, x is the zero Value and ok is false. If the channel is closed, x is the zero value for the channel's element type and ok is false. </p>
+<h3 id="Value.TrySend">func (Value) <span>TrySend</span> </h3> <pre data-language="go">func (v Value) TrySend(x Value) bool</pre> <p>TrySend attempts to send x on the channel v but will not block. It panics if v's Kind is not <a href="#Chan">Chan</a>. It reports whether the value was sent. As in Go, x's value must be assignable to the channel's element type. </p>
+<h3 id="Value.Type">func (Value) <span>Type</span> </h3> <pre data-language="go">func (v Value) Type() Type</pre> <p>Type returns v's type. </p>
+<h3 id="Value.Uint">func (Value) <span>Uint</span> </h3> <pre data-language="go">func (v Value) Uint() uint64</pre> <p>Uint returns v's underlying value, as a uint64. It panics if v's Kind is not <a href="#Uint">Uint</a>, <a href="#Uintptr">Uintptr</a>, <a href="#Uint8">Uint8</a>, <a href="#Uint16">Uint16</a>, <a href="#Uint32">Uint32</a>, or <a href="#Uint64">Uint64</a>. </p>
+<h3 id="Value.UnsafeAddr">func (Value) <span>UnsafeAddr</span> </h3> <pre data-language="go">func (v Value) UnsafeAddr() uintptr</pre> <p>UnsafeAddr returns a pointer to v's data, as a uintptr. It panics if v is not addressable. </p>
+<p>It's preferred to use uintptr(Value.Addr().UnsafePointer()) to get the equivalent result. </p>
+<h3 id="Value.UnsafePointer">func (Value) <span>UnsafePointer</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (v Value) UnsafePointer() unsafe.Pointer</pre> <p>UnsafePointer returns v's value as a <span>unsafe.Pointer</span>. It panics if v's Kind is not <a href="#Chan">Chan</a>, <a href="#Func">Func</a>, <a href="#Map">Map</a>, <a href="#Pointer">Pointer</a>, <a href="#Slice">Slice</a>, or <a href="#UnsafePointer">UnsafePointer</a>. </p>
+<p>If v's Kind is <a href="#Func">Func</a>, the returned pointer is an underlying code pointer, but not necessarily enough to identify a single function uniquely. The only guarantee is that the result is zero if and only if v is a nil func Value. </p>
+<p>If v's Kind is <a href="#Slice">Slice</a>, the returned pointer is to the first element of the slice. If the slice is nil the returned value is nil. If the slice is empty but non-nil the return value is non-nil. </p>
+<h2 id="ValueError">type <span>ValueError</span> </h2> <p>A ValueError occurs when a Value method is invoked on a <a href="#Value">Value</a> that does not support it. Such cases are documented in the description of each method. </p>
+<pre data-language="go">type ValueError struct {
+ Method string
+ Kind Kind
+}
+</pre> <h3 id="ValueError.Error">func (*ValueError) <span>Error</span> </h3> <pre data-language="go">func (e *ValueError) Error() string</pre> <h2 id="pkg-note-BUG">Bugs</h2> <ul> <li>☞ <p>FieldByName and related functions consider struct field names to be equal if the names are equal, even if they are unexported names originating in different packages. The practical effect of this is that the result of t.FieldByName("x") is not well defined if the struct type t contains multiple fields named x (embedded from different packages). FieldByName may return one of the fields named x or may report that there are none. See <a href="https://golang.org/issue/4876">https://golang.org/issue/4876</a> for more details. </p>
+</li> </ul> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/reflect/" class="_attribution-link">http://golang.org/pkg/reflect/</a>
+ </p>
+</div>
diff --git a/devdocs/go/regexp%2Findex.html b/devdocs/go/regexp%2Findex.html
new file mode 100644
index 00000000..e5fe3bd5
--- /dev/null
+++ b/devdocs/go/regexp%2Findex.html
@@ -0,0 +1,501 @@
+<h1> Package regexp </h1> <ul id="short-nav">
+<li><code>import "regexp"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package regexp implements regular expression search. </p>
+<p>The syntax of the regular expressions accepted is the same general syntax used by Perl, Python, and other languages. More precisely, it is the syntax accepted by RE2 and described at <a href="https://golang.org/s/re2syntax">https://golang.org/s/re2syntax</a>, except for \C. For an overview of the syntax, see the <span>regexp/syntax</span> package. </p>
+<p>The regexp implementation provided by this package is guaranteed to run in time linear in the size of the input. (This is a property not guaranteed by most open source implementations of regular expressions.) For more information about this property, see </p>
+<pre data-language="go">https://swtch.com/~rsc/regexp/regexp1.html
+</pre> <p>or any book about automata theory. </p>
+<p>All characters are UTF-8-encoded code points. Following <span>utf8.DecodeRune</span>, each byte of an invalid UTF-8 sequence is treated as if it encoded utf8.RuneError (U+FFFD). </p>
+<p>There are 16 methods of <a href="#Regexp">Regexp</a> that match a regular expression and identify the matched text. Their names are matched by this regular expression: </p>
+<pre data-language="go">Find(All)?(String)?(Submatch)?(Index)?
+</pre> <p>If 'All' is present, the routine matches successive non-overlapping matches of the entire expression. Empty matches abutting a preceding match are ignored. The return value is a slice containing the successive return values of the corresponding non-'All' routine. These routines take an extra integer argument, n. If n &gt;= 0, the function returns at most n matches/submatches; otherwise, it returns all of them. </p>
+<p>If 'String' is present, the argument is a string; otherwise it is a slice of bytes; return values are adjusted as appropriate. </p>
+<p>If 'Submatch' is present, the return value is a slice identifying the successive submatches of the expression. Submatches are matches of parenthesized subexpressions (also known as capturing groups) within the regular expression, numbered from left to right in order of opening parenthesis. Submatch 0 is the match of the entire expression, submatch 1 is the match of the first parenthesized subexpression, and so on. </p>
+<p>If 'Index' is present, matches and submatches are identified by byte index pairs within the input string: result[2*n:2*n+2] identifies the indexes of the nth submatch. The pair for n==0 identifies the match of the entire expression. If 'Index' is not present, the match is identified by the text of the match/submatch. If an index is negative or text is nil, it means that subexpression did not match any string in the input. For 'String' versions an empty string means either no match or an empty match. </p>
+<p>There is also a subset of the methods that can be applied to text read from a RuneReader: </p>
+<pre data-language="go">MatchReader, FindReaderIndex, FindReaderSubmatchIndex
+</pre> <p>This set may grow. Note that regular expression matches may need to examine text beyond the text returned by a match, so the methods that match text from a RuneReader may read arbitrarily far into the input before returning. </p>
+<p>(There are a few other methods that do not match this pattern.) </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Compile the expression once, usually at init time.
+// Use raw strings to avoid having to quote the backslashes.
+var validID = regexp.MustCompile(`^[a-z]+\[[0-9]+\]$`)
+
+fmt.Println(validID.MatchString("adam[23]"))
+fmt.Println(validID.MatchString("eve[7]"))
+fmt.Println(validID.MatchString("Job[48]"))
+fmt.Println(validID.MatchString("snakey"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+true
+false
+false
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Match">func Match(pattern string, b []byte) (matched bool, err error)</a></li>
+<li><a href="#MatchReader">func MatchReader(pattern string, r io.RuneReader) (matched bool, err error)</a></li>
+<li><a href="#MatchString">func MatchString(pattern string, s string) (matched bool, err error)</a></li>
+<li><a href="#QuoteMeta">func QuoteMeta(s string) string</a></li>
+<li><a href="#Regexp">type Regexp</a></li>
+<li> <a href="#Compile">func Compile(expr string) (*Regexp, error)</a>
+</li>
+<li> <a href="#CompilePOSIX">func CompilePOSIX(expr string) (*Regexp, error)</a>
+</li>
+<li> <a href="#MustCompile">func MustCompile(str string) *Regexp</a>
+</li>
+<li> <a href="#MustCompilePOSIX">func MustCompilePOSIX(str string) *Regexp</a>
+</li>
+<li> <a href="#Regexp.Copy">func (re *Regexp) Copy() *Regexp</a>
+</li>
+<li> <a href="#Regexp.Expand">func (re *Regexp) Expand(dst []byte, template []byte, src []byte, match []int) []byte</a>
+</li>
+<li> <a href="#Regexp.ExpandString">func (re *Regexp) ExpandString(dst []byte, template string, src string, match []int) []byte</a>
+</li>
+<li> <a href="#Regexp.Find">func (re *Regexp) Find(b []byte) []byte</a>
+</li>
+<li> <a href="#Regexp.FindAll">func (re *Regexp) FindAll(b []byte, n int) [][]byte</a>
+</li>
+<li> <a href="#Regexp.FindAllIndex">func (re *Regexp) FindAllIndex(b []byte, n int) [][]int</a>
+</li>
+<li> <a href="#Regexp.FindAllString">func (re *Regexp) FindAllString(s string, n int) []string</a>
+</li>
+<li> <a href="#Regexp.FindAllStringIndex">func (re *Regexp) FindAllStringIndex(s string, n int) [][]int</a>
+</li>
+<li> <a href="#Regexp.FindAllStringSubmatch">func (re *Regexp) FindAllStringSubmatch(s string, n int) [][]string</a>
+</li>
+<li> <a href="#Regexp.FindAllStringSubmatchIndex">func (re *Regexp) FindAllStringSubmatchIndex(s string, n int) [][]int</a>
+</li>
+<li> <a href="#Regexp.FindAllSubmatch">func (re *Regexp) FindAllSubmatch(b []byte, n int) [][][]byte</a>
+</li>
+<li> <a href="#Regexp.FindAllSubmatchIndex">func (re *Regexp) FindAllSubmatchIndex(b []byte, n int) [][]int</a>
+</li>
+<li> <a href="#Regexp.FindIndex">func (re *Regexp) FindIndex(b []byte) (loc []int)</a>
+</li>
+<li> <a href="#Regexp.FindReaderIndex">func (re *Regexp) FindReaderIndex(r io.RuneReader) (loc []int)</a>
+</li>
+<li> <a href="#Regexp.FindReaderSubmatchIndex">func (re *Regexp) FindReaderSubmatchIndex(r io.RuneReader) []int</a>
+</li>
+<li> <a href="#Regexp.FindString">func (re *Regexp) FindString(s string) string</a>
+</li>
+<li> <a href="#Regexp.FindStringIndex">func (re *Regexp) FindStringIndex(s string) (loc []int)</a>
+</li>
+<li> <a href="#Regexp.FindStringSubmatch">func (re *Regexp) FindStringSubmatch(s string) []string</a>
+</li>
+<li> <a href="#Regexp.FindStringSubmatchIndex">func (re *Regexp) FindStringSubmatchIndex(s string) []int</a>
+</li>
+<li> <a href="#Regexp.FindSubmatch">func (re *Regexp) FindSubmatch(b []byte) [][]byte</a>
+</li>
+<li> <a href="#Regexp.FindSubmatchIndex">func (re *Regexp) FindSubmatchIndex(b []byte) []int</a>
+</li>
+<li> <a href="#Regexp.LiteralPrefix">func (re *Regexp) LiteralPrefix() (prefix string, complete bool)</a>
+</li>
+<li> <a href="#Regexp.Longest">func (re *Regexp) Longest()</a>
+</li>
+<li> <a href="#Regexp.MarshalText">func (re *Regexp) MarshalText() ([]byte, error)</a>
+</li>
+<li> <a href="#Regexp.Match">func (re *Regexp) Match(b []byte) bool</a>
+</li>
+<li> <a href="#Regexp.MatchReader">func (re *Regexp) MatchReader(r io.RuneReader) bool</a>
+</li>
+<li> <a href="#Regexp.MatchString">func (re *Regexp) MatchString(s string) bool</a>
+</li>
+<li> <a href="#Regexp.NumSubexp">func (re *Regexp) NumSubexp() int</a>
+</li>
+<li> <a href="#Regexp.ReplaceAll">func (re *Regexp) ReplaceAll(src, repl []byte) []byte</a>
+</li>
+<li> <a href="#Regexp.ReplaceAllFunc">func (re *Regexp) ReplaceAllFunc(src []byte, repl func([]byte) []byte) []byte</a>
+</li>
+<li> <a href="#Regexp.ReplaceAllLiteral">func (re *Regexp) ReplaceAllLiteral(src, repl []byte) []byte</a>
+</li>
+<li> <a href="#Regexp.ReplaceAllLiteralString">func (re *Regexp) ReplaceAllLiteralString(src, repl string) string</a>
+</li>
+<li> <a href="#Regexp.ReplaceAllString">func (re *Regexp) ReplaceAllString(src, repl string) string</a>
+</li>
+<li> <a href="#Regexp.ReplaceAllStringFunc">func (re *Regexp) ReplaceAllStringFunc(src string, repl func(string) string) string</a>
+</li>
+<li> <a href="#Regexp.Split">func (re *Regexp) Split(s string, n int) []string</a>
+</li>
+<li> <a href="#Regexp.String">func (re *Regexp) String() string</a>
+</li>
+<li> <a href="#Regexp.SubexpIndex">func (re *Regexp) SubexpIndex(name string) int</a>
+</li>
+<li> <a href="#Regexp.SubexpNames">func (re *Regexp) SubexpNames() []string</a>
+</li>
+<li> <a href="#Regexp.UnmarshalText">func (re *Regexp) UnmarshalText(text []byte) error</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example_Match">Match</a></dd> <dd><a class="exampleLink" href="#example_MatchString">MatchString</a></dd> <dd><a class="exampleLink" href="#example_QuoteMeta">QuoteMeta</a></dd> <dd><a class="exampleLink" href="#example_Regexp_Expand">Regexp.Expand</a></dd> <dd><a class="exampleLink" href="#example_Regexp_ExpandString">Regexp.ExpandString</a></dd> <dd><a class="exampleLink" href="#example_Regexp_Find">Regexp.Find</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindAll">Regexp.FindAll</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindAllIndex">Regexp.FindAllIndex</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindAllString">Regexp.FindAllString</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindAllStringSubmatch">Regexp.FindAllStringSubmatch</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindAllStringSubmatchIndex">Regexp.FindAllStringSubmatchIndex</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindAllSubmatch">Regexp.FindAllSubmatch</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindAllSubmatchIndex">Regexp.FindAllSubmatchIndex</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindIndex">Regexp.FindIndex</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindString">Regexp.FindString</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindStringIndex">Regexp.FindStringIndex</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindStringSubmatch">Regexp.FindStringSubmatch</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindSubmatch">Regexp.FindSubmatch</a></dd> <dd><a class="exampleLink" href="#example_Regexp_FindSubmatchIndex">Regexp.FindSubmatchIndex</a></dd> <dd><a class="exampleLink" href="#example_Regexp_Longest">Regexp.Longest</a></dd> <dd><a class="exampleLink" href="#example_Regexp_Match">Regexp.Match</a></dd> <dd><a class="exampleLink" href="#example_Regexp_MatchString">Regexp.MatchString</a></dd> <dd><a class="exampleLink" href="#example_Regexp_NumSubexp">Regexp.NumSubexp</a></dd> <dd><a class="exampleLink" href="#example_Regexp_ReplaceAll">Regexp.ReplaceAll</a></dd> <dd><a class="exampleLink" href="#example_Regexp_ReplaceAllLiteralString">Regexp.ReplaceAllLiteralString</a></dd> <dd><a class="exampleLink" href="#example_Regexp_ReplaceAllString">Regexp.ReplaceAllString</a></dd> <dd><a class="exampleLink" href="#example_Regexp_ReplaceAllStringFunc">Regexp.ReplaceAllStringFunc</a></dd> <dd><a class="exampleLink" href="#example_Regexp_Split">Regexp.Split</a></dd> <dd><a class="exampleLink" href="#example_Regexp_SubexpIndex">Regexp.SubexpIndex</a></dd> <dd><a class="exampleLink" href="#example_Regexp_SubexpNames">Regexp.SubexpNames</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>backtrack.go</span> <span>exec.go</span> <span>onepass.go</span> <span>regexp.go</span> </p> <h2 id="Match">func <span>Match</span> </h2> <pre data-language="go">func Match(pattern string, b []byte) (matched bool, err error)</pre> <p>Match reports whether the byte slice b contains any match of the regular expression pattern. More complicated queries need to use <a href="#Compile">Compile</a> and the full <a href="#Regexp">Regexp</a> interface. </p> <h4 id="example_Match"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">matched, err := regexp.Match(`foo.*`, []byte(`seafood`))
+fmt.Println(matched, err)
+matched, err = regexp.Match(`bar.*`, []byte(`seafood`))
+fmt.Println(matched, err)
+matched, err = regexp.Match(`a(b`, []byte(`seafood`))
+fmt.Println(matched, err)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true &lt;nil&gt;
+false &lt;nil&gt;
+false error parsing regexp: missing closing ): `a(b`
+</pre> <h2 id="MatchReader">func <span>MatchReader</span> </h2> <pre data-language="go">func MatchReader(pattern string, r io.RuneReader) (matched bool, err error)</pre> <p>MatchReader reports whether the text returned by the RuneReader contains any match of the regular expression pattern. More complicated queries need to use <a href="#Compile">Compile</a> and the full <a href="#Regexp">Regexp</a> interface. </p>
+<h2 id="MatchString">func <span>MatchString</span> </h2> <pre data-language="go">func MatchString(pattern string, s string) (matched bool, err error)</pre> <p>MatchString reports whether the string s contains any match of the regular expression pattern. More complicated queries need to use <a href="#Compile">Compile</a> and the full <a href="#Regexp">Regexp</a> interface. </p> <h4 id="example_MatchString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">matched, err := regexp.MatchString(`foo.*`, "seafood")
+fmt.Println(matched, err)
+matched, err = regexp.MatchString(`bar.*`, "seafood")
+fmt.Println(matched, err)
+matched, err = regexp.MatchString(`a(b`, "seafood")
+fmt.Println(matched, err)
+</pre> <p>Output:</p> <pre class="output" data-language="go">true &lt;nil&gt;
+false &lt;nil&gt;
+false error parsing regexp: missing closing ): `a(b`
+</pre> <h2 id="QuoteMeta">func <span>QuoteMeta</span> </h2> <pre data-language="go">func QuoteMeta(s string) string</pre> <p>QuoteMeta returns a string that escapes all regular expression metacharacters inside the argument text; the returned string is a regular expression matching the literal text. </p> <h4 id="example_QuoteMeta"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(regexp.QuoteMeta(`Escaping symbols like: .+*?()|[]{}^$`))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Escaping symbols like: \.\+\*\?\(\)\|\[\]\{\}\^\$
+</pre> <h2 id="Regexp">type <span>Regexp</span> </h2> <p>Regexp is the representation of a compiled regular expression. A Regexp is safe for concurrent use by multiple goroutines, except for configuration methods, such as <a href="#Regexp.Longest">Regexp.Longest</a>. </p>
+<pre data-language="go">type Regexp struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Compile">func <span>Compile</span> </h3> <pre data-language="go">func Compile(expr string) (*Regexp, error)</pre> <p>Compile parses a regular expression and returns, if successful, a <a href="#Regexp">Regexp</a> object that can be used to match against text. </p>
+<p>When matching against text, the regexp returns a match that begins as early as possible in the input (leftmost), and among those it chooses the one that a backtracking search would have found first. This so-called leftmost-first matching is the same semantics that Perl, Python, and other implementations use, although this package implements it without the expense of backtracking. For POSIX leftmost-longest matching, see <a href="#CompilePOSIX">CompilePOSIX</a>. </p>
+<h3 id="CompilePOSIX">func <span>CompilePOSIX</span> </h3> <pre data-language="go">func CompilePOSIX(expr string) (*Regexp, error)</pre> <p>CompilePOSIX is like <a href="#Compile">Compile</a> but restricts the regular expression to POSIX ERE (egrep) syntax and changes the match semantics to leftmost-longest. </p>
+<p>That is, when matching against text, the regexp returns a match that begins as early as possible in the input (leftmost), and among those it chooses a match that is as long as possible. This so-called leftmost-longest matching is the same semantics that early regular expression implementations used and that POSIX specifies. </p>
+<p>However, there can be multiple leftmost-longest matches, with different submatch choices, and here this package diverges from POSIX. Among the possible leftmost-longest matches, this package chooses the one that a backtracking search would have found first, while POSIX specifies that the match be chosen to maximize the length of the first subexpression, then the second, and so on from left to right. The POSIX rule is computationally prohibitive and not even well-defined. See <a href="https://swtch.com/~rsc/regexp/regexp2.html#posix">https://swtch.com/~rsc/regexp/regexp2.html#posix</a> for details. </p>
+<h3 id="MustCompile">func <span>MustCompile</span> </h3> <pre data-language="go">func MustCompile(str string) *Regexp</pre> <p>MustCompile is like <a href="#Compile">Compile</a> but panics if the expression cannot be parsed. It simplifies safe initialization of global variables holding compiled regular expressions. </p>
+<h3 id="MustCompilePOSIX">func <span>MustCompilePOSIX</span> </h3> <pre data-language="go">func MustCompilePOSIX(str string) *Regexp</pre> <p>MustCompilePOSIX is like <a href="#CompilePOSIX">CompilePOSIX</a> but panics if the expression cannot be parsed. It simplifies safe initialization of global variables holding compiled regular expressions. </p>
+<h3 id="Regexp.Copy">func (*Regexp) <span>Copy</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (re *Regexp) Copy() *Regexp</pre> <p>Copy returns a new <a href="#Regexp">Regexp</a> object copied from re. Calling <a href="#Regexp.Longest">Regexp.Longest</a> on one copy does not affect another. </p>
+<p>Deprecated: In earlier releases, when using a <a href="#Regexp">Regexp</a> in multiple goroutines, giving each goroutine its own copy helped to avoid lock contention. As of Go 1.12, using Copy is no longer necessary to avoid lock contention. Copy may still be appropriate if the reason for its use is to make two copies with different <a href="#Regexp.Longest">Regexp.Longest</a> settings. </p>
+<h3 id="Regexp.Expand">func (*Regexp) <span>Expand</span> </h3> <pre data-language="go">func (re *Regexp) Expand(dst []byte, template []byte, src []byte, match []int) []byte</pre> <p>Expand appends template to dst and returns the result; during the append, Expand replaces variables in the template with corresponding matches drawn from src. The match slice should have been returned by <a href="#Regexp.FindSubmatchIndex">Regexp.FindSubmatchIndex</a>. </p>
+<p>In the template, a variable is denoted by a substring of the form $name or ${name}, where name is a non-empty sequence of letters, digits, and underscores. A purely numeric name like $1 refers to the submatch with the corresponding index; other names refer to capturing parentheses named with the (?P&lt;name&gt;...) syntax. A reference to an out of range or unmatched index or a name that is not present in the regular expression is replaced with an empty slice. </p>
+<p>In the $name form, name is taken to be as long as possible: $1x is equivalent to ${1x}, not ${1}x, and, $10 is equivalent to ${10}, not ${1}0. </p>
+<p>To insert a literal $ in the output, use $$ in the template. </p> <h4 id="example_Regexp_Expand"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">content := []byte(`
+ # comment line
+ option1: value1
+ option2: value2
+
+ # another comment line
+ option3: value3
+`)
+
+// Regex pattern captures "key: value" pair from the content.
+pattern := regexp.MustCompile(`(?m)(?P&lt;key&gt;\w+):\s+(?P&lt;value&gt;\w+)$`)
+
+// Template to convert "key: value" to "key=value" by
+// referencing the values captured by the regex pattern.
+template := []byte("$key=$value\n")
+
+result := []byte{}
+
+// For each match of the regex in the content.
+for _, submatches := range pattern.FindAllSubmatchIndex(content, -1) {
+ // Apply the captured submatches to the template and append the output
+ // to the result.
+ result = pattern.Expand(result, template, content, submatches)
+}
+fmt.Println(string(result))
+</pre> <p>Output:</p> <pre class="output" data-language="go">option1=value1
+option2=value2
+option3=value3
+</pre> <h3 id="Regexp.ExpandString">func (*Regexp) <span>ExpandString</span> </h3> <pre data-language="go">func (re *Regexp) ExpandString(dst []byte, template string, src string, match []int) []byte</pre> <p>ExpandString is like <a href="#Regexp.Expand">Regexp.Expand</a> but the template and source are strings. It appends to and returns a byte slice in order to give the calling code control over allocation. </p> <h4 id="example_Regexp_ExpandString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">content := `
+ # comment line
+ option1: value1
+ option2: value2
+
+ # another comment line
+ option3: value3
+`
+
+// Regex pattern captures "key: value" pair from the content.
+pattern := regexp.MustCompile(`(?m)(?P&lt;key&gt;\w+):\s+(?P&lt;value&gt;\w+)$`)
+
+// Template to convert "key: value" to "key=value" by
+// referencing the values captured by the regex pattern.
+template := "$key=$value\n"
+
+result := []byte{}
+
+// For each match of the regex in the content.
+for _, submatches := range pattern.FindAllStringSubmatchIndex(content, -1) {
+ // Apply the captured submatches to the template and append the output
+ // to the result.
+ result = pattern.ExpandString(result, template, content, submatches)
+}
+fmt.Println(string(result))
+</pre> <p>Output:</p> <pre class="output" data-language="go">option1=value1
+option2=value2
+option3=value3
+</pre> <h3 id="Regexp.Find">func (*Regexp) <span>Find</span> </h3> <pre data-language="go">func (re *Regexp) Find(b []byte) []byte</pre> <p>Find returns a slice holding the text of the leftmost match in b of the regular expression. A return value of nil indicates no match. </p> <h4 id="example_Regexp_Find"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`foo.?`)
+fmt.Printf("%q\n", re.Find([]byte(`seafood fool`)))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"food"
+</pre> <h3 id="Regexp.FindAll">func (*Regexp) <span>FindAll</span> </h3> <pre data-language="go">func (re *Regexp) FindAll(b []byte, n int) [][]byte</pre> <p>FindAll is the 'All' version of Find; it returns a slice of all successive matches of the expression, as defined by the 'All' description in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindAll"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`foo.?`)
+fmt.Printf("%q\n", re.FindAll([]byte(`seafood fool`), -1))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">["food" "fool"]
+</pre> <h3 id="Regexp.FindAllIndex">func (*Regexp) <span>FindAllIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindAllIndex(b []byte, n int) [][]int</pre> <p>FindAllIndex is the 'All' version of <a href="#Regexp.FindIndex">Regexp.FindIndex</a>; it returns a slice of all successive matches of the expression, as defined by the 'All' description in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindAllIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">content := []byte("London")
+re := regexp.MustCompile(`o.`)
+fmt.Println(re.FindAllIndex(content, 1))
+fmt.Println(re.FindAllIndex(content, -1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">[[1 3]]
+[[1 3] [4 6]]
+</pre> <h3 id="Regexp.FindAllString">func (*Regexp) <span>FindAllString</span> </h3> <pre data-language="go">func (re *Regexp) FindAllString(s string, n int) []string</pre> <p>FindAllString is the 'All' version of <a href="#Regexp.FindString">Regexp.FindString</a>; it returns a slice of all successive matches of the expression, as defined by the 'All' description in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindAllString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`a.`)
+fmt.Println(re.FindAllString("paranormal", -1))
+fmt.Println(re.FindAllString("paranormal", 2))
+fmt.Println(re.FindAllString("graal", -1))
+fmt.Println(re.FindAllString("none", -1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">[ar an al]
+[ar an]
+[aa]
+[]
+</pre> <h3 id="Regexp.FindAllStringIndex">func (*Regexp) <span>FindAllStringIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindAllStringIndex(s string, n int) [][]int</pre> <p>FindAllStringIndex is the 'All' version of <a href="#Regexp.FindStringIndex">Regexp.FindStringIndex</a>; it returns a slice of all successive matches of the expression, as defined by the 'All' description in the package comment. A return value of nil indicates no match. </p>
+<h3 id="Regexp.FindAllStringSubmatch">func (*Regexp) <span>FindAllStringSubmatch</span> </h3> <pre data-language="go">func (re *Regexp) FindAllStringSubmatch(s string, n int) [][]string</pre> <p>FindAllStringSubmatch is the 'All' version of <a href="#Regexp.FindStringSubmatch">Regexp.FindStringSubmatch</a>; it returns a slice of all successive matches of the expression, as defined by the 'All' description in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindAllStringSubmatch"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`a(x*)b`)
+fmt.Printf("%q\n", re.FindAllStringSubmatch("-ab-", -1))
+fmt.Printf("%q\n", re.FindAllStringSubmatch("-axxb-", -1))
+fmt.Printf("%q\n", re.FindAllStringSubmatch("-ab-axb-", -1))
+fmt.Printf("%q\n", re.FindAllStringSubmatch("-axxb-ab-", -1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">[["ab" ""]]
+[["axxb" "xx"]]
+[["ab" ""] ["axb" "x"]]
+[["axxb" "xx"] ["ab" ""]]
+</pre> <h3 id="Regexp.FindAllStringSubmatchIndex">func (*Regexp) <span>FindAllStringSubmatchIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindAllStringSubmatchIndex(s string, n int) [][]int</pre> <p>FindAllStringSubmatchIndex is the 'All' version of <a href="#Regexp.FindStringSubmatchIndex">Regexp.FindStringSubmatchIndex</a>; it returns a slice of all successive matches of the expression, as defined by the 'All' description in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindAllStringSubmatchIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`a(x*)b`)
+// Indices:
+// 01234567 012345678
+// -ab-axb- -axxb-ab-
+fmt.Println(re.FindAllStringSubmatchIndex("-ab-", -1))
+fmt.Println(re.FindAllStringSubmatchIndex("-axxb-", -1))
+fmt.Println(re.FindAllStringSubmatchIndex("-ab-axb-", -1))
+fmt.Println(re.FindAllStringSubmatchIndex("-axxb-ab-", -1))
+fmt.Println(re.FindAllStringSubmatchIndex("-foo-", -1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">[[1 3 2 2]]
+[[1 5 2 4]]
+[[1 3 2 2] [4 7 5 6]]
+[[1 5 2 4] [6 8 7 7]]
+[]
+</pre> <h3 id="Regexp.FindAllSubmatch">func (*Regexp) <span>FindAllSubmatch</span> </h3> <pre data-language="go">func (re *Regexp) FindAllSubmatch(b []byte, n int) [][][]byte</pre> <p>FindAllSubmatch is the 'All' version of <a href="#Regexp.FindSubmatch">Regexp.FindSubmatch</a>; it returns a slice of all successive matches of the expression, as defined by the 'All' description in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindAllSubmatch"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`foo(.?)`)
+fmt.Printf("%q\n", re.FindAllSubmatch([]byte(`seafood fool`), -1))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">[["food" "d"] ["fool" "l"]]
+</pre> <h3 id="Regexp.FindAllSubmatchIndex">func (*Regexp) <span>FindAllSubmatchIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindAllSubmatchIndex(b []byte, n int) [][]int</pre> <p>FindAllSubmatchIndex is the 'All' version of <a href="#Regexp.FindSubmatchIndex">Regexp.FindSubmatchIndex</a>; it returns a slice of all successive matches of the expression, as defined by the 'All' description in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindAllSubmatchIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">content := []byte(`
+ # comment line
+ option1: value1
+ option2: value2
+`)
+// Regex pattern captures "key: value" pair from the content.
+pattern := regexp.MustCompile(`(?m)(?P&lt;key&gt;\w+):\s+(?P&lt;value&gt;\w+)$`)
+allIndexes := pattern.FindAllSubmatchIndex(content, -1)
+for _, loc := range allIndexes {
+ fmt.Println(loc)
+ fmt.Println(string(content[loc[0]:loc[1]]))
+ fmt.Println(string(content[loc[2]:loc[3]]))
+ fmt.Println(string(content[loc[4]:loc[5]]))
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">[18 33 18 25 27 33]
+option1: value1
+option1
+value1
+[35 50 35 42 44 50]
+option2: value2
+option2
+value2
+</pre> <h3 id="Regexp.FindIndex">func (*Regexp) <span>FindIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindIndex(b []byte) (loc []int)</pre> <p>FindIndex returns a two-element slice of integers defining the location of the leftmost match in b of the regular expression. The match itself is at b[loc[0]:loc[1]]. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">content := []byte(`
+ # comment line
+ option1: value1
+ option2: value2
+`)
+// Regex pattern captures "key: value" pair from the content.
+pattern := regexp.MustCompile(`(?m)(?P&lt;key&gt;\w+):\s+(?P&lt;value&gt;\w+)$`)
+
+loc := pattern.FindIndex(content)
+fmt.Println(loc)
+fmt.Println(string(content[loc[0]:loc[1]]))
+</pre> <p>Output:</p> <pre class="output" data-language="go">[18 33]
+option1: value1
+</pre> <h3 id="Regexp.FindReaderIndex">func (*Regexp) <span>FindReaderIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindReaderIndex(r io.RuneReader) (loc []int)</pre> <p>FindReaderIndex returns a two-element slice of integers defining the location of the leftmost match of the regular expression in text read from the <span>io.RuneReader</span>. The match text was found in the input stream at byte offset loc[0] through loc[1]-1. A return value of nil indicates no match. </p>
+<h3 id="Regexp.FindReaderSubmatchIndex">func (*Regexp) <span>FindReaderSubmatchIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindReaderSubmatchIndex(r io.RuneReader) []int</pre> <p>FindReaderSubmatchIndex returns a slice holding the index pairs identifying the leftmost match of the regular expression of text read by the <span>io.RuneReader</span>, and the matches, if any, of its subexpressions, as defined by the 'Submatch' and 'Index' descriptions in the package comment. A return value of nil indicates no match. </p>
+<h3 id="Regexp.FindString">func (*Regexp) <span>FindString</span> </h3> <pre data-language="go">func (re *Regexp) FindString(s string) string</pre> <p>FindString returns a string holding the text of the leftmost match in s of the regular expression. If there is no match, the return value is an empty string, but it will also be empty if the regular expression successfully matches an empty string. Use <a href="#Regexp.FindStringIndex">Regexp.FindStringIndex</a> or <a href="#Regexp.FindStringSubmatch">Regexp.FindStringSubmatch</a> if it is necessary to distinguish these cases. </p> <h4 id="example_Regexp_FindString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`foo.?`)
+fmt.Printf("%q\n", re.FindString("seafood fool"))
+fmt.Printf("%q\n", re.FindString("meat"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">"food"
+""
+</pre> <h3 id="Regexp.FindStringIndex">func (*Regexp) <span>FindStringIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindStringIndex(s string) (loc []int)</pre> <p>FindStringIndex returns a two-element slice of integers defining the location of the leftmost match in s of the regular expression. The match itself is at s[loc[0]:loc[1]]. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindStringIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`ab?`)
+fmt.Println(re.FindStringIndex("tablett"))
+fmt.Println(re.FindStringIndex("foo") == nil)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[1 3]
+true
+</pre> <h3 id="Regexp.FindStringSubmatch">func (*Regexp) <span>FindStringSubmatch</span> </h3> <pre data-language="go">func (re *Regexp) FindStringSubmatch(s string) []string</pre> <p>FindStringSubmatch returns a slice of strings holding the text of the leftmost match of the regular expression in s and the matches, if any, of its subexpressions, as defined by the 'Submatch' description in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindStringSubmatch"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`a(x*)b(y|z)c`)
+fmt.Printf("%q\n", re.FindStringSubmatch("-axxxbyc-"))
+fmt.Printf("%q\n", re.FindStringSubmatch("-abzc-"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">["axxxbyc" "xxx" "y"]
+["abzc" "" "z"]
+</pre> <h3 id="Regexp.FindStringSubmatchIndex">func (*Regexp) <span>FindStringSubmatchIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindStringSubmatchIndex(s string) []int</pre> <p>FindStringSubmatchIndex returns a slice holding the index pairs identifying the leftmost match of the regular expression in s and the matches, if any, of its subexpressions, as defined by the 'Submatch' and 'Index' descriptions in the package comment. A return value of nil indicates no match. </p>
+<h3 id="Regexp.FindSubmatch">func (*Regexp) <span>FindSubmatch</span> </h3> <pre data-language="go">func (re *Regexp) FindSubmatch(b []byte) [][]byte</pre> <p>FindSubmatch returns a slice of slices holding the text of the leftmost match of the regular expression in b and the matches, if any, of its subexpressions, as defined by the 'Submatch' descriptions in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindSubmatch"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`foo(.?)`)
+fmt.Printf("%q\n", re.FindSubmatch([]byte(`seafood fool`)))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">["food" "d"]
+</pre> <h3 id="Regexp.FindSubmatchIndex">func (*Regexp) <span>FindSubmatchIndex</span> </h3> <pre data-language="go">func (re *Regexp) FindSubmatchIndex(b []byte) []int</pre> <p>FindSubmatchIndex returns a slice holding the index pairs identifying the leftmost match of the regular expression in b and the matches, if any, of its subexpressions, as defined by the 'Submatch' and 'Index' descriptions in the package comment. A return value of nil indicates no match. </p> <h4 id="example_Regexp_FindSubmatchIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`a(x*)b`)
+// Indices:
+// 01234567 012345678
+// -ab-axb- -axxb-ab-
+fmt.Println(re.FindSubmatchIndex([]byte("-ab-")))
+fmt.Println(re.FindSubmatchIndex([]byte("-axxb-")))
+fmt.Println(re.FindSubmatchIndex([]byte("-ab-axb-")))
+fmt.Println(re.FindSubmatchIndex([]byte("-axxb-ab-")))
+fmt.Println(re.FindSubmatchIndex([]byte("-foo-")))
+</pre> <p>Output:</p> <pre class="output" data-language="go">[1 3 2 2]
+[1 5 2 4]
+[1 3 2 2]
+[1 5 2 4]
+[]
+</pre> <h3 id="Regexp.LiteralPrefix">func (*Regexp) <span>LiteralPrefix</span> </h3> <pre data-language="go">func (re *Regexp) LiteralPrefix() (prefix string, complete bool)</pre> <p>LiteralPrefix returns a literal string that must begin any match of the regular expression re. It returns the boolean true if the literal string comprises the entire regular expression. </p>
+<h3 id="Regexp.Longest">func (*Regexp) <span>Longest</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (re *Regexp) Longest()</pre> <p>Longest makes future searches prefer the leftmost-longest match. That is, when matching against text, the regexp returns a match that begins as early as possible in the input (leftmost), and among those it chooses a match that is as long as possible. This method modifies the <a href="#Regexp">Regexp</a> and may not be called concurrently with any other methods. </p> <h4 id="example_Regexp_Longest"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`a(|b)`)
+fmt.Println(re.FindString("ab"))
+re.Longest()
+fmt.Println(re.FindString("ab"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">a
+ab
+</pre> <h3 id="Regexp.MarshalText">func (*Regexp) <span>MarshalText</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (re *Regexp) MarshalText() ([]byte, error)</pre> <p>MarshalText implements <span>encoding.TextMarshaler</span>. The output matches that of calling the <a href="#Regexp.String">Regexp.String</a> method. </p>
+<p>Note that the output is lossy in some cases: This method does not indicate POSIX regular expressions (i.e. those compiled by calling <a href="#CompilePOSIX">CompilePOSIX</a>), or those for which the <a href="#Regexp.Longest">Regexp.Longest</a> method has been called. </p>
+<h3 id="Regexp.Match">func (*Regexp) <span>Match</span> </h3> <pre data-language="go">func (re *Regexp) Match(b []byte) bool</pre> <p>Match reports whether the byte slice b contains any match of the regular expression re. </p> <h4 id="example_Regexp_Match"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`foo.?`)
+fmt.Println(re.Match([]byte(`seafood fool`)))
+fmt.Println(re.Match([]byte(`something else`)))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h3 id="Regexp.MatchReader">func (*Regexp) <span>MatchReader</span> </h3> <pre data-language="go">func (re *Regexp) MatchReader(r io.RuneReader) bool</pre> <p>MatchReader reports whether the text returned by the <span>io.RuneReader</span> contains any match of the regular expression re. </p>
+<h3 id="Regexp.MatchString">func (*Regexp) <span>MatchString</span> </h3> <pre data-language="go">func (re *Regexp) MatchString(s string) bool</pre> <p>MatchString reports whether the string s contains any match of the regular expression re. </p> <h4 id="example_Regexp_MatchString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`(gopher){2}`)
+fmt.Println(re.MatchString("gopher"))
+fmt.Println(re.MatchString("gophergopher"))
+fmt.Println(re.MatchString("gophergophergopher"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">false
+true
+true
+</pre> <h3 id="Regexp.NumSubexp">func (*Regexp) <span>NumSubexp</span> </h3> <pre data-language="go">func (re *Regexp) NumSubexp() int</pre> <p>NumSubexp returns the number of parenthesized subexpressions in this <a href="#Regexp">Regexp</a>. </p> <h4 id="example_Regexp_NumSubexp"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re0 := regexp.MustCompile(`a.`)
+fmt.Printf("%d\n", re0.NumSubexp())
+
+re := regexp.MustCompile(`(.*)((a)b)(.*)a`)
+fmt.Println(re.NumSubexp())
+</pre> <p>Output:</p> <pre class="output" data-language="go">0
+4
+</pre> <h3 id="Regexp.ReplaceAll">func (*Regexp) <span>ReplaceAll</span> </h3> <pre data-language="go">func (re *Regexp) ReplaceAll(src, repl []byte) []byte</pre> <p>ReplaceAll returns a copy of src, replacing matches of the <a href="#Regexp">Regexp</a> with the replacement text repl. Inside repl, $ signs are interpreted as in <a href="#Regexp.Expand">Regexp.Expand</a>. </p> <h4 id="example_Regexp_ReplaceAll"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`a(x*)b`)
+fmt.Printf("%s\n", re.ReplaceAll([]byte("-ab-axxb-"), []byte("T")))
+fmt.Printf("%s\n", re.ReplaceAll([]byte("-ab-axxb-"), []byte("$1")))
+fmt.Printf("%s\n", re.ReplaceAll([]byte("-ab-axxb-"), []byte("$1W")))
+fmt.Printf("%s\n", re.ReplaceAll([]byte("-ab-axxb-"), []byte("${1}W")))
+
+re2 := regexp.MustCompile(`a(?P&lt;1W&gt;x*)b`)
+fmt.Printf("%s\n", re2.ReplaceAll([]byte("-ab-axxb-"), []byte("$1W")))
+fmt.Printf("%s\n", re2.ReplaceAll([]byte("-ab-axxb-"), []byte("${1}W")))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">-T-T-
+--xx-
+---
+-W-xxW-
+--xx-
+-W-xxW-
+</pre> <h3 id="Regexp.ReplaceAllFunc">func (*Regexp) <span>ReplaceAllFunc</span> </h3> <pre data-language="go">func (re *Regexp) ReplaceAllFunc(src []byte, repl func([]byte) []byte) []byte</pre> <p>ReplaceAllFunc returns a copy of src in which all matches of the <a href="#Regexp">Regexp</a> have been replaced by the return value of function repl applied to the matched byte slice. The replacement returned by repl is substituted directly, without using <a href="#Regexp.Expand">Regexp.Expand</a>. </p>
+<h3 id="Regexp.ReplaceAllLiteral">func (*Regexp) <span>ReplaceAllLiteral</span> </h3> <pre data-language="go">func (re *Regexp) ReplaceAllLiteral(src, repl []byte) []byte</pre> <p>ReplaceAllLiteral returns a copy of src, replacing matches of the <a href="#Regexp">Regexp</a> with the replacement bytes repl. The replacement repl is substituted directly, without using <a href="#Regexp.Expand">Regexp.Expand</a>. </p>
+<h3 id="Regexp.ReplaceAllLiteralString">func (*Regexp) <span>ReplaceAllLiteralString</span> </h3> <pre data-language="go">func (re *Regexp) ReplaceAllLiteralString(src, repl string) string</pre> <p>ReplaceAllLiteralString returns a copy of src, replacing matches of the <a href="#Regexp">Regexp</a> with the replacement string repl. The replacement repl is substituted directly, without using <a href="#Regexp.Expand">Regexp.Expand</a>. </p> <h4 id="example_Regexp_ReplaceAllLiteralString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`a(x*)b`)
+fmt.Println(re.ReplaceAllLiteralString("-ab-axxb-", "T"))
+fmt.Println(re.ReplaceAllLiteralString("-ab-axxb-", "$1"))
+fmt.Println(re.ReplaceAllLiteralString("-ab-axxb-", "${1}"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">-T-T-
+-$1-$1-
+-${1}-${1}-
+</pre> <h3 id="Regexp.ReplaceAllString">func (*Regexp) <span>ReplaceAllString</span> </h3> <pre data-language="go">func (re *Regexp) ReplaceAllString(src, repl string) string</pre> <p>ReplaceAllString returns a copy of src, replacing matches of the <a href="#Regexp">Regexp</a> with the replacement string repl. Inside repl, $ signs are interpreted as in <a href="#Regexp.Expand">Regexp.Expand</a>. </p> <h4 id="example_Regexp_ReplaceAllString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`a(x*)b`)
+fmt.Println(re.ReplaceAllString("-ab-axxb-", "T"))
+fmt.Println(re.ReplaceAllString("-ab-axxb-", "$1"))
+fmt.Println(re.ReplaceAllString("-ab-axxb-", "$1W"))
+fmt.Println(re.ReplaceAllString("-ab-axxb-", "${1}W"))
+
+re2 := regexp.MustCompile(`a(?P&lt;1W&gt;x*)b`)
+fmt.Printf("%s\n", re2.ReplaceAllString("-ab-axxb-", "$1W"))
+fmt.Println(re.ReplaceAllString("-ab-axxb-", "${1}W"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">-T-T-
+--xx-
+---
+-W-xxW-
+--xx-
+-W-xxW-
+</pre> <h3 id="Regexp.ReplaceAllStringFunc">func (*Regexp) <span>ReplaceAllStringFunc</span> </h3> <pre data-language="go">func (re *Regexp) ReplaceAllStringFunc(src string, repl func(string) string) string</pre> <p>ReplaceAllStringFunc returns a copy of src in which all matches of the <a href="#Regexp">Regexp</a> have been replaced by the return value of function repl applied to the matched substring. The replacement returned by repl is substituted directly, without using <a href="#Regexp.Expand">Regexp.Expand</a>. </p> <h4 id="example_Regexp_ReplaceAllStringFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`[^aeiou]`)
+fmt.Println(re.ReplaceAllStringFunc("seafood fool", strings.ToUpper))
+</pre> <p>Output:</p> <pre class="output" data-language="go">SeaFooD FooL
+</pre> <h3 id="Regexp.Split">func (*Regexp) <span>Split</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (re *Regexp) Split(s string, n int) []string</pre> <p>Split slices s into substrings separated by the expression and returns a slice of the substrings between those expression matches. </p>
+<p>The slice returned by this method consists of all the substrings of s not contained in the slice returned by <a href="#Regexp.FindAllString">Regexp.FindAllString</a>. When called on an expression that contains no metacharacters, it is equivalent to <span>strings.SplitN</span>. </p>
+<p>Example: </p>
+<pre data-language="go">s := regexp.MustCompile("a*").Split("abaabaccadaaae", 5)
+// s: ["", "b", "b", "c", "cadaaae"]
+</pre> <p>The count determines the number of substrings to return: </p>
+<pre data-language="go">n &gt; 0: at most n substrings; the last substring will be the unsplit remainder.
+n == 0: the result is nil (zero substrings)
+n &lt; 0: all substrings
+</pre> <h4 id="example_Regexp_Split"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">a := regexp.MustCompile(`a`)
+fmt.Println(a.Split("banana", -1))
+fmt.Println(a.Split("banana", 0))
+fmt.Println(a.Split("banana", 1))
+fmt.Println(a.Split("banana", 2))
+zp := regexp.MustCompile(`z+`)
+fmt.Println(zp.Split("pizza", -1))
+fmt.Println(zp.Split("pizza", 0))
+fmt.Println(zp.Split("pizza", 1))
+fmt.Println(zp.Split("pizza", 2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">[b n n ]
+[]
+[banana]
+[b nana]
+[pi a]
+[]
+[pizza]
+[pi a]
+</pre> <h3 id="Regexp.String">func (*Regexp) <span>String</span> </h3> <pre data-language="go">func (re *Regexp) String() string</pre> <p>String returns the source text used to compile the regular expression. </p>
+<h3 id="Regexp.SubexpIndex">func (*Regexp) <span>SubexpIndex</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (re *Regexp) SubexpIndex(name string) int</pre> <p>SubexpIndex returns the index of the first subexpression with the given name, or -1 if there is no subexpression with that name. </p>
+<p>Note that multiple subexpressions can be written using the same name, as in (?P&lt;bob&gt;a+)(?P&lt;bob&gt;b+), which declares two subexpressions named "bob". In this case, SubexpIndex returns the index of the leftmost such subexpression in the regular expression. </p> <h4 id="example_Regexp_SubexpIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`(?P&lt;first&gt;[a-zA-Z]+) (?P&lt;last&gt;[a-zA-Z]+)`)
+fmt.Println(re.MatchString("Alan Turing"))
+matches := re.FindStringSubmatch("Alan Turing")
+lastIndex := re.SubexpIndex("last")
+fmt.Printf("last =&gt; %d\n", lastIndex)
+fmt.Println(matches[lastIndex])
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+last =&gt; 2
+Turing
+</pre> <h3 id="Regexp.SubexpNames">func (*Regexp) <span>SubexpNames</span> </h3> <pre data-language="go">func (re *Regexp) SubexpNames() []string</pre> <p>SubexpNames returns the names of the parenthesized subexpressions in this <a href="#Regexp">Regexp</a>. The name for the first sub-expression is names[1], so that if m is a match slice, the name for m[i] is SubexpNames()[i]. Since the Regexp as a whole cannot be named, names[0] is always the empty string. The slice should not be modified. </p> <h4 id="example_Regexp_SubexpNames"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">re := regexp.MustCompile(`(?P&lt;first&gt;[a-zA-Z]+) (?P&lt;last&gt;[a-zA-Z]+)`)
+fmt.Println(re.MatchString("Alan Turing"))
+fmt.Printf("%q\n", re.SubexpNames())
+reversed := fmt.Sprintf("${%s} ${%s}", re.SubexpNames()[2], re.SubexpNames()[1])
+fmt.Println(reversed)
+fmt.Println(re.ReplaceAllString("Alan Turing", reversed))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+["" "first" "last"]
+${last} ${first}
+Turing Alan
+</pre> <h3 id="Regexp.UnmarshalText">func (*Regexp) <span>UnmarshalText</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (re *Regexp) UnmarshalText(text []byte) error</pre> <p>UnmarshalText implements <span>encoding.TextUnmarshaler</span> by calling <a href="#Compile">Compile</a> on the encoded value. </p>
+<h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="syntax/index">syntax</a> </td> <td class="pkg-synopsis"> Package syntax parses regular expressions into parse trees and compiles parse trees into programs. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/regexp/" class="_attribution-link">http://golang.org/pkg/regexp/</a>
+ </p>
+</div>
diff --git a/devdocs/go/regexp%2Fsyntax%2Findex.html b/devdocs/go/regexp%2Fsyntax%2Findex.html
new file mode 100644
index 00000000..641bf891
--- /dev/null
+++ b/devdocs/go/regexp%2Fsyntax%2Findex.html
@@ -0,0 +1,284 @@
+<h1> Package syntax </h1> <ul id="short-nav">
+<li><code>import "regexp/syntax"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package syntax parses regular expressions into parse trees and compiles parse trees into programs. Most clients of regular expressions will use the facilities of package regexp (such as Compile and Match) instead of this package. </p>
+<h3 id="hdr-Syntax">Syntax</h3> <p>The regular expression syntax understood by this package when parsing with the Perl flag is as follows. Parts of the syntax can be disabled by passing alternate flags to Parse. </p>
+<p>Single characters: </p>
+<pre data-language="go">. any character, possibly including newline (flag s=true)
+[xyz] character class
+[^xyz] negated character class
+\d Perl character class
+\D negated Perl character class
+[[:alpha:]] ASCII character class
+[[:^alpha:]] negated ASCII character class
+\pN Unicode character class (one-letter name)
+\p{Greek} Unicode character class
+\PN negated Unicode character class (one-letter name)
+\P{Greek} negated Unicode character class
+</pre> <p>Composites: </p>
+<pre data-language="go">xy x followed by y
+x|y x or y (prefer x)
+</pre> <p>Repetitions: </p>
+<pre data-language="go">x* zero or more x, prefer more
+x+ one or more x, prefer more
+x? zero or one x, prefer one
+x{n,m} n or n+1 or ... or m x, prefer more
+x{n,} n or more x, prefer more
+x{n} exactly n x
+x*? zero or more x, prefer fewer
+x+? one or more x, prefer fewer
+x?? zero or one x, prefer zero
+x{n,m}? n or n+1 or ... or m x, prefer fewer
+x{n,}? n or more x, prefer fewer
+x{n}? exactly n x
+</pre> <p>Implementation restriction: The counting forms x{n,m}, x{n,}, and x{n} reject forms that create a minimum or maximum repetition count above 1000. Unlimited repetitions are not subject to this restriction. </p>
+<p>Grouping: </p>
+<pre data-language="go">(re) numbered capturing group (submatch)
+(?P&lt;name&gt;re) named &amp; numbered capturing group (submatch)
+(?&lt;name&gt;re) named &amp; numbered capturing group (submatch)
+(?:re) non-capturing group
+(?flags) set flags within current group; non-capturing
+(?flags:re) set flags during re; non-capturing
+
+Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). The flags are:
+
+i case-insensitive (default false)
+m multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false)
+s let . match \n (default false)
+U ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false)
+</pre> <p>Empty strings: </p>
+<pre data-language="go">^ at beginning of text or line (flag m=true)
+$ at end of text (like \z not \Z) or line (flag m=true)
+\A at beginning of text
+\b at ASCII word boundary (\w on one side and \W, \A, or \z on the other)
+\B not at ASCII word boundary
+\z at end of text
+</pre> <p>Escape sequences: </p>
+<pre data-language="go">\a bell (== \007)
+\f form feed (== \014)
+\t horizontal tab (== \011)
+\n newline (== \012)
+\r carriage return (== \015)
+\v vertical tab character (== \013)
+\* literal *, for any punctuation character *
+\123 octal character code (up to three digits)
+\x7F hex character code (exactly two digits)
+\x{10FFFF} hex character code
+\Q...\E literal text ... even if ... has punctuation
+</pre> <p>Character class elements: </p>
+<pre data-language="go">x single character
+A-Z character range (inclusive)
+\d Perl character class
+[:foo:] ASCII character class foo
+\p{Foo} Unicode character class Foo
+\pF Unicode character class F (one-letter name)
+</pre> <p>Named character classes as character class elements: </p>
+<pre data-language="go">[\d] digits (== \d)
+[^\d] not digits (== \D)
+[\D] not digits (== \D)
+[^\D] not not digits (== \d)
+[[:name:]] named ASCII class inside character class (== [:name:])
+[^[:name:]] named ASCII class inside negated character class (== [:^name:])
+[\p{Name}] named Unicode property inside character class (== \p{Name})
+[^\p{Name}] named Unicode property inside negated character class (== \P{Name})
+</pre> <p>Perl character classes (all ASCII-only): </p>
+<pre data-language="go">\d digits (== [0-9])
+\D not digits (== [^0-9])
+\s whitespace (== [\t\n\f\r ])
+\S not whitespace (== [^\t\n\f\r ])
+\w word characters (== [0-9A-Za-z_])
+\W not word characters (== [^0-9A-Za-z_])
+</pre> <p>ASCII character classes: </p>
+<pre data-language="go">[[:alnum:]] alphanumeric (== [0-9A-Za-z])
+[[:alpha:]] alphabetic (== [A-Za-z])
+[[:ascii:]] ASCII (== [\x00-\x7F])
+[[:blank:]] blank (== [\t ])
+[[:cntrl:]] control (== [\x00-\x1F\x7F])
+[[:digit:]] digits (== [0-9])
+[[:graph:]] graphical (== [!-~] == [A-Za-z0-9!"#$%&amp;'()*+,\-./:;&lt;=&gt;?@[\\\]^_`{|}~])
+[[:lower:]] lower case (== [a-z])
+[[:print:]] printable (== [ -~] == [ [:graph:]])
+[[:punct:]] punctuation (== [!-/:-@[-`{-~])
+[[:space:]] whitespace (== [\t\n\v\f\r ])
+[[:upper:]] upper case (== [A-Z])
+[[:word:]] word characters (== [0-9A-Za-z_])
+[[:xdigit:]] hex digit (== [0-9A-Fa-f])
+</pre> <p>Unicode character classes are those in unicode.Categories and unicode.Scripts. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#IsWordChar">func IsWordChar(r rune) bool</a></li>
+<li><a href="#EmptyOp">type EmptyOp</a></li>
+<li> <a href="#EmptyOpContext">func EmptyOpContext(r1, r2 rune) EmptyOp</a>
+</li>
+<li><a href="#Error">type Error</a></li>
+<li> <a href="#Error.Error">func (e *Error) Error() string</a>
+</li>
+<li><a href="#ErrorCode">type ErrorCode</a></li>
+<li> <a href="#ErrorCode.String">func (e ErrorCode) String() string</a>
+</li>
+<li><a href="#Flags">type Flags</a></li>
+<li><a href="#Inst">type Inst</a></li>
+<li> <a href="#Inst.MatchEmptyWidth">func (i *Inst) MatchEmptyWidth(before rune, after rune) bool</a>
+</li>
+<li> <a href="#Inst.MatchRune">func (i *Inst) MatchRune(r rune) bool</a>
+</li>
+<li> <a href="#Inst.MatchRunePos">func (i *Inst) MatchRunePos(r rune) int</a>
+</li>
+<li> <a href="#Inst.String">func (i *Inst) String() string</a>
+</li>
+<li><a href="#InstOp">type InstOp</a></li>
+<li> <a href="#InstOp.String">func (i InstOp) String() string</a>
+</li>
+<li><a href="#Op">type Op</a></li>
+<li> <a href="#Op.String">func (i Op) String() string</a>
+</li>
+<li><a href="#Prog">type Prog</a></li>
+<li> <a href="#Compile">func Compile(re *Regexp) (*Prog, error)</a>
+</li>
+<li> <a href="#Prog.Prefix">func (p *Prog) Prefix() (prefix string, complete bool)</a>
+</li>
+<li> <a href="#Prog.StartCond">func (p *Prog) StartCond() EmptyOp</a>
+</li>
+<li> <a href="#Prog.String">func (p *Prog) String() string</a>
+</li>
+<li><a href="#Regexp">type Regexp</a></li>
+<li> <a href="#Parse">func Parse(s string, flags Flags) (*Regexp, error)</a>
+</li>
+<li> <a href="#Regexp.CapNames">func (re *Regexp) CapNames() []string</a>
+</li>
+<li> <a href="#Regexp.Equal">func (x *Regexp) Equal(y *Regexp) bool</a>
+</li>
+<li> <a href="#Regexp.MaxCap">func (re *Regexp) MaxCap() int</a>
+</li>
+<li> <a href="#Regexp.Simplify">func (re *Regexp) Simplify() *Regexp</a>
+</li>
+<li> <a href="#Regexp.String">func (re *Regexp) String() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>compile.go</span> <span>doc.go</span> <span>op_string.go</span> <span>parse.go</span> <span>perl_groups.go</span> <span>prog.go</span> <span>regexp.go</span> <span>simplify.go</span> </p> <h2 id="IsWordChar">func <span>IsWordChar</span> </h2> <pre data-language="go">func IsWordChar(r rune) bool</pre> <p>IsWordChar reports whether r is considered a “word character” during the evaluation of the \b and \B zero-width assertions. These assertions are ASCII-only: the word characters are [A-Za-z0-9_]. </p>
+<h2 id="EmptyOp">type <span>EmptyOp</span> </h2> <p>An EmptyOp specifies a kind or mixture of zero-width assertions. </p>
+<pre data-language="go">type EmptyOp uint8</pre> <pre data-language="go">const (
+ EmptyBeginLine EmptyOp = 1 &lt;&lt; iota
+ EmptyEndLine
+ EmptyBeginText
+ EmptyEndText
+ EmptyWordBoundary
+ EmptyNoWordBoundary
+)</pre> <h3 id="EmptyOpContext">func <span>EmptyOpContext</span> </h3> <pre data-language="go">func EmptyOpContext(r1, r2 rune) EmptyOp</pre> <p>EmptyOpContext returns the zero-width assertions satisfied at the position between the runes r1 and r2. Passing r1 == -1 indicates that the position is at the beginning of the text. Passing r2 == -1 indicates that the position is at the end of the text. </p>
+<h2 id="Error">type <span>Error</span> </h2> <p>An Error describes a failure to parse a regular expression and gives the offending expression. </p>
+<pre data-language="go">type Error struct {
+ Code ErrorCode
+ Expr string
+}
+</pre> <h3 id="Error.Error">func (*Error) <span>Error</span> </h3> <pre data-language="go">func (e *Error) Error() string</pre> <h2 id="ErrorCode">type <span>ErrorCode</span> </h2> <p>An ErrorCode describes a failure to parse a regular expression. </p>
+<pre data-language="go">type ErrorCode string</pre> <pre data-language="go">const (
+ // Unexpected error
+ ErrInternalError ErrorCode = "regexp/syntax: internal error"
+
+ // Parse errors
+ ErrInvalidCharClass ErrorCode = "invalid character class"
+ ErrInvalidCharRange ErrorCode = "invalid character class range"
+ ErrInvalidEscape ErrorCode = "invalid escape sequence"
+ ErrInvalidNamedCapture ErrorCode = "invalid named capture"
+ ErrInvalidPerlOp ErrorCode = "invalid or unsupported Perl syntax"
+ ErrInvalidRepeatOp ErrorCode = "invalid nested repetition operator"
+ ErrInvalidRepeatSize ErrorCode = "invalid repeat count"
+ ErrInvalidUTF8 ErrorCode = "invalid UTF-8"
+ ErrMissingBracket ErrorCode = "missing closing ]"
+ ErrMissingParen ErrorCode = "missing closing )"
+ ErrMissingRepeatArgument ErrorCode = "missing argument to repetition operator"
+ ErrTrailingBackslash ErrorCode = "trailing backslash at end of expression"
+ ErrUnexpectedParen ErrorCode = "unexpected )"
+ ErrNestingDepth ErrorCode = "expression nests too deeply"
+ ErrLarge ErrorCode = "expression too large"
+)</pre> <h3 id="ErrorCode.String">func (ErrorCode) <span>String</span> </h3> <pre data-language="go">func (e ErrorCode) String() string</pre> <h2 id="Flags">type <span>Flags</span> </h2> <p>Flags control the behavior of the parser and record information about regexp context. </p>
+<pre data-language="go">type Flags uint16</pre> <pre data-language="go">const (
+ FoldCase Flags = 1 &lt;&lt; iota // case-insensitive match
+ Literal // treat pattern as literal string
+ ClassNL // allow character classes like [^a-z] and [[:space:]] to match newline
+ DotNL // allow . to match newline
+ OneLine // treat ^ and $ as only matching at beginning and end of text
+ NonGreedy // make repetition operators default to non-greedy
+ PerlX // allow Perl extensions
+ UnicodeGroups // allow \p{Han}, \P{Han} for Unicode group and negation
+ WasDollar // regexp OpEndText was $, not \z
+ Simple // regexp contains no counted repetition
+
+ MatchNL = ClassNL | DotNL
+
+ Perl = ClassNL | OneLine | PerlX | UnicodeGroups // as close to Perl as possible
+ POSIX Flags = 0 // POSIX syntax
+)</pre> <h2 id="Inst">type <span>Inst</span> </h2> <p>An Inst is a single instruction in a regular expression program. </p>
+<pre data-language="go">type Inst struct {
+ Op InstOp
+ Out uint32 // all but InstMatch, InstFail
+ Arg uint32 // InstAlt, InstAltMatch, InstCapture, InstEmptyWidth
+ Rune []rune
+}
+</pre> <h3 id="Inst.MatchEmptyWidth">func (*Inst) <span>MatchEmptyWidth</span> </h3> <pre data-language="go">func (i *Inst) MatchEmptyWidth(before rune, after rune) bool</pre> <p>MatchEmptyWidth reports whether the instruction matches an empty string between the runes before and after. It should only be called when i.Op == InstEmptyWidth. </p>
+<h3 id="Inst.MatchRune">func (*Inst) <span>MatchRune</span> </h3> <pre data-language="go">func (i *Inst) MatchRune(r rune) bool</pre> <p>MatchRune reports whether the instruction matches (and consumes) r. It should only be called when i.Op == InstRune. </p>
+<h3 id="Inst.MatchRunePos">func (*Inst) <span>MatchRunePos</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (i *Inst) MatchRunePos(r rune) int</pre> <p>MatchRunePos checks whether the instruction matches (and consumes) r. If so, MatchRunePos returns the index of the matching rune pair (or, when len(i.Rune) == 1, rune singleton). If not, MatchRunePos returns -1. MatchRunePos should only be called when i.Op == InstRune. </p>
+<h3 id="Inst.String">func (*Inst) <span>String</span> </h3> <pre data-language="go">func (i *Inst) String() string</pre> <h2 id="InstOp">type <span>InstOp</span> </h2> <p>An InstOp is an instruction opcode. </p>
+<pre data-language="go">type InstOp uint8</pre> <pre data-language="go">const (
+ InstAlt InstOp = iota
+ InstAltMatch
+ InstCapture
+ InstEmptyWidth
+ InstMatch
+ InstFail
+ InstNop
+ InstRune
+ InstRune1
+ InstRuneAny
+ InstRuneAnyNotNL
+)</pre> <h3 id="InstOp.String">func (InstOp) <span>String</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (i InstOp) String() string</pre> <h2 id="Op">type <span>Op</span> </h2> <p>An Op is a single regular expression operator. </p>
+<pre data-language="go">type Op uint8</pre> <pre data-language="go">const (
+ OpNoMatch Op = 1 + iota // matches no strings
+ OpEmptyMatch // matches empty string
+ OpLiteral // matches Runes sequence
+ OpCharClass // matches Runes interpreted as range pair list
+ OpAnyCharNotNL // matches any character except newline
+ OpAnyChar // matches any character
+ OpBeginLine // matches empty string at beginning of line
+ OpEndLine // matches empty string at end of line
+ OpBeginText // matches empty string at beginning of text
+ OpEndText // matches empty string at end of text
+ OpWordBoundary // matches word boundary `\b`
+ OpNoWordBoundary // matches word non-boundary `\B`
+ OpCapture // capturing subexpression with index Cap, optional name Name
+ OpStar // matches Sub[0] zero or more times
+ OpPlus // matches Sub[0] one or more times
+ OpQuest // matches Sub[0] zero or one times
+ OpRepeat // matches Sub[0] at least Min times, at most Max (Max == -1 is no limit)
+ OpConcat // matches concatenation of Subs
+ OpAlternate // matches alternation of Subs
+)</pre> <h3 id="Op.String">func (Op) <span>String</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (i Op) String() string</pre> <h2 id="Prog">type <span>Prog</span> </h2> <p>A Prog is a compiled regular expression program. </p>
+<pre data-language="go">type Prog struct {
+ Inst []Inst
+ Start int // index of start instruction
+ NumCap int // number of InstCapture insts in re
+}
+</pre> <h3 id="Compile">func <span>Compile</span> </h3> <pre data-language="go">func Compile(re *Regexp) (*Prog, error)</pre> <p>Compile compiles the regexp into a program to be executed. The regexp should have been simplified already (returned from re.Simplify). </p>
+<h3 id="Prog.Prefix">func (*Prog) <span>Prefix</span> </h3> <pre data-language="go">func (p *Prog) Prefix() (prefix string, complete bool)</pre> <p>Prefix returns a literal string that all matches for the regexp must start with. Complete is true if the prefix is the entire match. </p>
+<h3 id="Prog.StartCond">func (*Prog) <span>StartCond</span> </h3> <pre data-language="go">func (p *Prog) StartCond() EmptyOp</pre> <p>StartCond returns the leading empty-width conditions that must be true in any match. It returns ^EmptyOp(0) if no matches are possible. </p>
+<h3 id="Prog.String">func (*Prog) <span>String</span> </h3> <pre data-language="go">func (p *Prog) String() string</pre> <h2 id="Regexp">type <span>Regexp</span> </h2> <p>A Regexp is a node in a regular expression syntax tree. </p>
+<pre data-language="go">type Regexp struct {
+ Op Op // operator
+ Flags Flags
+ Sub []*Regexp // subexpressions, if any
+ Sub0 [1]*Regexp // storage for short Sub
+ Rune []rune // matched runes, for OpLiteral, OpCharClass
+ Rune0 [2]rune // storage for short Rune
+ Min, Max int // min, max for OpRepeat
+ Cap int // capturing index, for OpCapture
+ Name string // capturing name, for OpCapture
+}
+</pre> <h3 id="Parse">func <span>Parse</span> </h3> <pre data-language="go">func Parse(s string, flags Flags) (*Regexp, error)</pre> <p>Parse parses a regular expression string s, controlled by the specified Flags, and returns a regular expression parse tree. The syntax is described in the top-level comment. </p>
+<h3 id="Regexp.CapNames">func (*Regexp) <span>CapNames</span> </h3> <pre data-language="go">func (re *Regexp) CapNames() []string</pre> <p>CapNames walks the regexp to find the names of capturing groups. </p>
+<h3 id="Regexp.Equal">func (*Regexp) <span>Equal</span> </h3> <pre data-language="go">func (x *Regexp) Equal(y *Regexp) bool</pre> <p>Equal reports whether x and y have identical structure. </p>
+<h3 id="Regexp.MaxCap">func (*Regexp) <span>MaxCap</span> </h3> <pre data-language="go">func (re *Regexp) MaxCap() int</pre> <p>MaxCap walks the regexp to find the maximum capture index. </p>
+<h3 id="Regexp.Simplify">func (*Regexp) <span>Simplify</span> </h3> <pre data-language="go">func (re *Regexp) Simplify() *Regexp</pre> <p>Simplify returns a regexp equivalent to re but without counted repetitions and with various other simplifications, such as rewriting /(?:a+)+/ to /a+/. The resulting regexp will execute correctly but its string representation will not produce the same parse tree, because capturing parentheses may have been duplicated or removed. For example, the simplified form for /(x){1,2}/ is /(x)(x)?/ but both parentheses capture as $1. The returned regexp may share structure with or be the original. </p>
+<h3 id="Regexp.String">func (*Regexp) <span>String</span> </h3> <pre data-language="go">func (re *Regexp) String() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/regexp/syntax/" class="_attribution-link">http://golang.org/pkg/regexp/syntax/</a>
+ </p>
+</div>
diff --git a/devdocs/go/runtime%2Fasan%2Findex.html b/devdocs/go/runtime%2Fasan%2Findex.html
new file mode 100644
index 00000000..01d57008
--- /dev/null
+++ b/devdocs/go/runtime%2Fasan%2Findex.html
@@ -0,0 +1,6 @@
+<h1> Command asan </h1><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/runtime/asan/" class="_attribution-link">http://golang.org/pkg/runtime/asan/</a>
+ </p>
+</div>
diff --git a/devdocs/go/runtime%2Fcgo%2Findex.html b/devdocs/go/runtime%2Fcgo%2Findex.html
new file mode 100644
index 00000000..1f504a91
--- /dev/null
+++ b/devdocs/go/runtime%2Fcgo%2Findex.html
@@ -0,0 +1,96 @@
+<h1> Package cgo </h1> <ul id="short-nav">
+<li><code>import "runtime/cgo"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package cgo contains runtime support for code generated by the cgo tool. See the documentation for the cgo command for details on using cgo. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Handle">type Handle</a></li>
+<li> <a href="#NewHandle">func NewHandle(v any) Handle</a>
+</li>
+<li> <a href="#Handle.Delete">func (h Handle) Delete()</a>
+</li>
+<li> <a href="#Handle.Value">func (h Handle) Value() any</a>
+</li>
+<li><a href="#Incomplete">type Incomplete</a></li>
+</ul> <h3>Package files</h3> <p> <span>callbacks.go</span> <span>callbacks_traceback.go</span> <span>cgo.go</span> <span>handle.go</span> <span>iscgo.go</span> <span>linux.go</span> <span>mmap.go</span> <span>setenv.go</span> <span>sigaction.go</span> </p> <h2 id="Handle">type <span>Handle</span> </h2> <p>Handle provides a way to pass values that contain Go pointers (pointers to memory allocated by Go) between Go and C without breaking the cgo pointer passing rules. A Handle is an integer value that can represent any Go value. A Handle can be passed through C and back to Go, and Go code can use the Handle to retrieve the original Go value. </p>
+<p>The underlying type of Handle is guaranteed to fit in an integer type that is large enough to hold the bit pattern of any pointer. The zero value of a Handle is not valid, and thus is safe to use as a sentinel in C APIs. </p>
+<p>For instance, on the Go side: </p>
+<pre data-language="go">package main
+
+/*
+#include &lt;stdint.h&gt; // for uintptr_t
+
+extern void MyGoPrint(uintptr_t handle);
+void myprint(uintptr_t handle);
+*/
+import "C"
+import "runtime/cgo"
+
+//export MyGoPrint
+func MyGoPrint(handle C.uintptr_t) {
+ h := cgo.Handle(handle)
+ val := h.Value().(string)
+ println(val)
+ h.Delete()
+}
+
+func main() {
+ val := "hello Go"
+ C.myprint(C.uintptr_t(cgo.NewHandle(val)))
+ // Output: hello Go
+}
+</pre> <p>and on the C side: </p>
+<pre data-language="go">#include &lt;stdint.h&gt; // for uintptr_t
+
+// A Go function
+extern void MyGoPrint(uintptr_t handle);
+
+// A C function
+void myprint(uintptr_t handle) {
+ MyGoPrint(handle);
+}
+</pre> <p>Some C functions accept a void* argument that points to an arbitrary data value supplied by the caller. It is not safe to coerce a <a href="#Handle">cgo.Handle</a> (an integer) to a Go <span>unsafe.Pointer</span>, but instead we can pass the address of the cgo.Handle to the void* parameter, as in this variant of the previous example: </p>
+<pre data-language="go">package main
+
+/*
+extern void MyGoPrint(void *context);
+static inline void myprint(void *context) {
+ MyGoPrint(context);
+}
+*/
+import "C"
+import (
+ "runtime/cgo"
+ "unsafe"
+)
+
+//export MyGoPrint
+func MyGoPrint(context unsafe.Pointer) {
+ h := *(*cgo.Handle)(context)
+ val := h.Value().(string)
+ println(val)
+ h.Delete()
+}
+
+func main() {
+ val := "hello Go"
+ h := cgo.NewHandle(val)
+ C.myprint(unsafe.Pointer(&amp;h))
+ // Output: hello Go
+}
+</pre> <pre data-language="go">type Handle uintptr</pre> <h3 id="NewHandle">func <span>NewHandle</span> </h3> <pre data-language="go">func NewHandle(v any) Handle</pre> <p>NewHandle returns a handle for a given value. </p>
+<p>The handle is valid until the program calls Delete on it. The handle uses resources, and this package assumes that C code may hold on to the handle, so a program must explicitly call Delete when the handle is no longer needed. </p>
+<p>The intended use is to pass the returned handle to C code, which passes it back to Go, which calls Value. </p>
+<h3 id="Handle.Delete">func (Handle) <span>Delete</span> </h3> <pre data-language="go">func (h Handle) Delete()</pre> <p>Delete invalidates a handle. This method should only be called once the program no longer needs to pass the handle to C and the C code no longer has a copy of the handle value. </p>
+<p>The method panics if the handle is invalid. </p>
+<h3 id="Handle.Value">func (Handle) <span>Value</span> </h3> <pre data-language="go">func (h Handle) Value() any</pre> <p>Value returns the associated Go value for a valid handle. </p>
+<p>The method panics if the handle is invalid. </p>
+<h2 id="Incomplete">type <span>Incomplete</span> </h2> <p>Incomplete is used specifically for the semantics of incomplete C types. </p>
+<pre data-language="go">type Incomplete struct {
+ // contains filtered or unexported fields
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/runtime/cgo/" class="_attribution-link">http://golang.org/pkg/runtime/cgo/</a>
+ </p>
+</div>
diff --git a/devdocs/go/runtime%2Fcoverage%2Findex.html b/devdocs/go/runtime%2Fcoverage%2Findex.html
new file mode 100644
index 00000000..f62b083b
--- /dev/null
+++ b/devdocs/go/runtime%2Fcoverage%2Findex.html
@@ -0,0 +1,20 @@
+<h1> Package coverage </h1> <ul id="short-nav">
+<li><code>import "runtime/coverage"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#ClearCounters">func ClearCounters() error</a></li>
+<li><a href="#WriteCounters">func WriteCounters(w io.Writer) error</a></li>
+<li><a href="#WriteCountersDir">func WriteCountersDir(dir string) error</a></li>
+<li><a href="#WriteMeta">func WriteMeta(w io.Writer) error</a></li>
+<li><a href="#WriteMetaDir">func WriteMetaDir(dir string) error</a></li>
+</ul> <h3>Package files</h3> <p> <span>apis.go</span> <span>emit.go</span> <span>hooks.go</span> <span>testsupport.go</span> </p> <h2 id="ClearCounters">func <span>ClearCounters</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func ClearCounters() error</pre> <p>ClearCounters clears/resets all coverage counter variables in the currently running program. It returns an error if the program in question was not built with the "-cover" flag. Clearing of coverage counters is also not supported for programs not using atomic counter mode (see more detailed comments below for the rationale here). </p>
+<h2 id="WriteCounters">func <span>WriteCounters</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func WriteCounters(w io.Writer) error</pre> <p>WriteCounters writes coverage counter-data content for the currently running program to the writer 'w'. An error will be returned if the operation can't be completed successfully (for example, if the currently running program was not built with "-cover", or if a write fails). The counter data written will be a snapshot taken at the point of the invocation. </p>
+<h2 id="WriteCountersDir">func <span>WriteCountersDir</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func WriteCountersDir(dir string) error</pre> <p>WriteCountersDir writes a coverage counter-data file for the currently running program to the directory specified in 'dir'. An error will be returned if the operation can't be completed successfully (for example, if the currently running program was not built with "-cover", or if the directory does not exist). The counter data written will be a snapshot taken at the point of the call. </p>
+<h2 id="WriteMeta">func <span>WriteMeta</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func WriteMeta(w io.Writer) error</pre> <p>WriteMeta writes the meta-data content (the payload that would normally be emitted to a meta-data file) for the currently running program to the writer 'w'. An error will be returned if the operation can't be completed successfully (for example, if the currently running program was not built with "-cover", or if a write fails). </p>
+<h2 id="WriteMetaDir">func <span>WriteMetaDir</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func WriteMetaDir(dir string) error</pre> <p>WriteMetaDir writes a coverage meta-data file for the currently running program to the directory specified in 'dir'. An error will be returned if the operation can't be completed successfully (for example, if the currently running program was not built with "-cover", or if the directory does not exist). </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/runtime/coverage/" class="_attribution-link">http://golang.org/pkg/runtime/coverage/</a>
+ </p>
+</div>
diff --git a/devdocs/go/runtime%2Fdebug%2Findex.html b/devdocs/go/runtime%2Fdebug%2Findex.html
new file mode 100644
index 00000000..1b21523b
--- /dev/null
+++ b/devdocs/go/runtime%2Fdebug%2Findex.html
@@ -0,0 +1,120 @@
+<h1> Package debug </h1> <ul id="short-nav">
+<li><code>import "runtime/debug"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package debug contains facilities for programs to debug themselves while they are running. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#FreeOSMemory">func FreeOSMemory()</a></li>
+<li><a href="#PrintStack">func PrintStack()</a></li>
+<li><a href="#ReadGCStats">func ReadGCStats(stats *GCStats)</a></li>
+<li><a href="#SetGCPercent">func SetGCPercent(percent int) int</a></li>
+<li><a href="#SetMaxStack">func SetMaxStack(bytes int) int</a></li>
+<li><a href="#SetMaxThreads">func SetMaxThreads(threads int) int</a></li>
+<li><a href="#SetMemoryLimit">func SetMemoryLimit(limit int64) int64</a></li>
+<li><a href="#SetPanicOnFault">func SetPanicOnFault(enabled bool) bool</a></li>
+<li><a href="#SetTraceback">func SetTraceback(level string)</a></li>
+<li><a href="#Stack">func Stack() []byte</a></li>
+<li><a href="#WriteHeapDump">func WriteHeapDump(fd uintptr)</a></li>
+<li><a href="#BuildInfo">type BuildInfo</a></li>
+<li> <a href="#ParseBuildInfo">func ParseBuildInfo(data string) (bi *BuildInfo, err error)</a>
+</li>
+<li> <a href="#ReadBuildInfo">func ReadBuildInfo() (info *BuildInfo, ok bool)</a>
+</li>
+<li> <a href="#BuildInfo.String">func (bi *BuildInfo) String() string</a>
+</li>
+<li><a href="#BuildSetting">type BuildSetting</a></li>
+<li><a href="#GCStats">type GCStats</a></li>
+<li><a href="#Module">type Module</a></li>
+</ul> <h3>Package files</h3> <p> <span>garbage.go</span> <span>mod.go</span> <span>stack.go</span> <span>stubs.go</span> </p> <h2 id="FreeOSMemory">func <span>FreeOSMemory</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func FreeOSMemory()</pre> <p>FreeOSMemory forces a garbage collection followed by an attempt to return as much memory to the operating system as possible. (Even if this is not called, the runtime gradually returns memory to the operating system in a background task.) </p>
+<h2 id="PrintStack">func <span>PrintStack</span> </h2> <pre data-language="go">func PrintStack()</pre> <p>PrintStack prints to standard error the stack trace returned by runtime.Stack. </p>
+<h2 id="ReadGCStats">func <span>ReadGCStats</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func ReadGCStats(stats *GCStats)</pre> <p>ReadGCStats reads statistics about garbage collection into stats. The number of entries in the pause history is system-dependent; stats.Pause slice will be reused if large enough, reallocated otherwise. ReadGCStats may use the full capacity of the stats.Pause slice. If stats.PauseQuantiles is non-empty, ReadGCStats fills it with quantiles summarizing the distribution of pause time. For example, if len(stats.PauseQuantiles) is 5, it will be filled with the minimum, 25%, 50%, 75%, and maximum pause times. </p>
+<h2 id="SetGCPercent">func <span>SetGCPercent</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func SetGCPercent(percent int) int</pre> <p>SetGCPercent sets the garbage collection target percentage: a collection is triggered when the ratio of freshly allocated data to live data remaining after the previous collection reaches this percentage. SetGCPercent returns the previous setting. The initial setting is the value of the GOGC environment variable at startup, or 100 if the variable is not set. This setting may be effectively reduced in order to maintain a memory limit. A negative percentage effectively disables garbage collection, unless the memory limit is reached. See SetMemoryLimit for more details. </p>
+<h2 id="SetMaxStack">func <span>SetMaxStack</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func SetMaxStack(bytes int) int</pre> <p>SetMaxStack sets the maximum amount of memory that can be used by a single goroutine stack. If any goroutine exceeds this limit while growing its stack, the program crashes. SetMaxStack returns the previous setting. The initial setting is 1 GB on 64-bit systems, 250 MB on 32-bit systems. There may be a system-imposed maximum stack limit regardless of the value provided to SetMaxStack. </p>
+<p>SetMaxStack is useful mainly for limiting the damage done by goroutines that enter an infinite recursion. It only limits future stack growth. </p>
+<h2 id="SetMaxThreads">func <span>SetMaxThreads</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func SetMaxThreads(threads int) int</pre> <p>SetMaxThreads sets the maximum number of operating system threads that the Go program can use. If it attempts to use more than this many, the program crashes. SetMaxThreads returns the previous setting. The initial setting is 10,000 threads. </p>
+<p>The limit controls the number of operating system threads, not the number of goroutines. A Go program creates a new thread only when a goroutine is ready to run but all the existing threads are blocked in system calls, cgo calls, or are locked to other goroutines due to use of runtime.LockOSThread. </p>
+<p>SetMaxThreads is useful mainly for limiting the damage done by programs that create an unbounded number of threads. The idea is to take down the program before it takes down the operating system. </p>
+<h2 id="SetMemoryLimit">func <span>SetMemoryLimit</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func SetMemoryLimit(limit int64) int64</pre> <p>SetMemoryLimit provides the runtime with a soft memory limit. </p>
+<p>The runtime undertakes several processes to try to respect this memory limit, including adjustments to the frequency of garbage collections and returning memory to the underlying system more aggressively. This limit will be respected even if GOGC=off (or, if SetGCPercent(-1) is executed). </p>
+<p>The input limit is provided as bytes, and includes all memory mapped, managed, and not released by the Go runtime. Notably, it does not account for space used by the Go binary and memory external to Go, such as memory managed by the underlying system on behalf of the process, or memory managed by non-Go code inside the same process. Examples of excluded memory sources include: OS kernel memory held on behalf of the process, memory allocated by C code, and memory mapped by syscall.Mmap (because it is not managed by the Go runtime). </p>
+<p>More specifically, the following expression accurately reflects the value the runtime attempts to maintain as the limit: </p>
+<pre data-language="go">runtime.MemStats.Sys - runtime.MemStats.HeapReleased
+</pre> <p>or in terms of the runtime/metrics package: </p>
+<pre data-language="go">/memory/classes/total:bytes - /memory/classes/heap/released:bytes
+</pre> <p>A zero limit or a limit that's lower than the amount of memory used by the Go runtime may cause the garbage collector to run nearly continuously. However, the application may still make progress. </p>
+<p>The memory limit is always respected by the Go runtime, so to effectively disable this behavior, set the limit very high. <span>math.MaxInt64</span> is the canonical value for disabling the limit, but values much greater than the available memory on the underlying system work just as well. </p>
+<p>See <a href="https://go.dev/doc/gc-guide">https://go.dev/doc/gc-guide</a> for a detailed guide explaining the soft memory limit in more detail, as well as a variety of common use-cases and scenarios. </p>
+<p>The initial setting is math.MaxInt64 unless the GOMEMLIMIT environment variable is set, in which case it provides the initial setting. GOMEMLIMIT is a numeric value in bytes with an optional unit suffix. The supported suffixes include B, KiB, MiB, GiB, and TiB. These suffixes represent quantities of bytes as defined by the IEC 80000-13 standard. That is, they are based on powers of two: KiB means 2^10 bytes, MiB means 2^20 bytes, and so on. </p>
+<p>SetMemoryLimit returns the previously set memory limit. A negative input does not adjust the limit, and allows for retrieval of the currently set memory limit. </p>
+<h2 id="SetPanicOnFault">func <span>SetPanicOnFault</span> <span title="Added in Go 1.3">1.3</span> </h2> <pre data-language="go">func SetPanicOnFault(enabled bool) bool</pre> <p>SetPanicOnFault controls the runtime's behavior when a program faults at an unexpected (non-nil) address. Such faults are typically caused by bugs such as runtime memory corruption, so the default response is to crash the program. Programs working with memory-mapped files or unsafe manipulation of memory may cause faults at non-nil addresses in less dramatic situations; SetPanicOnFault allows such programs to request that the runtime trigger only a panic, not a crash. The runtime.Error that the runtime panics with may have an additional method: </p>
+<pre data-language="go">Addr() uintptr
+</pre> <p>If that method exists, it returns the memory address which triggered the fault. The results of Addr are best-effort and the veracity of the result may depend on the platform. SetPanicOnFault applies only to the current goroutine. It returns the previous setting. </p>
+<h2 id="SetTraceback">func <span>SetTraceback</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">func SetTraceback(level string)</pre> <p>SetTraceback sets the amount of detail printed by the runtime in the traceback it prints before exiting due to an unrecovered panic or an internal runtime error. The level argument takes the same values as the GOTRACEBACK environment variable. For example, SetTraceback("all") ensure that the program prints all goroutines when it crashes. See the package runtime documentation for details. If SetTraceback is called with a level lower than that of the environment variable, the call is ignored. </p>
+<h2 id="Stack">func <span>Stack</span> </h2> <pre data-language="go">func Stack() []byte</pre> <p>Stack returns a formatted stack trace of the goroutine that calls it. It calls <span>runtime.Stack</span> with a large enough buffer to capture the entire trace. </p>
+<h2 id="WriteHeapDump">func <span>WriteHeapDump</span> <span title="Added in Go 1.3">1.3</span> </h2> <pre data-language="go">func WriteHeapDump(fd uintptr)</pre> <p>WriteHeapDump writes a description of the heap and the objects in it to the given file descriptor. </p>
+<p>WriteHeapDump suspends the execution of all goroutines until the heap dump is completely written. Thus, the file descriptor must not be connected to a pipe or socket whose other end is in the same Go process; instead, use a temporary file or network socket. </p>
+<p>The heap dump format is defined at <a href="https://golang.org/s/go15heapdump">https://golang.org/s/go15heapdump</a>. </p>
+<h2 id="BuildInfo">type <span>BuildInfo</span> <span title="Added in Go 1.12">1.12</span> </h2> <p>BuildInfo represents the build information read from a Go binary. </p>
+<pre data-language="go">type BuildInfo struct {
+ // GoVersion is the version of the Go toolchain that built the binary
+ // (for example, "go1.19.2").
+ GoVersion string // Go 1.18
+
+ // Path is the package path of the main package for the binary
+ // (for example, "golang.org/x/tools/cmd/stringer").
+ Path string
+
+ // Main describes the module that contains the main package for the binary.
+ Main Module
+
+ // Deps describes all the dependency modules, both direct and indirect,
+ // that contributed packages to the build of this binary.
+ Deps []*Module
+
+ // Settings describes the build settings used to build the binary.
+ Settings []BuildSetting // Go 1.18
+}
+</pre> <h3 id="ParseBuildInfo">func <span>ParseBuildInfo</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func ParseBuildInfo(data string) (bi *BuildInfo, err error)</pre> <h3 id="ReadBuildInfo">func <span>ReadBuildInfo</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func ReadBuildInfo() (info *BuildInfo, ok bool)</pre> <p>ReadBuildInfo returns the build information embedded in the running binary. The information is available only in binaries built with module support. </p>
+<h3 id="BuildInfo.String">func (*BuildInfo) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (bi *BuildInfo) String() string</pre> <h2 id="BuildSetting">type <span>BuildSetting</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>A BuildSetting is a key-value pair describing one setting that influenced a build. </p>
+<p>Defined keys include: </p>
+<ul> <li>-buildmode: the buildmode flag used (typically "exe") </li>
+<li>-compiler: the compiler toolchain flag used (typically "gc") </li>
+<li>CGO_ENABLED: the effective CGO_ENABLED environment variable </li>
+<li>CGO_CFLAGS: the effective CGO_CFLAGS environment variable </li>
+<li>CGO_CPPFLAGS: the effective CGO_CPPFLAGS environment variable </li>
+<li>CGO_CXXFLAGS: the effective CGO_CXXFLAGS environment variable </li>
+<li>CGO_LDFLAGS: the effective CGO_LDFLAGS environment variable </li>
+<li>GOARCH: the architecture target </li>
+<li>GOAMD64/GOARM/GO386/etc: the architecture feature level for GOARCH </li>
+<li>GOOS: the operating system target </li>
+<li>vcs: the version control system for the source tree where the build ran </li>
+<li>vcs.revision: the revision identifier for the current commit or checkout </li>
+<li>vcs.time: the modification time associated with vcs.revision, in RFC3339 format </li>
+<li>vcs.modified: true or false indicating whether the source tree had local modifications </li>
+</ul> <pre data-language="go">type BuildSetting struct {
+ // Key and Value describe the build setting.
+ // Key must not contain an equals sign, space, tab, or newline.
+ // Value must not contain newlines ('\n').
+ Key, Value string
+}
+</pre> <h2 id="GCStats">type <span>GCStats</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>GCStats collect information about recent garbage collections. </p>
+<pre data-language="go">type GCStats struct {
+ LastGC time.Time // time of last collection
+ NumGC int64 // number of garbage collections
+ PauseTotal time.Duration // total pause for all collections
+ Pause []time.Duration // pause history, most recent first
+ PauseEnd []time.Time // pause end times history, most recent first; added in Go 1.4
+ PauseQuantiles []time.Duration
+}
+</pre> <h2 id="Module">type <span>Module</span> <span title="Added in Go 1.12">1.12</span> </h2> <p>A Module describes a single module included in a build. </p>
+<pre data-language="go">type Module struct {
+ Path string // module path
+ Version string // module version
+ Sum string // checksum
+ Replace *Module // replaced by this module
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/runtime/debug/" class="_attribution-link">http://golang.org/pkg/runtime/debug/</a>
+ </p>
+</div>
diff --git a/devdocs/go/runtime%2Findex.html b/devdocs/go/runtime%2Findex.html
new file mode 100644
index 00000000..cab9d5b8
--- /dev/null
+++ b/devdocs/go/runtime%2Findex.html
@@ -0,0 +1,810 @@
+<h1> Package runtime </h1> <ul id="short-nav">
+<li><code>import "runtime"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package runtime contains operations that interact with Go's runtime system, such as functions to control goroutines. It also includes the low-level type information used by the reflect package; see <span>reflect</span>'s documentation for the programmable interface to the run-time type system. </p>
+<h3 id="hdr-Environment_Variables">Environment Variables</h3> <p>The following environment variables ($name or %name%, depending on the host operating system) control the run-time behavior of Go programs. The meanings and use may change from release to release. </p>
+<p>The GOGC variable sets the initial garbage collection target percentage. A collection is triggered when the ratio of freshly allocated data to live data remaining after the previous collection reaches this percentage. The default is GOGC=100. Setting GOGC=off disables the garbage collector entirely. <span>runtime/debug.SetGCPercent</span> allows changing this percentage at run time. </p>
+<p>The GOMEMLIMIT variable sets a soft memory limit for the runtime. This memory limit includes the Go heap and all other memory managed by the runtime, and excludes external memory sources such as mappings of the binary itself, memory managed in other languages, and memory held by the operating system on behalf of the Go program. GOMEMLIMIT is a numeric value in bytes with an optional unit suffix. The supported suffixes include B, KiB, MiB, GiB, and TiB. These suffixes represent quantities of bytes as defined by the IEC 80000-13 standard. That is, they are based on powers of two: KiB means 2^10 bytes, MiB means 2^20 bytes, and so on. The default setting is <span>math.MaxInt64</span>, which effectively disables the memory limit. <span>runtime/debug.SetMemoryLimit</span> allows changing this limit at run time. </p>
+<p>The GODEBUG variable controls debugging variables within the runtime. It is a comma-separated list of name=val pairs setting these named variables: </p>
+<pre data-language="go">allocfreetrace: setting allocfreetrace=1 causes every allocation to be
+profiled and a stack trace printed on each object's allocation and free.
+
+clobberfree: setting clobberfree=1 causes the garbage collector to
+clobber the memory content of an object with bad content when it frees
+the object.
+
+cpu.*: cpu.all=off disables the use of all optional instruction set extensions.
+cpu.extension=off disables use of instructions from the specified instruction set extension.
+extension is the lower case name for the instruction set extension such as sse41 or avx
+as listed in internal/cpu package. As an example cpu.avx=off disables runtime detection
+and thereby use of AVX instructions.
+
+cgocheck: setting cgocheck=0 disables all checks for packages
+using cgo to incorrectly pass Go pointers to non-Go code.
+Setting cgocheck=1 (the default) enables relatively cheap
+checks that may miss some errors. A more complete, but slow,
+cgocheck mode can be enabled using GOEXPERIMENT (which
+requires a rebuild), see https://pkg.go.dev/internal/goexperiment for details.
+
+disablethp: setting disablethp=1 on Linux disables transparent huge pages for the heap.
+It has no effect on other platforms. disablethp is meant for compatibility with versions
+of Go before 1.21, which stopped working around a Linux kernel default that can result
+in significant memory overuse. See https://go.dev/issue/64332. This setting will be
+removed in a future release, so operators should tweak their Linux configuration to suit
+their needs before then. See https://go.dev/doc/gc-guide#Linux_transparent_huge_pages.
+
+dontfreezetheworld: by default, the start of a fatal panic or throw
+"freezes the world", preempting all threads to stop all running
+goroutines, which makes it possible to traceback all goroutines, and
+keeps their state close to the point of panic. Setting
+dontfreezetheworld=1 disables this preemption, allowing goroutines to
+continue executing during panic processing. Note that goroutines that
+naturally enter the scheduler will still stop. This can be useful when
+debugging the runtime scheduler, as freezetheworld perturbs scheduler
+state and thus may hide problems.
+
+efence: setting efence=1 causes the allocator to run in a mode
+where each object is allocated on a unique page and addresses are
+never recycled.
+
+gccheckmark: setting gccheckmark=1 enables verification of the
+garbage collector's concurrent mark phase by performing a
+second mark pass while the world is stopped. If the second
+pass finds a reachable object that was not found by concurrent
+mark, the garbage collector will panic.
+
+gcpacertrace: setting gcpacertrace=1 causes the garbage collector to
+print information about the internal state of the concurrent pacer.
+
+gcshrinkstackoff: setting gcshrinkstackoff=1 disables moving goroutines
+onto smaller stacks. In this mode, a goroutine's stack can only grow.
+
+gcstoptheworld: setting gcstoptheworld=1 disables concurrent garbage collection,
+making every garbage collection a stop-the-world event. Setting gcstoptheworld=2
+also disables concurrent sweeping after the garbage collection finishes.
+
+gctrace: setting gctrace=1 causes the garbage collector to emit a single line to standard
+error at each collection, summarizing the amount of memory collected and the
+length of the pause. The format of this line is subject to change. Included in
+the explanation below is also the relevant runtime/metrics metric for each field.
+Currently, it is:
+ gc # @#s #%: #+#+# ms clock, #+#/#/#+# ms cpu, #-&gt;#-&gt;# MB, # MB goal, # MB stacks, #MB globals, # P
+where the fields are as follows:
+ gc # the GC number, incremented at each GC
+ @#s time in seconds since program start
+ #% percentage of time spent in GC since program start
+ #+...+# wall-clock/CPU times for the phases of the GC
+ #-&gt;#-&gt;# MB heap size at GC start, at GC end, and live heap, or /gc/scan/heap:bytes
+ # MB goal goal heap size, or /gc/heap/goal:bytes
+ # MB stacks estimated scannable stack size, or /gc/scan/stack:bytes
+ # MB globals scannable global size, or /gc/scan/globals:bytes
+ # P number of processors used, or /sched/gomaxprocs:threads
+The phases are stop-the-world (STW) sweep termination, concurrent
+mark and scan, and STW mark termination. The CPU times
+for mark/scan are broken down in to assist time (GC performed in
+line with allocation), background GC time, and idle GC time.
+If the line ends with "(forced)", this GC was forced by a
+runtime.GC() call.
+
+harddecommit: setting harddecommit=1 causes memory that is returned to the OS to
+also have protections removed on it. This is the only mode of operation on Windows,
+but is helpful in debugging scavenger-related issues on other platforms. Currently,
+only supported on Linux.
+
+inittrace: setting inittrace=1 causes the runtime to emit a single line to standard
+error for each package with init work, summarizing the execution time and memory
+allocation. No information is printed for inits executed as part of plugin loading
+and for packages without both user defined and compiler generated init work.
+The format of this line is subject to change. Currently, it is:
+ init # @#ms, # ms clock, # bytes, # allocs
+where the fields are as follows:
+ init # the package name
+ @# ms time in milliseconds when the init started since program start
+ # clock wall-clock time for package initialization work
+ # bytes memory allocated on the heap
+ # allocs number of heap allocations
+
+madvdontneed: setting madvdontneed=0 will use MADV_FREE
+instead of MADV_DONTNEED on Linux when returning memory to the
+kernel. This is more efficient, but means RSS numbers will
+drop only when the OS is under memory pressure. On the BSDs and
+Illumos/Solaris, setting madvdontneed=1 will use MADV_DONTNEED instead
+of MADV_FREE. This is less efficient, but causes RSS numbers to drop
+more quickly.
+
+memprofilerate: setting memprofilerate=X will update the value of runtime.MemProfileRate.
+When set to 0 memory profiling is disabled. Refer to the description of
+MemProfileRate for the default value.
+
+pagetrace: setting pagetrace=/path/to/file will write out a trace of page events
+that can be viewed, analyzed, and visualized using the x/debug/cmd/pagetrace tool.
+Build your program with GOEXPERIMENT=pagetrace to enable this functionality. Do not
+enable this functionality if your program is a setuid binary as it introduces a security
+risk in that scenario. Currently not supported on Windows, plan9 or js/wasm. Setting this
+option for some applications can produce large traces, so use with care.
+
+panicnil: setting panicnil=1 disables the runtime error when calling panic with nil
+interface value or an untyped nil.
+
+runtimecontentionstacks: setting runtimecontentionstacks=1 enables inclusion of call stacks
+related to contention on runtime-internal locks in the "mutex" profile, subject to the
+MutexProfileFraction setting. When runtimecontentionstacks=0, contention on
+runtime-internal locks will report as "runtime._LostContendedRuntimeLock". When
+runtimecontentionstacks=1, the call stacks will correspond to the unlock call that released
+the lock. But instead of the value corresponding to the amount of contention that call
+stack caused, it corresponds to the amount of time the caller of unlock had to wait in its
+original call to lock. A future release is expected to align those and remove this setting.
+
+invalidptr: invalidptr=1 (the default) causes the garbage collector and stack
+copier to crash the program if an invalid pointer value (for example, 1)
+is found in a pointer-typed location. Setting invalidptr=0 disables this check.
+This should only be used as a temporary workaround to diagnose buggy code.
+The real fix is to not store integers in pointer-typed locations.
+
+sbrk: setting sbrk=1 replaces the memory allocator and garbage collector
+with a trivial allocator that obtains memory from the operating system and
+never reclaims any memory.
+
+scavtrace: setting scavtrace=1 causes the runtime to emit a single line to standard
+error, roughly once per GC cycle, summarizing the amount of work done by the
+scavenger as well as the total amount of memory returned to the operating system
+and an estimate of physical memory utilization. The format of this line is subject
+to change, but currently it is:
+ scav # KiB work (bg), # KiB work (eager), # KiB total, #% util
+where the fields are as follows:
+ # KiB work (bg) the amount of memory returned to the OS in the background since
+ the last line
+ # KiB work (eager) the amount of memory returned to the OS eagerly since the last line
+ # KiB now the amount of address space currently returned to the OS
+ #% util the fraction of all unscavenged heap memory which is in-use
+If the line ends with "(forced)", then scavenging was forced by a
+debug.FreeOSMemory() call.
+
+scheddetail: setting schedtrace=X and scheddetail=1 causes the scheduler to emit
+detailed multiline info every X milliseconds, describing state of the scheduler,
+processors, threads and goroutines.
+
+schedtrace: setting schedtrace=X causes the scheduler to emit a single line to standard
+error every X milliseconds, summarizing the scheduler state.
+
+tracebackancestors: setting tracebackancestors=N extends tracebacks with the stacks at
+which goroutines were created, where N limits the number of ancestor goroutines to
+report. This also extends the information returned by runtime.Stack. Ancestor's goroutine
+IDs will refer to the ID of the goroutine at the time of creation; it's possible for this
+ID to be reused for another goroutine. Setting N to 0 will report no ancestry information.
+
+tracefpunwindoff: setting tracefpunwindoff=1 forces the execution tracer to
+use the runtime's default stack unwinder instead of frame pointer unwinding.
+This increases tracer overhead, but could be helpful as a workaround or for
+debugging unexpected regressions caused by frame pointer unwinding.
+
+traceadvanceperiod: the approximate period in nanoseconds between trace generations. Only
+applies if a program is built with GOEXPERIMENT=exectracer2. Used primarily for testing
+and debugging the execution tracer.
+
+asyncpreemptoff: asyncpreemptoff=1 disables signal-based
+asynchronous goroutine preemption. This makes some loops
+non-preemptible for long periods, which may delay GC and
+goroutine scheduling. This is useful for debugging GC issues
+because it also disables the conservative stack scanning used
+for asynchronously preempted goroutines.
+</pre> <p>The <span>net</span> and <span>net/http</span> packages also refer to debugging variables in GODEBUG. See the documentation for those packages for details. </p>
+<p>The GOMAXPROCS variable limits the number of operating system threads that can execute user-level Go code simultaneously. There is no limit to the number of threads that can be blocked in system calls on behalf of Go code; those do not count against the GOMAXPROCS limit. This package's <a href="#GOMAXPROCS">GOMAXPROCS</a> function queries and changes the limit. </p>
+<p>The GORACE variable configures the race detector, for programs built using -race. See the <a href="https://go.dev/doc/articles/race_detector">Race Detector article</a> for details. </p>
+<p>The GOTRACEBACK variable controls the amount of output generated when a Go program fails due to an unrecovered panic or an unexpected runtime condition. By default, a failure prints a stack trace for the current goroutine, eliding functions internal to the run-time system, and then exits with exit code 2. The failure prints stack traces for all goroutines if there is no current goroutine or the failure is internal to the run-time. GOTRACEBACK=none omits the goroutine stack traces entirely. GOTRACEBACK=single (the default) behaves as described above. GOTRACEBACK=all adds stack traces for all user-created goroutines. GOTRACEBACK=system is like “all” but adds stack frames for run-time functions and shows goroutines created internally by the run-time. GOTRACEBACK=crash is like “system” but crashes in an operating system-specific manner instead of exiting. For example, on Unix systems, the crash raises SIGABRT to trigger a core dump. GOTRACEBACK=wer is like “crash” but doesn't disable Windows Error Reporting (WER). For historical reasons, the GOTRACEBACK settings 0, 1, and 2 are synonyms for none, all, and system, respectively. The <span>runtime/debug.SetTraceback</span> function allows increasing the amount of output at run time, but it cannot reduce the amount below that specified by the environment variable. </p>
+<p>The GOARCH, GOOS, GOPATH, and GOROOT environment variables complete the set of Go environment variables. They influence the building of Go programs (see <span>cmd/go</span> and <span>go/build</span>). GOARCH, GOOS, and GOROOT are recorded at compile time and made available by constants or functions in this package, but they do not influence the execution of the run-time system. </p>
+<h3 id="hdr-Security">Security</h3> <p>On Unix platforms, Go's runtime system behaves slightly differently when a binary is setuid/setgid or executed with setuid/setgid-like properties, in order to prevent dangerous behaviors. On Linux this is determined by checking for the AT_SECURE flag in the auxiliary vector, on the BSDs and Solaris/Illumos it is determined by checking the issetugid syscall, and on AIX it is determined by checking if the uid/gid match the effective uid/gid. </p>
+<p>When the runtime determines the binary is setuid/setgid-like, it does three main things: </p>
+<ul> <li>The standard input/output file descriptors (0, 1, 2) are checked to be open. If any of them are closed, they are opened pointing at /dev/null. </li>
+<li>The value of the GOTRACEBACK environment variable is set to 'none'. </li>
+<li>When a signal is received that terminates the program, or the program encounters an unrecoverable panic that would otherwise override the value of GOTRACEBACK, the goroutine stack, registers, and other memory related information are omitted. </li>
+</ul> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#BlockProfile">func BlockProfile(p []BlockProfileRecord) (n int, ok bool)</a></li>
+<li><a href="#Breakpoint">func Breakpoint()</a></li>
+<li><a href="#CPUProfile">func CPUProfile() []byte</a></li>
+<li><a href="#Caller">func Caller(skip int) (pc uintptr, file string, line int, ok bool)</a></li>
+<li><a href="#Callers">func Callers(skip int, pc []uintptr) int</a></li>
+<li><a href="#GC">func GC()</a></li>
+<li><a href="#GOMAXPROCS">func GOMAXPROCS(n int) int</a></li>
+<li><a href="#GOROOT">func GOROOT() string</a></li>
+<li><a href="#Goexit">func Goexit()</a></li>
+<li><a href="#GoroutineProfile">func GoroutineProfile(p []StackRecord) (n int, ok bool)</a></li>
+<li><a href="#Gosched">func Gosched()</a></li>
+<li><a href="#KeepAlive">func KeepAlive(x any)</a></li>
+<li><a href="#LockOSThread">func LockOSThread()</a></li>
+<li><a href="#MemProfile">func MemProfile(p []MemProfileRecord, inuseZero bool) (n int, ok bool)</a></li>
+<li><a href="#MutexProfile">func MutexProfile(p []BlockProfileRecord) (n int, ok bool)</a></li>
+<li><a href="#NumCPU">func NumCPU() int</a></li>
+<li><a href="#NumCgoCall">func NumCgoCall() int64</a></li>
+<li><a href="#NumGoroutine">func NumGoroutine() int</a></li>
+<li><a href="#ReadMemStats">func ReadMemStats(m *MemStats)</a></li>
+<li><a href="#ReadTrace">func ReadTrace() []byte</a></li>
+<li><a href="#SetBlockProfileRate">func SetBlockProfileRate(rate int)</a></li>
+<li><a href="#SetCPUProfileRate">func SetCPUProfileRate(hz int)</a></li>
+<li><a href="#SetCgoTraceback">func SetCgoTraceback(version int, traceback, context, symbolizer unsafe.Pointer)</a></li>
+<li><a href="#SetFinalizer">func SetFinalizer(obj any, finalizer any)</a></li>
+<li><a href="#SetMutexProfileFraction">func SetMutexProfileFraction(rate int) int</a></li>
+<li><a href="#Stack">func Stack(buf []byte, all bool) int</a></li>
+<li><a href="#StartTrace">func StartTrace() error</a></li>
+<li><a href="#StopTrace">func StopTrace()</a></li>
+<li><a href="#ThreadCreateProfile">func ThreadCreateProfile(p []StackRecord) (n int, ok bool)</a></li>
+<li><a href="#UnlockOSThread">func UnlockOSThread()</a></li>
+<li><a href="#Version">func Version() string</a></li>
+<li><a href="#BlockProfileRecord">type BlockProfileRecord</a></li>
+<li><a href="#Error">type Error</a></li>
+<li><a href="#Frame">type Frame</a></li>
+<li><a href="#Frames">type Frames</a></li>
+<li> <a href="#CallersFrames">func CallersFrames(callers []uintptr) *Frames</a>
+</li>
+<li> <a href="#Frames.Next">func (ci *Frames) Next() (frame Frame, more bool)</a>
+</li>
+<li><a href="#Func">type Func</a></li>
+<li> <a href="#FuncForPC">func FuncForPC(pc uintptr) *Func</a>
+</li>
+<li> <a href="#Func.Entry">func (f *Func) Entry() uintptr</a>
+</li>
+<li> <a href="#Func.FileLine">func (f *Func) FileLine(pc uintptr) (file string, line int)</a>
+</li>
+<li> <a href="#Func.Name">func (f *Func) Name() string</a>
+</li>
+<li><a href="#MemProfileRecord">type MemProfileRecord</a></li>
+<li> <a href="#MemProfileRecord.InUseBytes">func (r *MemProfileRecord) InUseBytes() int64</a>
+</li>
+<li> <a href="#MemProfileRecord.InUseObjects">func (r *MemProfileRecord) InUseObjects() int64</a>
+</li>
+<li> <a href="#MemProfileRecord.Stack">func (r *MemProfileRecord) Stack() []uintptr</a>
+</li>
+<li><a href="#MemStats">type MemStats</a></li>
+<li><a href="#PanicNilError">type PanicNilError</a></li>
+<li> <a href="#PanicNilError.Error">func (*PanicNilError) Error() string</a>
+</li>
+<li> <a href="#PanicNilError.RuntimeError">func (*PanicNilError) RuntimeError()</a>
+</li>
+<li><a href="#Pinner">type Pinner</a></li>
+<li> <a href="#Pinner.Pin">func (p *Pinner) Pin(pointer any)</a>
+</li>
+<li> <a href="#Pinner.Unpin">func (p *Pinner) Unpin()</a>
+</li>
+<li><a href="#StackRecord">type StackRecord</a></li>
+<li> <a href="#StackRecord.Stack">func (r *StackRecord) Stack() []uintptr</a>
+</li>
+<li><a href="#TypeAssertionError">type TypeAssertionError</a></li>
+<li> <a href="#TypeAssertionError.Error">func (e *TypeAssertionError) Error() string</a>
+</li>
+<li> <a href="#TypeAssertionError.RuntimeError">func (*TypeAssertionError) RuntimeError()</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Frames">Frames</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>alg.go</span> <span>arena.go</span> <span>asan0.go</span> <span>atomic_pointer.go</span> <span>cgo.go</span> <span>cgo_mmap.go</span> <span>cgo_sigaction.go</span> <span>cgocall.go</span> <span>cgocallback.go</span> <span>cgocheck.go</span> <span>chan.go</span> <span>checkptr.go</span> <span>compiler.go</span> <span>complex.go</span> <span>coro.go</span> <span>covercounter.go</span> <span>covermeta.go</span> <span>cpuflags.go</span> <span>cpuflags_amd64.go</span> <span>cpuprof.go</span> <span>cputicks.go</span> <span>create_file_unix.go</span> <span>debug.go</span> <span>debugcall.go</span> <span>debuglog.go</span> <span>debuglog_off.go</span> <span>defs_linux_amd64.go</span> <span>env_posix.go</span> <span>error.go</span> <span>exithook.go</span> <span>extern.go</span> <span>fastlog2.go</span> <span>fastlog2table.go</span> <span>fds_unix.go</span> <span>float.go</span> <span>hash64.go</span> <span>heapdump.go</span> <span>histogram.go</span> <span>iface.go</span> <span>lfstack.go</span> <span>lock_futex.go</span> <span>lockrank.go</span> <span>lockrank_off.go</span> <span>malloc.go</span> <span>map.go</span> <span>map_fast32.go</span> <span>map_fast64.go</span> <span>map_faststr.go</span> <span>mbarrier.go</span> <span>mbitmap.go</span> <span>mbitmap_allocheaders.go</span> <span>mcache.go</span> <span>mcentral.go</span> <span>mcheckmark.go</span> <span>mem.go</span> <span>mem_linux.go</span> <span>metrics.go</span> <span>mfinal.go</span> <span>mfixalloc.go</span> <span>mgc.go</span> <span>mgclimit.go</span> <span>mgcmark.go</span> <span>mgcpacer.go</span> <span>mgcscavenge.go</span> <span>mgcstack.go</span> <span>mgcsweep.go</span> <span>mgcwork.go</span> <span>mheap.go</span> <span>minmax.go</span> <span>mpagealloc.go</span> <span>mpagealloc_64bit.go</span> <span>mpagecache.go</span> <span>mpallocbits.go</span> <span>mprof.go</span> <span>mranges.go</span> <span>msan0.go</span> <span>msize_allocheaders.go</span> <span>mspanset.go</span> <span>mstats.go</span> <span>mwbbuf.go</span> <span>nbpipe_pipe2.go</span> <span>netpoll.go</span> <span>netpoll_epoll.go</span> <span>nonwindows_stub.go</span> <span>os_linux.go</span> <span>os_linux_generic.go</span> <span>os_linux_noauxv.go</span> <span>os_linux_x86.go</span> <span>os_nonopenbsd.go</span> <span>os_unix.go</span> <span>pagetrace_off.go</span> <span>panic.go</span> <span>pinner.go</span> <span>plugin.go</span> <span>preempt.go</span> <span>preempt_nonwindows.go</span> <span>print.go</span> <span>proc.go</span> <span>profbuf.go</span> <span>proflabel.go</span> <span>race0.go</span> <span>rand.go</span> <span>rdebug.go</span> <span>retry.go</span> <span>runtime.go</span> <span>runtime1.go</span> <span>runtime2.go</span> <span>runtime_boring.go</span> <span>rwmutex.go</span> <span>security_linux.go</span> <span>security_unix.go</span> <span>select.go</span> <span>sema.go</span> <span>signal_amd64.go</span> <span>signal_linux_amd64.go</span> <span>signal_unix.go</span> <span>sigqueue.go</span> <span>sigqueue_note.go</span> <span>sigtab_linux_generic.go</span> <span>sizeclasses.go</span> <span>slice.go</span> <span>softfloat64.go</span> <span>stack.go</span> <span>stkframe.go</span> <span>string.go</span> <span>stubs.go</span> <span>stubs2.go</span> <span>stubs3.go</span> <span>stubs_amd64.go</span> <span>stubs_linux.go</span> <span>symtab.go</span> <span>symtabinl.go</span> <span>sys_nonppc64x.go</span> <span>sys_x86.go</span> <span>tagptr.go</span> <span>tagptr_64bit.go</span> <span>test_amd64.go</span> <span>time.go</span> <span>time_nofake.go</span> <span>timeasm.go</span> <span>tls_stub.go</span> <span>trace2.go</span> <span>trace2buf.go</span> <span>trace2cpu.go</span> <span>trace2event.go</span> <span>trace2map.go</span> <span>trace2region.go</span> <span>trace2runtime.go</span> <span>trace2stack.go</span> <span>trace2status.go</span> <span>trace2string.go</span> <span>trace2time.go</span> <span>traceback.go</span> <span>type.go</span> <span>typekind.go</span> <span>unsafe.go</span> <span>utf8.go</span> <span>vdso_elf64.go</span> <span>vdso_linux.go</span> <span>vdso_linux_amd64.go</span> <span>write_err.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Compiler is the name of the compiler toolchain that built the running binary. Known toolchains are: </p>
+<pre data-language="go">gc Also known as cmd/compile.
+gccgo The gccgo front end, part of the GCC compiler suite.
+</pre> <pre data-language="go">const Compiler = "gc"</pre> <p>GOARCH is the running program's architecture target: one of 386, amd64, arm, s390x, and so on. </p>
+<pre data-language="go">const GOARCH string = goarch.GOARCH</pre> <p>GOOS is the running program's operating system target: one of darwin, freebsd, linux, and so on. To view possible combinations of GOOS and GOARCH, run "go tool dist list". </p>
+<pre data-language="go">const GOOS string = goos.GOOS</pre> <h2 id="pkg-variables">Variables</h2> <p>MemProfileRate controls the fraction of memory allocations that are recorded and reported in the memory profile. The profiler aims to sample an average of one allocation per MemProfileRate bytes allocated. </p>
+<p>To include every allocated block in the profile, set MemProfileRate to 1. To turn off profiling entirely, set MemProfileRate to 0. </p>
+<p>The tools that process the memory profiles assume that the profile rate is constant across the lifetime of the program and equal to the current value. Programs that change the memory profiling rate should do so just once, as early as possible in the execution of the program (for example, at the beginning of main). </p>
+<pre data-language="go">var MemProfileRate int = 512 * 1024</pre> <h2 id="BlockProfile">func <span>BlockProfile</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func BlockProfile(p []BlockProfileRecord) (n int, ok bool)</pre> <p>BlockProfile returns n, the number of records in the current blocking profile. If len(p) &gt;= n, BlockProfile copies the profile into p and returns n, true. If len(p) &lt; n, BlockProfile does not change p and returns n, false. </p>
+<p>Most clients should use the <span>runtime/pprof</span> package or the <span>testing</span> package's -test.blockprofile flag instead of calling BlockProfile directly. </p>
+<h2 id="Breakpoint">func <span>Breakpoint</span> </h2> <pre data-language="go">func Breakpoint()</pre> <p>Breakpoint executes a breakpoint trap. </p>
+<h2 id="CPUProfile">func <span>CPUProfile</span> </h2> <pre data-language="go">func CPUProfile() []byte</pre> <p>CPUProfile panics. It formerly provided raw access to chunks of a pprof-format profile generated by the runtime. The details of generating that format have changed, so this functionality has been removed. </p>
+<p>Deprecated: Use the <span>runtime/pprof</span> package, or the handlers in the <span>net/http/pprof</span> package, or the <span>testing</span> package's -test.cpuprofile flag instead. </p>
+<h2 id="Caller">func <span>Caller</span> </h2> <pre data-language="go">func Caller(skip int) (pc uintptr, file string, line int, ok bool)</pre> <p>Caller reports file and line number information about function invocations on the calling goroutine's stack. The argument skip is the number of stack frames to ascend, with 0 identifying the caller of Caller. (For historical reasons the meaning of skip differs between Caller and <a href="#Callers">Callers</a>.) The return values report the program counter, file name, and line number within the file of the corresponding call. The boolean ok is false if it was not possible to recover the information. </p>
+<h2 id="Callers">func <span>Callers</span> </h2> <pre data-language="go">func Callers(skip int, pc []uintptr) int</pre> <p>Callers fills the slice pc with the return program counters of function invocations on the calling goroutine's stack. The argument skip is the number of stack frames to skip before recording in pc, with 0 identifying the frame for Callers itself and 1 identifying the caller of Callers. It returns the number of entries written to pc. </p>
+<p>To translate these PCs into symbolic information such as function names and line numbers, use <a href="#CallersFrames">CallersFrames</a>. CallersFrames accounts for inlined functions and adjusts the return program counters into call program counters. Iterating over the returned slice of PCs directly is discouraged, as is using <a href="#FuncForPC">FuncForPC</a> on any of the returned PCs, since these cannot account for inlining or return program counter adjustment. </p>
+<h2 id="GC">func <span>GC</span> </h2> <pre data-language="go">func GC()</pre> <p>GC runs a garbage collection and blocks the caller until the garbage collection is complete. It may also block the entire program. </p>
+<h2 id="GOMAXPROCS">func <span>GOMAXPROCS</span> </h2> <pre data-language="go">func GOMAXPROCS(n int) int</pre> <p>GOMAXPROCS sets the maximum number of CPUs that can be executing simultaneously and returns the previous setting. It defaults to the value of <a href="#NumCPU">runtime.NumCPU</a>. If n &lt; 1, it does not change the current setting. This call will go away when the scheduler improves. </p>
+<h2 id="GOROOT">func <span>GOROOT</span> </h2> <pre data-language="go">func GOROOT() string</pre> <p>GOROOT returns the root of the Go tree. It uses the GOROOT environment variable, if set at process start, or else the root used during the Go build. </p>
+<h2 id="Goexit">func <span>Goexit</span> </h2> <pre data-language="go">func Goexit()</pre> <p>Goexit terminates the goroutine that calls it. No other goroutine is affected. Goexit runs all deferred calls before terminating the goroutine. Because Goexit is not a panic, any recover calls in those deferred functions will return nil. </p>
+<p>Calling Goexit from the main goroutine terminates that goroutine without func main returning. Since func main has not returned, the program continues execution of other goroutines. If all other goroutines exit, the program crashes. </p>
+<h2 id="GoroutineProfile">func <span>GoroutineProfile</span> </h2> <pre data-language="go">func GoroutineProfile(p []StackRecord) (n int, ok bool)</pre> <p>GoroutineProfile returns n, the number of records in the active goroutine stack profile. If len(p) &gt;= n, GoroutineProfile copies the profile into p and returns n, true. If len(p) &lt; n, GoroutineProfile does not change p and returns n, false. </p>
+<p>Most clients should use the <span>runtime/pprof</span> package instead of calling GoroutineProfile directly. </p>
+<h2 id="Gosched">func <span>Gosched</span> </h2> <pre data-language="go">func Gosched()</pre> <p>Gosched yields the processor, allowing other goroutines to run. It does not suspend the current goroutine, so execution resumes automatically. </p>
+<h2 id="KeepAlive">func <span>KeepAlive</span> <span title="Added in Go 1.7">1.7</span> </h2> <pre data-language="go">func KeepAlive(x any)</pre> <p>KeepAlive marks its argument as currently reachable. This ensures that the object is not freed, and its finalizer is not run, before the point in the program where KeepAlive is called. </p>
+<p>A very simplified example showing where KeepAlive is required: </p>
+<pre data-language="go">type File struct { d int }
+d, err := syscall.Open("/file/path", syscall.O_RDONLY, 0)
+// ... do something if err != nil ...
+p := &amp;File{d}
+runtime.SetFinalizer(p, func(p *File) { syscall.Close(p.d) })
+var buf [10]byte
+n, err := syscall.Read(p.d, buf[:])
+// Ensure p is not finalized until Read returns.
+runtime.KeepAlive(p)
+// No more uses of p after this point.
+</pre> <p>Without the KeepAlive call, the finalizer could run at the start of <span>syscall.Read</span>, closing the file descriptor before syscall.Read makes the actual system call. </p>
+<p>Note: KeepAlive should only be used to prevent finalizers from running prematurely. In particular, when used with <span>unsafe.Pointer</span>, the rules for valid uses of unsafe.Pointer still apply. </p>
+<h2 id="LockOSThread">func <span>LockOSThread</span> </h2> <pre data-language="go">func LockOSThread()</pre> <p>LockOSThread wires the calling goroutine to its current operating system thread. The calling goroutine will always execute in that thread, and no other goroutine will execute in it, until the calling goroutine has made as many calls to <a href="#UnlockOSThread">UnlockOSThread</a> as to LockOSThread. If the calling goroutine exits without unlocking the thread, the thread will be terminated. </p>
+<p>All init functions are run on the startup thread. Calling LockOSThread from an init function will cause the main function to be invoked on that thread. </p>
+<p>A goroutine should call LockOSThread before calling OS services or non-Go library functions that depend on per-thread state. </p>
+<h2 id="MemProfile">func <span>MemProfile</span> </h2> <pre data-language="go">func MemProfile(p []MemProfileRecord, inuseZero bool) (n int, ok bool)</pre> <p>MemProfile returns a profile of memory allocated and freed per allocation site. </p>
+<p>MemProfile returns n, the number of records in the current memory profile. If len(p) &gt;= n, MemProfile copies the profile into p and returns n, true. If len(p) &lt; n, MemProfile does not change p and returns n, false. </p>
+<p>If inuseZero is true, the profile includes allocation records where r.AllocBytes &gt; 0 but r.AllocBytes == r.FreeBytes. These are sites where memory was allocated, but it has all been released back to the runtime. </p>
+<p>The returned profile may be up to two garbage collection cycles old. This is to avoid skewing the profile toward allocations; because allocations happen in real time but frees are delayed until the garbage collector performs sweeping, the profile only accounts for allocations that have had a chance to be freed by the garbage collector. </p>
+<p>Most clients should use the runtime/pprof package or the testing package's -test.memprofile flag instead of calling MemProfile directly. </p>
+<h2 id="MutexProfile">func <span>MutexProfile</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func MutexProfile(p []BlockProfileRecord) (n int, ok bool)</pre> <p>MutexProfile returns n, the number of records in the current mutex profile. If len(p) &gt;= n, MutexProfile copies the profile into p and returns n, true. Otherwise, MutexProfile does not change p, and returns n, false. </p>
+<p>Most clients should use the <span>runtime/pprof</span> package instead of calling MutexProfile directly. </p>
+<h2 id="NumCPU">func <span>NumCPU</span> </h2> <pre data-language="go">func NumCPU() int</pre> <p>NumCPU returns the number of logical CPUs usable by the current process. </p>
+<p>The set of available CPUs is checked by querying the operating system at process startup. Changes to operating system CPU allocation after process startup are not reflected. </p>
+<h2 id="NumCgoCall">func <span>NumCgoCall</span> </h2> <pre data-language="go">func NumCgoCall() int64</pre> <p>NumCgoCall returns the number of cgo calls made by the current process. </p>
+<h2 id="NumGoroutine">func <span>NumGoroutine</span> </h2> <pre data-language="go">func NumGoroutine() int</pre> <p>NumGoroutine returns the number of goroutines that currently exist. </p>
+<h2 id="ReadMemStats">func <span>ReadMemStats</span> </h2> <pre data-language="go">func ReadMemStats(m *MemStats)</pre> <p>ReadMemStats populates m with memory allocator statistics. </p>
+<p>The returned memory allocator statistics are up to date as of the call to ReadMemStats. This is in contrast with a heap profile, which is a snapshot as of the most recently completed garbage collection cycle. </p>
+<h2 id="ReadTrace">func <span>ReadTrace</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func ReadTrace() []byte</pre> <p>ReadTrace returns the next chunk of binary tracing data, blocking until data is available. If tracing is turned off and all the data accumulated while it was on has been returned, ReadTrace returns nil. The caller must copy the returned data before calling ReadTrace again. ReadTrace must be called from one goroutine at a time. </p>
+<h2 id="SetBlockProfileRate">func <span>SetBlockProfileRate</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func SetBlockProfileRate(rate int)</pre> <p>SetBlockProfileRate controls the fraction of goroutine blocking events that are reported in the blocking profile. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked. </p>
+<p>To include every blocking event in the profile, pass rate = 1. To turn off profiling entirely, pass rate &lt;= 0. </p>
+<h2 id="SetCPUProfileRate">func <span>SetCPUProfileRate</span> </h2> <pre data-language="go">func SetCPUProfileRate(hz int)</pre> <p>SetCPUProfileRate sets the CPU profiling rate to hz samples per second. If hz &lt;= 0, SetCPUProfileRate turns off profiling. If the profiler is on, the rate cannot be changed without first turning it off. </p>
+<p>Most clients should use the <span>runtime/pprof</span> package or the <span>testing</span> package's -test.cpuprofile flag instead of calling SetCPUProfileRate directly. </p>
+<h2 id="SetCgoTraceback">func <span>SetCgoTraceback</span> <span title="Added in Go 1.7">1.7</span> </h2> <pre data-language="go">func SetCgoTraceback(version int, traceback, context, symbolizer unsafe.Pointer)</pre> <p>SetCgoTraceback records three C functions to use to gather traceback information from C code and to convert that traceback information into symbolic information. These are used when printing stack traces for a program that uses cgo. </p>
+<p>The traceback and context functions may be called from a signal handler, and must therefore use only async-signal safe functions. The symbolizer function may be called while the program is crashing, and so must be cautious about using memory. None of the functions may call back into Go. </p>
+<p>The context function will be called with a single argument, a pointer to a struct: </p>
+<pre data-language="go">struct {
+ Context uintptr
+}
+</pre> <p>In C syntax, this struct will be </p>
+<pre data-language="go">struct {
+ uintptr_t Context;
+};
+</pre> <p>If the Context field is 0, the context function is being called to record the current traceback context. It should record in the Context field whatever information is needed about the current point of execution to later produce a stack trace, probably the stack pointer and PC. In this case the context function will be called from C code. </p>
+<p>If the Context field is not 0, then it is a value returned by a previous call to the context function. This case is called when the context is no longer needed; that is, when the Go code is returning to its C code caller. This permits the context function to release any associated resources. </p>
+<p>While it would be correct for the context function to record a complete a stack trace whenever it is called, and simply copy that out in the traceback function, in a typical program the context function will be called many times without ever recording a traceback for that context. Recording a complete stack trace in a call to the context function is likely to be inefficient. </p>
+<p>The traceback function will be called with a single argument, a pointer to a struct: </p>
+<pre data-language="go">struct {
+ Context uintptr
+ SigContext uintptr
+ Buf *uintptr
+ Max uintptr
+}
+</pre> <p>In C syntax, this struct will be </p>
+<pre data-language="go">struct {
+ uintptr_t Context;
+ uintptr_t SigContext;
+ uintptr_t* Buf;
+ uintptr_t Max;
+};
+</pre> <p>The Context field will be zero to gather a traceback from the current program execution point. In this case, the traceback function will be called from C code. </p>
+<p>Otherwise Context will be a value previously returned by a call to the context function. The traceback function should gather a stack trace from that saved point in the program execution. The traceback function may be called from an execution thread other than the one that recorded the context, but only when the context is known to be valid and unchanging. The traceback function may also be called deeper in the call stack on the same thread that recorded the context. The traceback function may be called multiple times with the same Context value; it will usually be appropriate to cache the result, if possible, the first time this is called for a specific context value. </p>
+<p>If the traceback function is called from a signal handler on a Unix system, SigContext will be the signal context argument passed to the signal handler (a C ucontext_t* cast to uintptr_t). This may be used to start tracing at the point where the signal occurred. If the traceback function is not called from a signal handler, SigContext will be zero. </p>
+<p>Buf is where the traceback information should be stored. It should be PC values, such that Buf[0] is the PC of the caller, Buf[1] is the PC of that function's caller, and so on. Max is the maximum number of entries to store. The function should store a zero to indicate the top of the stack, or that the caller is on a different stack, presumably a Go stack. </p>
+<p>Unlike runtime.Callers, the PC values returned should, when passed to the symbolizer function, return the file/line of the call instruction. No additional subtraction is required or appropriate. </p>
+<p>On all platforms, the traceback function is invoked when a call from Go to C to Go requests a stack trace. On linux/amd64, linux/ppc64le, linux/arm64, and freebsd/amd64, the traceback function is also invoked when a signal is received by a thread that is executing a cgo call. The traceback function should not make assumptions about when it is called, as future versions of Go may make additional calls. </p>
+<p>The symbolizer function will be called with a single argument, a pointer to a struct: </p>
+<pre data-language="go">struct {
+ PC uintptr // program counter to fetch information for
+ File *byte // file name (NUL terminated)
+ Lineno uintptr // line number
+ Func *byte // function name (NUL terminated)
+ Entry uintptr // function entry point
+ More uintptr // set non-zero if more info for this PC
+ Data uintptr // unused by runtime, available for function
+}
+</pre> <p>In C syntax, this struct will be </p>
+<pre data-language="go">struct {
+ uintptr_t PC;
+ char* File;
+ uintptr_t Lineno;
+ char* Func;
+ uintptr_t Entry;
+ uintptr_t More;
+ uintptr_t Data;
+};
+</pre> <p>The PC field will be a value returned by a call to the traceback function. </p>
+<p>The first time the function is called for a particular traceback, all the fields except PC will be 0. The function should fill in the other fields if possible, setting them to 0/nil if the information is not available. The Data field may be used to store any useful information across calls. The More field should be set to non-zero if there is more information for this PC, zero otherwise. If More is set non-zero, the function will be called again with the same PC, and may return different information (this is intended for use with inlined functions). If More is zero, the function will be called with the next PC value in the traceback. When the traceback is complete, the function will be called once more with PC set to zero; this may be used to free any information. Each call will leave the fields of the struct set to the same values they had upon return, except for the PC field when the More field is zero. The function must not keep a copy of the struct pointer between calls. </p>
+<p>When calling SetCgoTraceback, the version argument is the version number of the structs that the functions expect to receive. Currently this must be zero. </p>
+<p>The symbolizer function may be nil, in which case the results of the traceback function will be displayed as numbers. If the traceback function is nil, the symbolizer function will never be called. The context function may be nil, in which case the traceback function will only be called with the context field set to zero. If the context function is nil, then calls from Go to C to Go will not show a traceback for the C portion of the call stack. </p>
+<p>SetCgoTraceback should be called only once, ideally from an init function. </p>
+<h2 id="SetFinalizer">func <span>SetFinalizer</span> </h2> <pre data-language="go">func SetFinalizer(obj any, finalizer any)</pre> <p>SetFinalizer sets the finalizer associated with obj to the provided finalizer function. When the garbage collector finds an unreachable block with an associated finalizer, it clears the association and runs finalizer(obj) in a separate goroutine. This makes obj reachable again, but now without an associated finalizer. Assuming that SetFinalizer is not called again, the next time the garbage collector sees that obj is unreachable, it will free obj. </p>
+<p>SetFinalizer(obj, nil) clears any finalizer associated with obj. </p>
+<p>The argument obj must be a pointer to an object allocated by calling new, by taking the address of a composite literal, or by taking the address of a local variable. The argument finalizer must be a function that takes a single argument to which obj's type can be assigned, and can have arbitrary ignored return values. If either of these is not true, SetFinalizer may abort the program. </p>
+<p>Finalizers are run in dependency order: if A points at B, both have finalizers, and they are otherwise unreachable, only the finalizer for A runs; once A is freed, the finalizer for B can run. If a cyclic structure includes a block with a finalizer, that cycle is not guaranteed to be garbage collected and the finalizer is not guaranteed to run, because there is no ordering that respects the dependencies. </p>
+<p>The finalizer is scheduled to run at some arbitrary time after the program can no longer reach the object to which obj points. There is no guarantee that finalizers will run before a program exits, so typically they are useful only for releasing non-memory resources associated with an object during a long-running program. For example, an <span>os.File</span> object could use a finalizer to close the associated operating system file descriptor when a program discards an os.File without calling Close, but it would be a mistake to depend on a finalizer to flush an in-memory I/O buffer such as a <span>bufio.Writer</span>, because the buffer would not be flushed at program exit. </p>
+<p>It is not guaranteed that a finalizer will run if the size of *obj is zero bytes, because it may share same address with other zero-size objects in memory. See <a href="https://go.dev/ref/spec#Size_and_alignment_guarantees">https://go.dev/ref/spec#Size_and_alignment_guarantees</a>. </p>
+<p>It is not guaranteed that a finalizer will run for objects allocated in initializers for package-level variables. Such objects may be linker-allocated, not heap-allocated. </p>
+<p>Note that because finalizers may execute arbitrarily far into the future after an object is no longer referenced, the runtime is allowed to perform a space-saving optimization that batches objects together in a single allocation slot. The finalizer for an unreferenced object in such an allocation may never run if it always exists in the same batch as a referenced object. Typically, this batching only happens for tiny (on the order of 16 bytes or less) and pointer-free objects. </p>
+<p>A finalizer may run as soon as an object becomes unreachable. In order to use finalizers correctly, the program must ensure that the object is reachable until it is no longer required. Objects stored in global variables, or that can be found by tracing pointers from a global variable, are reachable. For other objects, pass the object to a call of the <a href="#KeepAlive">KeepAlive</a> function to mark the last point in the function where the object must be reachable. </p>
+<p>For example, if p points to a struct, such as os.File, that contains a file descriptor d, and p has a finalizer that closes that file descriptor, and if the last use of p in a function is a call to syscall.Write(p.d, buf, size), then p may be unreachable as soon as the program enters <span>syscall.Write</span>. The finalizer may run at that moment, closing p.d, causing syscall.Write to fail because it is writing to a closed file descriptor (or, worse, to an entirely different file descriptor opened by a different goroutine). To avoid this problem, call KeepAlive(p) after the call to syscall.Write. </p>
+<p>A single goroutine runs all finalizers for a program, sequentially. If a finalizer must run for a long time, it should do so by starting a new goroutine. </p>
+<p>In the terminology of the Go memory model, a call SetFinalizer(x, f) “synchronizes before” the finalization call f(x). However, there is no guarantee that KeepAlive(x) or any other use of x “synchronizes before” f(x), so in general a finalizer should use a mutex or other synchronization mechanism if it needs to access mutable state in x. For example, consider a finalizer that inspects a mutable field in x that is modified from time to time in the main program before x becomes unreachable and the finalizer is invoked. The modifications in the main program and the inspection in the finalizer need to use appropriate synchronization, such as mutexes or atomic updates, to avoid read-write races. </p>
+<h2 id="SetMutexProfileFraction">func <span>SetMutexProfileFraction</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func SetMutexProfileFraction(rate int) int</pre> <p>SetMutexProfileFraction controls the fraction of mutex contention events that are reported in the mutex profile. On average 1/rate events are reported. The previous rate is returned. </p>
+<p>To turn off profiling entirely, pass rate 0. To just read the current rate, pass rate &lt; 0. (For n&gt;1 the details of sampling may change.) </p>
+<h2 id="Stack">func <span>Stack</span> </h2> <pre data-language="go">func Stack(buf []byte, all bool) int</pre> <p>Stack formats a stack trace of the calling goroutine into buf and returns the number of bytes written to buf. If all is true, Stack formats stack traces of all other goroutines into buf after the trace for the current goroutine. </p>
+<h2 id="StartTrace">func <span>StartTrace</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func StartTrace() error</pre> <p>StartTrace enables tracing for the current process. While tracing, the data will be buffered and available via <a href="#ReadTrace">ReadTrace</a>. StartTrace returns an error if tracing is already enabled. Most clients should use the <span>runtime/trace</span> package or the <span>testing</span> package's -test.trace flag instead of calling StartTrace directly. </p>
+<h2 id="StopTrace">func <span>StopTrace</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func StopTrace()</pre> <p>StopTrace stops tracing, if it was previously enabled. StopTrace only returns after all the reads for the trace have completed. </p>
+<h2 id="ThreadCreateProfile">func <span>ThreadCreateProfile</span> </h2> <pre data-language="go">func ThreadCreateProfile(p []StackRecord) (n int, ok bool)</pre> <p>ThreadCreateProfile returns n, the number of records in the thread creation profile. If len(p) &gt;= n, ThreadCreateProfile copies the profile into p and returns n, true. If len(p) &lt; n, ThreadCreateProfile does not change p and returns n, false. </p>
+<p>Most clients should use the runtime/pprof package instead of calling ThreadCreateProfile directly. </p>
+<h2 id="UnlockOSThread">func <span>UnlockOSThread</span> </h2> <pre data-language="go">func UnlockOSThread()</pre> <p>UnlockOSThread undoes an earlier call to LockOSThread. If this drops the number of active LockOSThread calls on the calling goroutine to zero, it unwires the calling goroutine from its fixed operating system thread. If there are no active LockOSThread calls, this is a no-op. </p>
+<p>Before calling UnlockOSThread, the caller must ensure that the OS thread is suitable for running other goroutines. If the caller made any permanent changes to the state of the thread that would affect other goroutines, it should not call this function and thus leave the goroutine locked to the OS thread until the goroutine (and hence the thread) exits. </p>
+<h2 id="Version">func <span>Version</span> </h2> <pre data-language="go">func Version() string</pre> <p>Version returns the Go tree's version string. It is either the commit hash and date at the time of the build or, when possible, a release tag like "go1.3". </p>
+<h2 id="BlockProfileRecord">type <span>BlockProfileRecord</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>BlockProfileRecord describes blocking events originated at a particular call sequence (stack trace). </p>
+<pre data-language="go">type BlockProfileRecord struct {
+ Count int64
+ Cycles int64
+ StackRecord
+}
+</pre> <h2 id="Error">type <span>Error</span> </h2> <p>The Error interface identifies a run time error. </p>
+<pre data-language="go">type Error interface {
+ error
+
+ // RuntimeError is a no-op function but
+ // serves to distinguish types that are run time
+ // errors from ordinary errors: a type is a
+ // run time error if it has a RuntimeError method.
+ RuntimeError()
+}</pre> <h2 id="Frame">type <span>Frame</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>Frame is the information returned by <a href="#Frames">Frames</a> for each call frame. </p>
+<pre data-language="go">type Frame struct {
+ // PC is the program counter for the location in this frame.
+ // For a frame that calls another frame, this will be the
+ // program counter of a call instruction. Because of inlining,
+ // multiple frames may have the same PC value, but different
+ // symbolic information.
+ PC uintptr
+
+ // Func is the Func value of this call frame. This may be nil
+ // for non-Go code or fully inlined functions.
+ Func *Func
+
+ // Function is the package path-qualified function name of
+ // this call frame. If non-empty, this string uniquely
+ // identifies a single function in the program.
+ // This may be the empty string if not known.
+ // If Func is not nil then Function == Func.Name().
+ Function string
+
+ // File and Line are the file name and line number of the
+ // location in this frame. For non-leaf frames, this will be
+ // the location of a call. These may be the empty string and
+ // zero, respectively, if not known.
+ File string
+ Line int
+
+ // Entry point program counter for the function; may be zero
+ // if not known. If Func is not nil then Entry ==
+ // Func.Entry().
+ Entry uintptr
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="Frames">type <span>Frames</span> <span title="Added in Go 1.7">1.7</span> </h2> <p>Frames may be used to get function/file/line information for a slice of PC values returned by <a href="#Callers">Callers</a>. </p>
+<pre data-language="go">type Frames struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Frames"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">c := func() {
+ // Ask runtime.Callers for up to 10 PCs, including runtime.Callers itself.
+ pc := make([]uintptr, 10)
+ n := runtime.Callers(0, pc)
+ if n == 0 {
+ // No PCs available. This can happen if the first argument to
+ // runtime.Callers is large.
+ //
+ // Return now to avoid processing the zero Frame that would
+ // otherwise be returned by frames.Next below.
+ return
+ }
+
+ pc = pc[:n] // pass only valid pcs to runtime.CallersFrames
+ frames := runtime.CallersFrames(pc)
+
+ // Loop to get frames.
+ // A fixed number of PCs can expand to an indefinite number of Frames.
+ for {
+ frame, more := frames.Next()
+
+ // Process this frame.
+ //
+ // To keep this example's output stable
+ // even if there are changes in the testing package,
+ // stop unwinding when we leave package runtime.
+ if !strings.Contains(frame.File, "runtime/") {
+ break
+ }
+ fmt.Printf("- more:%v | %s\n", more, frame.Function)
+
+ // Check whether there are more frames to process after this one.
+ if !more {
+ break
+ }
+ }
+}
+
+b := func() { c() }
+a := func() { b() }
+
+a()
+</pre> <p>Output:</p> <pre class="output" data-language="go">- more:true | runtime.Callers
+- more:true | runtime_test.ExampleFrames.func1
+- more:true | runtime_test.ExampleFrames.func2
+- more:true | runtime_test.ExampleFrames.func3
+- more:true | runtime_test.ExampleFrames
+</pre> <h3 id="CallersFrames">func <span>CallersFrames</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func CallersFrames(callers []uintptr) *Frames</pre> <p>CallersFrames takes a slice of PC values returned by <a href="#Callers">Callers</a> and prepares to return function/file/line information. Do not change the slice until you are done with the <a href="#Frames">Frames</a>. </p>
+<h3 id="Frames.Next">func (*Frames) <span>Next</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (ci *Frames) Next() (frame Frame, more bool)</pre> <p>Next returns a <a href="#Frame">Frame</a> representing the next call frame in the slice of PC values. If it has already returned all call frames, Next returns a zero <a href="#Frame">Frame</a>. </p>
+<p>The more result indicates whether the next call to Next will return a valid <a href="#Frame">Frame</a>. It does not necessarily indicate whether this call returned one. </p>
+<p>See the <a href="#Frames">Frames</a> example for idiomatic usage. </p>
+<h2 id="Func">type <span>Func</span> </h2> <p>A Func represents a Go function in the running binary. </p>
+<pre data-language="go">type Func struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="FuncForPC">func <span>FuncForPC</span> </h3> <pre data-language="go">func FuncForPC(pc uintptr) *Func</pre> <p>FuncForPC returns a *<a href="#Func">Func</a> describing the function that contains the given program counter address, or else nil. </p>
+<p>If pc represents multiple functions because of inlining, it returns the *Func describing the innermost function, but with an entry of the outermost function. </p>
+<h3 id="Func.Entry">func (*Func) <span>Entry</span> </h3> <pre data-language="go">func (f *Func) Entry() uintptr</pre> <p>Entry returns the entry address of the function. </p>
+<h3 id="Func.FileLine">func (*Func) <span>FileLine</span> </h3> <pre data-language="go">func (f *Func) FileLine(pc uintptr) (file string, line int)</pre> <p>FileLine returns the file name and line number of the source code corresponding to the program counter pc. The result will not be accurate if pc is not a program counter within f. </p>
+<h3 id="Func.Name">func (*Func) <span>Name</span> </h3> <pre data-language="go">func (f *Func) Name() string</pre> <p>Name returns the name of the function. </p>
+<h2 id="MemProfileRecord">type <span>MemProfileRecord</span> </h2> <p>A MemProfileRecord describes the live objects allocated by a particular call sequence (stack trace). </p>
+<pre data-language="go">type MemProfileRecord struct {
+ AllocBytes, FreeBytes int64 // number of bytes allocated, freed
+ AllocObjects, FreeObjects int64 // number of objects allocated, freed
+ Stack0 [32]uintptr // stack trace for this record; ends at first 0 entry
+}
+</pre> <h3 id="MemProfileRecord.InUseBytes">func (*MemProfileRecord) <span>InUseBytes</span> </h3> <pre data-language="go">func (r *MemProfileRecord) InUseBytes() int64</pre> <p>InUseBytes returns the number of bytes in use (AllocBytes - FreeBytes). </p>
+<h3 id="MemProfileRecord.InUseObjects">func (*MemProfileRecord) <span>InUseObjects</span> </h3> <pre data-language="go">func (r *MemProfileRecord) InUseObjects() int64</pre> <p>InUseObjects returns the number of objects in use (AllocObjects - FreeObjects). </p>
+<h3 id="MemProfileRecord.Stack">func (*MemProfileRecord) <span>Stack</span> </h3> <pre data-language="go">func (r *MemProfileRecord) Stack() []uintptr</pre> <p>Stack returns the stack trace associated with the record, a prefix of r.Stack0. </p>
+<h2 id="MemStats">type <span>MemStats</span> </h2> <p>A MemStats records statistics about the memory allocator. </p>
+<pre data-language="go">type MemStats struct {
+
+ // Alloc is bytes of allocated heap objects.
+ //
+ // This is the same as HeapAlloc (see below).
+ Alloc uint64
+
+ // TotalAlloc is cumulative bytes allocated for heap objects.
+ //
+ // TotalAlloc increases as heap objects are allocated, but
+ // unlike Alloc and HeapAlloc, it does not decrease when
+ // objects are freed.
+ TotalAlloc uint64
+
+ // Sys is the total bytes of memory obtained from the OS.
+ //
+ // Sys is the sum of the XSys fields below. Sys measures the
+ // virtual address space reserved by the Go runtime for the
+ // heap, stacks, and other internal data structures. It's
+ // likely that not all of the virtual address space is backed
+ // by physical memory at any given moment, though in general
+ // it all was at some point.
+ Sys uint64
+
+ // Lookups is the number of pointer lookups performed by the
+ // runtime.
+ //
+ // This is primarily useful for debugging runtime internals.
+ Lookups uint64
+
+ // Mallocs is the cumulative count of heap objects allocated.
+ // The number of live objects is Mallocs - Frees.
+ Mallocs uint64
+
+ // Frees is the cumulative count of heap objects freed.
+ Frees uint64
+
+ // HeapAlloc is bytes of allocated heap objects.
+ //
+ // "Allocated" heap objects include all reachable objects, as
+ // well as unreachable objects that the garbage collector has
+ // not yet freed. Specifically, HeapAlloc increases as heap
+ // objects are allocated and decreases as the heap is swept
+ // and unreachable objects are freed. Sweeping occurs
+ // incrementally between GC cycles, so these two processes
+ // occur simultaneously, and as a result HeapAlloc tends to
+ // change smoothly (in contrast with the sawtooth that is
+ // typical of stop-the-world garbage collectors).
+ HeapAlloc uint64
+
+ // HeapSys is bytes of heap memory obtained from the OS.
+ //
+ // HeapSys measures the amount of virtual address space
+ // reserved for the heap. This includes virtual address space
+ // that has been reserved but not yet used, which consumes no
+ // physical memory, but tends to be small, as well as virtual
+ // address space for which the physical memory has been
+ // returned to the OS after it became unused (see HeapReleased
+ // for a measure of the latter).
+ //
+ // HeapSys estimates the largest size the heap has had.
+ HeapSys uint64
+
+ // HeapIdle is bytes in idle (unused) spans.
+ //
+ // Idle spans have no objects in them. These spans could be
+ // (and may already have been) returned to the OS, or they can
+ // be reused for heap allocations, or they can be reused as
+ // stack memory.
+ //
+ // HeapIdle minus HeapReleased estimates the amount of memory
+ // that could be returned to the OS, but is being retained by
+ // the runtime so it can grow the heap without requesting more
+ // memory from the OS. If this difference is significantly
+ // larger than the heap size, it indicates there was a recent
+ // transient spike in live heap size.
+ HeapIdle uint64
+
+ // HeapInuse is bytes in in-use spans.
+ //
+ // In-use spans have at least one object in them. These spans
+ // can only be used for other objects of roughly the same
+ // size.
+ //
+ // HeapInuse minus HeapAlloc estimates the amount of memory
+ // that has been dedicated to particular size classes, but is
+ // not currently being used. This is an upper bound on
+ // fragmentation, but in general this memory can be reused
+ // efficiently.
+ HeapInuse uint64
+
+ // HeapReleased is bytes of physical memory returned to the OS.
+ //
+ // This counts heap memory from idle spans that was returned
+ // to the OS and has not yet been reacquired for the heap.
+ HeapReleased uint64
+
+ // HeapObjects is the number of allocated heap objects.
+ //
+ // Like HeapAlloc, this increases as objects are allocated and
+ // decreases as the heap is swept and unreachable objects are
+ // freed.
+ HeapObjects uint64
+
+ // StackInuse is bytes in stack spans.
+ //
+ // In-use stack spans have at least one stack in them. These
+ // spans can only be used for other stacks of the same size.
+ //
+ // There is no StackIdle because unused stack spans are
+ // returned to the heap (and hence counted toward HeapIdle).
+ StackInuse uint64
+
+ // StackSys is bytes of stack memory obtained from the OS.
+ //
+ // StackSys is StackInuse, plus any memory obtained directly
+ // from the OS for OS thread stacks.
+ //
+ // In non-cgo programs this metric is currently equal to StackInuse
+ // (but this should not be relied upon, and the value may change in
+ // the future).
+ //
+ // In cgo programs this metric includes OS thread stacks allocated
+ // directly from the OS. Currently, this only accounts for one stack in
+ // c-shared and c-archive build modes and other sources of stacks from
+ // the OS (notably, any allocated by C code) are not currently measured.
+ // Note this too may change in the future.
+ StackSys uint64
+
+ // MSpanInuse is bytes of allocated mspan structures.
+ MSpanInuse uint64
+
+ // MSpanSys is bytes of memory obtained from the OS for mspan
+ // structures.
+ MSpanSys uint64
+
+ // MCacheInuse is bytes of allocated mcache structures.
+ MCacheInuse uint64
+
+ // MCacheSys is bytes of memory obtained from the OS for
+ // mcache structures.
+ MCacheSys uint64
+
+ // BuckHashSys is bytes of memory in profiling bucket hash tables.
+ BuckHashSys uint64
+
+ // GCSys is bytes of memory in garbage collection metadata.
+ GCSys uint64 // Go 1.2
+
+ // OtherSys is bytes of memory in miscellaneous off-heap
+ // runtime allocations.
+ OtherSys uint64 // Go 1.2
+
+ // NextGC is the target heap size of the next GC cycle.
+ //
+ // The garbage collector's goal is to keep HeapAlloc ≤ NextGC.
+ // At the end of each GC cycle, the target for the next cycle
+ // is computed based on the amount of reachable data and the
+ // value of GOGC.
+ NextGC uint64
+
+ // LastGC is the time the last garbage collection finished, as
+ // nanoseconds since 1970 (the UNIX epoch).
+ LastGC uint64
+
+ // PauseTotalNs is the cumulative nanoseconds in GC
+ // stop-the-world pauses since the program started.
+ //
+ // During a stop-the-world pause, all goroutines are paused
+ // and only the garbage collector can run.
+ PauseTotalNs uint64
+
+ // PauseNs is a circular buffer of recent GC stop-the-world
+ // pause times in nanoseconds.
+ //
+ // The most recent pause is at PauseNs[(NumGC+255)%256]. In
+ // general, PauseNs[N%256] records the time paused in the most
+ // recent N%256th GC cycle. There may be multiple pauses per
+ // GC cycle; this is the sum of all pauses during a cycle.
+ PauseNs [256]uint64
+
+ // PauseEnd is a circular buffer of recent GC pause end times,
+ // as nanoseconds since 1970 (the UNIX epoch).
+ //
+ // This buffer is filled the same way as PauseNs. There may be
+ // multiple pauses per GC cycle; this records the end of the
+ // last pause in a cycle.
+ PauseEnd [256]uint64 // Go 1.4
+
+ // NumGC is the number of completed GC cycles.
+ NumGC uint32
+
+ // NumForcedGC is the number of GC cycles that were forced by
+ // the application calling the GC function.
+ NumForcedGC uint32 // Go 1.8
+
+ // GCCPUFraction is the fraction of this program's available
+ // CPU time used by the GC since the program started.
+ //
+ // GCCPUFraction is expressed as a number between 0 and 1,
+ // where 0 means GC has consumed none of this program's CPU. A
+ // program's available CPU time is defined as the integral of
+ // GOMAXPROCS since the program started. That is, if
+ // GOMAXPROCS is 2 and a program has been running for 10
+ // seconds, its "available CPU" is 20 seconds. GCCPUFraction
+ // does not include CPU time used for write barrier activity.
+ //
+ // This is the same as the fraction of CPU reported by
+ // GODEBUG=gctrace=1.
+ GCCPUFraction float64 // Go 1.5
+
+ // EnableGC indicates that GC is enabled. It is always true,
+ // even if GOGC=off.
+ EnableGC bool
+
+ // DebugGC is currently unused.
+ DebugGC bool
+
+ // BySize reports per-size class allocation statistics.
+ //
+ // BySize[N] gives statistics for allocations of size S where
+ // BySize[N-1].Size &lt; S ≤ BySize[N].Size.
+ //
+ // This does not report allocations larger than BySize[60].Size.
+ BySize [61]struct {
+ // Size is the maximum byte size of an object in this
+ // size class.
+ Size uint32
+
+ // Mallocs is the cumulative count of heap objects
+ // allocated in this size class. The cumulative bytes
+ // of allocation is Size*Mallocs. The number of live
+ // objects in this size class is Mallocs - Frees.
+ Mallocs uint64
+
+ // Frees is the cumulative count of heap objects freed
+ // in this size class.
+ Frees uint64
+ }
+}
+</pre> <h2 id="PanicNilError">type <span>PanicNilError</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A PanicNilError happens when code calls panic(nil). </p>
+<p>Before Go 1.21, programs that called panic(nil) observed recover returning nil. Starting in Go 1.21, programs that call panic(nil) observe recover returning a *PanicNilError. Programs can change back to the old behavior by setting GODEBUG=panicnil=1. </p>
+<pre data-language="go">type PanicNilError struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="PanicNilError.Error">func (*PanicNilError) <span>Error</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (*PanicNilError) Error() string</pre> <h3 id="PanicNilError.RuntimeError">func (*PanicNilError) <span>RuntimeError</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (*PanicNilError) RuntimeError()</pre> <h2 id="Pinner">type <span>Pinner</span> <span title="Added in Go 1.21">1.21</span> </h2> <p>A Pinner is a set of Go objects each pinned to a fixed location in memory. The <a href="#Pinner.Pin">Pinner.Pin</a> method pins one object, while <a href="#Pinner.Unpin">Pinner.Unpin</a> unpins all pinned objects. See their comments for more information. </p>
+<pre data-language="go">type Pinner struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Pinner.Pin">func (*Pinner) <span>Pin</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (p *Pinner) Pin(pointer any)</pre> <p>Pin pins a Go object, preventing it from being moved or freed by the garbage collector until the <a href="#Pinner.Unpin">Pinner.Unpin</a> method has been called. </p>
+<p>A pointer to a pinned object can be directly stored in C memory or can be contained in Go memory passed to C functions. If the pinned object itself contains pointers to Go objects, these objects must be pinned separately if they are going to be accessed from C code. </p>
+<p>The argument must be a pointer of any type or an <span>unsafe.Pointer</span>. It's safe to call Pin on non-Go pointers, in which case Pin will do nothing. </p>
+<h3 id="Pinner.Unpin">func (*Pinner) <span>Unpin</span> <span title="Added in Go 1.21">1.21</span> </h3> <pre data-language="go">func (p *Pinner) Unpin()</pre> <p>Unpin unpins all pinned objects of the <a href="#Pinner">Pinner</a>. </p>
+<h2 id="StackRecord">type <span>StackRecord</span> </h2> <p>A StackRecord describes a single execution stack. </p>
+<pre data-language="go">type StackRecord struct {
+ Stack0 [32]uintptr // stack trace for this record; ends at first 0 entry
+}
+</pre> <h3 id="StackRecord.Stack">func (*StackRecord) <span>Stack</span> </h3> <pre data-language="go">func (r *StackRecord) Stack() []uintptr</pre> <p>Stack returns the stack trace associated with the record, a prefix of r.Stack0. </p>
+<h2 id="TypeAssertionError">type <span>TypeAssertionError</span> </h2> <p>A TypeAssertionError explains a failed type assertion. </p>
+<pre data-language="go">type TypeAssertionError struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="TypeAssertionError.Error">func (*TypeAssertionError) <span>Error</span> </h3> <pre data-language="go">func (e *TypeAssertionError) Error() string</pre> <h3 id="TypeAssertionError.RuntimeError">func (*TypeAssertionError) <span>RuntimeError</span> </h3> <pre data-language="go">func (*TypeAssertionError) RuntimeError()</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="asan/index">asan</a> </td> <td class="pkg-synopsis"> </td> </tr> <tr> <td class="pkg-name"> <a href="cgo/index">cgo</a> </td> <td class="pkg-synopsis"> Package cgo contains runtime support for code generated by the cgo tool. </td> </tr> <tr> <td class="pkg-name"> <a href="coverage/index">coverage</a> </td> <td class="pkg-synopsis"> </td> </tr> <tr> <td class="pkg-name"> <a href="debug/index">debug</a> </td> <td class="pkg-synopsis"> Package debug contains facilities for programs to debug themselves while they are running. </td> </tr> <tr> <td class="pkg-name"> <a href="metrics/index">metrics</a> </td> <td class="pkg-synopsis"> Package metrics provides a stable interface to access implementation-defined metrics exported by the Go runtime. </td> </tr> <tr> <td class="pkg-name"> <span>msan</span> </td> <td class="pkg-synopsis"> </td> </tr> <tr> <td class="pkg-name"> <a href="pprof/index">pprof</a> </td> <td class="pkg-synopsis"> Package pprof writes runtime profiling data in the format expected by the pprof visualization tool. </td> </tr> <tr> <td class="pkg-name"> <a href="race/index">race</a> </td> <td class="pkg-synopsis"> Package race implements data race detection logic. </td> </tr> <tr> <td class="pkg-name"> <a href="trace/index">trace</a> </td> <td class="pkg-synopsis"> Package trace contains facilities for programs to generate traces for the Go execution tracer. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/runtime/" class="_attribution-link">http://golang.org/pkg/runtime/</a>
+ </p>
+</div>
diff --git a/devdocs/go/runtime%2Fmetrics%2Findex.html b/devdocs/go/runtime%2Fmetrics%2Findex.html
new file mode 100644
index 00000000..b26400d7
--- /dev/null
+++ b/devdocs/go/runtime%2Fmetrics%2Findex.html
@@ -0,0 +1,618 @@
+<h1> Package metrics </h1> <ul id="short-nav">
+<li><code>import "runtime/metrics"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package metrics provides a stable interface to access implementation-defined metrics exported by the Go runtime. This package is similar to existing functions like <span>runtime.ReadMemStats</span> and <span>runtime/debug.ReadGCStats</span>, but significantly more general. </p>
+<p>The set of metrics defined by this package may evolve as the runtime itself evolves, and also enables variation across Go implementations, whose relevant metric sets may not intersect. </p>
+<h3 id="hdr-Interface">Interface</h3> <p>Metrics are designated by a string key, rather than, for example, a field name in a struct. The full list of supported metrics is always available in the slice of Descriptions returned by <a href="#All">All</a>. Each <a href="#Description">Description</a> also includes useful information about the metric. </p>
+<p>Thus, users of this API are encouraged to sample supported metrics defined by the slice returned by All to remain compatible across Go versions. Of course, situations arise where reading specific metrics is critical. For these cases, users are encouraged to use build tags, and although metrics may be deprecated and removed, users should consider this to be an exceptional and rare event, coinciding with a very large change in a particular Go implementation. </p>
+<p>Each metric key also has a "kind" (see <a href="#ValueKind">ValueKind</a>) that describes the format of the metric's value. In the interest of not breaking users of this package, the "kind" for a given metric is guaranteed not to change. If it must change, then a new metric will be introduced with a new key and a new "kind." </p>
+<h3 id="hdr-Metric_key_format">Metric key format</h3> <p>As mentioned earlier, metric keys are strings. Their format is simple and well-defined, designed to be both human and machine readable. It is split into two components, separated by a colon: a rooted path and a unit. The choice to include the unit in the key is motivated by compatibility: if a metric's unit changes, its semantics likely did also, and a new key should be introduced. </p>
+<p>For more details on the precise definition of the metric key's path and unit formats, see the documentation of the Name field of the Description struct. </p>
+<h3 id="hdr-A_note_about_floats">A note about floats</h3> <p>This package supports metrics whose values have a floating-point representation. In order to improve ease-of-use, this package promises to never produce the following classes of floating-point values: NaN, infinity. </p>
+<h3 id="hdr-Supported_metrics">Supported metrics</h3> <p>Below is the full list of supported metrics, ordered lexicographically. </p>
+<pre data-language="go">/cgo/go-to-c-calls:calls
+ Count of calls made from Go to C by the current process.
+
+/cpu/classes/gc/mark/assist:cpu-seconds
+ Estimated total CPU time goroutines spent performing GC
+ tasks to assist the GC and prevent it from falling behind the
+ application. This metric is an overestimate, and not directly
+ comparable to system CPU time measurements. Compare only with
+ other /cpu/classes metrics.
+
+/cpu/classes/gc/mark/dedicated:cpu-seconds
+ Estimated total CPU time spent performing GC tasks on processors
+ (as defined by GOMAXPROCS) dedicated to those tasks. This metric
+ is an overestimate, and not directly comparable to system CPU
+ time measurements. Compare only with other /cpu/classes metrics.
+
+/cpu/classes/gc/mark/idle:cpu-seconds
+ Estimated total CPU time spent performing GC tasks on spare CPU
+ resources that the Go scheduler could not otherwise find a use
+ for. This should be subtracted from the total GC CPU time to
+ obtain a measure of compulsory GC CPU time. This metric is an
+ overestimate, and not directly comparable to system CPU time
+ measurements. Compare only with other /cpu/classes metrics.
+
+/cpu/classes/gc/pause:cpu-seconds
+ Estimated total CPU time spent with the application paused by
+ the GC. Even if only one thread is running during the pause,
+ this is computed as GOMAXPROCS times the pause latency because
+ nothing else can be executing. This is the exact sum of samples
+ in /sched/pauses/total/gc:seconds if each sample is multiplied
+ by GOMAXPROCS at the time it is taken. This metric is an
+ overestimate, and not directly comparable to system CPU time
+ measurements. Compare only with other /cpu/classes metrics.
+
+/cpu/classes/gc/total:cpu-seconds
+ Estimated total CPU time spent performing GC tasks. This metric
+ is an overestimate, and not directly comparable to system CPU
+ time measurements. Compare only with other /cpu/classes metrics.
+ Sum of all metrics in /cpu/classes/gc.
+
+/cpu/classes/idle:cpu-seconds
+ Estimated total available CPU time not spent executing
+ any Go or Go runtime code. In other words, the part of
+ /cpu/classes/total:cpu-seconds that was unused. This metric is
+ an overestimate, and not directly comparable to system CPU time
+ measurements. Compare only with other /cpu/classes metrics.
+
+/cpu/classes/scavenge/assist:cpu-seconds
+ Estimated total CPU time spent returning unused memory to the
+ underlying platform in response eagerly in response to memory
+ pressure. This metric is an overestimate, and not directly
+ comparable to system CPU time measurements. Compare only with
+ other /cpu/classes metrics.
+
+/cpu/classes/scavenge/background:cpu-seconds
+ Estimated total CPU time spent performing background tasks to
+ return unused memory to the underlying platform. This metric is
+ an overestimate, and not directly comparable to system CPU time
+ measurements. Compare only with other /cpu/classes metrics.
+
+/cpu/classes/scavenge/total:cpu-seconds
+ Estimated total CPU time spent performing tasks that return
+ unused memory to the underlying platform. This metric is an
+ overestimate, and not directly comparable to system CPU time
+ measurements. Compare only with other /cpu/classes metrics.
+ Sum of all metrics in /cpu/classes/scavenge.
+
+/cpu/classes/total:cpu-seconds
+ Estimated total available CPU time for user Go code or the Go
+ runtime, as defined by GOMAXPROCS. In other words, GOMAXPROCS
+ integrated over the wall-clock duration this process has been
+ executing for. This metric is an overestimate, and not directly
+ comparable to system CPU time measurements. Compare only with
+ other /cpu/classes metrics. Sum of all metrics in /cpu/classes.
+
+/cpu/classes/user:cpu-seconds
+ Estimated total CPU time spent running user Go code. This may
+ also include some small amount of time spent in the Go runtime.
+ This metric is an overestimate, and not directly comparable
+ to system CPU time measurements. Compare only with other
+ /cpu/classes metrics.
+
+/gc/cycles/automatic:gc-cycles
+ Count of completed GC cycles generated by the Go runtime.
+
+/gc/cycles/forced:gc-cycles
+ Count of completed GC cycles forced by the application.
+
+/gc/cycles/total:gc-cycles
+ Count of all completed GC cycles.
+
+/gc/gogc:percent
+ Heap size target percentage configured by the user, otherwise
+ 100. This value is set by the GOGC environment variable, and the
+ runtime/debug.SetGCPercent function.
+
+/gc/gomemlimit:bytes
+ Go runtime memory limit configured by the user, otherwise
+ math.MaxInt64. This value is set by the GOMEMLIMIT environment
+ variable, and the runtime/debug.SetMemoryLimit function.
+
+/gc/heap/allocs-by-size:bytes
+ Distribution of heap allocations by approximate size.
+ Bucket counts increase monotonically. Note that this does not
+ include tiny objects as defined by /gc/heap/tiny/allocs:objects,
+ only tiny blocks.
+
+/gc/heap/allocs:bytes
+ Cumulative sum of memory allocated to the heap by the
+ application.
+
+/gc/heap/allocs:objects
+ Cumulative count of heap allocations triggered by the
+ application. Note that this does not include tiny objects as
+ defined by /gc/heap/tiny/allocs:objects, only tiny blocks.
+
+/gc/heap/frees-by-size:bytes
+ Distribution of freed heap allocations by approximate size.
+ Bucket counts increase monotonically. Note that this does not
+ include tiny objects as defined by /gc/heap/tiny/allocs:objects,
+ only tiny blocks.
+
+/gc/heap/frees:bytes
+ Cumulative sum of heap memory freed by the garbage collector.
+
+/gc/heap/frees:objects
+ Cumulative count of heap allocations whose storage was freed
+ by the garbage collector. Note that this does not include tiny
+ objects as defined by /gc/heap/tiny/allocs:objects, only tiny
+ blocks.
+
+/gc/heap/goal:bytes
+ Heap size target for the end of the GC cycle.
+
+/gc/heap/live:bytes
+ Heap memory occupied by live objects that were marked by the
+ previous GC.
+
+/gc/heap/objects:objects
+ Number of objects, live or unswept, occupying heap memory.
+
+/gc/heap/tiny/allocs:objects
+ Count of small allocations that are packed together into blocks.
+ These allocations are counted separately from other allocations
+ because each individual allocation is not tracked by the
+ runtime, only their block. Each block is already accounted for
+ in allocs-by-size and frees-by-size.
+
+/gc/limiter/last-enabled:gc-cycle
+ GC cycle the last time the GC CPU limiter was enabled.
+ This metric is useful for diagnosing the root cause of an
+ out-of-memory error, because the limiter trades memory for CPU
+ time when the GC's CPU time gets too high. This is most likely
+ to occur with use of SetMemoryLimit. The first GC cycle is cycle
+ 1, so a value of 0 indicates that it was never enabled.
+
+/gc/pauses:seconds
+ Deprecated. Prefer the identical /sched/pauses/total/gc:seconds.
+
+/gc/scan/globals:bytes
+ The total amount of global variable space that is scannable.
+
+/gc/scan/heap:bytes
+ The total amount of heap space that is scannable.
+
+/gc/scan/stack:bytes
+ The number of bytes of stack that were scanned last GC cycle.
+
+/gc/scan/total:bytes
+ The total amount space that is scannable. Sum of all metrics in
+ /gc/scan.
+
+/gc/stack/starting-size:bytes
+ The stack size of new goroutines.
+
+/godebug/non-default-behavior/execerrdot:events
+ The number of non-default behaviors executed by the os/exec
+ package due to a non-default GODEBUG=execerrdot=... setting.
+
+/godebug/non-default-behavior/gocachehash:events
+ The number of non-default behaviors executed by the cmd/go
+ package due to a non-default GODEBUG=gocachehash=... setting.
+
+/godebug/non-default-behavior/gocachetest:events
+ The number of non-default behaviors executed by the cmd/go
+ package due to a non-default GODEBUG=gocachetest=... setting.
+
+/godebug/non-default-behavior/gocacheverify:events
+ The number of non-default behaviors executed by the cmd/go
+ package due to a non-default GODEBUG=gocacheverify=... setting.
+
+/godebug/non-default-behavior/gotypesalias:events
+ The number of non-default behaviors executed by the go/types
+ package due to a non-default GODEBUG=gotypesalias=... setting.
+
+/godebug/non-default-behavior/http2client:events
+ The number of non-default behaviors executed by the net/http
+ package due to a non-default GODEBUG=http2client=... setting.
+
+/godebug/non-default-behavior/http2server:events
+ The number of non-default behaviors executed by the net/http
+ package due to a non-default GODEBUG=http2server=... setting.
+
+/godebug/non-default-behavior/httplaxcontentlength:events
+ The number of non-default behaviors executed by the net/http
+ package due to a non-default GODEBUG=httplaxcontentlength=...
+ setting.
+
+/godebug/non-default-behavior/httpmuxgo121:events
+ The number of non-default behaviors executed by the net/http
+ package due to a non-default GODEBUG=httpmuxgo121=... setting.
+
+/godebug/non-default-behavior/installgoroot:events
+ The number of non-default behaviors executed by the go/build
+ package due to a non-default GODEBUG=installgoroot=... setting.
+
+/godebug/non-default-behavior/jstmpllitinterp:events
+ The number of non-default behaviors executed by
+ the html/template package due to a non-default
+ GODEBUG=jstmpllitinterp=... setting.
+
+/godebug/non-default-behavior/multipartmaxheaders:events
+ The number of non-default behaviors executed by
+ the mime/multipart package due to a non-default
+ GODEBUG=multipartmaxheaders=... setting.
+
+/godebug/non-default-behavior/multipartmaxparts:events
+ The number of non-default behaviors executed by
+ the mime/multipart package due to a non-default
+ GODEBUG=multipartmaxparts=... setting.
+
+/godebug/non-default-behavior/multipathtcp:events
+ The number of non-default behaviors executed by the net package
+ due to a non-default GODEBUG=multipathtcp=... setting.
+
+/godebug/non-default-behavior/panicnil:events
+ The number of non-default behaviors executed by the runtime
+ package due to a non-default GODEBUG=panicnil=... setting.
+
+/godebug/non-default-behavior/randautoseed:events
+ The number of non-default behaviors executed by the math/rand
+ package due to a non-default GODEBUG=randautoseed=... setting.
+
+/godebug/non-default-behavior/tarinsecurepath:events
+ The number of non-default behaviors executed by the archive/tar
+ package due to a non-default GODEBUG=tarinsecurepath=...
+ setting.
+
+/godebug/non-default-behavior/tls10server:events
+ The number of non-default behaviors executed by the crypto/tls
+ package due to a non-default GODEBUG=tls10server=... setting.
+
+/godebug/non-default-behavior/tlsmaxrsasize:events
+ The number of non-default behaviors executed by the crypto/tls
+ package due to a non-default GODEBUG=tlsmaxrsasize=... setting.
+
+/godebug/non-default-behavior/tlsrsakex:events
+ The number of non-default behaviors executed by the crypto/tls
+ package due to a non-default GODEBUG=tlsrsakex=... setting.
+
+/godebug/non-default-behavior/tlsunsafeekm:events
+ The number of non-default behaviors executed by the crypto/tls
+ package due to a non-default GODEBUG=tlsunsafeekm=... setting.
+
+/godebug/non-default-behavior/x509sha1:events
+ The number of non-default behaviors executed by the crypto/x509
+ package due to a non-default GODEBUG=x509sha1=... setting.
+
+/godebug/non-default-behavior/x509usefallbackroots:events
+ The number of non-default behaviors executed by the crypto/x509
+ package due to a non-default GODEBUG=x509usefallbackroots=...
+ setting.
+
+/godebug/non-default-behavior/x509usepolicies:events
+ The number of non-default behaviors executed by the crypto/x509
+ package due to a non-default GODEBUG=x509usepolicies=...
+ setting.
+
+/godebug/non-default-behavior/zipinsecurepath:events
+ The number of non-default behaviors executed by the archive/zip
+ package due to a non-default GODEBUG=zipinsecurepath=...
+ setting.
+
+/memory/classes/heap/free:bytes
+ Memory that is completely free and eligible to be returned to
+ the underlying system, but has not been. This metric is the
+ runtime's estimate of free address space that is backed by
+ physical memory.
+
+/memory/classes/heap/objects:bytes
+ Memory occupied by live objects and dead objects that have not
+ yet been marked free by the garbage collector.
+
+/memory/classes/heap/released:bytes
+ Memory that is completely free and has been returned to the
+ underlying system. This metric is the runtime's estimate of free
+ address space that is still mapped into the process, but is not
+ backed by physical memory.
+
+/memory/classes/heap/stacks:bytes
+ Memory allocated from the heap that is reserved for stack space,
+ whether or not it is currently in-use. Currently, this
+ represents all stack memory for goroutines. It also includes all
+ OS thread stacks in non-cgo programs. Note that stacks may be
+ allocated differently in the future, and this may change.
+
+/memory/classes/heap/unused:bytes
+ Memory that is reserved for heap objects but is not currently
+ used to hold heap objects.
+
+/memory/classes/metadata/mcache/free:bytes
+ Memory that is reserved for runtime mcache structures, but not
+ in-use.
+
+/memory/classes/metadata/mcache/inuse:bytes
+ Memory that is occupied by runtime mcache structures that are
+ currently being used.
+
+/memory/classes/metadata/mspan/free:bytes
+ Memory that is reserved for runtime mspan structures, but not
+ in-use.
+
+/memory/classes/metadata/mspan/inuse:bytes
+ Memory that is occupied by runtime mspan structures that are
+ currently being used.
+
+/memory/classes/metadata/other:bytes
+ Memory that is reserved for or used to hold runtime metadata.
+
+/memory/classes/os-stacks:bytes
+ Stack memory allocated by the underlying operating system.
+ In non-cgo programs this metric is currently zero. This may
+ change in the future.In cgo programs this metric includes
+ OS thread stacks allocated directly from the OS. Currently,
+ this only accounts for one stack in c-shared and c-archive build
+ modes, and other sources of stacks from the OS are not measured.
+ This too may change in the future.
+
+/memory/classes/other:bytes
+ Memory used by execution trace buffers, structures for debugging
+ the runtime, finalizer and profiler specials, and more.
+
+/memory/classes/profiling/buckets:bytes
+ Memory that is used by the stack trace hash map used for
+ profiling.
+
+/memory/classes/total:bytes
+ All memory mapped by the Go runtime into the current process
+ as read-write. Note that this does not include memory mapped
+ by code called via cgo or via the syscall package. Sum of all
+ metrics in /memory/classes.
+
+/sched/gomaxprocs:threads
+ The current runtime.GOMAXPROCS setting, or the number of
+ operating system threads that can execute user-level Go code
+ simultaneously.
+
+/sched/goroutines:goroutines
+ Count of live goroutines.
+
+/sched/latencies:seconds
+ Distribution of the time goroutines have spent in the scheduler
+ in a runnable state before actually running. Bucket counts
+ increase monotonically.
+
+/sched/pauses/stopping/gc:seconds
+ Distribution of individual GC-related stop-the-world stopping
+ latencies. This is the time it takes from deciding to stop the
+ world until all Ps are stopped. This is a subset of the total
+ GC-related stop-the-world time (/sched/pauses/total/gc:seconds).
+ During this time, some threads may be executing. Bucket counts
+ increase monotonically.
+
+/sched/pauses/stopping/other:seconds
+ Distribution of individual non-GC-related stop-the-world
+ stopping latencies. This is the time it takes from deciding
+ to stop the world until all Ps are stopped. This is a
+ subset of the total non-GC-related stop-the-world time
+ (/sched/pauses/total/other:seconds). During this time, some
+ threads may be executing. Bucket counts increase monotonically.
+
+/sched/pauses/total/gc:seconds
+ Distribution of individual GC-related stop-the-world pause
+ latencies. This is the time from deciding to stop the world
+ until the world is started again. Some of this time is spent
+ getting all threads to stop (this is measured directly in
+ /sched/pauses/stopping/gc:seconds), during which some threads
+ may still be running. Bucket counts increase monotonically.
+
+/sched/pauses/total/other:seconds
+ Distribution of individual non-GC-related stop-the-world
+ pause latencies. This is the time from deciding to stop the
+ world until the world is started again. Some of this time
+ is spent getting all threads to stop (measured directly in
+ /sched/pauses/stopping/other:seconds). Bucket counts increase
+ monotonically.
+
+/sync/mutex/wait/total:seconds
+ Approximate cumulative time goroutines have spent blocked on a
+ sync.Mutex, sync.RWMutex, or runtime-internal lock. This metric
+ is useful for identifying global changes in lock contention.
+ Collect a mutex or block profile using the runtime/pprof package
+ for more detailed contention data.
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Read">func Read(m []Sample)</a></li>
+<li><a href="#Description">type Description</a></li>
+<li> <a href="#All">func All() []Description</a>
+</li>
+<li><a href="#Float64Histogram">type Float64Histogram</a></li>
+<li><a href="#Sample">type Sample</a></li>
+<li><a href="#Value">type Value</a></li>
+<li> <a href="#Value.Float64">func (v Value) Float64() float64</a>
+</li>
+<li> <a href="#Value.Float64Histogram">func (v Value) Float64Histogram() *Float64Histogram</a>
+</li>
+<li> <a href="#Value.Kind">func (v Value) Kind() ValueKind</a>
+</li>
+<li> <a href="#Value.Uint64">func (v Value) Uint64() uint64</a>
+</li>
+<li><a href="#ValueKind">type ValueKind</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Read_readingAllMetrics">Read (ReadingAllMetrics)</a></dd> <dd><a class="exampleLink" href="#example_Read_readingOneMetric">Read (ReadingOneMetric)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>description.go</span> <span>doc.go</span> <span>histogram.go</span> <span>sample.go</span> <span>value.go</span> </p> <h2 id="Read">func <span>Read</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func Read(m []Sample)</pre> <p>Read populates each <a href="#Value">Value</a> field in the given slice of metric samples. </p>
+<p>Desired metrics should be present in the slice with the appropriate name. The user of this API is encouraged to re-use the same slice between calls for efficiency, but is not required to do so. </p>
+<p>Note that re-use has some caveats. Notably, Values should not be read or manipulated while a Read with that value is outstanding; that is a data race. This property includes pointer-typed Values (for example, <a href="#Float64Histogram">Float64Histogram</a>) whose underlying storage will be reused by Read when possible. To safely use such values in a concurrent setting, all data must be deep-copied. </p>
+<p>It is safe to execute multiple Read calls concurrently, but their arguments must share no underlying memory. When in doubt, create a new []Sample from scratch, which is always safe, though may be inefficient. </p>
+<p>Sample values with names not appearing in <a href="#All">All</a> will have their Value populated as KindBad to indicate that the name is unknown. </p> <h4 id="example_Read_readingAllMetrics"> <span class="text">Example (ReadingAllMetrics)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Get descriptions for all supported metrics.
+descs := metrics.All()
+
+// Create a sample for each metric.
+samples := make([]metrics.Sample, len(descs))
+for i := range samples {
+ samples[i].Name = descs[i].Name
+}
+
+// Sample the metrics. Re-use the samples slice if you can!
+metrics.Read(samples)
+
+// Iterate over all results.
+for _, sample := range samples {
+ // Pull out the name and value.
+ name, value := sample.Name, sample.Value
+
+ // Handle each sample.
+ switch value.Kind() {
+ case metrics.KindUint64:
+ fmt.Printf("%s: %d\n", name, value.Uint64())
+ case metrics.KindFloat64:
+ fmt.Printf("%s: %f\n", name, value.Float64())
+ case metrics.KindFloat64Histogram:
+ // The histogram may be quite large, so let's just pull out
+ // a crude estimate for the median for the sake of this example.
+ fmt.Printf("%s: %f\n", name, medianBucket(value.Float64Histogram()))
+ case metrics.KindBad:
+ // This should never happen because all metrics are supported
+ // by construction.
+ panic("bug in runtime/metrics package!")
+ default:
+ // This may happen as new metrics get added.
+ //
+ // The safest thing to do here is to simply log it somewhere
+ // as something to look into, but ignore it for now.
+ // In the worst case, you might temporarily miss out on a new metric.
+ fmt.Printf("%s: unexpected metric Kind: %v\n", name, value.Kind())
+ }
+}
+</pre> <h4 id="example_Read_readingOneMetric"> <span class="text">Example (ReadingOneMetric)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Name of the metric we want to read.
+const myMetric = "/memory/classes/heap/free:bytes"
+
+// Create a sample for the metric.
+sample := make([]metrics.Sample, 1)
+sample[0].Name = myMetric
+
+// Sample the metric.
+metrics.Read(sample)
+
+// Check if the metric is actually supported.
+// If it's not, the resulting value will always have
+// kind KindBad.
+if sample[0].Value.Kind() == metrics.KindBad {
+ panic(fmt.Sprintf("metric %q no longer supported", myMetric))
+}
+
+// Handle the result.
+//
+// It's OK to assume a particular Kind for a metric;
+// they're guaranteed not to change.
+freeBytes := sample[0].Value.Uint64()
+
+fmt.Printf("free but not released memory: %d\n", freeBytes)
+</pre> <h2 id="Description">type <span>Description</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>Description describes a runtime metric. </p>
+<pre data-language="go">type Description struct {
+ // Name is the full name of the metric which includes the unit.
+ //
+ // The format of the metric may be described by the following regular expression.
+ //
+ // ^(?P&lt;name&gt;/[^:]+):(?P&lt;unit&gt;[^:*/]+(?:[*/][^:*/]+)*)$
+ //
+ // The format splits the name into two components, separated by a colon: a path which always
+ // starts with a /, and a machine-parseable unit. The name may contain any valid Unicode
+ // codepoint in between / characters, but by convention will try to stick to lowercase
+ // characters and hyphens. An example of such a path might be "/memory/heap/free".
+ //
+ // The unit is by convention a series of lowercase English unit names (singular or plural)
+ // without prefixes delimited by '*' or '/'. The unit names may contain any valid Unicode
+ // codepoint that is not a delimiter.
+ // Examples of units might be "seconds", "bytes", "bytes/second", "cpu-seconds",
+ // "byte*cpu-seconds", and "bytes/second/second".
+ //
+ // For histograms, multiple units may apply. For instance, the units of the buckets and
+ // the count. By convention, for histograms, the units of the count are always "samples"
+ // with the type of sample evident by the metric's name, while the unit in the name
+ // specifies the buckets' unit.
+ //
+ // A complete name might look like "/memory/heap/free:bytes".
+ Name string
+
+ // Description is an English language sentence describing the metric.
+ Description string
+
+ // Kind is the kind of value for this metric.
+ //
+ // The purpose of this field is to allow users to filter out metrics whose values are
+ // types which their application may not understand.
+ Kind ValueKind
+
+ // Cumulative is whether or not the metric is cumulative. If a cumulative metric is just
+ // a single number, then it increases monotonically. If the metric is a distribution,
+ // then each bucket count increases monotonically.
+ //
+ // This flag thus indicates whether or not it's useful to compute a rate from this value.
+ Cumulative bool
+}
+</pre> <h3 id="All">func <span>All</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func All() []Description</pre> <p>All returns a slice of containing metric descriptions for all supported metrics. </p>
+<h2 id="Float64Histogram">type <span>Float64Histogram</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>Float64Histogram represents a distribution of float64 values. </p>
+<pre data-language="go">type Float64Histogram struct {
+ // Counts contains the weights for each histogram bucket.
+ //
+ // Given N buckets, Count[n] is the weight of the range
+ // [bucket[n], bucket[n+1]), for 0 &lt;= n &lt; N.
+ Counts []uint64
+
+ // Buckets contains the boundaries of the histogram buckets, in increasing order.
+ //
+ // Buckets[0] is the inclusive lower bound of the minimum bucket while
+ // Buckets[len(Buckets)-1] is the exclusive upper bound of the maximum bucket.
+ // Hence, there are len(Buckets)-1 counts. Furthermore, len(Buckets) != 1, always,
+ // since at least two boundaries are required to describe one bucket (and 0
+ // boundaries are used to describe 0 buckets).
+ //
+ // Buckets[0] is permitted to have value -Inf and Buckets[len(Buckets)-1] is
+ // permitted to have value Inf.
+ //
+ // For a given metric name, the value of Buckets is guaranteed not to change
+ // between calls until program exit.
+ //
+ // This slice value is permitted to alias with other Float64Histograms' Buckets
+ // fields, so the values within should only ever be read. If they need to be
+ // modified, the user must make a copy.
+ Buckets []float64
+}
+</pre> <h2 id="Sample">type <span>Sample</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>Sample captures a single metric sample. </p>
+<pre data-language="go">type Sample struct {
+ // Name is the name of the metric sampled.
+ //
+ // It must correspond to a name in one of the metric descriptions
+ // returned by All.
+ Name string
+
+ // Value is the value of the metric sample.
+ Value Value
+}
+</pre> <h2 id="Value">type <span>Value</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>Value represents a metric value returned by the runtime. </p>
+<pre data-language="go">type Value struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Value.Float64">func (Value) <span>Float64</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (v Value) Float64() float64</pre> <p>Float64 returns the internal float64 value for the metric. </p>
+<p>If v.Kind() != KindFloat64, this method panics. </p>
+<h3 id="Value.Float64Histogram">func (Value) <span>Float64Histogram</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (v Value) Float64Histogram() *Float64Histogram</pre> <p>Float64Histogram returns the internal *Float64Histogram value for the metric. </p>
+<p>If v.Kind() != KindFloat64Histogram, this method panics. </p>
+<h3 id="Value.Kind">func (Value) <span>Kind</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (v Value) Kind() ValueKind</pre> <p>Kind returns the tag representing the kind of value this is. </p>
+<h3 id="Value.Uint64">func (Value) <span>Uint64</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (v Value) Uint64() uint64</pre> <p>Uint64 returns the internal uint64 value for the metric. </p>
+<p>If v.Kind() != KindUint64, this method panics. </p>
+<h2 id="ValueKind">type <span>ValueKind</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>ValueKind is a tag for a metric <a href="#Value">Value</a> which indicates its type. </p>
+<pre data-language="go">type ValueKind int</pre> <pre data-language="go">const (
+ // KindBad indicates that the Value has no type and should not be used.
+ KindBad ValueKind = iota
+
+ // KindUint64 indicates that the type of the Value is a uint64.
+ KindUint64
+
+ // KindFloat64 indicates that the type of the Value is a float64.
+ KindFloat64
+
+ // KindFloat64Histogram indicates that the type of the Value is a *Float64Histogram.
+ KindFloat64Histogram
+)</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/runtime/metrics/" class="_attribution-link">http://golang.org/pkg/runtime/metrics/</a>
+ </p>
+</div>
diff --git a/devdocs/go/runtime%2Fpprof%2Findex.html b/devdocs/go/runtime%2Fpprof%2Findex.html
new file mode 100644
index 00000000..1d4391d7
--- /dev/null
+++ b/devdocs/go/runtime%2Fpprof%2Findex.html
@@ -0,0 +1,136 @@
+<h1> Package pprof </h1> <ul id="short-nav">
+<li><code>import "runtime/pprof"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package pprof writes runtime profiling data in the format expected by the pprof visualization tool. </p>
+<h3 id="hdr-Profiling_a_Go_program">Profiling a Go program</h3> <p>The first step to profiling a Go program is to enable profiling. Support for profiling benchmarks built with the standard testing package is built into go test. For example, the following command runs benchmarks in the current directory and writes the CPU and memory profiles to cpu.prof and mem.prof: </p>
+<pre data-language="go">go test -cpuprofile cpu.prof -memprofile mem.prof -bench .
+</pre> <p>To add equivalent profiling support to a standalone program, add code like the following to your main function: </p>
+<pre data-language="go">var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to `file`")
+var memprofile = flag.String("memprofile", "", "write memory profile to `file`")
+
+func main() {
+ flag.Parse()
+ if *cpuprofile != "" {
+ f, err := os.Create(*cpuprofile)
+ if err != nil {
+ log.Fatal("could not create CPU profile: ", err)
+ }
+ defer f.Close() // error handling omitted for example
+ if err := pprof.StartCPUProfile(f); err != nil {
+ log.Fatal("could not start CPU profile: ", err)
+ }
+ defer pprof.StopCPUProfile()
+ }
+
+ // ... rest of the program ...
+
+ if *memprofile != "" {
+ f, err := os.Create(*memprofile)
+ if err != nil {
+ log.Fatal("could not create memory profile: ", err)
+ }
+ defer f.Close() // error handling omitted for example
+ runtime.GC() // get up-to-date statistics
+ if err := pprof.WriteHeapProfile(f); err != nil {
+ log.Fatal("could not write memory profile: ", err)
+ }
+ }
+}
+</pre> <p>There is also a standard HTTP interface to profiling data. Adding the following line will install handlers under the /debug/pprof/ URL to download live profiles: </p>
+<pre data-language="go">import _ "net/http/pprof"
+</pre> <p>See the net/http/pprof package for more details. </p>
+<p>Profiles can then be visualized with the pprof tool: </p>
+<pre data-language="go">go tool pprof cpu.prof
+</pre> <p>There are many commands available from the pprof command line. Commonly used commands include "top", which prints a summary of the top program hot-spots, and "web", which opens an interactive graph of hot-spots and their call graphs. Use "help" for information on all pprof commands. </p>
+<p>For more information about pprof, see <a href="https://github.com/google/pprof/blob/main/doc/README.md">https://github.com/google/pprof/blob/main/doc/README.md</a>. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Do">func Do(ctx context.Context, labels LabelSet, f func(context.Context))</a></li>
+<li><a href="#ForLabels">func ForLabels(ctx context.Context, f func(key, value string) bool)</a></li>
+<li><a href="#Label">func Label(ctx context.Context, key string) (string, bool)</a></li>
+<li><a href="#SetGoroutineLabels">func SetGoroutineLabels(ctx context.Context)</a></li>
+<li><a href="#StartCPUProfile">func StartCPUProfile(w io.Writer) error</a></li>
+<li><a href="#StopCPUProfile">func StopCPUProfile()</a></li>
+<li><a href="#WithLabels">func WithLabels(ctx context.Context, labels LabelSet) context.Context</a></li>
+<li><a href="#WriteHeapProfile">func WriteHeapProfile(w io.Writer) error</a></li>
+<li><a href="#LabelSet">type LabelSet</a></li>
+<li> <a href="#Labels">func Labels(args ...string) LabelSet</a>
+</li>
+<li><a href="#Profile">type Profile</a></li>
+<li> <a href="#Lookup">func Lookup(name string) *Profile</a>
+</li>
+<li> <a href="#NewProfile">func NewProfile(name string) *Profile</a>
+</li>
+<li> <a href="#Profiles">func Profiles() []*Profile</a>
+</li>
+<li> <a href="#Profile.Add">func (p *Profile) Add(value any, skip int)</a>
+</li>
+<li> <a href="#Profile.Count">func (p *Profile) Count() int</a>
+</li>
+<li> <a href="#Profile.Name">func (p *Profile) Name() string</a>
+</li>
+<li> <a href="#Profile.Remove">func (p *Profile) Remove(value any)</a>
+</li>
+<li> <a href="#Profile.WriteTo">func (p *Profile) WriteTo(w io.Writer, debug int) error</a>
+</li>
+<li><a href="#pkg-note-BUG">Bugs</a></li>
+</ul> <h3>Package files</h3> <p> <span>elf.go</span> <span>label.go</span> <span>map.go</span> <span>pe.go</span> <span>pprof.go</span> <span>pprof_rusage.go</span> <span>proto.go</span> <span>proto_other.go</span> <span>protobuf.go</span> <span>protomem.go</span> <span>runtime.go</span> </p> <h2 id="Do">func <span>Do</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Do(ctx context.Context, labels LabelSet, f func(context.Context))</pre> <p>Do calls f with a copy of the parent context with the given labels added to the parent's label map. Goroutines spawned while executing f will inherit the augmented label-set. Each key/value pair in labels is inserted into the label map in the order provided, overriding any previous value for the same key. The augmented label map will be set for the duration of the call to f and restored once f returns. </p>
+<h2 id="ForLabels">func <span>ForLabels</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func ForLabels(ctx context.Context, f func(key, value string) bool)</pre> <p>ForLabels invokes f with each label set on the context. The function f should return true to continue iteration or false to stop iteration early. </p>
+<h2 id="Label">func <span>Label</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func Label(ctx context.Context, key string) (string, bool)</pre> <p>Label returns the value of the label with the given key on ctx, and a boolean indicating whether that label exists. </p>
+<h2 id="SetGoroutineLabels">func <span>SetGoroutineLabels</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func SetGoroutineLabels(ctx context.Context)</pre> <p>SetGoroutineLabels sets the current goroutine's labels to match ctx. A new goroutine inherits the labels of the goroutine that created it. This is a lower-level API than <a href="#Do">Do</a>, which should be used instead when possible. </p>
+<h2 id="StartCPUProfile">func <span>StartCPUProfile</span> </h2> <pre data-language="go">func StartCPUProfile(w io.Writer) error</pre> <p>StartCPUProfile enables CPU profiling for the current process. While profiling, the profile will be buffered and written to w. StartCPUProfile returns an error if profiling is already enabled. </p>
+<p>On Unix-like systems, StartCPUProfile does not work by default for Go code built with -buildmode=c-archive or -buildmode=c-shared. StartCPUProfile relies on the SIGPROF signal, but that signal will be delivered to the main program's SIGPROF signal handler (if any) not to the one used by Go. To make it work, call <span>os/signal.Notify</span> for <span>syscall.SIGPROF</span>, but note that doing so may break any profiling being done by the main program. </p>
+<h2 id="StopCPUProfile">func <span>StopCPUProfile</span> </h2> <pre data-language="go">func StopCPUProfile()</pre> <p>StopCPUProfile stops the current CPU profile, if any. StopCPUProfile only returns after all the writes for the profile have completed. </p>
+<h2 id="WithLabels">func <span>WithLabels</span> <span title="Added in Go 1.9">1.9</span> </h2> <pre data-language="go">func WithLabels(ctx context.Context, labels LabelSet) context.Context</pre> <p>WithLabels returns a new <span>context.Context</span> with the given labels added. A label overwrites a prior label with the same key. </p>
+<h2 id="WriteHeapProfile">func <span>WriteHeapProfile</span> </h2> <pre data-language="go">func WriteHeapProfile(w io.Writer) error</pre> <p>WriteHeapProfile is shorthand for <a href="#Lookup">Lookup</a>("heap").WriteTo(w, 0). It is preserved for backwards compatibility. </p>
+<h2 id="LabelSet">type <span>LabelSet</span> <span title="Added in Go 1.9">1.9</span> </h2> <p>LabelSet is a set of labels. </p>
+<pre data-language="go">type LabelSet struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Labels">func <span>Labels</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func Labels(args ...string) LabelSet</pre> <p>Labels takes an even number of strings representing key-value pairs and makes a <a href="#LabelSet">LabelSet</a> containing them. A label overwrites a prior label with the same key. Currently only the CPU and goroutine profiles utilize any labels information. See <a href="https://golang.org/issue/23458">https://golang.org/issue/23458</a> for details. </p>
+<h2 id="Profile">type <span>Profile</span> </h2> <p>A Profile is a collection of stack traces showing the call sequences that led to instances of a particular event, such as allocation. Packages can create and maintain their own profiles; the most common use is for tracking resources that must be explicitly closed, such as files or network connections. </p>
+<p>A Profile's methods can be called from multiple goroutines simultaneously. </p>
+<p>Each Profile has a unique name. A few profiles are predefined: </p>
+<pre data-language="go">goroutine - stack traces of all current goroutines
+heap - a sampling of memory allocations of live objects
+allocs - a sampling of all past memory allocations
+threadcreate - stack traces that led to the creation of new OS threads
+block - stack traces that led to blocking on synchronization primitives
+mutex - stack traces of holders of contended mutexes
+</pre> <p>These predefined profiles maintain themselves and panic on an explicit <a href="#Profile.Add">Profile.Add</a> or <a href="#Profile.Remove">Profile.Remove</a> method call. </p>
+<p>The CPU profile is not available as a Profile. It has a special API, the <a href="#StartCPUProfile">StartCPUProfile</a> and <a href="#StopCPUProfile">StopCPUProfile</a> functions, because it streams output to a writer during profiling. </p>
+<h3 id="hdr-Heap_profile">Heap profile</h3> <p>The heap profile reports statistics as of the most recently completed garbage collection; it elides more recent allocation to avoid skewing the profile away from live data and toward garbage. If there has been no garbage collection at all, the heap profile reports all known allocations. This exception helps mainly in programs running without garbage collection enabled, usually for debugging purposes. </p>
+<p>The heap profile tracks both the allocation sites for all live objects in the application memory and for all objects allocated since the program start. Pprof's -inuse_space, -inuse_objects, -alloc_space, and -alloc_objects flags select which to display, defaulting to -inuse_space (live objects, scaled by size). </p>
+<h3 id="hdr-Allocs_profile">Allocs profile</h3> <p>The allocs profile is the same as the heap profile but changes the default pprof display to -alloc_space, the total number of bytes allocated since the program began (including garbage-collected bytes). </p>
+<h3 id="hdr-Block_profile">Block profile</h3> <p>The block profile tracks time spent blocked on synchronization primitives, such as <span>sync.Mutex</span>, <span>sync.RWMutex</span>, <span>sync.WaitGroup</span>, <span>sync.Cond</span>, and channel send/receive/select. </p>
+<p>Stack traces correspond to the location that blocked (for example, <span>sync.Mutex.Lock</span>). </p>
+<p>Sample values correspond to cumulative time spent blocked at that stack trace, subject to time-based sampling specified by <span>runtime.SetBlockProfileRate</span>. </p>
+<h3 id="hdr-Mutex_profile">Mutex profile</h3> <p>The mutex profile tracks contention on mutexes, such as <span>sync.Mutex</span>, <span>sync.RWMutex</span>, and runtime-internal locks. </p>
+<p>Stack traces correspond to the end of the critical section causing contention. For example, a lock held for a long time while other goroutines are waiting to acquire the lock will report contention when the lock is finally unlocked (that is, at <span>sync.Mutex.Unlock</span>). </p>
+<p>Sample values correspond to the approximate cumulative time other goroutines spent blocked waiting for the lock, subject to event-based sampling specified by <span>runtime.SetMutexProfileFraction</span>. For example, if a caller holds a lock for 1s while 5 other goroutines are waiting for the entire second to acquire the lock, its unlock call stack will report 5s of contention. </p>
+<p>Runtime-internal locks are always reported at the location "runtime._LostContendedRuntimeLock". More detailed stack traces for runtime-internal locks can be obtained by setting `GODEBUG=runtimecontentionstacks=1` (see package <span>runtime</span> docs for caveats). </p>
+<pre data-language="go">type Profile struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Lookup">func <span>Lookup</span> </h3> <pre data-language="go">func Lookup(name string) *Profile</pre> <p>Lookup returns the profile with the given name, or nil if no such profile exists. </p>
+<h3 id="NewProfile">func <span>NewProfile</span> </h3> <pre data-language="go">func NewProfile(name string) *Profile</pre> <p>NewProfile creates a new profile with the given name. If a profile with that name already exists, NewProfile panics. The convention is to use a 'import/path.' prefix to create separate name spaces for each package. For compatibility with various tools that read pprof data, profile names should not contain spaces. </p>
+<h3 id="Profiles">func <span>Profiles</span> </h3> <pre data-language="go">func Profiles() []*Profile</pre> <p>Profiles returns a slice of all the known profiles, sorted by name. </p>
+<h3 id="Profile.Add">func (*Profile) <span>Add</span> </h3> <pre data-language="go">func (p *Profile) Add(value any, skip int)</pre> <p>Add adds the current execution stack to the profile, associated with value. Add stores value in an internal map, so value must be suitable for use as a map key and will not be garbage collected until the corresponding call to <a href="#Profile.Remove">Profile.Remove</a>. Add panics if the profile already contains a stack for value. </p>
+<p>The skip parameter has the same meaning as <span>runtime.Caller</span>'s skip and controls where the stack trace begins. Passing skip=0 begins the trace in the function calling Add. For example, given this execution stack: </p>
+<pre data-language="go">Add
+called from rpc.NewClient
+called from mypkg.Run
+called from main.main
+</pre> <p>Passing skip=0 begins the stack trace at the call to Add inside rpc.NewClient. Passing skip=1 begins the stack trace at the call to NewClient inside mypkg.Run. </p>
+<h3 id="Profile.Count">func (*Profile) <span>Count</span> </h3> <pre data-language="go">func (p *Profile) Count() int</pre> <p>Count returns the number of execution stacks currently in the profile. </p>
+<h3 id="Profile.Name">func (*Profile) <span>Name</span> </h3> <pre data-language="go">func (p *Profile) Name() string</pre> <p>Name returns this profile's name, which can be passed to <a href="#Lookup">Lookup</a> to reobtain the profile. </p>
+<h3 id="Profile.Remove">func (*Profile) <span>Remove</span> </h3> <pre data-language="go">func (p *Profile) Remove(value any)</pre> <p>Remove removes the execution stack associated with value from the profile. It is a no-op if the value is not in the profile. </p>
+<h3 id="Profile.WriteTo">func (*Profile) <span>WriteTo</span> </h3> <pre data-language="go">func (p *Profile) WriteTo(w io.Writer, debug int) error</pre> <p>WriteTo writes a pprof-formatted snapshot of the profile to w. If a write to w returns an error, WriteTo returns that error. Otherwise, WriteTo returns nil. </p>
+<p>The debug parameter enables additional output. Passing debug=0 writes the gzip-compressed protocol buffer described in <a href="https://github.com/google/pprof/tree/master/proto#overview">https://github.com/google/pprof/tree/master/proto#overview</a>. Passing debug=1 writes the legacy text format with comments translating addresses to function names and line numbers, so that a programmer can read the profile without tools. </p>
+<p>The predefined profiles may assign meaning to other debug values; for example, when printing the "goroutine" profile, debug=2 means to print the goroutine stacks in the same form that a Go program uses when dying due to an unrecovered panic. </p>
+<h2 id="pkg-note-BUG">Bugs</h2> <ul> <li>☞ <p>Profiles are only as good as the kernel support used to generate them. See <a href="https://golang.org/issue/13841">https://golang.org/issue/13841</a> for details about known problems. </p>
+</li> </ul><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/runtime/pprof/" class="_attribution-link">http://golang.org/pkg/runtime/pprof/</a>
+ </p>
+</div>
diff --git a/devdocs/go/runtime%2Frace%2Findex.html b/devdocs/go/runtime%2Frace%2Findex.html
new file mode 100644
index 00000000..e1abbf02
--- /dev/null
+++ b/devdocs/go/runtime%2Frace%2Findex.html
@@ -0,0 +1,11 @@
+<h1> Package race </h1> <ul id="short-nav">
+<li><code>import "runtime/race"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package race implements data race detection logic. No public interface is provided. For details about the race detector see <a href="https://golang.org/doc/articles/race_detector.html">https://golang.org/doc/articles/race_detector.html</a> </p> <h2 id="pkg-index">Index </h2> <h3>Package files</h3> <p> <span>doc.go</span> <span>race_v1_amd64.go</span> </p> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/runtime/race/" class="_attribution-link">http://golang.org/pkg/runtime/race/</a>
+ </p>
+</div>
diff --git a/devdocs/go/runtime%2Ftrace%2Findex.html b/devdocs/go/runtime%2Ftrace%2Findex.html
new file mode 100644
index 00000000..980aa1a1
--- /dev/null
+++ b/devdocs/go/runtime%2Ftrace%2Findex.html
@@ -0,0 +1,136 @@
+<h1> Package trace </h1> <ul id="short-nav">
+<li><code>import "runtime/trace"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package trace contains facilities for programs to generate traces for the Go execution tracer. </p>
+<h3 id="hdr-Tracing_runtime_activities">Tracing runtime activities</h3> <p>The execution trace captures a wide range of execution events such as goroutine creation/blocking/unblocking, syscall enter/exit/block, GC-related events, changes of heap size, processor start/stop, etc. When CPU profiling is active, the execution tracer makes an effort to include those samples as well. A precise nanosecond-precision timestamp and a stack trace is captured for most events. The generated trace can be interpreted using `go tool trace`. </p>
+<p>Support for tracing tests and benchmarks built with the standard testing package is built into `go test`. For example, the following command runs the test in the current directory and writes the trace file (trace.out). </p>
+<pre data-language="go">go test -trace=trace.out
+</pre> <p>This runtime/trace package provides APIs to add equivalent tracing support to a standalone program. See the Example that demonstrates how to use this API to enable tracing. </p>
+<p>There is also a standard HTTP interface to trace data. Adding the following line will install a handler under the /debug/pprof/trace URL to download a live trace: </p>
+<pre data-language="go">import _ "net/http/pprof"
+</pre> <p>See the <span>net/http/pprof</span> package for more details about all of the debug endpoints installed by this import. </p>
+<h3 id="hdr-User_annotation">User annotation</h3> <p>Package trace provides user annotation APIs that can be used to log interesting events during execution. </p>
+<p>There are three types of user annotations: log messages, regions, and tasks. </p>
+<p><a href="#Log">Log</a> emits a timestamped message to the execution trace along with additional information such as the category of the message and which goroutine called <a href="#Log">Log</a>. The execution tracer provides UIs to filter and group goroutines using the log category and the message supplied in <a href="#Log">Log</a>. </p>
+<p>A region is for logging a time interval during a goroutine's execution. By definition, a region starts and ends in the same goroutine. Regions can be nested to represent subintervals. For example, the following code records four regions in the execution trace to trace the durations of sequential steps in a cappuccino making operation. </p>
+<pre data-language="go">trace.WithRegion(ctx, "makeCappuccino", func() {
+
+ // orderID allows to identify a specific order
+ // among many cappuccino order region records.
+ trace.Log(ctx, "orderID", orderID)
+
+ trace.WithRegion(ctx, "steamMilk", steamMilk)
+ trace.WithRegion(ctx, "extractCoffee", extractCoffee)
+ trace.WithRegion(ctx, "mixMilkCoffee", mixMilkCoffee)
+})
+</pre> <p>A task is a higher-level component that aids tracing of logical operations such as an RPC request, an HTTP request, or an interesting local operation which may require multiple goroutines working together. Since tasks can involve multiple goroutines, they are tracked via a <span>context.Context</span> object. <a href="#NewTask">NewTask</a> creates a new task and embeds it in the returned <span>context.Context</span> object. Log messages and regions are attached to the task, if any, in the Context passed to <a href="#Log">Log</a> and <a href="#WithRegion">WithRegion</a>. </p>
+<p>For example, assume that we decided to froth milk, extract coffee, and mix milk and coffee in separate goroutines. With a task, the trace tool can identify the goroutines involved in a specific cappuccino order. </p>
+<pre data-language="go">ctx, task := trace.NewTask(ctx, "makeCappuccino")
+trace.Log(ctx, "orderID", orderID)
+
+milk := make(chan bool)
+espresso := make(chan bool)
+
+go func() {
+ trace.WithRegion(ctx, "steamMilk", steamMilk)
+ milk &lt;- true
+}()
+go func() {
+ trace.WithRegion(ctx, "extractCoffee", extractCoffee)
+ espresso &lt;- true
+}()
+go func() {
+ defer task.End() // When assemble is done, the order is complete.
+ &lt;-espresso
+ &lt;-milk
+ trace.WithRegion(ctx, "mixMilkCoffee", mixMilkCoffee)
+}()
+</pre> <p>The trace tool computes the latency of a task by measuring the time between the task creation and the task end and provides latency distributions for each task type found in the trace. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Example demonstrates the use of the trace package to trace the execution of a Go program. The trace output will be written to the file trace.out </p> <p>Code:</p> <pre class="code" data-language="go">package trace_test
+
+import (
+ "fmt"
+ "log"
+ "os"
+ "runtime/trace"
+)
+
+// Example demonstrates the use of the trace package to trace
+// the execution of a Go program. The trace output will be
+// written to the file trace.out
+func Example() {
+ f, err := os.Create("trace.out")
+ if err != nil {
+ log.Fatalf("failed to create trace output file: %v", err)
+ }
+ defer func() {
+ if err := f.Close(); err != nil {
+ log.Fatalf("failed to close trace file: %v", err)
+ }
+ }()
+
+ if err := trace.Start(f); err != nil {
+ log.Fatalf("failed to start trace: %v", err)
+ }
+ defer trace.Stop()
+
+ // your program here
+ RunMyProgram()
+}
+
+func RunMyProgram() {
+ fmt.Printf("this function will be traced")
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#IsEnabled">func IsEnabled() bool</a></li>
+<li><a href="#Log">func Log(ctx context.Context, category, message string)</a></li>
+<li><a href="#Logf">func Logf(ctx context.Context, category, format string, args ...any)</a></li>
+<li><a href="#Start">func Start(w io.Writer) error</a></li>
+<li><a href="#Stop">func Stop()</a></li>
+<li><a href="#WithRegion">func WithRegion(ctx context.Context, regionType string, fn func())</a></li>
+<li><a href="#Region">type Region</a></li>
+<li> <a href="#StartRegion">func StartRegion(ctx context.Context, regionType string) *Region</a>
+</li>
+<li> <a href="#Region.End">func (r *Region) End()</a>
+</li>
+<li><a href="#Task">type Task</a></li>
+<li> <a href="#NewTask">func NewTask(pctx context.Context, taskType string) (ctx context.Context, task *Task)</a>
+</li>
+<li> <a href="#Task.End">func (t *Task) End()</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>annotation.go</span> <span>trace.go</span> </p> <h2 id="IsEnabled">func <span>IsEnabled</span> <span title="Added in Go 1.11">1.11</span> </h2> <pre data-language="go">func IsEnabled() bool</pre> <p>IsEnabled reports whether tracing is enabled. The information is advisory only. The tracing status may have changed by the time this function returns. </p>
+<h2 id="Log">func <span>Log</span> <span title="Added in Go 1.11">1.11</span> </h2> <pre data-language="go">func Log(ctx context.Context, category, message string)</pre> <p>Log emits a one-off event with the given category and message. Category can be empty and the API assumes there are only a handful of unique categories in the system. </p>
+<h2 id="Logf">func <span>Logf</span> <span title="Added in Go 1.11">1.11</span> </h2> <pre data-language="go">func Logf(ctx context.Context, category, format string, args ...any)</pre> <p>Logf is like <a href="#Log">Log</a>, but the value is formatted using the specified format spec. </p>
+<h2 id="Start">func <span>Start</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Start(w io.Writer) error</pre> <p>Start enables tracing for the current program. While tracing, the trace will be buffered and written to w. Start returns an error if tracing is already enabled. </p>
+<h2 id="Stop">func <span>Stop</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Stop()</pre> <p>Stop stops the current tracing, if any. Stop only returns after all the writes for the trace have completed. </p>
+<h2 id="WithRegion">func <span>WithRegion</span> <span title="Added in Go 1.11">1.11</span> </h2> <pre data-language="go">func WithRegion(ctx context.Context, regionType string, fn func())</pre> <p>WithRegion starts a region associated with its calling goroutine, runs fn, and then ends the region. If the context carries a task, the region is associated with the task. Otherwise, the region is attached to the background task. </p>
+<p>The regionType is used to classify regions, so there should be only a handful of unique region types. </p>
+<h2 id="Region">type <span>Region</span> <span title="Added in Go 1.11">1.11</span> </h2> <p>Region is a region of code whose execution time interval is traced. </p>
+<pre data-language="go">type Region struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="StartRegion">func <span>StartRegion</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func StartRegion(ctx context.Context, regionType string) *Region</pre> <p>StartRegion starts a region and returns it. The returned Region's <a href="#Region.End">Region.End</a> method must be called from the same goroutine where the region was started. Within each goroutine, regions must nest. That is, regions started after this region must be ended before this region can be ended. Recommended usage is </p>
+<pre data-language="go">defer trace.StartRegion(ctx, "myTracedRegion").End()
+</pre> <h3 id="Region.End">func (*Region) <span>End</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (r *Region) End()</pre> <p>End marks the end of the traced code region. </p>
+<h2 id="Task">type <span>Task</span> <span title="Added in Go 1.11">1.11</span> </h2> <p>Task is a data type for tracing a user-defined, logical operation. </p>
+<pre data-language="go">type Task struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewTask">func <span>NewTask</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func NewTask(pctx context.Context, taskType string) (ctx context.Context, task *Task)</pre> <p>NewTask creates a task instance with the type taskType and returns it along with a Context that carries the task. If the input context contains a task, the new task is its subtask. </p>
+<p>The taskType is used to classify task instances. Analysis tools like the Go execution tracer may assume there are only a bounded number of unique task types in the system. </p>
+<p>The returned Task's <a href="#Task.End">Task.End</a> method is used to mark the task's end. The trace tool measures task latency as the time between task creation and when the End method is called, and provides the latency distribution per task type. If the End method is called multiple times, only the first call is used in the latency measurement. </p>
+<pre data-language="go">ctx, task := trace.NewTask(ctx, "awesomeTask")
+trace.WithRegion(ctx, "preparation", prepWork)
+// preparation of the task
+go func() { // continue processing the task in a separate goroutine.
+ defer task.End()
+ trace.WithRegion(ctx, "remainingWork", remainingWork)
+}()
+</pre> <h3 id="Task.End">func (*Task) <span>End</span> <span title="Added in Go 1.11">1.11</span> </h3> <pre data-language="go">func (t *Task) End()</pre> <p>End marks the end of the operation represented by the <a href="#Task">Task</a>. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/runtime/trace/" class="_attribution-link">http://golang.org/pkg/runtime/trace/</a>
+ </p>
+</div>
diff --git a/devdocs/go/slices%2Findex.html b/devdocs/go/slices%2Findex.html
new file mode 100644
index 00000000..39c60ddb
--- /dev/null
+++ b/devdocs/go/slices%2Findex.html
@@ -0,0 +1,277 @@
+<h1> Package slices </h1> <ul id="short-nav">
+<li><code>import "slices"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package slices defines various functions useful with slices of any type. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#BinarySearch">func BinarySearch[S ~[]E, E cmp.Ordered](x S, target E) (int, bool)</a></li>
+<li><a href="#BinarySearchFunc">func BinarySearchFunc[S ~[]E, E, T any](x S, target T, cmp func(E, T) int) (int, bool)</a></li>
+<li><a href="#Clip">func Clip[S ~[]E, E any](s S) S</a></li>
+<li><a href="#Clone">func Clone[S ~[]E, E any](s S) S</a></li>
+<li><a href="#Compact">func Compact[S ~[]E, E comparable](s S) S</a></li>
+<li><a href="#CompactFunc">func CompactFunc[S ~[]E, E any](s S, eq func(E, E) bool) S</a></li>
+<li><a href="#Compare">func Compare[S ~[]E, E cmp.Ordered](s1, s2 S) int</a></li>
+<li><a href="#CompareFunc">func CompareFunc[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, cmp func(E1, E2) int) int</a></li>
+<li><a href="#Concat">func Concat[S ~[]E, E any](slices ...S) S</a></li>
+<li><a href="#Contains">func Contains[S ~[]E, E comparable](s S, v E) bool</a></li>
+<li><a href="#ContainsFunc">func ContainsFunc[S ~[]E, E any](s S, f func(E) bool) bool</a></li>
+<li><a href="#Delete">func Delete[S ~[]E, E any](s S, i, j int) S</a></li>
+<li><a href="#DeleteFunc">func DeleteFunc[S ~[]E, E any](s S, del func(E) bool) S</a></li>
+<li><a href="#Equal">func Equal[S ~[]E, E comparable](s1, s2 S) bool</a></li>
+<li><a href="#EqualFunc">func EqualFunc[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, eq func(E1, E2) bool) bool</a></li>
+<li><a href="#Grow">func Grow[S ~[]E, E any](s S, n int) S</a></li>
+<li><a href="#Index">func Index[S ~[]E, E comparable](s S, v E) int</a></li>
+<li><a href="#IndexFunc">func IndexFunc[S ~[]E, E any](s S, f func(E) bool) int</a></li>
+<li><a href="#Insert">func Insert[S ~[]E, E any](s S, i int, v ...E) S</a></li>
+<li><a href="#IsSorted">func IsSorted[S ~[]E, E cmp.Ordered](x S) bool</a></li>
+<li><a href="#IsSortedFunc">func IsSortedFunc[S ~[]E, E any](x S, cmp func(a, b E) int) bool</a></li>
+<li><a href="#Max">func Max[S ~[]E, E cmp.Ordered](x S) E</a></li>
+<li><a href="#MaxFunc">func MaxFunc[S ~[]E, E any](x S, cmp func(a, b E) int) E</a></li>
+<li><a href="#Min">func Min[S ~[]E, E cmp.Ordered](x S) E</a></li>
+<li><a href="#MinFunc">func MinFunc[S ~[]E, E any](x S, cmp func(a, b E) int) E</a></li>
+<li><a href="#Replace">func Replace[S ~[]E, E any](s S, i, j int, v ...E) S</a></li>
+<li><a href="#Reverse">func Reverse[S ~[]E, E any](s S)</a></li>
+<li><a href="#Sort">func Sort[S ~[]E, E cmp.Ordered](x S)</a></li>
+<li><a href="#SortFunc">func SortFunc[S ~[]E, E any](x S, cmp func(a, b E) int)</a></li>
+<li><a href="#SortStableFunc">func SortStableFunc[S ~[]E, E any](x S, cmp func(a, b E) int)</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_BinarySearch">BinarySearch</a></dd> <dd><a class="exampleLink" href="#example_BinarySearchFunc">BinarySearchFunc</a></dd> <dd><a class="exampleLink" href="#example_Compact">Compact</a></dd> <dd><a class="exampleLink" href="#example_CompactFunc">CompactFunc</a></dd> <dd><a class="exampleLink" href="#example_Compare">Compare</a></dd> <dd><a class="exampleLink" href="#example_CompareFunc">CompareFunc</a></dd> <dd><a class="exampleLink" href="#example_ContainsFunc">ContainsFunc</a></dd> <dd><a class="exampleLink" href="#example_Delete">Delete</a></dd> <dd><a class="exampleLink" href="#example_DeleteFunc">DeleteFunc</a></dd> <dd><a class="exampleLink" href="#example_Equal">Equal</a></dd> <dd><a class="exampleLink" href="#example_EqualFunc">EqualFunc</a></dd> <dd><a class="exampleLink" href="#example_Index">Index</a></dd> <dd><a class="exampleLink" href="#example_IndexFunc">IndexFunc</a></dd> <dd><a class="exampleLink" href="#example_Insert">Insert</a></dd> <dd><a class="exampleLink" href="#example_IsSorted">IsSorted</a></dd> <dd><a class="exampleLink" href="#example_IsSortedFunc">IsSortedFunc</a></dd> <dd><a class="exampleLink" href="#example_Max">Max</a></dd> <dd><a class="exampleLink" href="#example_MaxFunc">MaxFunc</a></dd> <dd><a class="exampleLink" href="#example_Min">Min</a></dd> <dd><a class="exampleLink" href="#example_MinFunc">MinFunc</a></dd> <dd><a class="exampleLink" href="#example_Replace">Replace</a></dd> <dd><a class="exampleLink" href="#example_Reverse">Reverse</a></dd> <dd><a class="exampleLink" href="#example_Sort">Sort</a></dd> <dd><a class="exampleLink" href="#example_SortFunc_caseInsensitive">SortFunc (CaseInsensitive)</a></dd> <dd><a class="exampleLink" href="#example_SortFunc_multiField">SortFunc (MultiField)</a></dd> <dd><a class="exampleLink" href="#example_SortStableFunc">SortStableFunc</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>slices.go</span> <span>sort.go</span> <span>zsortanyfunc.go</span> <span>zsortordered.go</span> </p> <h2 id="BinarySearch">func <span>BinarySearch</span> </h2> <pre data-language="go">func BinarySearch[S ~[]E, E cmp.Ordered](x S, target E) (int, bool)</pre> <p>BinarySearch searches for target in a sorted slice and returns the position where target is found, or the position where target would appear in the sort order; it also returns a bool saying whether the target is really found in the slice. The slice must be sorted in increasing order. </p> <h4 id="example_BinarySearch"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">names := []string{"Alice", "Bob", "Vera"}
+n, found := slices.BinarySearch(names, "Vera")
+fmt.Println("Vera:", n, found)
+n, found = slices.BinarySearch(names, "Bill")
+fmt.Println("Bill:", n, found)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Vera: 2 true
+Bill: 1 false
+</pre> <h2 id="BinarySearchFunc">func <span>BinarySearchFunc</span> </h2> <pre data-language="go">func BinarySearchFunc[S ~[]E, E, T any](x S, target T, cmp func(E, T) int) (int, bool)</pre> <p>BinarySearchFunc works like <a href="#BinarySearch">BinarySearch</a>, but uses a custom comparison function. The slice must be sorted in increasing order, where "increasing" is defined by cmp. cmp should return 0 if the slice element matches the target, a negative number if the slice element precedes the target, or a positive number if the slice element follows the target. cmp must implement the same ordering as the slice, such that if cmp(a, t) &lt; 0 and cmp(b, t) &gt;= 0, then a must precede b in the slice. </p> <h4 id="example_BinarySearchFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type Person struct {
+ Name string
+ Age int
+}
+people := []Person{
+ {"Alice", 55},
+ {"Bob", 24},
+ {"Gopher", 13},
+}
+n, found := slices.BinarySearchFunc(people, Person{"Bob", 0}, func(a, b Person) int {
+ return cmp.Compare(a.Name, b.Name)
+})
+fmt.Println("Bob:", n, found)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Bob: 1 true
+</pre> <h2 id="Clip">func <span>Clip</span> </h2> <pre data-language="go">func Clip[S ~[]E, E any](s S) S</pre> <p>Clip removes unused capacity from the slice, returning s[:len(s):len(s)]. </p>
+<h2 id="Clone">func <span>Clone</span> </h2> <pre data-language="go">func Clone[S ~[]E, E any](s S) S</pre> <p>Clone returns a copy of the slice. The elements are copied using assignment, so this is a shallow clone. </p>
+<h2 id="Compact">func <span>Compact</span> </h2> <pre data-language="go">func Compact[S ~[]E, E comparable](s S) S</pre> <p>Compact replaces consecutive runs of equal elements with a single copy. This is like the uniq command found on Unix. Compact modifies the contents of the slice s and returns the modified slice, which may have a smaller length. Compact zeroes the elements between the new length and the original length. </p> <h4 id="example_Compact"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">seq := []int{0, 1, 1, 2, 3, 5, 8}
+seq = slices.Compact(seq)
+fmt.Println(seq)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[0 1 2 3 5 8]
+</pre> <h2 id="CompactFunc">func <span>CompactFunc</span> </h2> <pre data-language="go">func CompactFunc[S ~[]E, E any](s S, eq func(E, E) bool) S</pre> <p>CompactFunc is like <a href="#Compact">Compact</a> but uses an equality function to compare elements. For runs of elements that compare equal, CompactFunc keeps the first one. CompactFunc zeroes the elements between the new length and the original length. </p> <h4 id="example_CompactFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">names := []string{"bob", "Bob", "alice", "Vera", "VERA"}
+names = slices.CompactFunc(names, strings.EqualFold)
+fmt.Println(names)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[bob alice Vera]
+</pre> <h2 id="Compare">func <span>Compare</span> </h2> <pre data-language="go">func Compare[S ~[]E, E cmp.Ordered](s1, s2 S) int</pre> <p>Compare compares the elements of s1 and s2, using <span>cmp.Compare</span> on each pair of elements. The elements are compared sequentially, starting at index 0, until one element is not equal to the other. The result of comparing the first non-matching elements is returned. If both slices are equal until one of them ends, the shorter slice is considered less than the longer one. The result is 0 if s1 == s2, -1 if s1 &lt; s2, and +1 if s1 &gt; s2. </p> <h4 id="example_Compare"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">names := []string{"Alice", "Bob", "Vera"}
+fmt.Println("Equal:", slices.Compare(names, []string{"Alice", "Bob", "Vera"}))
+fmt.Println("V &lt; X:", slices.Compare(names, []string{"Alice", "Bob", "Xena"}))
+fmt.Println("V &gt; C:", slices.Compare(names, []string{"Alice", "Bob", "Cat"}))
+fmt.Println("3 &gt; 2:", slices.Compare(names, []string{"Alice", "Bob"}))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Equal: 0
+V &lt; X: -1
+V &gt; C: 1
+3 &gt; 2: 1
+</pre> <h2 id="CompareFunc">func <span>CompareFunc</span> </h2> <pre data-language="go">func CompareFunc[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, cmp func(E1, E2) int) int</pre> <p>CompareFunc is like <a href="#Compare">Compare</a> but uses a custom comparison function on each pair of elements. The result is the first non-zero result of cmp; if cmp always returns 0 the result is 0 if len(s1) == len(s2), -1 if len(s1) &lt; len(s2), and +1 if len(s1) &gt; len(s2). </p> <h4 id="example_CompareFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">numbers := []int{0, 43, 8}
+strings := []string{"0", "0", "8"}
+result := slices.CompareFunc(numbers, strings, func(n int, s string) int {
+ sn, err := strconv.Atoi(s)
+ if err != nil {
+ return 1
+ }
+ return cmp.Compare(n, sn)
+})
+fmt.Println(result)
+</pre> <p>Output:</p> <pre class="output" data-language="go">1
+</pre> <h2 id="Concat">func <span>Concat</span> </h2> <pre data-language="go">func Concat[S ~[]E, E any](slices ...S) S</pre> <p>Concat returns a new slice concatenating the passed in slices. </p>
+<h2 id="Contains">func <span>Contains</span> </h2> <pre data-language="go">func Contains[S ~[]E, E comparable](s S, v E) bool</pre> <p>Contains reports whether v is present in s. </p>
+<h2 id="ContainsFunc">func <span>ContainsFunc</span> </h2> <pre data-language="go">func ContainsFunc[S ~[]E, E any](s S, f func(E) bool) bool</pre> <p>ContainsFunc reports whether at least one element e of s satisfies f(e). </p> <h4 id="example_ContainsFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">numbers := []int{0, 42, -10, 8}
+hasNegative := slices.ContainsFunc(numbers, func(n int) bool {
+ return n &lt; 0
+})
+fmt.Println("Has a negative:", hasNegative)
+hasOdd := slices.ContainsFunc(numbers, func(n int) bool {
+ return n%2 != 0
+})
+fmt.Println("Has an odd number:", hasOdd)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Has a negative: true
+Has an odd number: false
+</pre> <h2 id="Delete">func <span>Delete</span> </h2> <pre data-language="go">func Delete[S ~[]E, E any](s S, i, j int) S</pre> <p>Delete removes the elements s[i:j] from s, returning the modified slice. Delete panics if j &gt; len(s) or s[i:j] is not a valid slice of s. Delete is O(len(s)-i), so if many items must be deleted, it is better to make a single call deleting them all together than to delete one at a time. Delete zeroes the elements s[len(s)-(j-i):len(s)]. </p> <h4 id="example_Delete"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">letters := []string{"a", "b", "c", "d", "e"}
+letters = slices.Delete(letters, 1, 4)
+fmt.Println(letters)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[a e]
+</pre> <h2 id="DeleteFunc">func <span>DeleteFunc</span> </h2> <pre data-language="go">func DeleteFunc[S ~[]E, E any](s S, del func(E) bool) S</pre> <p>DeleteFunc removes any elements from s for which del returns true, returning the modified slice. DeleteFunc zeroes the elements between the new length and the original length. </p> <h4 id="example_DeleteFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">seq := []int{0, 1, 1, 2, 3, 5, 8}
+seq = slices.DeleteFunc(seq, func(n int) bool {
+ return n%2 != 0 // delete the odd numbers
+})
+fmt.Println(seq)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[0 2 8]
+</pre> <h2 id="Equal">func <span>Equal</span> </h2> <pre data-language="go">func Equal[S ~[]E, E comparable](s1, s2 S) bool</pre> <p>Equal reports whether two slices are equal: the same length and all elements equal. If the lengths are different, Equal returns false. Otherwise, the elements are compared in increasing index order, and the comparison stops at the first unequal pair. Floating point NaNs are not considered equal. </p> <h4 id="example_Equal"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">numbers := []int{0, 42, 8}
+fmt.Println(slices.Equal(numbers, []int{0, 42, 8}))
+fmt.Println(slices.Equal(numbers, []int{10}))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="EqualFunc">func <span>EqualFunc</span> </h2> <pre data-language="go">func EqualFunc[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, eq func(E1, E2) bool) bool</pre> <p>EqualFunc reports whether two slices are equal using an equality function on each pair of elements. If the lengths are different, EqualFunc returns false. Otherwise, the elements are compared in increasing index order, and the comparison stops at the first index for which eq returns false. </p> <h4 id="example_EqualFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">numbers := []int{0, 42, 8}
+strings := []string{"000", "42", "0o10"}
+equal := slices.EqualFunc(numbers, strings, func(n int, s string) bool {
+ sn, err := strconv.ParseInt(s, 0, 64)
+ if err != nil {
+ return false
+ }
+ return n == int(sn)
+})
+fmt.Println(equal)
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+</pre> <h2 id="Grow">func <span>Grow</span> </h2> <pre data-language="go">func Grow[S ~[]E, E any](s S, n int) S</pre> <p>Grow increases the slice's capacity, if necessary, to guarantee space for another n elements. After Grow(n), at least n elements can be appended to the slice without another allocation. If n is negative or too large to allocate the memory, Grow panics. </p>
+<h2 id="Index">func <span>Index</span> </h2> <pre data-language="go">func Index[S ~[]E, E comparable](s S, v E) int</pre> <p>Index returns the index of the first occurrence of v in s, or -1 if not present. </p> <h4 id="example_Index"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">numbers := []int{0, 42, 8}
+fmt.Println(slices.Index(numbers, 8))
+fmt.Println(slices.Index(numbers, 7))
+</pre> <p>Output:</p> <pre class="output" data-language="go">2
+-1
+</pre> <h2 id="IndexFunc">func <span>IndexFunc</span> </h2> <pre data-language="go">func IndexFunc[S ~[]E, E any](s S, f func(E) bool) int</pre> <p>IndexFunc returns the first index i satisfying f(s[i]), or -1 if none do. </p> <h4 id="example_IndexFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">numbers := []int{0, 42, -10, 8}
+i := slices.IndexFunc(numbers, func(n int) bool {
+ return n &lt; 0
+})
+fmt.Println("First negative at index", i)
+</pre> <p>Output:</p> <pre class="output" data-language="go">First negative at index 2
+</pre> <h2 id="Insert">func <span>Insert</span> </h2> <pre data-language="go">func Insert[S ~[]E, E any](s S, i int, v ...E) S</pre> <p>Insert inserts the values v... into s at index i, returning the modified slice. The elements at s[i:] are shifted up to make room. In the returned slice r, r[i] == v[0], and r[i+len(v)] == value originally at r[i]. Insert panics if i is out of range. This function is O(len(s) + len(v)). </p> <h4 id="example_Insert"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">names := []string{"Alice", "Bob", "Vera"}
+names = slices.Insert(names, 1, "Bill", "Billie")
+names = slices.Insert(names, len(names), "Zac")
+fmt.Println(names)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[Alice Bill Billie Bob Vera Zac]
+</pre> <h2 id="IsSorted">func <span>IsSorted</span> </h2> <pre data-language="go">func IsSorted[S ~[]E, E cmp.Ordered](x S) bool</pre> <p>IsSorted reports whether x is sorted in ascending order. </p> <h4 id="example_IsSorted"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(slices.IsSorted([]string{"Alice", "Bob", "Vera"}))
+fmt.Println(slices.IsSorted([]int{0, 2, 1}))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="IsSortedFunc">func <span>IsSortedFunc</span> </h2> <pre data-language="go">func IsSortedFunc[S ~[]E, E any](x S, cmp func(a, b E) int) bool</pre> <p>IsSortedFunc reports whether x is sorted in ascending order, with cmp as the comparison function as defined by <a href="#SortFunc">SortFunc</a>. </p> <h4 id="example_IsSortedFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">names := []string{"alice", "Bob", "VERA"}
+isSortedInsensitive := slices.IsSortedFunc(names, func(a, b string) int {
+ return cmp.Compare(strings.ToLower(a), strings.ToLower(b))
+})
+fmt.Println(isSortedInsensitive)
+fmt.Println(slices.IsSorted(names))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="Max">func <span>Max</span> </h2> <pre data-language="go">func Max[S ~[]E, E cmp.Ordered](x S) E</pre> <p>Max returns the maximal value in x. It panics if x is empty. For floating-point E, Max propagates NaNs (any NaN value in x forces the output to be NaN). </p> <h4 id="example_Max"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">numbers := []int{0, 42, -10, 8}
+fmt.Println(slices.Max(numbers))
+</pre> <p>Output:</p> <pre class="output" data-language="go">42
+</pre> <h2 id="MaxFunc">func <span>MaxFunc</span> </h2> <pre data-language="go">func MaxFunc[S ~[]E, E any](x S, cmp func(a, b E) int) E</pre> <p>MaxFunc returns the maximal value in x, using cmp to compare elements. It panics if x is empty. If there is more than one maximal element according to the cmp function, MaxFunc returns the first one. </p> <h4 id="example_MaxFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type Person struct {
+ Name string
+ Age int
+}
+people := []Person{
+ {"Gopher", 13},
+ {"Alice", 55},
+ {"Vera", 24},
+ {"Bob", 55},
+}
+firstOldest := slices.MaxFunc(people, func(a, b Person) int {
+ return cmp.Compare(a.Age, b.Age)
+})
+fmt.Println(firstOldest.Name)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Alice
+</pre> <h2 id="Min">func <span>Min</span> </h2> <pre data-language="go">func Min[S ~[]E, E cmp.Ordered](x S) E</pre> <p>Min returns the minimal value in x. It panics if x is empty. For floating-point numbers, Min propagates NaNs (any NaN value in x forces the output to be NaN). </p> <h4 id="example_Min"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">numbers := []int{0, 42, -10, 8}
+fmt.Println(slices.Min(numbers))
+</pre> <p>Output:</p> <pre class="output" data-language="go">-10
+</pre> <h2 id="MinFunc">func <span>MinFunc</span> </h2> <pre data-language="go">func MinFunc[S ~[]E, E any](x S, cmp func(a, b E) int) E</pre> <p>MinFunc returns the minimal value in x, using cmp to compare elements. It panics if x is empty. If there is more than one minimal element according to the cmp function, MinFunc returns the first one. </p> <h4 id="example_MinFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type Person struct {
+ Name string
+ Age int
+}
+people := []Person{
+ {"Gopher", 13},
+ {"Bob", 5},
+ {"Vera", 24},
+ {"Bill", 5},
+}
+firstYoungest := slices.MinFunc(people, func(a, b Person) int {
+ return cmp.Compare(a.Age, b.Age)
+})
+fmt.Println(firstYoungest.Name)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Bob
+</pre> <h2 id="Replace">func <span>Replace</span> </h2> <pre data-language="go">func Replace[S ~[]E, E any](s S, i, j int, v ...E) S</pre> <p>Replace replaces the elements s[i:j] by the given v, and returns the modified slice. Replace panics if j &gt; len(s) or s[i:j] is not a valid slice of s. When len(v) &lt; (j-i), Replace zeroes the elements between the new length and the original length. </p> <h4 id="example_Replace"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">names := []string{"Alice", "Bob", "Vera", "Zac"}
+names = slices.Replace(names, 1, 3, "Bill", "Billie", "Cat")
+fmt.Println(names)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[Alice Bill Billie Cat Zac]
+</pre> <h2 id="Reverse">func <span>Reverse</span> </h2> <pre data-language="go">func Reverse[S ~[]E, E any](s S)</pre> <p>Reverse reverses the elements of the slice in place. </p> <h4 id="example_Reverse"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">names := []string{"alice", "Bob", "VERA"}
+slices.Reverse(names)
+fmt.Println(names)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[VERA Bob alice]
+</pre> <h2 id="Sort">func <span>Sort</span> </h2> <pre data-language="go">func Sort[S ~[]E, E cmp.Ordered](x S)</pre> <p>Sort sorts a slice of any ordered type in ascending order. When sorting floating-point numbers, NaNs are ordered before other values. </p> <h4 id="example_Sort"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">smallInts := []int8{0, 42, -10, 8}
+slices.Sort(smallInts)
+fmt.Println(smallInts)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[-10 0 8 42]
+</pre> <h2 id="SortFunc">func <span>SortFunc</span> </h2> <pre data-language="go">func SortFunc[S ~[]E, E any](x S, cmp func(a, b E) int)</pre> <p>SortFunc sorts the slice x in ascending order as determined by the cmp function. This sort is not guaranteed to be stable. cmp(a, b) should return a negative number when a &lt; b, a positive number when a &gt; b and zero when a == b. </p>
+<p>SortFunc requires that cmp is a strict weak ordering. See <a href="https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings">https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings</a>. </p> <h4 id="example_SortFunc_caseInsensitive"> <span class="text">Example (CaseInsensitive)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">names := []string{"Bob", "alice", "VERA"}
+slices.SortFunc(names, func(a, b string) int {
+ return cmp.Compare(strings.ToLower(a), strings.ToLower(b))
+})
+fmt.Println(names)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[alice Bob VERA]
+</pre> <h4 id="example_SortFunc_multiField"> <span class="text">Example (MultiField)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type Person struct {
+ Name string
+ Age int
+}
+people := []Person{
+ {"Gopher", 13},
+ {"Alice", 55},
+ {"Bob", 24},
+ {"Alice", 20},
+}
+slices.SortFunc(people, func(a, b Person) int {
+ if n := cmp.Compare(a.Name, b.Name); n != 0 {
+ return n
+ }
+ // If names are equal, order by age
+ return cmp.Compare(a.Age, b.Age)
+})
+fmt.Println(people)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[{Alice 20} {Alice 55} {Bob 24} {Gopher 13}]
+</pre> <h2 id="SortStableFunc">func <span>SortStableFunc</span> </h2> <pre data-language="go">func SortStableFunc[S ~[]E, E any](x S, cmp func(a, b E) int)</pre> <p>SortStableFunc sorts the slice x while keeping the original order of equal elements, using cmp to compare elements in the same way as <a href="#SortFunc">SortFunc</a>. </p> <h4 id="example_SortStableFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">type Person struct {
+ Name string
+ Age int
+}
+people := []Person{
+ {"Gopher", 13},
+ {"Alice", 20},
+ {"Bob", 24},
+ {"Alice", 55},
+}
+// Stable sort by name, keeping age ordering of Alices intact
+slices.SortStableFunc(people, func(a, b Person) int {
+ return cmp.Compare(a.Name, b.Name)
+})
+fmt.Println(people)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[{Alice 20} {Alice 55} {Bob 24} {Gopher 13}]
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/slices/" class="_attribution-link">http://golang.org/pkg/slices/</a>
+ </p>
+</div>
diff --git a/devdocs/go/sort%2Findex.html b/devdocs/go/sort%2Findex.html
new file mode 100644
index 00000000..3e37b155
--- /dev/null
+++ b/devdocs/go/sort%2Findex.html
@@ -0,0 +1,648 @@
+<h1> Package sort </h1> <ul id="short-nav">
+<li><code>import "sort"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package sort provides primitives for sorting slices and user-defined collections. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package sort_test
+
+import (
+ "fmt"
+ "sort"
+)
+
+type Person struct {
+ Name string
+ Age int
+}
+
+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
+
+func (a ByAge) Len() int { return len(a) }
+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 &lt; a[j].Age }
+
+func Example() {
+ people := []Person{
+ {"Bob", 31},
+ {"John", 42},
+ {"Michael", 17},
+ {"Jenny", 26},
+ }
+
+ fmt.Println(people)
+ // There are two ways to sort a slice. First, one can define
+ // a set of methods for the slice type, as with ByAge, and
+ // call sort.Sort. In this first example we use that technique.
+ sort.Sort(ByAge(people))
+ fmt.Println(people)
+
+ // The other way is to use sort.Slice with a custom Less
+ // function, which can be provided as a closure. In this
+ // case no methods are needed. (And if they exist, they
+ // are ignored.) Here we re-sort in reverse order: compare
+ // the closure with ByAge.Less.
+ sort.Slice(people, func(i, j int) bool {
+ return people[i].Age &gt; people[j].Age
+ })
+ fmt.Println(people)
+
+ // Output:
+ // [Bob: 31 John: 42 Michael: 17 Jenny: 26]
+ // [Michael: 17 Jenny: 26 Bob: 31 John: 42]
+ // [John: 42 Bob: 31 Jenny: 26 Michael: 17]
+}
+</pre> <h4 id="example__sortKeys"> <span class="text">Example (SortKeys)</span>
+</h4> <p>ExampleSortKeys demonstrates a technique for sorting a struct type using programmable sort criteria. </p> <p>Code:</p> <pre class="code" data-language="go">package sort_test
+
+import (
+ "fmt"
+ "sort"
+)
+
+// A couple of type definitions to make the units clear.
+type earthMass float64
+type au float64
+
+// A Planet defines the properties of a solar system object.
+type Planet struct {
+ name string
+ mass earthMass
+ distance au
+}
+
+// By is the type of a "less" function that defines the ordering of its Planet arguments.
+type By func(p1, p2 *Planet) bool
+
+// Sort is a method on the function type, By, that sorts the argument slice according to the function.
+func (by By) Sort(planets []Planet) {
+ ps := &amp;planetSorter{
+ planets: planets,
+ by: by, // The Sort method's receiver is the function (closure) that defines the sort order.
+ }
+ sort.Sort(ps)
+}
+
+// planetSorter joins a By function and a slice of Planets to be sorted.
+type planetSorter struct {
+ planets []Planet
+ by func(p1, p2 *Planet) bool // Closure used in the Less method.
+}
+
+// Len is part of sort.Interface.
+func (s *planetSorter) Len() int {
+ return len(s.planets)
+}
+
+// Swap is part of sort.Interface.
+func (s *planetSorter) Swap(i, j int) {
+ s.planets[i], s.planets[j] = s.planets[j], s.planets[i]
+}
+
+// Less is part of sort.Interface. It is implemented by calling the "by" closure in the sorter.
+func (s *planetSorter) Less(i, j int) bool {
+ return s.by(&amp;s.planets[i], &amp;s.planets[j])
+}
+
+var planets = []Planet{
+ {"Mercury", 0.055, 0.4},
+ {"Venus", 0.815, 0.7},
+ {"Earth", 1.0, 1.0},
+ {"Mars", 0.107, 1.5},
+}
+
+// ExampleSortKeys demonstrates a technique for sorting a struct type using programmable sort criteria.
+func Example_sortKeys() {
+ // Closures that order the Planet structure.
+ name := func(p1, p2 *Planet) bool {
+ return p1.name &lt; p2.name
+ }
+ mass := func(p1, p2 *Planet) bool {
+ return p1.mass &lt; p2.mass
+ }
+ distance := func(p1, p2 *Planet) bool {
+ return p1.distance &lt; p2.distance
+ }
+ decreasingDistance := func(p1, p2 *Planet) bool {
+ return distance(p2, p1)
+ }
+
+ // Sort the planets by the various criteria.
+ By(name).Sort(planets)
+ fmt.Println("By name:", planets)
+
+ By(mass).Sort(planets)
+ fmt.Println("By mass:", planets)
+
+ By(distance).Sort(planets)
+ fmt.Println("By distance:", planets)
+
+ By(decreasingDistance).Sort(planets)
+ fmt.Println("By decreasing distance:", planets)
+
+ // Output: By name: [{Earth 1 1} {Mars 0.107 1.5} {Mercury 0.055 0.4} {Venus 0.815 0.7}]
+ // By mass: [{Mercury 0.055 0.4} {Mars 0.107 1.5} {Venus 0.815 0.7} {Earth 1 1}]
+ // By distance: [{Mercury 0.055 0.4} {Venus 0.815 0.7} {Earth 1 1} {Mars 0.107 1.5}]
+ // By decreasing distance: [{Mars 0.107 1.5} {Earth 1 1} {Venus 0.815 0.7} {Mercury 0.055 0.4}]
+}
+</pre> <h4 id="example__sortMultiKeys"> <span class="text">Example (SortMultiKeys)</span>
+</h4> <p>ExampleMultiKeys demonstrates a technique for sorting a struct type using different sets of multiple fields in the comparison. We chain together "Less" functions, each of which compares a single field. </p> <p>Code:</p> <pre class="code" data-language="go">package sort_test
+
+import (
+ "fmt"
+ "sort"
+)
+
+// A Change is a record of source code changes, recording user, language, and delta size.
+type Change struct {
+ user string
+ language string
+ lines int
+}
+
+type lessFunc func(p1, p2 *Change) bool
+
+// multiSorter implements the Sort interface, sorting the changes within.
+type multiSorter struct {
+ changes []Change
+ less []lessFunc
+}
+
+// Sort sorts the argument slice according to the less functions passed to OrderedBy.
+func (ms *multiSorter) Sort(changes []Change) {
+ ms.changes = changes
+ sort.Sort(ms)
+}
+
+// OrderedBy returns a Sorter that sorts using the less functions, in order.
+// Call its Sort method to sort the data.
+func OrderedBy(less ...lessFunc) *multiSorter {
+ return &amp;multiSorter{
+ less: less,
+ }
+}
+
+// Len is part of sort.Interface.
+func (ms *multiSorter) Len() int {
+ return len(ms.changes)
+}
+
+// Swap is part of sort.Interface.
+func (ms *multiSorter) Swap(i, j int) {
+ ms.changes[i], ms.changes[j] = ms.changes[j], ms.changes[i]
+}
+
+// Less is part of sort.Interface. It is implemented by looping along the
+// less functions until it finds a comparison that discriminates between
+// the two items (one is less than the other). Note that it can call the
+// less functions twice per call. We could change the functions to return
+// -1, 0, 1 and reduce the number of calls for greater efficiency: an
+// exercise for the reader.
+func (ms *multiSorter) Less(i, j int) bool {
+ p, q := &amp;ms.changes[i], &amp;ms.changes[j]
+ // Try all but the last comparison.
+ var k int
+ for k = 0; k &lt; len(ms.less)-1; k++ {
+ less := ms.less[k]
+ switch {
+ case less(p, q):
+ // p &lt; q, so we have a decision.
+ return true
+ case less(q, p):
+ // p &gt; q, so we have a decision.
+ return false
+ }
+ // p == q; try the next comparison.
+ }
+ // All comparisons to here said "equal", so just return whatever
+ // the final comparison reports.
+ return ms.less[k](p, q)
+}
+
+var changes = []Change{
+ {"gri", "Go", 100},
+ {"ken", "C", 150},
+ {"glenda", "Go", 200},
+ {"rsc", "Go", 200},
+ {"r", "Go", 100},
+ {"ken", "Go", 200},
+ {"dmr", "C", 100},
+ {"r", "C", 150},
+ {"gri", "Smalltalk", 80},
+}
+
+// ExampleMultiKeys demonstrates a technique for sorting a struct type using different
+// sets of multiple fields in the comparison. We chain together "Less" functions, each of
+// which compares a single field.
+func Example_sortMultiKeys() {
+ // Closures that order the Change structure.
+ user := func(c1, c2 *Change) bool {
+ return c1.user &lt; c2.user
+ }
+ language := func(c1, c2 *Change) bool {
+ return c1.language &lt; c2.language
+ }
+ increasingLines := func(c1, c2 *Change) bool {
+ return c1.lines &lt; c2.lines
+ }
+ decreasingLines := func(c1, c2 *Change) bool {
+ return c1.lines &gt; c2.lines // Note: &gt; orders downwards.
+ }
+
+ // Simple use: Sort by user.
+ OrderedBy(user).Sort(changes)
+ fmt.Println("By user:", changes)
+
+ // More examples.
+ OrderedBy(user, increasingLines).Sort(changes)
+ fmt.Println("By user,&lt;lines:", changes)
+
+ OrderedBy(user, decreasingLines).Sort(changes)
+ fmt.Println("By user,&gt;lines:", changes)
+
+ OrderedBy(language, increasingLines).Sort(changes)
+ fmt.Println("By language,&lt;lines:", changes)
+
+ OrderedBy(language, increasingLines, user).Sort(changes)
+ fmt.Println("By language,&lt;lines,user:", changes)
+
+ // Output:
+ // By user: [{dmr C 100} {glenda Go 200} {gri Go 100} {gri Smalltalk 80} {ken C 150} {ken Go 200} {r Go 100} {r C 150} {rsc Go 200}]
+ // By user,&lt;lines: [{dmr C 100} {glenda Go 200} {gri Smalltalk 80} {gri Go 100} {ken C 150} {ken Go 200} {r Go 100} {r C 150} {rsc Go 200}]
+ // By user,&gt;lines: [{dmr C 100} {glenda Go 200} {gri Go 100} {gri Smalltalk 80} {ken Go 200} {ken C 150} {r C 150} {r Go 100} {rsc Go 200}]
+ // By language,&lt;lines: [{dmr C 100} {ken C 150} {r C 150} {gri Go 100} {r Go 100} {glenda Go 200} {ken Go 200} {rsc Go 200} {gri Smalltalk 80}]
+ // By language,&lt;lines,user: [{dmr C 100} {ken C 150} {r C 150} {gri Go 100} {r Go 100} {glenda Go 200} {ken Go 200} {rsc Go 200} {gri Smalltalk 80}]
+
+}
+</pre> <h4 id="example__sortWrapper"> <span class="text">Example (SortWrapper)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package sort_test
+
+import (
+ "fmt"
+ "sort"
+)
+
+type Grams int
+
+func (g Grams) String() string { return fmt.Sprintf("%dg", int(g)) }
+
+type Organ struct {
+ Name string
+ Weight Grams
+}
+
+type Organs []*Organ
+
+func (s Organs) Len() int { return len(s) }
+func (s Organs) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
+
+// ByName implements sort.Interface by providing Less and using the Len and
+// Swap methods of the embedded Organs value.
+type ByName struct{ Organs }
+
+func (s ByName) Less(i, j int) bool { return s.Organs[i].Name &lt; s.Organs[j].Name }
+
+// ByWeight implements sort.Interface by providing Less and using the Len and
+// Swap methods of the embedded Organs value.
+type ByWeight struct{ Organs }
+
+func (s ByWeight) Less(i, j int) bool { return s.Organs[i].Weight &lt; s.Organs[j].Weight }
+
+func Example_sortWrapper() {
+ s := []*Organ{
+ {"brain", 1340},
+ {"heart", 290},
+ {"liver", 1494},
+ {"pancreas", 131},
+ {"prostate", 62},
+ {"spleen", 162},
+ }
+
+ sort.Sort(ByWeight{s})
+ fmt.Println("Organs by weight:")
+ printOrgans(s)
+
+ sort.Sort(ByName{s})
+ fmt.Println("Organs by name:")
+ printOrgans(s)
+
+ // Output:
+ // Organs by weight:
+ // prostate (62g)
+ // pancreas (131g)
+ // spleen (162g)
+ // heart (290g)
+ // brain (1340g)
+ // liver (1494g)
+ // Organs by name:
+ // brain (1340g)
+ // heart (290g)
+ // liver (1494g)
+ // pancreas (131g)
+ // prostate (62g)
+ // spleen (162g)
+}
+
+func printOrgans(s []*Organ) {
+ for _, o := range s {
+ fmt.Printf("%-8s (%v)\n", o.Name, o.Weight)
+ }
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Find">func Find(n int, cmp func(int) int) (i int, found bool)</a></li>
+<li><a href="#Float64s">func Float64s(x []float64)</a></li>
+<li><a href="#Float64sAreSorted">func Float64sAreSorted(x []float64) bool</a></li>
+<li><a href="#Ints">func Ints(x []int)</a></li>
+<li><a href="#IntsAreSorted">func IntsAreSorted(x []int) bool</a></li>
+<li><a href="#IsSorted">func IsSorted(data Interface) bool</a></li>
+<li><a href="#Search">func Search(n int, f func(int) bool) int</a></li>
+<li><a href="#SearchFloat64s">func SearchFloat64s(a []float64, x float64) int</a></li>
+<li><a href="#SearchInts">func SearchInts(a []int, x int) int</a></li>
+<li><a href="#SearchStrings">func SearchStrings(a []string, x string) int</a></li>
+<li><a href="#Slice">func Slice(x any, less func(i, j int) bool)</a></li>
+<li><a href="#SliceIsSorted">func SliceIsSorted(x any, less func(i, j int) bool) bool</a></li>
+<li><a href="#SliceStable">func SliceStable(x any, less func(i, j int) bool)</a></li>
+<li><a href="#Sort">func Sort(data Interface)</a></li>
+<li><a href="#Stable">func Stable(data Interface)</a></li>
+<li><a href="#Strings">func Strings(x []string)</a></li>
+<li><a href="#StringsAreSorted">func StringsAreSorted(x []string) bool</a></li>
+<li><a href="#Float64Slice">type Float64Slice</a></li>
+<li> <a href="#Float64Slice.Len">func (x Float64Slice) Len() int</a>
+</li>
+<li> <a href="#Float64Slice.Less">func (x Float64Slice) Less(i, j int) bool</a>
+</li>
+<li> <a href="#Float64Slice.Search">func (p Float64Slice) Search(x float64) int</a>
+</li>
+<li> <a href="#Float64Slice.Sort">func (x Float64Slice) Sort()</a>
+</li>
+<li> <a href="#Float64Slice.Swap">func (x Float64Slice) Swap(i, j int)</a>
+</li>
+<li><a href="#IntSlice">type IntSlice</a></li>
+<li> <a href="#IntSlice.Len">func (x IntSlice) Len() int</a>
+</li>
+<li> <a href="#IntSlice.Less">func (x IntSlice) Less(i, j int) bool</a>
+</li>
+<li> <a href="#IntSlice.Search">func (p IntSlice) Search(x int) int</a>
+</li>
+<li> <a href="#IntSlice.Sort">func (x IntSlice) Sort()</a>
+</li>
+<li> <a href="#IntSlice.Swap">func (x IntSlice) Swap(i, j int)</a>
+</li>
+<li><a href="#Interface">type Interface</a></li>
+<li> <a href="#Reverse">func Reverse(data Interface) Interface</a>
+</li>
+<li><a href="#StringSlice">type StringSlice</a></li>
+<li> <a href="#StringSlice.Len">func (x StringSlice) Len() int</a>
+</li>
+<li> <a href="#StringSlice.Less">func (x StringSlice) Less(i, j int) bool</a>
+</li>
+<li> <a href="#StringSlice.Search">func (p StringSlice) Search(x string) int</a>
+</li>
+<li> <a href="#StringSlice.Sort">func (x StringSlice) Sort()</a>
+</li>
+<li> <a href="#StringSlice.Swap">func (x StringSlice) Swap(i, j int)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example_Float64s">Float64s</a></dd> <dd><a class="exampleLink" href="#example_Float64sAreSorted">Float64sAreSorted</a></dd> <dd><a class="exampleLink" href="#example_Ints">Ints</a></dd> <dd><a class="exampleLink" href="#example_IntsAreSorted">IntsAreSorted</a></dd> <dd><a class="exampleLink" href="#example_Reverse">Reverse</a></dd> <dd><a class="exampleLink" href="#example_Search">Search</a></dd> <dd><a class="exampleLink" href="#example_SearchFloat64s">SearchFloat64s</a></dd> <dd><a class="exampleLink" href="#example_SearchInts">SearchInts</a></dd> <dd><a class="exampleLink" href="#example_Search_descendingOrder">Search (DescendingOrder)</a></dd> <dd><a class="exampleLink" href="#example_Slice">Slice</a></dd> <dd><a class="exampleLink" href="#example_SliceStable">SliceStable</a></dd> <dd><a class="exampleLink" href="#example_Strings">Strings</a></dd> <dd><a class="exampleLink" href="#example__sortKeys">Package (SortKeys)</a></dd> <dd><a class="exampleLink" href="#example__sortMultiKeys">Package (SortMultiKeys)</a></dd> <dd><a class="exampleLink" href="#example__sortWrapper">Package (SortWrapper)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>search.go</span> <span>slice.go</span> <span>sort.go</span> <span>sort_impl_go121.go</span> <span>zsortfunc.go</span> <span>zsortinterface.go</span> </p> <h2 id="Find">func <span>Find</span> <span title="Added in Go 1.19">1.19</span> </h2> <pre data-language="go">func Find(n int, cmp func(int) int) (i int, found bool)</pre> <p>Find uses binary search to find and return the smallest index i in [0, n) at which cmp(i) &lt;= 0. If there is no such index i, Find returns i = n. The found result is true if i &lt; n and cmp(i) == 0. Find calls cmp(i) only for i in the range [0, n). </p>
+<p>To permit binary search, Find requires that cmp(i) &gt; 0 for a leading prefix of the range, cmp(i) == 0 in the middle, and cmp(i) &lt; 0 for the final suffix of the range. (Each subrange could be empty.) The usual way to establish this condition is to interpret cmp(i) as a comparison of a desired target value t against entry i in an underlying indexed data structure x, returning &lt;0, 0, and &gt;0 when t &lt; x[i], t == x[i], and t &gt; x[i], respectively. </p>
+<p>For example, to look for a particular string in a sorted, random-access list of strings: </p>
+<pre data-language="go">i, found := sort.Find(x.Len(), func(i int) int {
+ return strings.Compare(target, x.At(i))
+})
+if found {
+ fmt.Printf("found %s at entry %d\n", target, i)
+} else {
+ fmt.Printf("%s not found, would insert at %d", target, i)
+}
+</pre> <h2 id="Float64s">func <span>Float64s</span> </h2> <pre data-language="go">func Float64s(x []float64)</pre> <p>Float64s sorts a slice of float64s in increasing order. Not-a-number (NaN) values are ordered before other values. </p>
+<p>Note: as of Go 1.22, this function simply calls <span>slices.Sort</span>. </p> <h4 id="example_Float64s"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := []float64{5.2, -1.3, 0.7, -3.8, 2.6} // unsorted
+sort.Float64s(s)
+fmt.Println(s)
+
+s = []float64{math.Inf(1), math.NaN(), math.Inf(-1), 0.0} // unsorted
+sort.Float64s(s)
+fmt.Println(s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">[-3.8 -1.3 0.7 2.6 5.2]
+[NaN -Inf 0 +Inf]
+</pre> <h2 id="Float64sAreSorted">func <span>Float64sAreSorted</span> </h2> <pre data-language="go">func Float64sAreSorted(x []float64) bool</pre> <p>Float64sAreSorted reports whether the slice x is sorted in increasing order, with not-a-number (NaN) values before any other values. </p>
+<p>Note: as of Go 1.22, this function simply calls <span>slices.IsSorted</span>. </p> <h4 id="example_Float64sAreSorted"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := []float64{0.7, 1.3, 2.6, 3.8, 5.2} // sorted ascending
+fmt.Println(sort.Float64sAreSorted(s))
+
+s = []float64{5.2, 3.8, 2.6, 1.3, 0.7} // sorted descending
+fmt.Println(sort.Float64sAreSorted(s))
+
+s = []float64{5.2, 1.3, 0.7, 3.8, 2.6} // unsorted
+fmt.Println(sort.Float64sAreSorted(s))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+false
+</pre> <h2 id="Ints">func <span>Ints</span> </h2> <pre data-language="go">func Ints(x []int)</pre> <p>Ints sorts a slice of ints in increasing order. </p>
+<p>Note: as of Go 1.22, this function simply calls <span>slices.Sort</span>. </p> <h4 id="example_Ints"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := []int{5, 2, 6, 3, 1, 4} // unsorted
+sort.Ints(s)
+fmt.Println(s)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[1 2 3 4 5 6]
+</pre> <h2 id="IntsAreSorted">func <span>IntsAreSorted</span> </h2> <pre data-language="go">func IntsAreSorted(x []int) bool</pre> <p>IntsAreSorted reports whether the slice x is sorted in increasing order. </p>
+<p>Note: as of Go 1.22, this function simply calls <span>slices.IsSorted</span>. </p> <h4 id="example_IntsAreSorted"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := []int{1, 2, 3, 4, 5, 6} // sorted ascending
+fmt.Println(sort.IntsAreSorted(s))
+
+s = []int{6, 5, 4, 3, 2, 1} // sorted descending
+fmt.Println(sort.IntsAreSorted(s))
+
+s = []int{3, 2, 4, 1, 5} // unsorted
+fmt.Println(sort.IntsAreSorted(s))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+false
+</pre> <h2 id="IsSorted">func <span>IsSorted</span> </h2> <pre data-language="go">func IsSorted(data Interface) bool</pre> <p>IsSorted reports whether data is sorted. </p>
+<p>Note: in many situations, the newer <span>slices.IsSortedFunc</span> function is more ergonomic and runs faster. </p>
+<h2 id="Search">func <span>Search</span> </h2> <pre data-language="go">func Search(n int, f func(int) bool) int</pre> <p>Search uses binary search to find and return the smallest index i in [0, n) at which f(i) is true, assuming that on the range [0, n), f(i) == true implies f(i+1) == true. That is, Search requires that f is false for some (possibly empty) prefix of the input range [0, n) and then true for the (possibly empty) remainder; Search returns the first true index. If there is no such index, Search returns n. (Note that the "not found" return value is not -1 as in, for instance, strings.Index.) Search calls f(i) only for i in the range [0, n). </p>
+<p>A common use of Search is to find the index i for a value x in a sorted, indexable data structure such as an array or slice. In this case, the argument f, typically a closure, captures the value to be searched for, and how the data structure is indexed and ordered. </p>
+<p>For instance, given a slice data sorted in ascending order, the call Search(len(data), func(i int) bool { return data[i] &gt;= 23 }) returns the smallest index i such that data[i] &gt;= 23. If the caller wants to find whether 23 is in the slice, it must test data[i] == 23 separately. </p>
+<p>Searching data sorted in descending order would use the &lt;= operator instead of the &gt;= operator. </p>
+<p>To complete the example above, the following code tries to find the value x in an integer slice data sorted in ascending order: </p>
+<pre data-language="go">x := 23
+i := sort.Search(len(data), func(i int) bool { return data[i] &gt;= x })
+if i &lt; len(data) &amp;&amp; data[i] == x {
+ // x is present at data[i]
+} else {
+ // x is not present in data,
+ // but i is the index where it would be inserted.
+}
+</pre> <p>As a more whimsical example, this program guesses your number: </p>
+<pre data-language="go">func GuessingGame() {
+ var s string
+ fmt.Printf("Pick an integer from 0 to 100.\n")
+ answer := sort.Search(100, func(i int) bool {
+ fmt.Printf("Is your number &lt;= %d? ", i)
+ fmt.Scanf("%s", &amp;s)
+ return s != "" &amp;&amp; s[0] == 'y'
+ })
+ fmt.Printf("Your number is %d.\n", answer)
+}
+</pre> <h4 id="example_Search"> <span class="text">Example</span>
+</h4> <p>This example demonstrates searching a list sorted in ascending order. </p> <p>Code:</p> <pre class="code" data-language="go">a := []int{1, 3, 6, 10, 15, 21, 28, 36, 45, 55}
+x := 6
+
+i := sort.Search(len(a), func(i int) bool { return a[i] &gt;= x })
+if i &lt; len(a) &amp;&amp; a[i] == x {
+ fmt.Printf("found %d at index %d in %v\n", x, i, a)
+} else {
+ fmt.Printf("%d not found in %v\n", x, a)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">found 6 at index 2 in [1 3 6 10 15 21 28 36 45 55]
+</pre> <h4 id="example_Search_descendingOrder"> <span class="text">Example (DescendingOrder)</span>
+</h4> <p>This example demonstrates searching a list sorted in descending order. The approach is the same as searching a list in ascending order, but with the condition inverted. </p> <p>Code:</p> <pre class="code" data-language="go">a := []int{55, 45, 36, 28, 21, 15, 10, 6, 3, 1}
+x := 6
+
+i := sort.Search(len(a), func(i int) bool { return a[i] &lt;= x })
+if i &lt; len(a) &amp;&amp; a[i] == x {
+ fmt.Printf("found %d at index %d in %v\n", x, i, a)
+} else {
+ fmt.Printf("%d not found in %v\n", x, a)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">found 6 at index 7 in [55 45 36 28 21 15 10 6 3 1]
+</pre> <h2 id="SearchFloat64s">func <span>SearchFloat64s</span> </h2> <pre data-language="go">func SearchFloat64s(a []float64, x float64) int</pre> <p>SearchFloat64s searches for x in a sorted slice of float64s and returns the index as specified by <a href="#Search">Search</a>. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order. </p> <h4 id="example_SearchFloat64s"> <span class="text">Example</span>
+</h4> <p>This example demonstrates searching for float64 in a list sorted in ascending order. </p> <p>Code:</p> <pre class="code" data-language="go">a := []float64{1.0, 2.0, 3.3, 4.6, 6.1, 7.2, 8.0}
+
+x := 2.0
+i := sort.SearchFloat64s(a, x)
+fmt.Printf("found %g at index %d in %v\n", x, i, a)
+
+x = 0.5
+i = sort.SearchFloat64s(a, x)
+fmt.Printf("%g not found, can be inserted at index %d in %v\n", x, i, a)
+</pre> <p>Output:</p> <pre class="output" data-language="go">found 2 at index 1 in [1 2 3.3 4.6 6.1 7.2 8]
+0.5 not found, can be inserted at index 0 in [1 2 3.3 4.6 6.1 7.2 8]
+</pre> <h2 id="SearchInts">func <span>SearchInts</span> </h2> <pre data-language="go">func SearchInts(a []int, x int) int</pre> <p>SearchInts searches for x in a sorted slice of ints and returns the index as specified by <a href="#Search">Search</a>. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order. </p> <h4 id="example_SearchInts"> <span class="text">Example</span>
+</h4> <p>This example demonstrates searching for int in a list sorted in ascending order. </p> <p>Code:</p> <pre class="code" data-language="go">a := []int{1, 2, 3, 4, 6, 7, 8}
+
+x := 2
+i := sort.SearchInts(a, x)
+fmt.Printf("found %d at index %d in %v\n", x, i, a)
+
+x = 5
+i = sort.SearchInts(a, x)
+fmt.Printf("%d not found, can be inserted at index %d in %v\n", x, i, a)
+</pre> <p>Output:</p> <pre class="output" data-language="go">found 2 at index 1 in [1 2 3 4 6 7 8]
+5 not found, can be inserted at index 4 in [1 2 3 4 6 7 8]
+</pre> <h2 id="SearchStrings">func <span>SearchStrings</span> </h2> <pre data-language="go">func SearchStrings(a []string, x string) int</pre> <p>SearchStrings searches for x in a sorted slice of strings and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order. </p>
+<h2 id="Slice">func <span>Slice</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func Slice(x any, less func(i, j int) bool)</pre> <p>Slice sorts the slice x given the provided less function. It panics if x is not a slice. </p>
+<p>The sort is not guaranteed to be stable: equal elements may be reversed from their original order. For a stable sort, use <a href="#SliceStable">SliceStable</a>. </p>
+<p>The less function must satisfy the same requirements as the Interface type's Less method. </p>
+<p>Note: in many situations, the newer <span>slices.SortFunc</span> function is more ergonomic and runs faster. </p> <h4 id="example_Slice"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">people := []struct {
+ Name string
+ Age int
+}{
+ {"Gopher", 7},
+ {"Alice", 55},
+ {"Vera", 24},
+ {"Bob", 75},
+}
+sort.Slice(people, func(i, j int) bool { return people[i].Name &lt; people[j].Name })
+fmt.Println("By name:", people)
+
+sort.Slice(people, func(i, j int) bool { return people[i].Age &lt; people[j].Age })
+fmt.Println("By age:", people)
+</pre> <p>Output:</p> <pre class="output" data-language="go">By name: [{Alice 55} {Bob 75} {Gopher 7} {Vera 24}]
+By age: [{Gopher 7} {Vera 24} {Alice 55} {Bob 75}]
+</pre> <h2 id="SliceIsSorted">func <span>SliceIsSorted</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func SliceIsSorted(x any, less func(i, j int) bool) bool</pre> <p>SliceIsSorted reports whether the slice x is sorted according to the provided less function. It panics if x is not a slice. </p>
+<p>Note: in many situations, the newer <span>slices.IsSortedFunc</span> function is more ergonomic and runs faster. </p>
+<h2 id="SliceStable">func <span>SliceStable</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func SliceStable(x any, less func(i, j int) bool)</pre> <p>SliceStable sorts the slice x using the provided less function, keeping equal elements in their original order. It panics if x is not a slice. </p>
+<p>The less function must satisfy the same requirements as the Interface type's Less method. </p>
+<p>Note: in many situations, the newer <span>slices.SortStableFunc</span> function is more ergonomic and runs faster. </p> <h4 id="example_SliceStable"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">people := []struct {
+ Name string
+ Age int
+}{
+ {"Alice", 25},
+ {"Elizabeth", 75},
+ {"Alice", 75},
+ {"Bob", 75},
+ {"Alice", 75},
+ {"Bob", 25},
+ {"Colin", 25},
+ {"Elizabeth", 25},
+}
+
+// Sort by name, preserving original order
+sort.SliceStable(people, func(i, j int) bool { return people[i].Name &lt; people[j].Name })
+fmt.Println("By name:", people)
+
+// Sort by age preserving name order
+sort.SliceStable(people, func(i, j int) bool { return people[i].Age &lt; people[j].Age })
+fmt.Println("By age,name:", people)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">By name: [{Alice 25} {Alice 75} {Alice 75} {Bob 75} {Bob 25} {Colin 25} {Elizabeth 75} {Elizabeth 25}]
+By age,name: [{Alice 25} {Bob 25} {Colin 25} {Elizabeth 25} {Alice 75} {Alice 75} {Bob 75} {Elizabeth 75}]
+</pre> <h2 id="Sort">func <span>Sort</span> </h2> <pre data-language="go">func Sort(data Interface)</pre> <p>Sort sorts data in ascending order as determined by the Less method. It makes one call to data.Len to determine n and O(n*log(n)) calls to data.Less and data.Swap. The sort is not guaranteed to be stable. </p>
+<p>Note: in many situations, the newer <span>slices.SortFunc</span> function is more ergonomic and runs faster. </p>
+<h2 id="Stable">func <span>Stable</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Stable(data Interface)</pre> <p>Stable sorts data in ascending order as determined by the Less method, while keeping the original order of equal elements. </p>
+<p>It makes one call to data.Len to determine n, O(n*log(n)) calls to data.Less and O(n*log(n)*log(n)) calls to data.Swap. </p>
+<p>Note: in many situations, the newer slices.SortStableFunc function is more ergonomic and runs faster. </p>
+<h2 id="Strings">func <span>Strings</span> </h2> <pre data-language="go">func Strings(x []string)</pre> <p>Strings sorts a slice of strings in increasing order. </p>
+<p>Note: as of Go 1.22, this function simply calls <span>slices.Sort</span>. </p> <h4 id="example_Strings"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := []string{"Go", "Bravo", "Gopher", "Alpha", "Grin", "Delta"}
+sort.Strings(s)
+fmt.Println(s)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[Alpha Bravo Delta Go Gopher Grin]
+</pre> <h2 id="StringsAreSorted">func <span>StringsAreSorted</span> </h2> <pre data-language="go">func StringsAreSorted(x []string) bool</pre> <p>StringsAreSorted reports whether the slice x is sorted in increasing order. </p>
+<p>Note: as of Go 1.22, this function simply calls <span>slices.IsSorted</span>. </p>
+<h2 id="Float64Slice">type <span>Float64Slice</span> </h2> <p>Float64Slice implements Interface for a []float64, sorting in increasing order, with not-a-number (NaN) values ordered before other values. </p>
+<pre data-language="go">type Float64Slice []float64</pre> <h3 id="Float64Slice.Len">func (Float64Slice) <span>Len</span> </h3> <pre data-language="go">func (x Float64Slice) Len() int</pre> <h3 id="Float64Slice.Less">func (Float64Slice) <span>Less</span> </h3> <pre data-language="go">func (x Float64Slice) Less(i, j int) bool</pre> <p>Less reports whether x[i] should be ordered before x[j], as required by the sort Interface. Note that floating-point comparison by itself is not a transitive relation: it does not report a consistent ordering for not-a-number (NaN) values. This implementation of Less places NaN values before any others, by using: </p>
+<pre data-language="go">x[i] &lt; x[j] || (math.IsNaN(x[i]) &amp;&amp; !math.IsNaN(x[j]))
+</pre> <h3 id="Float64Slice.Search">func (Float64Slice) <span>Search</span> </h3> <pre data-language="go">func (p Float64Slice) Search(x float64) int</pre> <p>Search returns the result of applying <a href="#SearchFloat64s">SearchFloat64s</a> to the receiver and x. </p>
+<h3 id="Float64Slice.Sort">func (Float64Slice) <span>Sort</span> </h3> <pre data-language="go">func (x Float64Slice) Sort()</pre> <p>Sort is a convenience method: x.Sort() calls Sort(x). </p>
+<h3 id="Float64Slice.Swap">func (Float64Slice) <span>Swap</span> </h3> <pre data-language="go">func (x Float64Slice) Swap(i, j int)</pre> <h2 id="IntSlice">type <span>IntSlice</span> </h2> <p>IntSlice attaches the methods of Interface to []int, sorting in increasing order. </p>
+<pre data-language="go">type IntSlice []int</pre> <h3 id="IntSlice.Len">func (IntSlice) <span>Len</span> </h3> <pre data-language="go">func (x IntSlice) Len() int</pre> <h3 id="IntSlice.Less">func (IntSlice) <span>Less</span> </h3> <pre data-language="go">func (x IntSlice) Less(i, j int) bool</pre> <h3 id="IntSlice.Search">func (IntSlice) <span>Search</span> </h3> <pre data-language="go">func (p IntSlice) Search(x int) int</pre> <p>Search returns the result of applying <a href="#SearchInts">SearchInts</a> to the receiver and x. </p>
+<h3 id="IntSlice.Sort">func (IntSlice) <span>Sort</span> </h3> <pre data-language="go">func (x IntSlice) Sort()</pre> <p>Sort is a convenience method: x.Sort() calls Sort(x). </p>
+<h3 id="IntSlice.Swap">func (IntSlice) <span>Swap</span> </h3> <pre data-language="go">func (x IntSlice) Swap(i, j int)</pre> <h2 id="Interface">type <span>Interface</span> </h2> <p>An implementation of Interface can be sorted by the routines in this package. The methods refer to elements of the underlying collection by integer index. </p>
+<pre data-language="go">type Interface interface {
+ // Len is the number of elements in the collection.
+ Len() int
+
+ // Less reports whether the element with index i
+ // must sort before the element with index j.
+ //
+ // If both Less(i, j) and Less(j, i) are false,
+ // then the elements at index i and j are considered equal.
+ // Sort may place equal elements in any order in the final result,
+ // while Stable preserves the original input order of equal elements.
+ //
+ // Less must describe a transitive ordering:
+ // - if both Less(i, j) and Less(j, k) are true, then Less(i, k) must be true as well.
+ // - if both Less(i, j) and Less(j, k) are false, then Less(i, k) must be false as well.
+ //
+ // Note that floating-point comparison (the &lt; operator on float32 or float64 values)
+ // is not a transitive ordering when not-a-number (NaN) values are involved.
+ // See Float64Slice.Less for a correct implementation for floating-point values.
+ Less(i, j int) bool
+
+ // Swap swaps the elements with indexes i and j.
+ Swap(i, j int)
+}</pre> <h3 id="Reverse">func <span>Reverse</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func Reverse(data Interface) Interface</pre> <p>Reverse returns the reverse order for data. </p> <h4 id="example_Reverse"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := []int{5, 2, 6, 3, 1, 4} // unsorted
+sort.Sort(sort.Reverse(sort.IntSlice(s)))
+fmt.Println(s)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[6 5 4 3 2 1]
+</pre> <h2 id="StringSlice">type <span>StringSlice</span> </h2> <p>StringSlice attaches the methods of Interface to []string, sorting in increasing order. </p>
+<pre data-language="go">type StringSlice []string</pre> <h3 id="StringSlice.Len">func (StringSlice) <span>Len</span> </h3> <pre data-language="go">func (x StringSlice) Len() int</pre> <h3 id="StringSlice.Less">func (StringSlice) <span>Less</span> </h3> <pre data-language="go">func (x StringSlice) Less(i, j int) bool</pre> <h3 id="StringSlice.Search">func (StringSlice) <span>Search</span> </h3> <pre data-language="go">func (p StringSlice) Search(x string) int</pre> <p>Search returns the result of applying <a href="#SearchStrings">SearchStrings</a> to the receiver and x. </p>
+<h3 id="StringSlice.Sort">func (StringSlice) <span>Sort</span> </h3> <pre data-language="go">func (x StringSlice) Sort()</pre> <p>Sort is a convenience method: x.Sort() calls Sort(x). </p>
+<h3 id="StringSlice.Swap">func (StringSlice) <span>Swap</span> </h3> <pre data-language="go">func (x StringSlice) Swap(i, j int)</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/sort/" class="_attribution-link">http://golang.org/pkg/sort/</a>
+ </p>
+</div>
diff --git a/devdocs/go/strconv%2Findex.html b/devdocs/go/strconv%2Findex.html
new file mode 100644
index 00000000..eb7a5d97
--- /dev/null
+++ b/devdocs/go/strconv%2Findex.html
@@ -0,0 +1,449 @@
+<h1> Package strconv </h1> <ul id="short-nav">
+<li><code>import "strconv"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package strconv implements conversions to and from string representations of basic data types. </p>
+<h3 id="hdr-Numeric_Conversions">Numeric Conversions</h3> <p>The most common numeric conversions are Atoi (string to int) and Itoa (int to string). </p>
+<pre data-language="go">i, err := strconv.Atoi("-42")
+s := strconv.Itoa(-42)
+</pre> <p>These assume decimal and the Go int type. </p>
+<p><a href="#ParseBool">ParseBool</a>, <a href="#ParseFloat">ParseFloat</a>, <a href="#ParseInt">ParseInt</a>, and <a href="#ParseUint">ParseUint</a> convert strings to values: </p>
+<pre data-language="go">b, err := strconv.ParseBool("true")
+f, err := strconv.ParseFloat("3.1415", 64)
+i, err := strconv.ParseInt("-42", 10, 64)
+u, err := strconv.ParseUint("42", 10, 64)
+</pre> <p>The parse functions return the widest type (float64, int64, and uint64), but if the size argument specifies a narrower width the result can be converted to that narrower type without data loss: </p>
+<pre data-language="go">s := "2147483647" // biggest int32
+i64, err := strconv.ParseInt(s, 10, 32)
+...
+i := int32(i64)
+</pre> <p><a href="#FormatBool">FormatBool</a>, <a href="#FormatFloat">FormatFloat</a>, <a href="#FormatInt">FormatInt</a>, and <a href="#FormatUint">FormatUint</a> convert values to strings: </p>
+<pre data-language="go">s := strconv.FormatBool(true)
+s := strconv.FormatFloat(3.1415, 'E', -1, 64)
+s := strconv.FormatInt(-42, 16)
+s := strconv.FormatUint(42, 16)
+</pre> <p><a href="#AppendBool">AppendBool</a>, <a href="#AppendFloat">AppendFloat</a>, <a href="#AppendInt">AppendInt</a>, and <a href="#AppendUint">AppendUint</a> are similar but append the formatted value to a destination slice. </p>
+<h3 id="hdr-String_Conversions">String Conversions</h3> <p><a href="#Quote">Quote</a> and <a href="#QuoteToASCII">QuoteToASCII</a> convert strings to quoted Go string literals. The latter guarantees that the result is an ASCII string, by escaping any non-ASCII Unicode with \u: </p>
+<pre data-language="go">q := strconv.Quote("Hello, 世界")
+q := strconv.QuoteToASCII("Hello, 世界")
+</pre> <p><a href="#QuoteRune">QuoteRune</a> and <a href="#QuoteRuneToASCII">QuoteRuneToASCII</a> are similar but accept runes and return quoted Go rune literals. </p>
+<p><a href="#Unquote">Unquote</a> and <a href="#UnquoteChar">UnquoteChar</a> unquote Go string and rune literals. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#AppendBool">func AppendBool(dst []byte, b bool) []byte</a></li>
+<li><a href="#AppendFloat">func AppendFloat(dst []byte, f float64, fmt byte, prec, bitSize int) []byte</a></li>
+<li><a href="#AppendInt">func AppendInt(dst []byte, i int64, base int) []byte</a></li>
+<li><a href="#AppendQuote">func AppendQuote(dst []byte, s string) []byte</a></li>
+<li><a href="#AppendQuoteRune">func AppendQuoteRune(dst []byte, r rune) []byte</a></li>
+<li><a href="#AppendQuoteRuneToASCII">func AppendQuoteRuneToASCII(dst []byte, r rune) []byte</a></li>
+<li><a href="#AppendQuoteRuneToGraphic">func AppendQuoteRuneToGraphic(dst []byte, r rune) []byte</a></li>
+<li><a href="#AppendQuoteToASCII">func AppendQuoteToASCII(dst []byte, s string) []byte</a></li>
+<li><a href="#AppendQuoteToGraphic">func AppendQuoteToGraphic(dst []byte, s string) []byte</a></li>
+<li><a href="#AppendUint">func AppendUint(dst []byte, i uint64, base int) []byte</a></li>
+<li><a href="#Atoi">func Atoi(s string) (int, error)</a></li>
+<li><a href="#CanBackquote">func CanBackquote(s string) bool</a></li>
+<li><a href="#FormatBool">func FormatBool(b bool) string</a></li>
+<li><a href="#FormatComplex">func FormatComplex(c complex128, fmt byte, prec, bitSize int) string</a></li>
+<li><a href="#FormatFloat">func FormatFloat(f float64, fmt byte, prec, bitSize int) string</a></li>
+<li><a href="#FormatInt">func FormatInt(i int64, base int) string</a></li>
+<li><a href="#FormatUint">func FormatUint(i uint64, base int) string</a></li>
+<li><a href="#IsGraphic">func IsGraphic(r rune) bool</a></li>
+<li><a href="#IsPrint">func IsPrint(r rune) bool</a></li>
+<li><a href="#Itoa">func Itoa(i int) string</a></li>
+<li><a href="#ParseBool">func ParseBool(str string) (bool, error)</a></li>
+<li><a href="#ParseComplex">func ParseComplex(s string, bitSize int) (complex128, error)</a></li>
+<li><a href="#ParseFloat">func ParseFloat(s string, bitSize int) (float64, error)</a></li>
+<li><a href="#ParseInt">func ParseInt(s string, base int, bitSize int) (i int64, err error)</a></li>
+<li><a href="#ParseUint">func ParseUint(s string, base int, bitSize int) (uint64, error)</a></li>
+<li><a href="#Quote">func Quote(s string) string</a></li>
+<li><a href="#QuoteRune">func QuoteRune(r rune) string</a></li>
+<li><a href="#QuoteRuneToASCII">func QuoteRuneToASCII(r rune) string</a></li>
+<li><a href="#QuoteRuneToGraphic">func QuoteRuneToGraphic(r rune) string</a></li>
+<li><a href="#QuoteToASCII">func QuoteToASCII(s string) string</a></li>
+<li><a href="#QuoteToGraphic">func QuoteToGraphic(s string) string</a></li>
+<li><a href="#QuotedPrefix">func QuotedPrefix(s string) (string, error)</a></li>
+<li><a href="#Unquote">func Unquote(s string) (string, error)</a></li>
+<li><a href="#UnquoteChar">func UnquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error)</a></li>
+<li><a href="#NumError">type NumError</a></li>
+<li> <a href="#NumError.Error">func (e *NumError) Error() string</a>
+</li>
+<li> <a href="#NumError.Unwrap">func (e *NumError) Unwrap() error</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_AppendBool">AppendBool</a></dd> <dd><a class="exampleLink" href="#example_AppendFloat">AppendFloat</a></dd> <dd><a class="exampleLink" href="#example_AppendInt">AppendInt</a></dd> <dd><a class="exampleLink" href="#example_AppendQuote">AppendQuote</a></dd> <dd><a class="exampleLink" href="#example_AppendQuoteRune">AppendQuoteRune</a></dd> <dd><a class="exampleLink" href="#example_AppendQuoteRuneToASCII">AppendQuoteRuneToASCII</a></dd> <dd><a class="exampleLink" href="#example_AppendQuoteToASCII">AppendQuoteToASCII</a></dd> <dd><a class="exampleLink" href="#example_AppendUint">AppendUint</a></dd> <dd><a class="exampleLink" href="#example_Atoi">Atoi</a></dd> <dd><a class="exampleLink" href="#example_CanBackquote">CanBackquote</a></dd> <dd><a class="exampleLink" href="#example_FormatBool">FormatBool</a></dd> <dd><a class="exampleLink" href="#example_FormatFloat">FormatFloat</a></dd> <dd><a class="exampleLink" href="#example_FormatInt">FormatInt</a></dd> <dd><a class="exampleLink" href="#example_FormatUint">FormatUint</a></dd> <dd><a class="exampleLink" href="#example_IsGraphic">IsGraphic</a></dd> <dd><a class="exampleLink" href="#example_IsPrint">IsPrint</a></dd> <dd><a class="exampleLink" href="#example_Itoa">Itoa</a></dd> <dd><a class="exampleLink" href="#example_NumError">NumError</a></dd> <dd><a class="exampleLink" href="#example_ParseBool">ParseBool</a></dd> <dd><a class="exampleLink" href="#example_ParseFloat">ParseFloat</a></dd> <dd><a class="exampleLink" href="#example_ParseInt">ParseInt</a></dd> <dd><a class="exampleLink" href="#example_ParseUint">ParseUint</a></dd> <dd><a class="exampleLink" href="#example_Quote">Quote</a></dd> <dd><a class="exampleLink" href="#example_QuoteRune">QuoteRune</a></dd> <dd><a class="exampleLink" href="#example_QuoteRuneToASCII">QuoteRuneToASCII</a></dd> <dd><a class="exampleLink" href="#example_QuoteRuneToGraphic">QuoteRuneToGraphic</a></dd> <dd><a class="exampleLink" href="#example_QuoteToASCII">QuoteToASCII</a></dd> <dd><a class="exampleLink" href="#example_QuoteToGraphic">QuoteToGraphic</a></dd> <dd><a class="exampleLink" href="#example_QuotedPrefix">QuotedPrefix</a></dd> <dd><a class="exampleLink" href="#example_Unquote">Unquote</a></dd> <dd><a class="exampleLink" href="#example_UnquoteChar">UnquoteChar</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>atob.go</span> <span>atoc.go</span> <span>atof.go</span> <span>atoi.go</span> <span>bytealg.go</span> <span>ctoa.go</span> <span>decimal.go</span> <span>doc.go</span> <span>eisel_lemire.go</span> <span>ftoa.go</span> <span>ftoaryu.go</span> <span>isprint.go</span> <span>itoa.go</span> <span>quote.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>IntSize is the size in bits of an int or uint value. </p>
+<pre data-language="go">const IntSize = intSize</pre> <h2 id="pkg-variables">Variables</h2> <p>ErrRange indicates that a value is out of range for the target type. </p>
+<pre data-language="go">var ErrRange = errors.New("value out of range")</pre> <p>ErrSyntax indicates that a value does not have the right syntax for the target type. </p>
+<pre data-language="go">var ErrSyntax = errors.New("invalid syntax")</pre> <h2 id="AppendBool">func <span>AppendBool</span> </h2> <pre data-language="go">func AppendBool(dst []byte, b bool) []byte</pre> <p>AppendBool appends "true" or "false", according to the value of b, to dst and returns the extended buffer. </p> <h4 id="example_AppendBool"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte("bool:")
+b = strconv.AppendBool(b, true)
+fmt.Println(string(b))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">bool:true
+</pre> <h2 id="AppendFloat">func <span>AppendFloat</span> </h2> <pre data-language="go">func AppendFloat(dst []byte, f float64, fmt byte, prec, bitSize int) []byte</pre> <p>AppendFloat appends the string form of the floating-point number f, as generated by FormatFloat, to dst and returns the extended buffer. </p> <h4 id="example_AppendFloat"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b32 := []byte("float32:")
+b32 = strconv.AppendFloat(b32, 3.1415926535, 'E', -1, 32)
+fmt.Println(string(b32))
+
+b64 := []byte("float64:")
+b64 = strconv.AppendFloat(b64, 3.1415926535, 'E', -1, 64)
+fmt.Println(string(b64))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">float32:3.1415927E+00
+float64:3.1415926535E+00
+</pre> <h2 id="AppendInt">func <span>AppendInt</span> </h2> <pre data-language="go">func AppendInt(dst []byte, i int64, base int) []byte</pre> <p>AppendInt appends the string form of the integer i, as generated by FormatInt, to dst and returns the extended buffer. </p> <h4 id="example_AppendInt"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b10 := []byte("int (base 10):")
+b10 = strconv.AppendInt(b10, -42, 10)
+fmt.Println(string(b10))
+
+b16 := []byte("int (base 16):")
+b16 = strconv.AppendInt(b16, -42, 16)
+fmt.Println(string(b16))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">int (base 10):-42
+int (base 16):-2a
+</pre> <h2 id="AppendQuote">func <span>AppendQuote</span> </h2> <pre data-language="go">func AppendQuote(dst []byte, s string) []byte</pre> <p>AppendQuote appends a double-quoted Go string literal representing s, as generated by Quote, to dst and returns the extended buffer. </p> <h4 id="example_AppendQuote"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte("quote:")
+b = strconv.AppendQuote(b, `"Fran &amp; Freddie's Diner"`)
+fmt.Println(string(b))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">quote:"\"Fran &amp; Freddie's Diner\""
+</pre> <h2 id="AppendQuoteRune">func <span>AppendQuoteRune</span> </h2> <pre data-language="go">func AppendQuoteRune(dst []byte, r rune) []byte</pre> <p>AppendQuoteRune appends a single-quoted Go character literal representing the rune, as generated by QuoteRune, to dst and returns the extended buffer. </p> <h4 id="example_AppendQuoteRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte("rune:")
+b = strconv.AppendQuoteRune(b, '☺')
+fmt.Println(string(b))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">rune:'☺'
+</pre> <h2 id="AppendQuoteRuneToASCII">func <span>AppendQuoteRuneToASCII</span> </h2> <pre data-language="go">func AppendQuoteRuneToASCII(dst []byte, r rune) []byte</pre> <p>AppendQuoteRuneToASCII appends a single-quoted Go character literal representing the rune, as generated by QuoteRuneToASCII, to dst and returns the extended buffer. </p> <h4 id="example_AppendQuoteRuneToASCII"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte("rune (ascii):")
+b = strconv.AppendQuoteRuneToASCII(b, '☺')
+fmt.Println(string(b))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">rune (ascii):'\u263a'
+</pre> <h2 id="AppendQuoteRuneToGraphic">func <span>AppendQuoteRuneToGraphic</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">func AppendQuoteRuneToGraphic(dst []byte, r rune) []byte</pre> <p>AppendQuoteRuneToGraphic appends a single-quoted Go character literal representing the rune, as generated by QuoteRuneToGraphic, to dst and returns the extended buffer. </p>
+<h2 id="AppendQuoteToASCII">func <span>AppendQuoteToASCII</span> </h2> <pre data-language="go">func AppendQuoteToASCII(dst []byte, s string) []byte</pre> <p>AppendQuoteToASCII appends a double-quoted Go string literal representing s, as generated by QuoteToASCII, to dst and returns the extended buffer. </p> <h4 id="example_AppendQuoteToASCII"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte("quote (ascii):")
+b = strconv.AppendQuoteToASCII(b, `"Fran &amp; Freddie's Diner"`)
+fmt.Println(string(b))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">quote (ascii):"\"Fran &amp; Freddie's Diner\""
+</pre> <h2 id="AppendQuoteToGraphic">func <span>AppendQuoteToGraphic</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">func AppendQuoteToGraphic(dst []byte, s string) []byte</pre> <p>AppendQuoteToGraphic appends a double-quoted Go string literal representing s, as generated by QuoteToGraphic, to dst and returns the extended buffer. </p>
+<h2 id="AppendUint">func <span>AppendUint</span> </h2> <pre data-language="go">func AppendUint(dst []byte, i uint64, base int) []byte</pre> <p>AppendUint appends the string form of the unsigned integer i, as generated by FormatUint, to dst and returns the extended buffer. </p> <h4 id="example_AppendUint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b10 := []byte("uint (base 10):")
+b10 = strconv.AppendUint(b10, 42, 10)
+fmt.Println(string(b10))
+
+b16 := []byte("uint (base 16):")
+b16 = strconv.AppendUint(b16, 42, 16)
+fmt.Println(string(b16))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">uint (base 10):42
+uint (base 16):2a
+</pre> <h2 id="Atoi">func <span>Atoi</span> </h2> <pre data-language="go">func Atoi(s string) (int, error)</pre> <p>Atoi is equivalent to ParseInt(s, 10, 0), converted to type int. </p> <h4 id="example_Atoi"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := "10"
+if s, err := strconv.Atoi(v); err == nil {
+ fmt.Printf("%T, %v", s, s)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">int, 10
+</pre> <h2 id="CanBackquote">func <span>CanBackquote</span> </h2> <pre data-language="go">func CanBackquote(s string) bool</pre> <p>CanBackquote reports whether the string s can be represented unchanged as a single-line backquoted string without control characters other than tab. </p> <h4 id="example_CanBackquote"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strconv.CanBackquote("Fran &amp; Freddie's Diner ☺"))
+fmt.Println(strconv.CanBackquote("`can't backquote this`"))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="FormatBool">func <span>FormatBool</span> </h2> <pre data-language="go">func FormatBool(b bool) string</pre> <p>FormatBool returns "true" or "false" according to the value of b. </p> <h4 id="example_FormatBool"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := true
+s := strconv.FormatBool(v)
+fmt.Printf("%T, %v\n", s, s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">string, true
+</pre> <h2 id="FormatComplex">func <span>FormatComplex</span> <span title="Added in Go 1.15">1.15</span> </h2> <pre data-language="go">func FormatComplex(c complex128, fmt byte, prec, bitSize int) string</pre> <p>FormatComplex converts the complex number c to a string of the form (a+bi) where a and b are the real and imaginary parts, formatted according to the format fmt and precision prec. </p>
+<p>The format fmt and precision prec have the same meaning as in FormatFloat. It rounds the result assuming that the original was obtained from a complex value of bitSize bits, which must be 64 for complex64 and 128 for complex128. </p>
+<h2 id="FormatFloat">func <span>FormatFloat</span> </h2> <pre data-language="go">func FormatFloat(f float64, fmt byte, prec, bitSize int) string</pre> <p>FormatFloat converts the floating-point number f to a string, according to the format fmt and precision prec. It rounds the result assuming that the original was obtained from a floating-point value of bitSize bits (32 for float32, 64 for float64). </p>
+<p>The format fmt is one of 'b' (-ddddp±ddd, a binary exponent), 'e' (-d.dddde±dd, a decimal exponent), 'E' (-d.ddddE±dd, a decimal exponent), 'f' (-ddd.dddd, no exponent), 'g' ('e' for large exponents, 'f' otherwise), 'G' ('E' for large exponents, 'f' otherwise), 'x' (-0xd.ddddp±ddd, a hexadecimal fraction and binary exponent), or 'X' (-0Xd.ddddP±ddd, a hexadecimal fraction and binary exponent). </p>
+<p>The precision prec controls the number of digits (excluding the exponent) printed by the 'e', 'E', 'f', 'g', 'G', 'x', and 'X' formats. For 'e', 'E', 'f', 'x', and 'X', it is the number of digits after the decimal point. For 'g' and 'G' it is the maximum number of significant digits (trailing zeros are removed). The special precision -1 uses the smallest number of digits necessary such that ParseFloat will return f exactly. </p> <h4 id="example_FormatFloat"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := 3.1415926535
+
+s32 := strconv.FormatFloat(v, 'E', -1, 32)
+fmt.Printf("%T, %v\n", s32, s32)
+
+s64 := strconv.FormatFloat(v, 'E', -1, 64)
+fmt.Printf("%T, %v\n", s64, s64)
+
+// fmt.Println uses these arguments to print floats
+fmt64 := strconv.FormatFloat(v, 'g', -1, 64)
+fmt.Printf("%T, %v\n", fmt64, fmt64)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">string, 3.1415927E+00
+string, 3.1415926535E+00
+string, 3.1415926535
+</pre> <h2 id="FormatInt">func <span>FormatInt</span> </h2> <pre data-language="go">func FormatInt(i int64, base int) string</pre> <p>FormatInt returns the string representation of i in the given base, for 2 &lt;= base &lt;= 36. The result uses the lower-case letters 'a' to 'z' for digit values &gt;= 10. </p> <h4 id="example_FormatInt"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := int64(-42)
+
+s10 := strconv.FormatInt(v, 10)
+fmt.Printf("%T, %v\n", s10, s10)
+
+s16 := strconv.FormatInt(v, 16)
+fmt.Printf("%T, %v\n", s16, s16)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">string, -42
+string, -2a
+</pre> <h2 id="FormatUint">func <span>FormatUint</span> </h2> <pre data-language="go">func FormatUint(i uint64, base int) string</pre> <p>FormatUint returns the string representation of i in the given base, for 2 &lt;= base &lt;= 36. The result uses the lower-case letters 'a' to 'z' for digit values &gt;= 10. </p> <h4 id="example_FormatUint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := uint64(42)
+
+s10 := strconv.FormatUint(v, 10)
+fmt.Printf("%T, %v\n", s10, s10)
+
+s16 := strconv.FormatUint(v, 16)
+fmt.Printf("%T, %v\n", s16, s16)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">string, 42
+string, 2a
+</pre> <h2 id="IsGraphic">func <span>IsGraphic</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">func IsGraphic(r rune) bool</pre> <p>IsGraphic reports whether the rune is defined as a Graphic by Unicode. Such characters include letters, marks, numbers, punctuation, symbols, and spaces, from categories L, M, N, P, S, and Zs. </p> <h4 id="example_IsGraphic"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">shamrock := strconv.IsGraphic('☘')
+fmt.Println(shamrock)
+
+a := strconv.IsGraphic('a')
+fmt.Println(a)
+
+bel := strconv.IsGraphic('\007')
+fmt.Println(bel)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+true
+false
+</pre> <h2 id="IsPrint">func <span>IsPrint</span> </h2> <pre data-language="go">func IsPrint(r rune) bool</pre> <p>IsPrint reports whether the rune is defined as printable by Go, with the same definition as unicode.IsPrint: letters, numbers, punctuation, symbols and ASCII space. </p> <h4 id="example_IsPrint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">c := strconv.IsPrint('\u263a')
+fmt.Println(c)
+
+bel := strconv.IsPrint('\007')
+fmt.Println(bel)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="Itoa">func <span>Itoa</span> </h2> <pre data-language="go">func Itoa(i int) string</pre> <p>Itoa is equivalent to FormatInt(int64(i), 10). </p> <h4 id="example_Itoa"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">i := 10
+s := strconv.Itoa(i)
+fmt.Printf("%T, %v\n", s, s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">string, 10
+</pre> <h2 id="ParseBool">func <span>ParseBool</span> </h2> <pre data-language="go">func ParseBool(str string) (bool, error)</pre> <p>ParseBool returns the boolean value represented by the string. It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False. Any other value returns an error. </p> <h4 id="example_ParseBool"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := "true"
+if s, err := strconv.ParseBool(v); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">bool, true
+</pre> <h2 id="ParseComplex">func <span>ParseComplex</span> <span title="Added in Go 1.15">1.15</span> </h2> <pre data-language="go">func ParseComplex(s string, bitSize int) (complex128, error)</pre> <p>ParseComplex converts the string s to a complex number with the precision specified by bitSize: 64 for complex64, or 128 for complex128. When bitSize=64, the result still has type complex128, but it will be convertible to complex64 without changing its value. </p>
+<p>The number represented by s must be of the form N, Ni, or N±Ni, where N stands for a floating-point number as recognized by ParseFloat, and i is the imaginary component. If the second N is unsigned, a + sign is required between the two components as indicated by the ±. If the second N is NaN, only a + sign is accepted. The form may be parenthesized and cannot contain any spaces. The resulting complex number consists of the two components converted by ParseFloat. </p>
+<p>The errors that ParseComplex returns have concrete type *NumError and include err.Num = s. </p>
+<p>If s is not syntactically well-formed, ParseComplex returns err.Err = ErrSyntax. </p>
+<p>If s is syntactically well-formed but either component is more than 1/2 ULP away from the largest floating point number of the given component's size, ParseComplex returns err.Err = ErrRange and c = ±Inf for the respective component. </p>
+<h2 id="ParseFloat">func <span>ParseFloat</span> </h2> <pre data-language="go">func ParseFloat(s string, bitSize int) (float64, error)</pre> <p>ParseFloat converts the string s to a floating-point number with the precision specified by bitSize: 32 for float32, or 64 for float64. When bitSize=32, the result still has type float64, but it will be convertible to float32 without changing its value. </p>
+<p>ParseFloat accepts decimal and hexadecimal floating-point numbers as defined by the Go syntax for <a href="https://go.dev/ref/spec#Floating-point_literals">floating-point literals</a>. If s is well-formed and near a valid floating-point number, ParseFloat returns the nearest floating-point number rounded using IEEE754 unbiased rounding. (Parsing a hexadecimal floating-point value only rounds when there are more bits in the hexadecimal representation than will fit in the mantissa.) </p>
+<p>The errors that ParseFloat returns have concrete type *NumError and include err.Num = s. </p>
+<p>If s is not syntactically well-formed, ParseFloat returns err.Err = ErrSyntax. </p>
+<p>If s is syntactically well-formed but is more than 1/2 ULP away from the largest floating point number of the given size, ParseFloat returns f = ±Inf, err.Err = ErrRange. </p>
+<p>ParseFloat recognizes the string "NaN", and the (possibly signed) strings "Inf" and "Infinity" as their respective special floating point values. It ignores case when matching. </p> <h4 id="example_ParseFloat"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := "3.1415926535"
+if s, err := strconv.ParseFloat(v, 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseFloat(v, 64); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseFloat("NaN", 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+// ParseFloat is case insensitive
+if s, err := strconv.ParseFloat("nan", 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseFloat("inf", 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseFloat("+Inf", 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseFloat("-Inf", 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseFloat("-0", 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseFloat("+0", 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">float64, 3.1415927410125732
+float64, 3.1415926535
+float64, NaN
+float64, NaN
+float64, +Inf
+float64, +Inf
+float64, -Inf
+float64, -0
+float64, 0
+</pre> <h2 id="ParseInt">func <span>ParseInt</span> </h2> <pre data-language="go">func ParseInt(s string, base int, bitSize int) (i int64, err error)</pre> <p>ParseInt interprets a string s in the given base (0, 2 to 36) and bit size (0 to 64) and returns the corresponding value i. </p>
+<p>The string may begin with a leading sign: "+" or "-". </p>
+<p>If the base argument is 0, the true base is implied by the string's prefix following the sign (if present): 2 for "0b", 8 for "0" or "0o", 16 for "0x", and 10 otherwise. Also, for argument base 0 only, underscore characters are permitted as defined by the Go syntax for <a href="https://go.dev/ref/spec#Integer_literals">integer literals</a>. </p>
+<p>The bitSize argument specifies the integer type that the result must fit into. Bit sizes 0, 8, 16, 32, and 64 correspond to int, int8, int16, int32, and int64. If bitSize is below 0 or above 64, an error is returned. </p>
+<p>The errors that ParseInt returns have concrete type *NumError and include err.Num = s. If s is empty or contains invalid digits, err.Err = ErrSyntax and the returned value is 0; if the value corresponding to s cannot be represented by a signed integer of the given size, err.Err = ErrRange and the returned value is the maximum magnitude integer of the appropriate bitSize and sign. </p> <h4 id="example_ParseInt"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v32 := "-354634382"
+if s, err := strconv.ParseInt(v32, 10, 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseInt(v32, 16, 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+
+v64 := "-3546343826724305832"
+if s, err := strconv.ParseInt(v64, 10, 64); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseInt(v64, 16, 64); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">int64, -354634382
+int64, -3546343826724305832
+</pre> <h2 id="ParseUint">func <span>ParseUint</span> </h2> <pre data-language="go">func ParseUint(s string, base int, bitSize int) (uint64, error)</pre> <p>ParseUint is like ParseInt but for unsigned numbers. </p>
+<p>A sign prefix is not permitted. </p> <h4 id="example_ParseUint"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v := "42"
+if s, err := strconv.ParseUint(v, 10, 32); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+if s, err := strconv.ParseUint(v, 10, 64); err == nil {
+ fmt.Printf("%T, %v\n", s, s)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">uint64, 42
+uint64, 42
+</pre> <h2 id="Quote">func <span>Quote</span> </h2> <pre data-language="go">func Quote(s string) string</pre> <p>Quote returns a double-quoted Go string literal representing s. The returned string uses Go escape sequences (\t, \n, \xFF, \u0100) for control characters and non-printable characters as defined by IsPrint. </p> <h4 id="example_Quote"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// This string literal contains a tab character.
+s := strconv.Quote(`"Fran &amp; Freddie's Diner ☺"`)
+fmt.Println(s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"\"Fran &amp; Freddie's Diner\t☺\""
+</pre> <h2 id="QuoteRune">func <span>QuoteRune</span> </h2> <pre data-language="go">func QuoteRune(r rune) string</pre> <p>QuoteRune returns a single-quoted Go character literal representing the rune. The returned string uses Go escape sequences (\t, \n, \xFF, \u0100) for control characters and non-printable characters as defined by IsPrint. If r is not a valid Unicode code point, it is interpreted as the Unicode replacement character U+FFFD. </p> <h4 id="example_QuoteRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := strconv.QuoteRune('☺')
+fmt.Println(s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">'☺'
+</pre> <h2 id="QuoteRuneToASCII">func <span>QuoteRuneToASCII</span> </h2> <pre data-language="go">func QuoteRuneToASCII(r rune) string</pre> <p>QuoteRuneToASCII returns a single-quoted Go character literal representing the rune. The returned string uses Go escape sequences (\t, \n, \xFF, \u0100) for non-ASCII characters and non-printable characters as defined by IsPrint. If r is not a valid Unicode code point, it is interpreted as the Unicode replacement character U+FFFD. </p> <h4 id="example_QuoteRuneToASCII"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := strconv.QuoteRuneToASCII('☺')
+fmt.Println(s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">'\u263a'
+</pre> <h2 id="QuoteRuneToGraphic">func <span>QuoteRuneToGraphic</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">func QuoteRuneToGraphic(r rune) string</pre> <p>QuoteRuneToGraphic returns a single-quoted Go character literal representing the rune. If the rune is not a Unicode graphic character, as defined by IsGraphic, the returned string will use a Go escape sequence (\t, \n, \xFF, \u0100). If r is not a valid Unicode code point, it is interpreted as the Unicode replacement character U+FFFD. </p> <h4 id="example_QuoteRuneToGraphic"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := strconv.QuoteRuneToGraphic('☺')
+fmt.Println(s)
+
+s = strconv.QuoteRuneToGraphic('\u263a')
+fmt.Println(s)
+
+s = strconv.QuoteRuneToGraphic('\u000a')
+fmt.Println(s)
+
+s = strconv.QuoteRuneToGraphic(' ') // tab character
+fmt.Println(s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">'☺'
+'☺'
+'\n'
+'\t'
+</pre> <h2 id="QuoteToASCII">func <span>QuoteToASCII</span> </h2> <pre data-language="go">func QuoteToASCII(s string) string</pre> <p>QuoteToASCII returns a double-quoted Go string literal representing s. The returned string uses Go escape sequences (\t, \n, \xFF, \u0100) for non-ASCII characters and non-printable characters as defined by IsPrint. </p> <h4 id="example_QuoteToASCII"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// This string literal contains a tab character.
+s := strconv.QuoteToASCII(`"Fran &amp; Freddie's Diner ☺"`)
+fmt.Println(s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"\"Fran &amp; Freddie's Diner\t\u263a\""
+</pre> <h2 id="QuoteToGraphic">func <span>QuoteToGraphic</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">func QuoteToGraphic(s string) string</pre> <p>QuoteToGraphic returns a double-quoted Go string literal representing s. The returned string leaves Unicode graphic characters, as defined by IsGraphic, unchanged and uses Go escape sequences (\t, \n, \xFF, \u0100) for non-graphic characters. </p> <h4 id="example_QuoteToGraphic"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := strconv.QuoteToGraphic("☺")
+fmt.Println(s)
+
+// This string literal contains a tab character.
+s = strconv.QuoteToGraphic("This is a \u263a \u000a")
+fmt.Println(s)
+
+s = strconv.QuoteToGraphic(`" This is a ☺ \n "`)
+fmt.Println(s)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"☺"
+"This is a ☺\t\n"
+"\" This is a ☺ \\n \""
+</pre> <h2 id="QuotedPrefix">func <span>QuotedPrefix</span> <span title="Added in Go 1.17">1.17</span> </h2> <pre data-language="go">func QuotedPrefix(s string) (string, error)</pre> <p>QuotedPrefix returns the quoted string (as understood by Unquote) at the prefix of s. If s does not start with a valid quoted string, QuotedPrefix returns an error. </p> <h4 id="example_QuotedPrefix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s, err := strconv.QuotedPrefix("not a quoted string")
+fmt.Printf("%q, %v\n", s, err)
+s, err = strconv.QuotedPrefix("\"double-quoted string\" with trailing text")
+fmt.Printf("%q, %v\n", s, err)
+s, err = strconv.QuotedPrefix("`or backquoted` with more trailing text")
+fmt.Printf("%q, %v\n", s, err)
+s, err = strconv.QuotedPrefix("'\u263a' is also okay")
+fmt.Printf("%q, %v\n", s, err)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"", invalid syntax
+"\"double-quoted string\"", &lt;nil&gt;
+"`or backquoted`", &lt;nil&gt;
+"'☺'", &lt;nil&gt;
+</pre> <h2 id="Unquote">func <span>Unquote</span> </h2> <pre data-language="go">func Unquote(s string) (string, error)</pre> <p>Unquote interprets s as a single-quoted, double-quoted, or backquoted Go string literal, returning the string value that s quotes. (If s is single-quoted, it would be a Go character literal; Unquote returns the corresponding one-character string.) </p> <h4 id="example_Unquote"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s, err := strconv.Unquote("You can't unquote a string without quotes")
+fmt.Printf("%q, %v\n", s, err)
+s, err = strconv.Unquote("\"The string must be either double-quoted\"")
+fmt.Printf("%q, %v\n", s, err)
+s, err = strconv.Unquote("`or backquoted.`")
+fmt.Printf("%q, %v\n", s, err)
+s, err = strconv.Unquote("'\u263a'") // single character only allowed in single quotes
+fmt.Printf("%q, %v\n", s, err)
+s, err = strconv.Unquote("'\u2639\u2639'")
+fmt.Printf("%q, %v\n", s, err)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">"", invalid syntax
+"The string must be either double-quoted", &lt;nil&gt;
+"or backquoted.", &lt;nil&gt;
+"☺", &lt;nil&gt;
+"", invalid syntax
+</pre> <h2 id="UnquoteChar">func <span>UnquoteChar</span> </h2> <pre data-language="go">func UnquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error)</pre> <p>UnquoteChar decodes the first character or byte in the escaped string or character literal represented by the string s. It returns four values: </p>
+<ol> <li>value, the decoded Unicode code point or byte value; </li>
+<li>multibyte, a boolean indicating whether the decoded character requires a multibyte UTF-8 representation; </li>
+<li>tail, the remainder of the string after the character; and </li>
+<li>an error that will be nil if the character is syntactically valid. </li>
+</ol> <p>The second argument, quote, specifies the type of literal being parsed and therefore which escaped quote character is permitted. If set to a single quote, it permits the sequence \' and disallows unescaped '. If set to a double quote, it permits \" and disallows unescaped ". If set to zero, it does not permit either escape and allows both quote characters to appear unescaped. </p> <h4 id="example_UnquoteChar"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">v, mb, t, err := strconv.UnquoteChar(`\"Fran &amp; Freddie's Diner\"`, '"')
+if err != nil {
+ log.Fatal(err)
+}
+
+fmt.Println("value:", string(v))
+fmt.Println("multibyte:", mb)
+fmt.Println("tail:", t)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">value: "
+multibyte: false
+tail: Fran &amp; Freddie's Diner\"
+</pre> <h2 id="NumError">type <span>NumError</span> </h2> <p>A NumError records a failed conversion. </p>
+<pre data-language="go">type NumError struct {
+ Func string // the failing function (ParseBool, ParseInt, ParseUint, ParseFloat, ParseComplex)
+ Num string // the input
+ Err error // the reason the conversion failed (e.g. ErrRange, ErrSyntax, etc.)
+}
+</pre> <h4 id="example_NumError"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := "Not a number"
+if _, err := strconv.ParseFloat(str, 64); err != nil {
+ e := err.(*strconv.NumError)
+ fmt.Println("Func:", e.Func)
+ fmt.Println("Num:", e.Num)
+ fmt.Println("Err:", e.Err)
+ fmt.Println(err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Func: ParseFloat
+Num: Not a number
+Err: invalid syntax
+strconv.ParseFloat: parsing "Not a number": invalid syntax
+</pre> <h3 id="NumError.Error">func (*NumError) <span>Error</span> </h3> <pre data-language="go">func (e *NumError) Error() string</pre> <h3 id="NumError.Unwrap">func (*NumError) <span>Unwrap</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (e *NumError) Unwrap() error</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/strconv/" class="_attribution-link">http://golang.org/pkg/strconv/</a>
+ </p>
+</div>
diff --git a/devdocs/go/strings%2Findex.html b/devdocs/go/strings%2Findex.html
new file mode 100644
index 00000000..53dc7feb
--- /dev/null
+++ b/devdocs/go/strings%2Findex.html
@@ -0,0 +1,488 @@
+<h1> Package strings </h1> <ul id="short-nav">
+<li><code>import "strings"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package strings implements simple functions to manipulate UTF-8 encoded strings. </p>
+<p>For information about UTF-8 strings in Go, see <a href="https://blog.golang.org/strings">https://blog.golang.org/strings</a>. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Clone">func Clone(s string) string</a></li>
+<li><a href="#Compare">func Compare(a, b string) int</a></li>
+<li><a href="#Contains">func Contains(s, substr string) bool</a></li>
+<li><a href="#ContainsAny">func ContainsAny(s, chars string) bool</a></li>
+<li><a href="#ContainsFunc">func ContainsFunc(s string, f func(rune) bool) bool</a></li>
+<li><a href="#ContainsRune">func ContainsRune(s string, r rune) bool</a></li>
+<li><a href="#Count">func Count(s, substr string) int</a></li>
+<li><a href="#Cut">func Cut(s, sep string) (before, after string, found bool)</a></li>
+<li><a href="#CutPrefix">func CutPrefix(s, prefix string) (after string, found bool)</a></li>
+<li><a href="#CutSuffix">func CutSuffix(s, suffix string) (before string, found bool)</a></li>
+<li><a href="#EqualFold">func EqualFold(s, t string) bool</a></li>
+<li><a href="#Fields">func Fields(s string) []string</a></li>
+<li><a href="#FieldsFunc">func FieldsFunc(s string, f func(rune) bool) []string</a></li>
+<li><a href="#HasPrefix">func HasPrefix(s, prefix string) bool</a></li>
+<li><a href="#HasSuffix">func HasSuffix(s, suffix string) bool</a></li>
+<li><a href="#Index">func Index(s, substr string) int</a></li>
+<li><a href="#IndexAny">func IndexAny(s, chars string) int</a></li>
+<li><a href="#IndexByte">func IndexByte(s string, c byte) int</a></li>
+<li><a href="#IndexFunc">func IndexFunc(s string, f func(rune) bool) int</a></li>
+<li><a href="#IndexRune">func IndexRune(s string, r rune) int</a></li>
+<li><a href="#Join">func Join(elems []string, sep string) string</a></li>
+<li><a href="#LastIndex">func LastIndex(s, substr string) int</a></li>
+<li><a href="#LastIndexAny">func LastIndexAny(s, chars string) int</a></li>
+<li><a href="#LastIndexByte">func LastIndexByte(s string, c byte) int</a></li>
+<li><a href="#LastIndexFunc">func LastIndexFunc(s string, f func(rune) bool) int</a></li>
+<li><a href="#Map">func Map(mapping func(rune) rune, s string) string</a></li>
+<li><a href="#Repeat">func Repeat(s string, count int) string</a></li>
+<li><a href="#Replace">func Replace(s, old, new string, n int) string</a></li>
+<li><a href="#ReplaceAll">func ReplaceAll(s, old, new string) string</a></li>
+<li><a href="#Split">func Split(s, sep string) []string</a></li>
+<li><a href="#SplitAfter">func SplitAfter(s, sep string) []string</a></li>
+<li><a href="#SplitAfterN">func SplitAfterN(s, sep string, n int) []string</a></li>
+<li><a href="#SplitN">func SplitN(s, sep string, n int) []string</a></li>
+<li><a href="#Title">func Title(s string) string</a></li>
+<li><a href="#ToLower">func ToLower(s string) string</a></li>
+<li><a href="#ToLowerSpecial">func ToLowerSpecial(c unicode.SpecialCase, s string) string</a></li>
+<li><a href="#ToTitle">func ToTitle(s string) string</a></li>
+<li><a href="#ToTitleSpecial">func ToTitleSpecial(c unicode.SpecialCase, s string) string</a></li>
+<li><a href="#ToUpper">func ToUpper(s string) string</a></li>
+<li><a href="#ToUpperSpecial">func ToUpperSpecial(c unicode.SpecialCase, s string) string</a></li>
+<li><a href="#ToValidUTF8">func ToValidUTF8(s, replacement string) string</a></li>
+<li><a href="#Trim">func Trim(s, cutset string) string</a></li>
+<li><a href="#TrimFunc">func TrimFunc(s string, f func(rune) bool) string</a></li>
+<li><a href="#TrimLeft">func TrimLeft(s, cutset string) string</a></li>
+<li><a href="#TrimLeftFunc">func TrimLeftFunc(s string, f func(rune) bool) string</a></li>
+<li><a href="#TrimPrefix">func TrimPrefix(s, prefix string) string</a></li>
+<li><a href="#TrimRight">func TrimRight(s, cutset string) string</a></li>
+<li><a href="#TrimRightFunc">func TrimRightFunc(s string, f func(rune) bool) string</a></li>
+<li><a href="#TrimSpace">func TrimSpace(s string) string</a></li>
+<li><a href="#TrimSuffix">func TrimSuffix(s, suffix string) string</a></li>
+<li><a href="#Builder">type Builder</a></li>
+<li> <a href="#Builder.Cap">func (b *Builder) Cap() int</a>
+</li>
+<li> <a href="#Builder.Grow">func (b *Builder) Grow(n int)</a>
+</li>
+<li> <a href="#Builder.Len">func (b *Builder) Len() int</a>
+</li>
+<li> <a href="#Builder.Reset">func (b *Builder) Reset()</a>
+</li>
+<li> <a href="#Builder.String">func (b *Builder) String() string</a>
+</li>
+<li> <a href="#Builder.Write">func (b *Builder) Write(p []byte) (int, error)</a>
+</li>
+<li> <a href="#Builder.WriteByte">func (b *Builder) WriteByte(c byte) error</a>
+</li>
+<li> <a href="#Builder.WriteRune">func (b *Builder) WriteRune(r rune) (int, error)</a>
+</li>
+<li> <a href="#Builder.WriteString">func (b *Builder) WriteString(s string) (int, error)</a>
+</li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#NewReader">func NewReader(s string) *Reader</a>
+</li>
+<li> <a href="#Reader.Len">func (r *Reader) Len() int</a>
+</li>
+<li> <a href="#Reader.Read">func (r *Reader) Read(b []byte) (n int, err error)</a>
+</li>
+<li> <a href="#Reader.ReadAt">func (r *Reader) ReadAt(b []byte, off int64) (n int, err error)</a>
+</li>
+<li> <a href="#Reader.ReadByte">func (r *Reader) ReadByte() (byte, error)</a>
+</li>
+<li> <a href="#Reader.ReadRune">func (r *Reader) ReadRune() (ch rune, size int, err error)</a>
+</li>
+<li> <a href="#Reader.Reset">func (r *Reader) Reset(s string)</a>
+</li>
+<li> <a href="#Reader.Seek">func (r *Reader) Seek(offset int64, whence int) (int64, error)</a>
+</li>
+<li> <a href="#Reader.Size">func (r *Reader) Size() int64</a>
+</li>
+<li> <a href="#Reader.UnreadByte">func (r *Reader) UnreadByte() error</a>
+</li>
+<li> <a href="#Reader.UnreadRune">func (r *Reader) UnreadRune() error</a>
+</li>
+<li> <a href="#Reader.WriteTo">func (r *Reader) WriteTo(w io.Writer) (n int64, err error)</a>
+</li>
+<li><a href="#Replacer">type Replacer</a></li>
+<li> <a href="#NewReplacer">func NewReplacer(oldnew ...string) *Replacer</a>
+</li>
+<li> <a href="#Replacer.Replace">func (r *Replacer) Replace(s string) string</a>
+</li>
+<li> <a href="#Replacer.WriteString">func (r *Replacer) WriteString(w io.Writer, s string) (n int, err error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Builder">Builder</a></dd> <dd><a class="exampleLink" href="#example_Clone">Clone</a></dd> <dd><a class="exampleLink" href="#example_Compare">Compare</a></dd> <dd><a class="exampleLink" href="#example_Contains">Contains</a></dd> <dd><a class="exampleLink" href="#example_ContainsAny">ContainsAny</a></dd> <dd><a class="exampleLink" href="#example_ContainsFunc">ContainsFunc</a></dd> <dd><a class="exampleLink" href="#example_ContainsRune">ContainsRune</a></dd> <dd><a class="exampleLink" href="#example_Count">Count</a></dd> <dd><a class="exampleLink" href="#example_Cut">Cut</a></dd> <dd><a class="exampleLink" href="#example_CutPrefix">CutPrefix</a></dd> <dd><a class="exampleLink" href="#example_CutSuffix">CutSuffix</a></dd> <dd><a class="exampleLink" href="#example_EqualFold">EqualFold</a></dd> <dd><a class="exampleLink" href="#example_Fields">Fields</a></dd> <dd><a class="exampleLink" href="#example_FieldsFunc">FieldsFunc</a></dd> <dd><a class="exampleLink" href="#example_HasPrefix">HasPrefix</a></dd> <dd><a class="exampleLink" href="#example_HasSuffix">HasSuffix</a></dd> <dd><a class="exampleLink" href="#example_Index">Index</a></dd> <dd><a class="exampleLink" href="#example_IndexAny">IndexAny</a></dd> <dd><a class="exampleLink" href="#example_IndexByte">IndexByte</a></dd> <dd><a class="exampleLink" href="#example_IndexFunc">IndexFunc</a></dd> <dd><a class="exampleLink" href="#example_IndexRune">IndexRune</a></dd> <dd><a class="exampleLink" href="#example_Join">Join</a></dd> <dd><a class="exampleLink" href="#example_LastIndex">LastIndex</a></dd> <dd><a class="exampleLink" href="#example_LastIndexAny">LastIndexAny</a></dd> <dd><a class="exampleLink" href="#example_LastIndexByte">LastIndexByte</a></dd> <dd><a class="exampleLink" href="#example_LastIndexFunc">LastIndexFunc</a></dd> <dd><a class="exampleLink" href="#example_Map">Map</a></dd> <dd><a class="exampleLink" href="#example_NewReplacer">NewReplacer</a></dd> <dd><a class="exampleLink" href="#example_Repeat">Repeat</a></dd> <dd><a class="exampleLink" href="#example_Replace">Replace</a></dd> <dd><a class="exampleLink" href="#example_ReplaceAll">ReplaceAll</a></dd> <dd><a class="exampleLink" href="#example_Split">Split</a></dd> <dd><a class="exampleLink" href="#example_SplitAfter">SplitAfter</a></dd> <dd><a class="exampleLink" href="#example_SplitAfterN">SplitAfterN</a></dd> <dd><a class="exampleLink" href="#example_SplitN">SplitN</a></dd> <dd><a class="exampleLink" href="#example_Title">Title</a></dd> <dd><a class="exampleLink" href="#example_ToLower">ToLower</a></dd> <dd><a class="exampleLink" href="#example_ToLowerSpecial">ToLowerSpecial</a></dd> <dd><a class="exampleLink" href="#example_ToTitle">ToTitle</a></dd> <dd><a class="exampleLink" href="#example_ToTitleSpecial">ToTitleSpecial</a></dd> <dd><a class="exampleLink" href="#example_ToUpper">ToUpper</a></dd> <dd><a class="exampleLink" href="#example_ToUpperSpecial">ToUpperSpecial</a></dd> <dd><a class="exampleLink" href="#example_ToValidUTF8">ToValidUTF8</a></dd> <dd><a class="exampleLink" href="#example_Trim">Trim</a></dd> <dd><a class="exampleLink" href="#example_TrimFunc">TrimFunc</a></dd> <dd><a class="exampleLink" href="#example_TrimLeft">TrimLeft</a></dd> <dd><a class="exampleLink" href="#example_TrimLeftFunc">TrimLeftFunc</a></dd> <dd><a class="exampleLink" href="#example_TrimPrefix">TrimPrefix</a></dd> <dd><a class="exampleLink" href="#example_TrimRight">TrimRight</a></dd> <dd><a class="exampleLink" href="#example_TrimRightFunc">TrimRightFunc</a></dd> <dd><a class="exampleLink" href="#example_TrimSpace">TrimSpace</a></dd> <dd><a class="exampleLink" href="#example_TrimSuffix">TrimSuffix</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>builder.go</span> <span>clone.go</span> <span>compare.go</span> <span>reader.go</span> <span>replace.go</span> <span>search.go</span> <span>strings.go</span> </p> <h2 id="Clone">func <span>Clone</span> <span title="Added in Go 1.18">1.18</span> </h2> <pre data-language="go">func Clone(s string) string</pre> <p>Clone returns a fresh copy of s. It guarantees to make a copy of s into a new allocation, which can be important when retaining only a small substring of a much larger string. Using Clone can help such programs use less memory. Of course, since using Clone makes a copy, overuse of Clone can make programs use more memory. Clone should typically be used only rarely, and only when profiling indicates that it is needed. For strings of length zero the string "" will be returned and no allocation is made. </p> <h4 id="example_Clone"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := "abc"
+clone := strings.Clone(s)
+fmt.Println(s == clone)
+fmt.Println(unsafe.StringData(s) == unsafe.StringData(clone))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="Compare">func <span>Compare</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func Compare(a, b string) int</pre> <p>Compare returns an integer comparing two strings lexicographically. The result will be 0 if a == b, -1 if a &lt; b, and +1 if a &gt; b. </p>
+<p>Compare is included only for symmetry with package bytes. It is usually clearer and always faster to use the built-in string comparison operators ==, &lt;, &gt;, and so on. </p> <h4 id="example_Compare"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.Compare("a", "b"))
+fmt.Println(strings.Compare("a", "a"))
+fmt.Println(strings.Compare("b", "a"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">-1
+0
+1
+</pre> <h2 id="Contains">func <span>Contains</span> </h2> <pre data-language="go">func Contains(s, substr string) bool</pre> <p>Contains reports whether substr is within s. </p> <h4 id="example_Contains"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.Contains("seafood", "foo"))
+fmt.Println(strings.Contains("seafood", "bar"))
+fmt.Println(strings.Contains("seafood", ""))
+fmt.Println(strings.Contains("", ""))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+true
+</pre> <h2 id="ContainsAny">func <span>ContainsAny</span> </h2> <pre data-language="go">func ContainsAny(s, chars string) bool</pre> <p>ContainsAny reports whether any Unicode code points in chars are within s. </p> <h4 id="example_ContainsAny"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.ContainsAny("team", "i"))
+fmt.Println(strings.ContainsAny("fail", "ui"))
+fmt.Println(strings.ContainsAny("ure", "ui"))
+fmt.Println(strings.ContainsAny("failure", "ui"))
+fmt.Println(strings.ContainsAny("foo", ""))
+fmt.Println(strings.ContainsAny("", ""))
+</pre> <p>Output:</p> <pre class="output" data-language="go">false
+true
+true
+true
+false
+false
+</pre> <h2 id="ContainsFunc">func <span>ContainsFunc</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func ContainsFunc(s string, f func(rune) bool) bool</pre> <p>ContainsFunc reports whether any Unicode code points r within s satisfy f(r). </p> <h4 id="example_ContainsFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">f := func(r rune) bool {
+ return r == 'a' || r == 'e' || r == 'i' || r == 'o' || r == 'u'
+}
+fmt.Println(strings.ContainsFunc("hello", f))
+fmt.Println(strings.ContainsFunc("rhythms", f))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="ContainsRune">func <span>ContainsRune</span> </h2> <pre data-language="go">func ContainsRune(s string, r rune) bool</pre> <p>ContainsRune reports whether the Unicode code point r is within s. </p> <h4 id="example_ContainsRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Finds whether a string contains a particular Unicode code point.
+// The code point for the lowercase letter "a", for example, is 97.
+fmt.Println(strings.ContainsRune("aardvark", 97))
+fmt.Println(strings.ContainsRune("timeout", 97))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="Count">func <span>Count</span> </h2> <pre data-language="go">func Count(s, substr string) int</pre> <p>Count counts the number of non-overlapping instances of substr in s. If substr is an empty string, Count returns 1 + the number of Unicode code points in s. </p> <h4 id="example_Count"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.Count("cheese", "e"))
+fmt.Println(strings.Count("five", "")) // before &amp; after each rune
+</pre> <p>Output:</p> <pre class="output" data-language="go">3
+5
+</pre> <h2 id="Cut">func <span>Cut</span> <span title="Added in Go 1.18">1.18</span> </h2> <pre data-language="go">func Cut(s, sep string) (before, after string, found bool)</pre> <p>Cut slices s around the first instance of sep, returning the text before and after sep. The found result reports whether sep appears in s. If sep does not appear in s, cut returns s, "", false. </p> <h4 id="example_Cut"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">show := func(s, sep string) {
+ before, after, found := strings.Cut(s, sep)
+ fmt.Printf("Cut(%q, %q) = %q, %q, %v\n", s, sep, before, after, found)
+}
+show("Gopher", "Go")
+show("Gopher", "ph")
+show("Gopher", "er")
+show("Gopher", "Badger")
+</pre> <p>Output:</p> <pre class="output" data-language="go">Cut("Gopher", "Go") = "", "pher", true
+Cut("Gopher", "ph") = "Go", "er", true
+Cut("Gopher", "er") = "Goph", "", true
+Cut("Gopher", "Badger") = "Gopher", "", false
+</pre> <h2 id="CutPrefix">func <span>CutPrefix</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func CutPrefix(s, prefix string) (after string, found bool)</pre> <p>CutPrefix returns s without the provided leading prefix string and reports whether it found the prefix. If s doesn't start with prefix, CutPrefix returns s, false. If prefix is the empty string, CutPrefix returns s, true. </p> <h4 id="example_CutPrefix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">show := func(s, sep string) {
+ after, found := strings.CutPrefix(s, sep)
+ fmt.Printf("CutPrefix(%q, %q) = %q, %v\n", s, sep, after, found)
+}
+show("Gopher", "Go")
+show("Gopher", "ph")
+</pre> <p>Output:</p> <pre class="output" data-language="go">CutPrefix("Gopher", "Go") = "pher", true
+CutPrefix("Gopher", "ph") = "Gopher", false
+</pre> <h2 id="CutSuffix">func <span>CutSuffix</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func CutSuffix(s, suffix string) (before string, found bool)</pre> <p>CutSuffix returns s without the provided ending suffix string and reports whether it found the suffix. If s doesn't end with suffix, CutSuffix returns s, false. If suffix is the empty string, CutSuffix returns s, true. </p> <h4 id="example_CutSuffix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">show := func(s, sep string) {
+ before, found := strings.CutSuffix(s, sep)
+ fmt.Printf("CutSuffix(%q, %q) = %q, %v\n", s, sep, before, found)
+}
+show("Gopher", "Go")
+show("Gopher", "er")
+</pre> <p>Output:</p> <pre class="output" data-language="go">CutSuffix("Gopher", "Go") = "Gopher", false
+CutSuffix("Gopher", "er") = "Goph", true
+</pre> <h2 id="EqualFold">func <span>EqualFold</span> </h2> <pre data-language="go">func EqualFold(s, t string) bool</pre> <p>EqualFold reports whether s and t, interpreted as UTF-8 strings, are equal under simple Unicode case-folding, which is a more general form of case-insensitivity. </p> <h4 id="example_EqualFold"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.EqualFold("Go", "go"))
+fmt.Println(strings.EqualFold("AB", "ab")) // true because comparison uses simple case-folding
+fmt.Println(strings.EqualFold("ß", "ss")) // false because comparison does not use full case-folding
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+true
+false
+</pre> <h2 id="Fields">func <span>Fields</span> </h2> <pre data-language="go">func Fields(s string) []string</pre> <p>Fields splits the string s around each instance of one or more consecutive white space characters, as defined by unicode.IsSpace, returning a slice of substrings of s or an empty slice if s contains only white space. </p> <h4 id="example_Fields"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("Fields are: %q", strings.Fields(" foo bar baz "))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Fields are: ["foo" "bar" "baz"]
+</pre> <h2 id="FieldsFunc">func <span>FieldsFunc</span> </h2> <pre data-language="go">func FieldsFunc(s string, f func(rune) bool) []string</pre> <p>FieldsFunc splits the string s at each run of Unicode code points c satisfying f(c) and returns an array of slices of s. If all code points in s satisfy f(c) or the string is empty, an empty slice is returned. </p>
+<p>FieldsFunc makes no guarantees about the order in which it calls f(c) and assumes that f always returns the same value for a given c. </p> <h4 id="example_FieldsFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">f := func(c rune) bool {
+ return !unicode.IsLetter(c) &amp;&amp; !unicode.IsNumber(c)
+}
+fmt.Printf("Fields are: %q", strings.FieldsFunc(" foo1;bar2,baz3...", f))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Fields are: ["foo1" "bar2" "baz3"]
+</pre> <h2 id="HasPrefix">func <span>HasPrefix</span> </h2> <pre data-language="go">func HasPrefix(s, prefix string) bool</pre> <p>HasPrefix reports whether the string s begins with prefix. </p> <h4 id="example_HasPrefix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.HasPrefix("Gopher", "Go"))
+fmt.Println(strings.HasPrefix("Gopher", "C"))
+fmt.Println(strings.HasPrefix("Gopher", ""))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+true
+</pre> <h2 id="HasSuffix">func <span>HasSuffix</span> </h2> <pre data-language="go">func HasSuffix(s, suffix string) bool</pre> <p>HasSuffix reports whether the string s ends with suffix. </p> <h4 id="example_HasSuffix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.HasSuffix("Amigo", "go"))
+fmt.Println(strings.HasSuffix("Amigo", "O"))
+fmt.Println(strings.HasSuffix("Amigo", "Ami"))
+fmt.Println(strings.HasSuffix("Amigo", ""))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+false
+true
+</pre> <h2 id="Index">func <span>Index</span> </h2> <pre data-language="go">func Index(s, substr string) int</pre> <p>Index returns the index of the first instance of substr in s, or -1 if substr is not present in s. </p> <h4 id="example_Index"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.Index("chicken", "ken"))
+fmt.Println(strings.Index("chicken", "dmr"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">4
+-1
+</pre> <h2 id="IndexAny">func <span>IndexAny</span> </h2> <pre data-language="go">func IndexAny(s, chars string) int</pre> <p>IndexAny returns the index of the first instance of any Unicode code point from chars in s, or -1 if no Unicode code point from chars is present in s. </p> <h4 id="example_IndexAny"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.IndexAny("chicken", "aeiouy"))
+fmt.Println(strings.IndexAny("crwth", "aeiouy"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">2
+-1
+</pre> <h2 id="IndexByte">func <span>IndexByte</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func IndexByte(s string, c byte) int</pre> <p>IndexByte returns the index of the first instance of c in s, or -1 if c is not present in s. </p> <h4 id="example_IndexByte"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.IndexByte("golang", 'g'))
+fmt.Println(strings.IndexByte("gophers", 'h'))
+fmt.Println(strings.IndexByte("golang", 'x'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0
+3
+-1
+</pre> <h2 id="IndexFunc">func <span>IndexFunc</span> </h2> <pre data-language="go">func IndexFunc(s string, f func(rune) bool) int</pre> <p>IndexFunc returns the index into s of the first Unicode code point satisfying f(c), or -1 if none do. </p> <h4 id="example_IndexFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">f := func(c rune) bool {
+ return unicode.Is(unicode.Han, c)
+}
+fmt.Println(strings.IndexFunc("Hello, 世界", f))
+fmt.Println(strings.IndexFunc("Hello, world", f))
+</pre> <p>Output:</p> <pre class="output" data-language="go">7
+-1
+</pre> <h2 id="IndexRune">func <span>IndexRune</span> </h2> <pre data-language="go">func IndexRune(s string, r rune) int</pre> <p>IndexRune returns the index of the first instance of the Unicode code point r, or -1 if rune is not present in s. If r is utf8.RuneError, it returns the first instance of any invalid UTF-8 byte sequence. </p> <h4 id="example_IndexRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.IndexRune("chicken", 'k'))
+fmt.Println(strings.IndexRune("chicken", 'd'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">4
+-1
+</pre> <h2 id="Join">func <span>Join</span> </h2> <pre data-language="go">func Join(elems []string, sep string) string</pre> <p>Join concatenates the elements of its first argument to create a single string. The separator string sep is placed between elements in the resulting string. </p> <h4 id="example_Join"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">s := []string{"foo", "bar", "baz"}
+fmt.Println(strings.Join(s, ", "))
+</pre> <p>Output:</p> <pre class="output" data-language="go">foo, bar, baz
+</pre> <h2 id="LastIndex">func <span>LastIndex</span> </h2> <pre data-language="go">func LastIndex(s, substr string) int</pre> <p>LastIndex returns the index of the last instance of substr in s, or -1 if substr is not present in s. </p> <h4 id="example_LastIndex"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.Index("go gopher", "go"))
+fmt.Println(strings.LastIndex("go gopher", "go"))
+fmt.Println(strings.LastIndex("go gopher", "rodent"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">0
+3
+-1
+</pre> <h2 id="LastIndexAny">func <span>LastIndexAny</span> </h2> <pre data-language="go">func LastIndexAny(s, chars string) int</pre> <p>LastIndexAny returns the index of the last instance of any Unicode code point from chars in s, or -1 if no Unicode code point from chars is present in s. </p> <h4 id="example_LastIndexAny"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.LastIndexAny("go gopher", "go"))
+fmt.Println(strings.LastIndexAny("go gopher", "rodent"))
+fmt.Println(strings.LastIndexAny("go gopher", "fail"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">4
+8
+-1
+</pre> <h2 id="LastIndexByte">func <span>LastIndexByte</span> <span title="Added in Go 1.5">1.5</span> </h2> <pre data-language="go">func LastIndexByte(s string, c byte) int</pre> <p>LastIndexByte returns the index of the last instance of c in s, or -1 if c is not present in s. </p> <h4 id="example_LastIndexByte"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.LastIndexByte("Hello, world", 'l'))
+fmt.Println(strings.LastIndexByte("Hello, world", 'o'))
+fmt.Println(strings.LastIndexByte("Hello, world", 'x'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">10
+8
+-1
+</pre> <h2 id="LastIndexFunc">func <span>LastIndexFunc</span> </h2> <pre data-language="go">func LastIndexFunc(s string, f func(rune) bool) int</pre> <p>LastIndexFunc returns the index into s of the last Unicode code point satisfying f(c), or -1 if none do. </p> <h4 id="example_LastIndexFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.LastIndexFunc("go 123", unicode.IsNumber))
+fmt.Println(strings.LastIndexFunc("123 go", unicode.IsNumber))
+fmt.Println(strings.LastIndexFunc("go", unicode.IsNumber))
+</pre> <p>Output:</p> <pre class="output" data-language="go">5
+2
+-1
+</pre> <h2 id="Map">func <span>Map</span> </h2> <pre data-language="go">func Map(mapping func(rune) rune, s string) string</pre> <p>Map returns a copy of the string s with all its characters modified according to the mapping function. If mapping returns a negative value, the character is dropped from the string with no replacement. </p> <h4 id="example_Map"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">rot13 := func(r rune) rune {
+ switch {
+ case r &gt;= 'A' &amp;&amp; r &lt;= 'Z':
+ return 'A' + (r-'A'+13)%26
+ case r &gt;= 'a' &amp;&amp; r &lt;= 'z':
+ return 'a' + (r-'a'+13)%26
+ }
+ return r
+}
+fmt.Println(strings.Map(rot13, "'Twas brillig and the slithy gopher..."))
+</pre> <p>Output:</p> <pre class="output" data-language="go">'Gjnf oevyyvt naq gur fyvgul tbcure...
+</pre> <h2 id="Repeat">func <span>Repeat</span> </h2> <pre data-language="go">func Repeat(s string, count int) string</pre> <p>Repeat returns a new string consisting of count copies of the string s. </p>
+<p>It panics if count is negative or if the result of (len(s) * count) overflows. </p> <h4 id="example_Repeat"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println("ba" + strings.Repeat("na", 2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">banana
+</pre> <h2 id="Replace">func <span>Replace</span> </h2> <pre data-language="go">func Replace(s, old, new string, n int) string</pre> <p>Replace returns a copy of the string s with the first n non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string. If n &lt; 0, there is no limit on the number of replacements. </p> <h4 id="example_Replace"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.Replace("oink oink oink", "k", "ky", 2))
+fmt.Println(strings.Replace("oink oink oink", "oink", "moo", -1))
+</pre> <p>Output:</p> <pre class="output" data-language="go">oinky oinky oink
+moo moo moo
+</pre> <h2 id="ReplaceAll">func <span>ReplaceAll</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">func ReplaceAll(s, old, new string) string</pre> <p>ReplaceAll returns a copy of the string s with all non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string. </p> <h4 id="example_ReplaceAll"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.ReplaceAll("oink oink oink", "oink", "moo"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">moo moo moo
+</pre> <h2 id="Split">func <span>Split</span> </h2> <pre data-language="go">func Split(s, sep string) []string</pre> <p>Split slices s into all substrings separated by sep and returns a slice of the substrings between those separators. </p>
+<p>If s does not contain sep and sep is not empty, Split returns a slice of length 1 whose only element is s. </p>
+<p>If sep is empty, Split splits after each UTF-8 sequence. If both s and sep are empty, Split returns an empty slice. </p>
+<p>It is equivalent to <a href="#SplitN">SplitN</a> with a count of -1. </p>
+<p>To split around the first instance of a separator, see Cut. </p> <h4 id="example_Split"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%q\n", strings.Split("a,b,c", ","))
+fmt.Printf("%q\n", strings.Split("a man a plan a canal panama", "a "))
+fmt.Printf("%q\n", strings.Split(" xyz ", ""))
+fmt.Printf("%q\n", strings.Split("", "Bernardo O'Higgins"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">["a" "b" "c"]
+["" "man " "plan " "canal panama"]
+[" " "x" "y" "z" " "]
+[""]
+</pre> <h2 id="SplitAfter">func <span>SplitAfter</span> </h2> <pre data-language="go">func SplitAfter(s, sep string) []string</pre> <p>SplitAfter slices s into all substrings after each instance of sep and returns a slice of those substrings. </p>
+<p>If s does not contain sep and sep is not empty, SplitAfter returns a slice of length 1 whose only element is s. </p>
+<p>If sep is empty, SplitAfter splits after each UTF-8 sequence. If both s and sep are empty, SplitAfter returns an empty slice. </p>
+<p>It is equivalent to <a href="#SplitAfterN">SplitAfterN</a> with a count of -1. </p> <h4 id="example_SplitAfter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%q\n", strings.SplitAfter("a,b,c", ","))
+</pre> <p>Output:</p> <pre class="output" data-language="go">["a," "b," "c"]
+</pre> <h2 id="SplitAfterN">func <span>SplitAfterN</span> </h2> <pre data-language="go">func SplitAfterN(s, sep string, n int) []string</pre> <p>SplitAfterN slices s into substrings after each instance of sep and returns a slice of those substrings. </p>
+<p>The count determines the number of substrings to return: </p>
+<pre data-language="go">n &gt; 0: at most n substrings; the last substring will be the unsplit remainder.
+n == 0: the result is nil (zero substrings)
+n &lt; 0: all substrings
+</pre> <p>Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for SplitAfter. </p> <h4 id="example_SplitAfterN"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%q\n", strings.SplitAfterN("a,b,c", ",", 2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">["a," "b,c"]
+</pre> <h2 id="SplitN">func <span>SplitN</span> </h2> <pre data-language="go">func SplitN(s, sep string, n int) []string</pre> <p>SplitN slices s into substrings separated by sep and returns a slice of the substrings between those separators. </p>
+<p>The count determines the number of substrings to return: </p>
+<pre data-language="go">n &gt; 0: at most n substrings; the last substring will be the unsplit remainder.
+n == 0: the result is nil (zero substrings)
+n &lt; 0: all substrings
+</pre> <p>Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for <a href="#Split">Split</a>. </p>
+<p>To split around the first instance of a separator, see Cut. </p> <h4 id="example_SplitN"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%q\n", strings.SplitN("a,b,c", ",", 2))
+z := strings.SplitN("a,b,c", ",", 0)
+fmt.Printf("%q (nil = %v)\n", z, z == nil)
+</pre> <p>Output:</p> <pre class="output" data-language="go">["a" "b,c"]
+[] (nil = true)
+</pre> <h2 id="Title">func <span>Title</span> </h2> <pre data-language="go">func Title(s string) string</pre> <p>Title returns a copy of the string s with all Unicode letters that begin words mapped to their Unicode title case. </p>
+<p>Deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. </p> <h4 id="example_Title"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Compare this example to the ToTitle example.
+fmt.Println(strings.Title("her royal highness"))
+fmt.Println(strings.Title("loud noises"))
+fmt.Println(strings.Title("хлеб"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Her Royal Highness
+Loud Noises
+Хлеб
+</pre> <h2 id="ToLower">func <span>ToLower</span> </h2> <pre data-language="go">func ToLower(s string) string</pre> <p>ToLower returns s with all Unicode letters mapped to their lower case. </p> <h4 id="example_ToLower"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.ToLower("Gopher"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">gopher
+</pre> <h2 id="ToLowerSpecial">func <span>ToLowerSpecial</span> </h2> <pre data-language="go">func ToLowerSpecial(c unicode.SpecialCase, s string) string</pre> <p>ToLowerSpecial returns a copy of the string s with all Unicode letters mapped to their lower case using the case mapping specified by c. </p> <h4 id="example_ToLowerSpecial"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.ToLowerSpecial(unicode.TurkishCase, "Önnek İş"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">önnek iş
+</pre> <h2 id="ToTitle">func <span>ToTitle</span> </h2> <pre data-language="go">func ToTitle(s string) string</pre> <p>ToTitle returns a copy of the string s with all Unicode letters mapped to their Unicode title case. </p> <h4 id="example_ToTitle"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Compare this example to the Title example.
+fmt.Println(strings.ToTitle("her royal highness"))
+fmt.Println(strings.ToTitle("loud noises"))
+fmt.Println(strings.ToTitle("хлеб"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">HER ROYAL HIGHNESS
+LOUD NOISES
+ХЛЕБ
+</pre> <h2 id="ToTitleSpecial">func <span>ToTitleSpecial</span> </h2> <pre data-language="go">func ToTitleSpecial(c unicode.SpecialCase, s string) string</pre> <p>ToTitleSpecial returns a copy of the string s with all Unicode letters mapped to their Unicode title case, giving priority to the special casing rules. </p> <h4 id="example_ToTitleSpecial"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.ToTitleSpecial(unicode.TurkishCase, "dünyanın ilk borsa yapısı Aizonai kabul edilir"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">DÜNYANIN İLK BORSA YAPISI AİZONAİ KABUL EDİLİR
+</pre> <h2 id="ToUpper">func <span>ToUpper</span> </h2> <pre data-language="go">func ToUpper(s string) string</pre> <p>ToUpper returns s with all Unicode letters mapped to their upper case. </p> <h4 id="example_ToUpper"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.ToUpper("Gopher"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">GOPHER
+</pre> <h2 id="ToUpperSpecial">func <span>ToUpperSpecial</span> </h2> <pre data-language="go">func ToUpperSpecial(c unicode.SpecialCase, s string) string</pre> <p>ToUpperSpecial returns a copy of the string s with all Unicode letters mapped to their upper case using the case mapping specified by c. </p> <h4 id="example_ToUpperSpecial"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.ToUpperSpecial(unicode.TurkishCase, "örnek iş"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">ÖRNEK İŞ
+</pre> <h2 id="ToValidUTF8">func <span>ToValidUTF8</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func ToValidUTF8(s, replacement string) string</pre> <p>ToValidUTF8 returns a copy of the string s with each run of invalid UTF-8 byte sequences replaced by the replacement string, which may be empty. </p> <h4 id="example_ToValidUTF8"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%s\n", strings.ToValidUTF8("abc", "\uFFFD"))
+fmt.Printf("%s\n", strings.ToValidUTF8("a\xffb\xC0\xAFc\xff", ""))
+fmt.Printf("%s\n", strings.ToValidUTF8("\xed\xa0\x80", "abc"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">abc
+abc
+abc
+</pre> <h2 id="Trim">func <span>Trim</span> </h2> <pre data-language="go">func Trim(s, cutset string) string</pre> <p>Trim returns a slice of the string s with all leading and trailing Unicode code points contained in cutset removed. </p> <h4 id="example_Trim"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Print(strings.Trim("¡¡¡Hello, Gophers!!!", "!¡"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, Gophers
+</pre> <h2 id="TrimFunc">func <span>TrimFunc</span> </h2> <pre data-language="go">func TrimFunc(s string, f func(rune) bool) string</pre> <p>TrimFunc returns a slice of the string s with all leading and trailing Unicode code points c satisfying f(c) removed. </p> <h4 id="example_TrimFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Print(strings.TrimFunc("¡¡¡Hello, Gophers!!!", func(r rune) bool {
+ return !unicode.IsLetter(r) &amp;&amp; !unicode.IsNumber(r)
+}))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, Gophers
+</pre> <h2 id="TrimLeft">func <span>TrimLeft</span> </h2> <pre data-language="go">func TrimLeft(s, cutset string) string</pre> <p>TrimLeft returns a slice of the string s with all leading Unicode code points contained in cutset removed. </p>
+<p>To remove a prefix, use <a href="#TrimPrefix">TrimPrefix</a> instead. </p> <h4 id="example_TrimLeft"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Print(strings.TrimLeft("¡¡¡Hello, Gophers!!!", "!¡"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, Gophers!!!
+</pre> <h2 id="TrimLeftFunc">func <span>TrimLeftFunc</span> </h2> <pre data-language="go">func TrimLeftFunc(s string, f func(rune) bool) string</pre> <p>TrimLeftFunc returns a slice of the string s with all leading Unicode code points c satisfying f(c) removed. </p> <h4 id="example_TrimLeftFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Print(strings.TrimLeftFunc("¡¡¡Hello, Gophers!!!", func(r rune) bool {
+ return !unicode.IsLetter(r) &amp;&amp; !unicode.IsNumber(r)
+}))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, Gophers!!!
+</pre> <h2 id="TrimPrefix">func <span>TrimPrefix</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func TrimPrefix(s, prefix string) string</pre> <p>TrimPrefix returns s without the provided leading prefix string. If s doesn't start with prefix, s is returned unchanged. </p> <h4 id="example_TrimPrefix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var s = "¡¡¡Hello, Gophers!!!"
+s = strings.TrimPrefix(s, "¡¡¡Hello, ")
+s = strings.TrimPrefix(s, "¡¡¡Howdy, ")
+fmt.Print(s)
+</pre> <p>Output:</p> <pre class="output" data-language="go">Gophers!!!
+</pre> <h2 id="TrimRight">func <span>TrimRight</span> </h2> <pre data-language="go">func TrimRight(s, cutset string) string</pre> <p>TrimRight returns a slice of the string s, with all trailing Unicode code points contained in cutset removed. </p>
+<p>To remove a suffix, use <a href="#TrimSuffix">TrimSuffix</a> instead. </p> <h4 id="example_TrimRight"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Print(strings.TrimRight("¡¡¡Hello, Gophers!!!", "!¡"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">¡¡¡Hello, Gophers
+</pre> <h2 id="TrimRightFunc">func <span>TrimRightFunc</span> </h2> <pre data-language="go">func TrimRightFunc(s string, f func(rune) bool) string</pre> <p>TrimRightFunc returns a slice of the string s with all trailing Unicode code points c satisfying f(c) removed. </p> <h4 id="example_TrimRightFunc"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Print(strings.TrimRightFunc("¡¡¡Hello, Gophers!!!", func(r rune) bool {
+ return !unicode.IsLetter(r) &amp;&amp; !unicode.IsNumber(r)
+}))
+</pre> <p>Output:</p> <pre class="output" data-language="go">¡¡¡Hello, Gophers
+</pre> <h2 id="TrimSpace">func <span>TrimSpace</span> </h2> <pre data-language="go">func TrimSpace(s string) string</pre> <p>TrimSpace returns a slice of the string s, with all leading and trailing white space removed, as defined by Unicode. </p> <h4 id="example_TrimSpace"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(strings.TrimSpace(" \t\n Hello, Gophers \n\t\r\n"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">Hello, Gophers
+</pre> <h2 id="TrimSuffix">func <span>TrimSuffix</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func TrimSuffix(s, suffix string) string</pre> <p>TrimSuffix returns s without the provided trailing suffix string. If s doesn't end with suffix, s is returned unchanged. </p> <h4 id="example_TrimSuffix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var s = "¡¡¡Hello, Gophers!!!"
+s = strings.TrimSuffix(s, ", Gophers!!!")
+s = strings.TrimSuffix(s, ", Marmots!!!")
+fmt.Print(s)
+</pre> <p>Output:</p> <pre class="output" data-language="go">¡¡¡Hello
+</pre> <h2 id="Builder">type <span>Builder</span> <span title="Added in Go 1.10">1.10</span> </h2> <p>A Builder is used to efficiently build a string using <a href="#Builder.Write">Builder.Write</a> methods. It minimizes memory copying. The zero value is ready to use. Do not copy a non-zero Builder. </p>
+<pre data-language="go">type Builder struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Builder"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var b strings.Builder
+for i := 3; i &gt;= 1; i-- {
+ fmt.Fprintf(&amp;b, "%d...", i)
+}
+b.WriteString("ignition")
+fmt.Println(b.String())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">3...2...1...ignition
+</pre> <h3 id="Builder.Cap">func (*Builder) <span>Cap</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (b *Builder) Cap() int</pre> <p>Cap returns the capacity of the builder's underlying byte slice. It is the total space allocated for the string being built and includes any bytes already written. </p>
+<h3 id="Builder.Grow">func (*Builder) <span>Grow</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Builder) Grow(n int)</pre> <p>Grow grows b's capacity, if necessary, to guarantee space for another n bytes. After Grow(n), at least n bytes can be written to b without another allocation. If n is negative, Grow panics. </p>
+<h3 id="Builder.Len">func (*Builder) <span>Len</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Builder) Len() int</pre> <p>Len returns the number of accumulated bytes; b.Len() == len(b.String()). </p>
+<h3 id="Builder.Reset">func (*Builder) <span>Reset</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Builder) Reset()</pre> <p>Reset resets the <a href="#Builder">Builder</a> to be empty. </p>
+<h3 id="Builder.String">func (*Builder) <span>String</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Builder) String() string</pre> <p>String returns the accumulated string. </p>
+<h3 id="Builder.Write">func (*Builder) <span>Write</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Builder) Write(p []byte) (int, error)</pre> <p>Write appends the contents of p to b's buffer. Write always returns len(p), nil. </p>
+<h3 id="Builder.WriteByte">func (*Builder) <span>WriteByte</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Builder) WriteByte(c byte) error</pre> <p>WriteByte appends the byte c to b's buffer. The returned error is always nil. </p>
+<h3 id="Builder.WriteRune">func (*Builder) <span>WriteRune</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Builder) WriteRune(r rune) (int, error)</pre> <p>WriteRune appends the UTF-8 encoding of Unicode code point r to b's buffer. It returns the length of r and a nil error. </p>
+<h3 id="Builder.WriteString">func (*Builder) <span>WriteString</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func (b *Builder) WriteString(s string) (int, error)</pre> <p>WriteString appends the contents of s to b's buffer. It returns the length of s and a nil error. </p>
+<h2 id="Reader">type <span>Reader</span> </h2> <p>A Reader implements the <span>io.Reader</span>, <span>io.ReaderAt</span>, <span>io.ByteReader</span>, <span>io.ByteScanner</span>, <span>io.RuneReader</span>, <span>io.RuneScanner</span>, <span>io.Seeker</span>, and <span>io.WriterTo</span> interfaces by reading from a string. The zero value for Reader operates like a Reader of an empty string. </p>
+<pre data-language="go">type Reader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewReader">func <span>NewReader</span> </h3> <pre data-language="go">func NewReader(s string) *Reader</pre> <p>NewReader returns a new <a href="#Reader">Reader</a> reading from s. It is similar to <span>bytes.NewBufferString</span> but more efficient and non-writable. </p>
+<h3 id="Reader.Len">func (*Reader) <span>Len</span> </h3> <pre data-language="go">func (r *Reader) Len() int</pre> <p>Len returns the number of bytes of the unread portion of the string. </p>
+<h3 id="Reader.Read">func (*Reader) <span>Read</span> </h3> <pre data-language="go">func (r *Reader) Read(b []byte) (n int, err error)</pre> <p>Read implements the <span>io.Reader</span> interface. </p>
+<h3 id="Reader.ReadAt">func (*Reader) <span>ReadAt</span> </h3> <pre data-language="go">func (r *Reader) ReadAt(b []byte, off int64) (n int, err error)</pre> <p>ReadAt implements the <span>io.ReaderAt</span> interface. </p>
+<h3 id="Reader.ReadByte">func (*Reader) <span>ReadByte</span> </h3> <pre data-language="go">func (r *Reader) ReadByte() (byte, error)</pre> <p>ReadByte implements the <span>io.ByteReader</span> interface. </p>
+<h3 id="Reader.ReadRune">func (*Reader) <span>ReadRune</span> </h3> <pre data-language="go">func (r *Reader) ReadRune() (ch rune, size int, err error)</pre> <p>ReadRune implements the <span>io.RuneReader</span> interface. </p>
+<h3 id="Reader.Reset">func (*Reader) <span>Reset</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (r *Reader) Reset(s string)</pre> <p>Reset resets the <a href="#Reader">Reader</a> to be reading from s. </p>
+<h3 id="Reader.Seek">func (*Reader) <span>Seek</span> </h3> <pre data-language="go">func (r *Reader) Seek(offset int64, whence int) (int64, error)</pre> <p>Seek implements the <span>io.Seeker</span> interface. </p>
+<h3 id="Reader.Size">func (*Reader) <span>Size</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (r *Reader) Size() int64</pre> <p>Size returns the original length of the underlying string. Size is the number of bytes available for reading via <a href="#Reader.ReadAt">Reader.ReadAt</a>. The returned value is always the same and is not affected by calls to any other method. </p>
+<h3 id="Reader.UnreadByte">func (*Reader) <span>UnreadByte</span> </h3> <pre data-language="go">func (r *Reader) UnreadByte() error</pre> <p>UnreadByte implements the <span>io.ByteScanner</span> interface. </p>
+<h3 id="Reader.UnreadRune">func (*Reader) <span>UnreadRune</span> </h3> <pre data-language="go">func (r *Reader) UnreadRune() error</pre> <p>UnreadRune implements the <span>io.RuneScanner</span> interface. </p>
+<h3 id="Reader.WriteTo">func (*Reader) <span>WriteTo</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (r *Reader) WriteTo(w io.Writer) (n int64, err error)</pre> <p>WriteTo implements the <span>io.WriterTo</span> interface. </p>
+<h2 id="Replacer">type <span>Replacer</span> </h2> <p>Replacer replaces a list of strings with replacements. It is safe for concurrent use by multiple goroutines. </p>
+<pre data-language="go">type Replacer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewReplacer">func <span>NewReplacer</span> </h3> <pre data-language="go">func NewReplacer(oldnew ...string) *Replacer</pre> <p>NewReplacer returns a new <a href="#Replacer">Replacer</a> from a list of old, new string pairs. Replacements are performed in the order they appear in the target string, without overlapping matches. The old string comparisons are done in argument order. </p>
+<p>NewReplacer panics if given an odd number of arguments. </p> <h4 id="example_NewReplacer"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := strings.NewReplacer("&lt;", "&amp;lt;", "&gt;", "&amp;gt;")
+fmt.Println(r.Replace("This is &lt;b&gt;HTML&lt;/b&gt;!"))
+</pre> <p>Output:</p> <pre class="output" data-language="go">This is &amp;lt;b&amp;gt;HTML&amp;lt;/b&amp;gt;!
+</pre> <h3 id="Replacer.Replace">func (*Replacer) <span>Replace</span> </h3> <pre data-language="go">func (r *Replacer) Replace(s string) string</pre> <p>Replace returns a copy of s with all replacements performed. </p>
+<h3 id="Replacer.WriteString">func (*Replacer) <span>WriteString</span> </h3> <pre data-language="go">func (r *Replacer) WriteString(w io.Writer, s string) (n int, err error)</pre> <p>WriteString writes s to w with all replacements performed. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/strings/" class="_attribution-link">http://golang.org/pkg/strings/</a>
+ </p>
+</div>
diff --git a/devdocs/go/sync%2Fatomic%2Findex.html b/devdocs/go/sync%2Fatomic%2Findex.html
new file mode 100644
index 00000000..f5fd3ba4
--- /dev/null
+++ b/devdocs/go/sync%2Fatomic%2Findex.html
@@ -0,0 +1,295 @@
+<h1> Package atomic </h1> <ul id="short-nav">
+<li><code>import "sync/atomic"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package atomic provides low-level atomic memory primitives useful for implementing synchronization algorithms. </p>
+<p>These functions require great care to be used correctly. Except for special, low-level applications, synchronization is better done with channels or the facilities of the <span>sync</span> package. Share memory by communicating; don't communicate by sharing memory. </p>
+<p>The swap operation, implemented by the SwapT functions, is the atomic equivalent of: </p>
+<pre data-language="go">old = *addr
+*addr = new
+return old
+</pre> <p>The compare-and-swap operation, implemented by the CompareAndSwapT functions, is the atomic equivalent of: </p>
+<pre data-language="go">if *addr == old {
+ *addr = new
+ return true
+}
+return false
+</pre> <p>The add operation, implemented by the AddT functions, is the atomic equivalent of: </p>
+<pre data-language="go">*addr += delta
+return *addr
+</pre> <p>The load and store operations, implemented by the LoadT and StoreT functions, are the atomic equivalents of "return *addr" and "*addr = val". </p>
+<p>In the terminology of the Go memory model, if the effect of an atomic operation A is observed by atomic operation B, then A “synchronizes before” B. Additionally, all the atomic operations executed in a program behave as though executed in some sequentially consistent order. This definition provides the same semantics as C++'s sequentially consistent atomics and Java's volatile variables. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#AddInt32">func AddInt32(addr *int32, delta int32) (new int32)</a></li>
+<li><a href="#AddInt64">func AddInt64(addr *int64, delta int64) (new int64)</a></li>
+<li><a href="#AddUint32">func AddUint32(addr *uint32, delta uint32) (new uint32)</a></li>
+<li><a href="#AddUint64">func AddUint64(addr *uint64, delta uint64) (new uint64)</a></li>
+<li><a href="#AddUintptr">func AddUintptr(addr *uintptr, delta uintptr) (new uintptr)</a></li>
+<li><a href="#CompareAndSwapInt32">func CompareAndSwapInt32(addr *int32, old, new int32) (swapped bool)</a></li>
+<li><a href="#CompareAndSwapInt64">func CompareAndSwapInt64(addr *int64, old, new int64) (swapped bool)</a></li>
+<li><a href="#CompareAndSwapPointer">func CompareAndSwapPointer(addr *unsafe.Pointer, old, new unsafe.Pointer) (swapped bool)</a></li>
+<li><a href="#CompareAndSwapUint32">func CompareAndSwapUint32(addr *uint32, old, new uint32) (swapped bool)</a></li>
+<li><a href="#CompareAndSwapUint64">func CompareAndSwapUint64(addr *uint64, old, new uint64) (swapped bool)</a></li>
+<li><a href="#CompareAndSwapUintptr">func CompareAndSwapUintptr(addr *uintptr, old, new uintptr) (swapped bool)</a></li>
+<li><a href="#LoadInt32">func LoadInt32(addr *int32) (val int32)</a></li>
+<li><a href="#LoadInt64">func LoadInt64(addr *int64) (val int64)</a></li>
+<li><a href="#LoadPointer">func LoadPointer(addr *unsafe.Pointer) (val unsafe.Pointer)</a></li>
+<li><a href="#LoadUint32">func LoadUint32(addr *uint32) (val uint32)</a></li>
+<li><a href="#LoadUint64">func LoadUint64(addr *uint64) (val uint64)</a></li>
+<li><a href="#LoadUintptr">func LoadUintptr(addr *uintptr) (val uintptr)</a></li>
+<li><a href="#StoreInt32">func StoreInt32(addr *int32, val int32)</a></li>
+<li><a href="#StoreInt64">func StoreInt64(addr *int64, val int64)</a></li>
+<li><a href="#StorePointer">func StorePointer(addr *unsafe.Pointer, val unsafe.Pointer)</a></li>
+<li><a href="#StoreUint32">func StoreUint32(addr *uint32, val uint32)</a></li>
+<li><a href="#StoreUint64">func StoreUint64(addr *uint64, val uint64)</a></li>
+<li><a href="#StoreUintptr">func StoreUintptr(addr *uintptr, val uintptr)</a></li>
+<li><a href="#SwapInt32">func SwapInt32(addr *int32, new int32) (old int32)</a></li>
+<li><a href="#SwapInt64">func SwapInt64(addr *int64, new int64) (old int64)</a></li>
+<li><a href="#SwapPointer">func SwapPointer(addr *unsafe.Pointer, new unsafe.Pointer) (old unsafe.Pointer)</a></li>
+<li><a href="#SwapUint32">func SwapUint32(addr *uint32, new uint32) (old uint32)</a></li>
+<li><a href="#SwapUint64">func SwapUint64(addr *uint64, new uint64) (old uint64)</a></li>
+<li><a href="#SwapUintptr">func SwapUintptr(addr *uintptr, new uintptr) (old uintptr)</a></li>
+<li><a href="#Bool">type Bool</a></li>
+<li> <a href="#Bool.CompareAndSwap">func (x *Bool) CompareAndSwap(old, new bool) (swapped bool)</a>
+</li>
+<li> <a href="#Bool.Load">func (x *Bool) Load() bool</a>
+</li>
+<li> <a href="#Bool.Store">func (x *Bool) Store(val bool)</a>
+</li>
+<li> <a href="#Bool.Swap">func (x *Bool) Swap(new bool) (old bool)</a>
+</li>
+<li><a href="#Int32">type Int32</a></li>
+<li> <a href="#Int32.Add">func (x *Int32) Add(delta int32) (new int32)</a>
+</li>
+<li> <a href="#Int32.CompareAndSwap">func (x *Int32) CompareAndSwap(old, new int32) (swapped bool)</a>
+</li>
+<li> <a href="#Int32.Load">func (x *Int32) Load() int32</a>
+</li>
+<li> <a href="#Int32.Store">func (x *Int32) Store(val int32)</a>
+</li>
+<li> <a href="#Int32.Swap">func (x *Int32) Swap(new int32) (old int32)</a>
+</li>
+<li><a href="#Int64">type Int64</a></li>
+<li> <a href="#Int64.Add">func (x *Int64) Add(delta int64) (new int64)</a>
+</li>
+<li> <a href="#Int64.CompareAndSwap">func (x *Int64) CompareAndSwap(old, new int64) (swapped bool)</a>
+</li>
+<li> <a href="#Int64.Load">func (x *Int64) Load() int64</a>
+</li>
+<li> <a href="#Int64.Store">func (x *Int64) Store(val int64)</a>
+</li>
+<li> <a href="#Int64.Swap">func (x *Int64) Swap(new int64) (old int64)</a>
+</li>
+<li><a href="#Pointer">type Pointer</a></li>
+<li> <a href="#Pointer.CompareAndSwap">func (x *Pointer[T]) CompareAndSwap(old, new *T) (swapped bool)</a>
+</li>
+<li> <a href="#Pointer.Load">func (x *Pointer[T]) Load() *T</a>
+</li>
+<li> <a href="#Pointer.Store">func (x *Pointer[T]) Store(val *T)</a>
+</li>
+<li> <a href="#Pointer.Swap">func (x *Pointer[T]) Swap(new *T) (old *T)</a>
+</li>
+<li><a href="#Uint32">type Uint32</a></li>
+<li> <a href="#Uint32.Add">func (x *Uint32) Add(delta uint32) (new uint32)</a>
+</li>
+<li> <a href="#Uint32.CompareAndSwap">func (x *Uint32) CompareAndSwap(old, new uint32) (swapped bool)</a>
+</li>
+<li> <a href="#Uint32.Load">func (x *Uint32) Load() uint32</a>
+</li>
+<li> <a href="#Uint32.Store">func (x *Uint32) Store(val uint32)</a>
+</li>
+<li> <a href="#Uint32.Swap">func (x *Uint32) Swap(new uint32) (old uint32)</a>
+</li>
+<li><a href="#Uint64">type Uint64</a></li>
+<li> <a href="#Uint64.Add">func (x *Uint64) Add(delta uint64) (new uint64)</a>
+</li>
+<li> <a href="#Uint64.CompareAndSwap">func (x *Uint64) CompareAndSwap(old, new uint64) (swapped bool)</a>
+</li>
+<li> <a href="#Uint64.Load">func (x *Uint64) Load() uint64</a>
+</li>
+<li> <a href="#Uint64.Store">func (x *Uint64) Store(val uint64)</a>
+</li>
+<li> <a href="#Uint64.Swap">func (x *Uint64) Swap(new uint64) (old uint64)</a>
+</li>
+<li><a href="#Uintptr">type Uintptr</a></li>
+<li> <a href="#Uintptr.Add">func (x *Uintptr) Add(delta uintptr) (new uintptr)</a>
+</li>
+<li> <a href="#Uintptr.CompareAndSwap">func (x *Uintptr) CompareAndSwap(old, new uintptr) (swapped bool)</a>
+</li>
+<li> <a href="#Uintptr.Load">func (x *Uintptr) Load() uintptr</a>
+</li>
+<li> <a href="#Uintptr.Store">func (x *Uintptr) Store(val uintptr)</a>
+</li>
+<li> <a href="#Uintptr.Swap">func (x *Uintptr) Swap(new uintptr) (old uintptr)</a>
+</li>
+<li><a href="#Value">type Value</a></li>
+<li> <a href="#Value.CompareAndSwap">func (v *Value) CompareAndSwap(old, new any) (swapped bool)</a>
+</li>
+<li> <a href="#Value.Load">func (v *Value) Load() (val any)</a>
+</li>
+<li> <a href="#Value.Store">func (v *Value) Store(val any)</a>
+</li>
+<li> <a href="#Value.Swap">func (v *Value) Swap(new any) (old any)</a>
+</li>
+<li><a href="#pkg-note-BUG">Bugs</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Value_config">Value (Config)</a></dd> <dd><a class="exampleLink" href="#example_Value_readMostly">Value (ReadMostly)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>doc.go</span> <span>type.go</span> <span>value.go</span> </p> <h2 id="AddInt32">func <span>AddInt32</span> </h2> <pre data-language="go">func AddInt32(addr *int32, delta int32) (new int32)</pre> <p>AddInt32 atomically adds delta to *addr and returns the new value. Consider using the more ergonomic and less error-prone <a href="#Int32.Add">Int32.Add</a> instead. </p>
+<h2 id="AddInt64">func <span>AddInt64</span> </h2> <pre data-language="go">func AddInt64(addr *int64, delta int64) (new int64)</pre> <p>AddInt64 atomically adds delta to *addr and returns the new value. Consider using the more ergonomic and less error-prone <a href="#Int64.Add">Int64.Add</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="AddUint32">func <span>AddUint32</span> </h2> <pre data-language="go">func AddUint32(addr *uint32, delta uint32) (new uint32)</pre> <p>AddUint32 atomically adds delta to *addr and returns the new value. To subtract a signed positive constant value c from x, do AddUint32(&amp;x, ^uint32(c-1)). In particular, to decrement x, do AddUint32(&amp;x, ^uint32(0)). Consider using the more ergonomic and less error-prone <a href="#Uint32.Add">Uint32.Add</a> instead. </p>
+<h2 id="AddUint64">func <span>AddUint64</span> </h2> <pre data-language="go">func AddUint64(addr *uint64, delta uint64) (new uint64)</pre> <p>AddUint64 atomically adds delta to *addr and returns the new value. To subtract a signed positive constant value c from x, do AddUint64(&amp;x, ^uint64(c-1)). In particular, to decrement x, do AddUint64(&amp;x, ^uint64(0)). Consider using the more ergonomic and less error-prone <a href="#Uint64.Add">Uint64.Add</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="AddUintptr">func <span>AddUintptr</span> </h2> <pre data-language="go">func AddUintptr(addr *uintptr, delta uintptr) (new uintptr)</pre> <p>AddUintptr atomically adds delta to *addr and returns the new value. Consider using the more ergonomic and less error-prone <a href="#Uintptr.Add">Uintptr.Add</a> instead. </p>
+<h2 id="CompareAndSwapInt32">func <span>CompareAndSwapInt32</span> </h2> <pre data-language="go">func CompareAndSwapInt32(addr *int32, old, new int32) (swapped bool)</pre> <p>CompareAndSwapInt32 executes the compare-and-swap operation for an int32 value. Consider using the more ergonomic and less error-prone <a href="#Int32.CompareAndSwap">Int32.CompareAndSwap</a> instead. </p>
+<h2 id="CompareAndSwapInt64">func <span>CompareAndSwapInt64</span> </h2> <pre data-language="go">func CompareAndSwapInt64(addr *int64, old, new int64) (swapped bool)</pre> <p>CompareAndSwapInt64 executes the compare-and-swap operation for an int64 value. Consider using the more ergonomic and less error-prone <a href="#Int64.CompareAndSwap">Int64.CompareAndSwap</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="CompareAndSwapPointer">func <span>CompareAndSwapPointer</span> </h2> <pre data-language="go">func CompareAndSwapPointer(addr *unsafe.Pointer, old, new unsafe.Pointer) (swapped bool)</pre> <p>CompareAndSwapPointer executes the compare-and-swap operation for a unsafe.Pointer value. Consider using the more ergonomic and less error-prone <a href="#Pointer.CompareAndSwap">Pointer.CompareAndSwap</a> instead. </p>
+<h2 id="CompareAndSwapUint32">func <span>CompareAndSwapUint32</span> </h2> <pre data-language="go">func CompareAndSwapUint32(addr *uint32, old, new uint32) (swapped bool)</pre> <p>CompareAndSwapUint32 executes the compare-and-swap operation for a uint32 value. Consider using the more ergonomic and less error-prone <a href="#Uint32.CompareAndSwap">Uint32.CompareAndSwap</a> instead. </p>
+<h2 id="CompareAndSwapUint64">func <span>CompareAndSwapUint64</span> </h2> <pre data-language="go">func CompareAndSwapUint64(addr *uint64, old, new uint64) (swapped bool)</pre> <p>CompareAndSwapUint64 executes the compare-and-swap operation for a uint64 value. Consider using the more ergonomic and less error-prone <a href="#Uint64.CompareAndSwap">Uint64.CompareAndSwap</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="CompareAndSwapUintptr">func <span>CompareAndSwapUintptr</span> </h2> <pre data-language="go">func CompareAndSwapUintptr(addr *uintptr, old, new uintptr) (swapped bool)</pre> <p>CompareAndSwapUintptr executes the compare-and-swap operation for a uintptr value. Consider using the more ergonomic and less error-prone <a href="#Uintptr.CompareAndSwap">Uintptr.CompareAndSwap</a> instead. </p>
+<h2 id="LoadInt32">func <span>LoadInt32</span> </h2> <pre data-language="go">func LoadInt32(addr *int32) (val int32)</pre> <p>LoadInt32 atomically loads *addr. Consider using the more ergonomic and less error-prone <a href="#Int32.Load">Int32.Load</a> instead. </p>
+<h2 id="LoadInt64">func <span>LoadInt64</span> </h2> <pre data-language="go">func LoadInt64(addr *int64) (val int64)</pre> <p>LoadInt64 atomically loads *addr. Consider using the more ergonomic and less error-prone <a href="#Int64.Load">Int64.Load</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="LoadPointer">func <span>LoadPointer</span> </h2> <pre data-language="go">func LoadPointer(addr *unsafe.Pointer) (val unsafe.Pointer)</pre> <p>LoadPointer atomically loads *addr. Consider using the more ergonomic and less error-prone <a href="#Pointer.Load">Pointer.Load</a> instead. </p>
+<h2 id="LoadUint32">func <span>LoadUint32</span> </h2> <pre data-language="go">func LoadUint32(addr *uint32) (val uint32)</pre> <p>LoadUint32 atomically loads *addr. Consider using the more ergonomic and less error-prone <a href="#Uint32.Load">Uint32.Load</a> instead. </p>
+<h2 id="LoadUint64">func <span>LoadUint64</span> </h2> <pre data-language="go">func LoadUint64(addr *uint64) (val uint64)</pre> <p>LoadUint64 atomically loads *addr. Consider using the more ergonomic and less error-prone <a href="#Uint64.Load">Uint64.Load</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="LoadUintptr">func <span>LoadUintptr</span> </h2> <pre data-language="go">func LoadUintptr(addr *uintptr) (val uintptr)</pre> <p>LoadUintptr atomically loads *addr. Consider using the more ergonomic and less error-prone <a href="#Uintptr.Load">Uintptr.Load</a> instead. </p>
+<h2 id="StoreInt32">func <span>StoreInt32</span> </h2> <pre data-language="go">func StoreInt32(addr *int32, val int32)</pre> <p>StoreInt32 atomically stores val into *addr. Consider using the more ergonomic and less error-prone <a href="#Int32.Store">Int32.Store</a> instead. </p>
+<h2 id="StoreInt64">func <span>StoreInt64</span> </h2> <pre data-language="go">func StoreInt64(addr *int64, val int64)</pre> <p>StoreInt64 atomically stores val into *addr. Consider using the more ergonomic and less error-prone <a href="#Int64.Store">Int64.Store</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="StorePointer">func <span>StorePointer</span> </h2> <pre data-language="go">func StorePointer(addr *unsafe.Pointer, val unsafe.Pointer)</pre> <p>StorePointer atomically stores val into *addr. Consider using the more ergonomic and less error-prone <a href="#Pointer.Store">Pointer.Store</a> instead. </p>
+<h2 id="StoreUint32">func <span>StoreUint32</span> </h2> <pre data-language="go">func StoreUint32(addr *uint32, val uint32)</pre> <p>StoreUint32 atomically stores val into *addr. Consider using the more ergonomic and less error-prone <a href="#Uint32.Store">Uint32.Store</a> instead. </p>
+<h2 id="StoreUint64">func <span>StoreUint64</span> </h2> <pre data-language="go">func StoreUint64(addr *uint64, val uint64)</pre> <p>StoreUint64 atomically stores val into *addr. Consider using the more ergonomic and less error-prone <a href="#Uint64.Store">Uint64.Store</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="StoreUintptr">func <span>StoreUintptr</span> </h2> <pre data-language="go">func StoreUintptr(addr *uintptr, val uintptr)</pre> <p>StoreUintptr atomically stores val into *addr. Consider using the more ergonomic and less error-prone <a href="#Uintptr.Store">Uintptr.Store</a> instead. </p>
+<h2 id="SwapInt32">func <span>SwapInt32</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func SwapInt32(addr *int32, new int32) (old int32)</pre> <p>SwapInt32 atomically stores new into *addr and returns the previous *addr value. Consider using the more ergonomic and less error-prone <a href="#Int32.Swap">Int32.Swap</a> instead. </p>
+<h2 id="SwapInt64">func <span>SwapInt64</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func SwapInt64(addr *int64, new int64) (old int64)</pre> <p>SwapInt64 atomically stores new into *addr and returns the previous *addr value. Consider using the more ergonomic and less error-prone <a href="#Int64.Swap">Int64.Swap</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="SwapPointer">func <span>SwapPointer</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func SwapPointer(addr *unsafe.Pointer, new unsafe.Pointer) (old unsafe.Pointer)</pre> <p>SwapPointer atomically stores new into *addr and returns the previous *addr value. Consider using the more ergonomic and less error-prone <a href="#Pointer.Swap">Pointer.Swap</a> instead. </p>
+<h2 id="SwapUint32">func <span>SwapUint32</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func SwapUint32(addr *uint32, new uint32) (old uint32)</pre> <p>SwapUint32 atomically stores new into *addr and returns the previous *addr value. Consider using the more ergonomic and less error-prone <a href="#Uint32.Swap">Uint32.Swap</a> instead. </p>
+<h2 id="SwapUint64">func <span>SwapUint64</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func SwapUint64(addr *uint64, new uint64) (old uint64)</pre> <p>SwapUint64 atomically stores new into *addr and returns the previous *addr value. Consider using the more ergonomic and less error-prone <a href="#Uint64.Swap">Uint64.Swap</a> instead (particularly if you target 32-bit platforms; see the bugs section). </p>
+<h2 id="SwapUintptr">func <span>SwapUintptr</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func SwapUintptr(addr *uintptr, new uintptr) (old uintptr)</pre> <p>SwapUintptr atomically stores new into *addr and returns the previous *addr value. Consider using the more ergonomic and less error-prone <a href="#Uintptr.Swap">Uintptr.Swap</a> instead. </p>
+<h2 id="Bool">type <span>Bool</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Bool is an atomic boolean value. The zero value is false. </p>
+<pre data-language="go">type Bool struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Bool.CompareAndSwap">func (*Bool) <span>CompareAndSwap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Bool) CompareAndSwap(old, new bool) (swapped bool)</pre> <p>CompareAndSwap executes the compare-and-swap operation for the boolean value x. </p>
+<h3 id="Bool.Load">func (*Bool) <span>Load</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Bool) Load() bool</pre> <p>Load atomically loads and returns the value stored in x. </p>
+<h3 id="Bool.Store">func (*Bool) <span>Store</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Bool) Store(val bool)</pre> <p>Store atomically stores val into x. </p>
+<h3 id="Bool.Swap">func (*Bool) <span>Swap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Bool) Swap(new bool) (old bool)</pre> <p>Swap atomically stores new into x and returns the previous value. </p>
+<h2 id="Int32">type <span>Int32</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>An Int32 is an atomic int32. The zero value is zero. </p>
+<pre data-language="go">type Int32 struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Int32.Add">func (*Int32) <span>Add</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int32) Add(delta int32) (new int32)</pre> <p>Add atomically adds delta to x and returns the new value. </p>
+<h3 id="Int32.CompareAndSwap">func (*Int32) <span>CompareAndSwap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int32) CompareAndSwap(old, new int32) (swapped bool)</pre> <p>CompareAndSwap executes the compare-and-swap operation for x. </p>
+<h3 id="Int32.Load">func (*Int32) <span>Load</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int32) Load() int32</pre> <p>Load atomically loads and returns the value stored in x. </p>
+<h3 id="Int32.Store">func (*Int32) <span>Store</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int32) Store(val int32)</pre> <p>Store atomically stores val into x. </p>
+<h3 id="Int32.Swap">func (*Int32) <span>Swap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int32) Swap(new int32) (old int32)</pre> <p>Swap atomically stores new into x and returns the previous value. </p>
+<h2 id="Int64">type <span>Int64</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>An Int64 is an atomic int64. The zero value is zero. </p>
+<pre data-language="go">type Int64 struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Int64.Add">func (*Int64) <span>Add</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int64) Add(delta int64) (new int64)</pre> <p>Add atomically adds delta to x and returns the new value. </p>
+<h3 id="Int64.CompareAndSwap">func (*Int64) <span>CompareAndSwap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int64) CompareAndSwap(old, new int64) (swapped bool)</pre> <p>CompareAndSwap executes the compare-and-swap operation for x. </p>
+<h3 id="Int64.Load">func (*Int64) <span>Load</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int64) Load() int64</pre> <p>Load atomically loads and returns the value stored in x. </p>
+<h3 id="Int64.Store">func (*Int64) <span>Store</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int64) Store(val int64)</pre> <p>Store atomically stores val into x. </p>
+<h3 id="Int64.Swap">func (*Int64) <span>Swap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Int64) Swap(new int64) (old int64)</pre> <p>Swap atomically stores new into x and returns the previous value. </p>
+<h2 id="Pointer">type <span>Pointer</span> </h2> <p>A Pointer is an atomic pointer of type *T. The zero value is a nil *T. </p>
+<pre data-language="go">type Pointer[T any] struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Pointer.CompareAndSwap">func (*Pointer[T]) <span>CompareAndSwap</span> </h3> <pre data-language="go">func (x *Pointer[T]) CompareAndSwap(old, new *T) (swapped bool)</pre> <p>CompareAndSwap executes the compare-and-swap operation for x. </p>
+<h3 id="Pointer.Load">func (*Pointer[T]) <span>Load</span> </h3> <pre data-language="go">func (x *Pointer[T]) Load() *T</pre> <p>Load atomically loads and returns the value stored in x. </p>
+<h3 id="Pointer.Store">func (*Pointer[T]) <span>Store</span> </h3> <pre data-language="go">func (x *Pointer[T]) Store(val *T)</pre> <p>Store atomically stores val into x. </p>
+<h3 id="Pointer.Swap">func (*Pointer[T]) <span>Swap</span> </h3> <pre data-language="go">func (x *Pointer[T]) Swap(new *T) (old *T)</pre> <p>Swap atomically stores new into x and returns the previous value. </p>
+<h2 id="Uint32">type <span>Uint32</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Uint32 is an atomic uint32. The zero value is zero. </p>
+<pre data-language="go">type Uint32 struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Uint32.Add">func (*Uint32) <span>Add</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint32) Add(delta uint32) (new uint32)</pre> <p>Add atomically adds delta to x and returns the new value. </p>
+<h3 id="Uint32.CompareAndSwap">func (*Uint32) <span>CompareAndSwap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint32) CompareAndSwap(old, new uint32) (swapped bool)</pre> <p>CompareAndSwap executes the compare-and-swap operation for x. </p>
+<h3 id="Uint32.Load">func (*Uint32) <span>Load</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint32) Load() uint32</pre> <p>Load atomically loads and returns the value stored in x. </p>
+<h3 id="Uint32.Store">func (*Uint32) <span>Store</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint32) Store(val uint32)</pre> <p>Store atomically stores val into x. </p>
+<h3 id="Uint32.Swap">func (*Uint32) <span>Swap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint32) Swap(new uint32) (old uint32)</pre> <p>Swap atomically stores new into x and returns the previous value. </p>
+<h2 id="Uint64">type <span>Uint64</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Uint64 is an atomic uint64. The zero value is zero. </p>
+<pre data-language="go">type Uint64 struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Uint64.Add">func (*Uint64) <span>Add</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint64) Add(delta uint64) (new uint64)</pre> <p>Add atomically adds delta to x and returns the new value. </p>
+<h3 id="Uint64.CompareAndSwap">func (*Uint64) <span>CompareAndSwap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint64) CompareAndSwap(old, new uint64) (swapped bool)</pre> <p>CompareAndSwap executes the compare-and-swap operation for x. </p>
+<h3 id="Uint64.Load">func (*Uint64) <span>Load</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint64) Load() uint64</pre> <p>Load atomically loads and returns the value stored in x. </p>
+<h3 id="Uint64.Store">func (*Uint64) <span>Store</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint64) Store(val uint64)</pre> <p>Store atomically stores val into x. </p>
+<h3 id="Uint64.Swap">func (*Uint64) <span>Swap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uint64) Swap(new uint64) (old uint64)</pre> <p>Swap atomically stores new into x and returns the previous value. </p>
+<h2 id="Uintptr">type <span>Uintptr</span> <span title="Added in Go 1.19">1.19</span> </h2> <p>A Uintptr is an atomic uintptr. The zero value is zero. </p>
+<pre data-language="go">type Uintptr struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Uintptr.Add">func (*Uintptr) <span>Add</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uintptr) Add(delta uintptr) (new uintptr)</pre> <p>Add atomically adds delta to x and returns the new value. </p>
+<h3 id="Uintptr.CompareAndSwap">func (*Uintptr) <span>CompareAndSwap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uintptr) CompareAndSwap(old, new uintptr) (swapped bool)</pre> <p>CompareAndSwap executes the compare-and-swap operation for x. </p>
+<h3 id="Uintptr.Load">func (*Uintptr) <span>Load</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uintptr) Load() uintptr</pre> <p>Load atomically loads and returns the value stored in x. </p>
+<h3 id="Uintptr.Store">func (*Uintptr) <span>Store</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uintptr) Store(val uintptr)</pre> <p>Store atomically stores val into x. </p>
+<h3 id="Uintptr.Swap">func (*Uintptr) <span>Swap</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (x *Uintptr) Swap(new uintptr) (old uintptr)</pre> <p>Swap atomically stores new into x and returns the previous value. </p>
+<h2 id="Value">type <span>Value</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>A Value provides an atomic load and store of a consistently typed value. The zero value for a Value returns nil from Load. Once Store has been called, a Value must not be copied. </p>
+<p>A Value must not be copied after first use. </p>
+<pre data-language="go">type Value struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Value_config"> <span class="text">Example (Config)</span>
+</h4> <p>The following example shows how to use Value for periodic program config updates and propagation of the changes to worker goroutines. </p> <p>Code:</p> <pre class="code" data-language="go">
+var config atomic.Value // holds current server configuration
+// Create initial config value and store into config.
+config.Store(loadConfig())
+go func() {
+ // Reload config every 10 seconds
+ // and update config value with the new version.
+ for {
+ time.Sleep(10 * time.Second)
+ config.Store(loadConfig())
+ }
+}()
+// Create worker goroutines that handle incoming requests
+// using the latest config value.
+for i := 0; i &lt; 10; i++ {
+ go func() {
+ for r := range requests() {
+ c := config.Load()
+ // Handle request r using config c.
+ _, _ = r, c
+ }
+ }()
+}
+</pre> <h4 id="example_Value_readMostly"> <span class="text">Example (ReadMostly)</span>
+</h4> <p>The following example shows how to maintain a scalable frequently read, but infrequently updated data structure using copy-on-write idiom. </p> <p>Code:</p> <pre class="code" data-language="go">
+type Map map[string]string
+var m atomic.Value
+m.Store(make(Map))
+var mu sync.Mutex // used only by writers
+// read function can be used to read the data without further synchronization
+read := func(key string) (val string) {
+ m1 := m.Load().(Map)
+ return m1[key]
+}
+// insert function can be used to update the data without further synchronization
+insert := func(key, val string) {
+ mu.Lock() // synchronize with other potential writers
+ defer mu.Unlock()
+ m1 := m.Load().(Map) // load current value of the data structure
+ m2 := make(Map) // create a new value
+ for k, v := range m1 {
+ m2[k] = v // copy all data from the current object to the new one
+ }
+ m2[key] = val // do the update that we need
+ m.Store(m2) // atomically replace the current object with the new one
+ // At this point all new readers start working with the new version.
+ // The old version will be garbage collected once the existing readers
+ // (if any) are done with it.
+}
+_, _ = read, insert
+</pre> <h3 id="Value.CompareAndSwap">func (*Value) <span>CompareAndSwap</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (v *Value) CompareAndSwap(old, new any) (swapped bool)</pre> <p>CompareAndSwap executes the compare-and-swap operation for the Value. </p>
+<p>All calls to CompareAndSwap for a given Value must use values of the same concrete type. CompareAndSwap of an inconsistent type panics, as does CompareAndSwap(old, nil). </p>
+<h3 id="Value.Load">func (*Value) <span>Load</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (v *Value) Load() (val any)</pre> <p>Load returns the value set by the most recent Store. It returns nil if there has been no call to Store for this Value. </p>
+<h3 id="Value.Store">func (*Value) <span>Store</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (v *Value) Store(val any)</pre> <p>Store sets the value of the Value v to val. All calls to Store for a given Value must use values of the same concrete type. Store of an inconsistent type panics, as does Store(nil). </p>
+<h3 id="Value.Swap">func (*Value) <span>Swap</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (v *Value) Swap(new any) (old any)</pre> <p>Swap stores new into Value and returns the previous value. It returns nil if the Value is empty. </p>
+<p>All calls to Swap for a given Value must use values of the same concrete type. Swap of an inconsistent type panics, as does Swap(nil). </p>
+<h2 id="pkg-note-BUG">Bugs</h2> <ul> <li>☞ <p>On 386, the 64-bit functions use instructions unavailable before the Pentium MMX. </p>
+<p>On non-Linux ARM, the 64-bit functions use instructions unavailable before the ARMv6k core. </p>
+<p>On ARM, 386, and 32-bit MIPS, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically via the primitive atomic functions (types <a href="#Int64">Int64</a> and <a href="#Uint64">Uint64</a> are automatically aligned). The first word in an allocated struct, array, or slice; in a global variable; or in a local variable (because the subject of all atomic operations will escape to the heap) can be relied upon to be 64-bit aligned. </p>
+</li> </ul><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/sync/atomic/" class="_attribution-link">http://golang.org/pkg/sync/atomic/</a>
+ </p>
+</div>
diff --git a/devdocs/go/sync%2Findex.html b/devdocs/go/sync%2Findex.html
new file mode 100644
index 00000000..d697bad7
--- /dev/null
+++ b/devdocs/go/sync%2Findex.html
@@ -0,0 +1,290 @@
+<h1> Package sync </h1> <ul id="short-nav">
+<li><code>import "sync"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package sync provides basic synchronization primitives such as mutual exclusion locks. Other than the Once and WaitGroup types, most are intended for use by low-level library routines. Higher-level synchronization is better done via channels and communication. </p>
+<p>Values containing the types defined in this package should not be copied. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#OnceFunc">func OnceFunc(f func()) func()</a></li>
+<li><a href="#OnceValue">func OnceValue[T any](f func() T) func() T</a></li>
+<li><a href="#OnceValues">func OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2)</a></li>
+<li><a href="#Cond">type Cond</a></li>
+<li> <a href="#NewCond">func NewCond(l Locker) *Cond</a>
+</li>
+<li> <a href="#Cond.Broadcast">func (c *Cond) Broadcast()</a>
+</li>
+<li> <a href="#Cond.Signal">func (c *Cond) Signal()</a>
+</li>
+<li> <a href="#Cond.Wait">func (c *Cond) Wait()</a>
+</li>
+<li><a href="#Locker">type Locker</a></li>
+<li><a href="#Map">type Map</a></li>
+<li> <a href="#Map.CompareAndDelete">func (m *Map) CompareAndDelete(key, old any) (deleted bool)</a>
+</li>
+<li> <a href="#Map.CompareAndSwap">func (m *Map) CompareAndSwap(key, old, new any) bool</a>
+</li>
+<li> <a href="#Map.Delete">func (m *Map) Delete(key any)</a>
+</li>
+<li> <a href="#Map.Load">func (m *Map) Load(key any) (value any, ok bool)</a>
+</li>
+<li> <a href="#Map.LoadAndDelete">func (m *Map) LoadAndDelete(key any) (value any, loaded bool)</a>
+</li>
+<li> <a href="#Map.LoadOrStore">func (m *Map) LoadOrStore(key, value any) (actual any, loaded bool)</a>
+</li>
+<li> <a href="#Map.Range">func (m *Map) Range(f func(key, value any) bool)</a>
+</li>
+<li> <a href="#Map.Store">func (m *Map) Store(key, value any)</a>
+</li>
+<li> <a href="#Map.Swap">func (m *Map) Swap(key, value any) (previous any, loaded bool)</a>
+</li>
+<li><a href="#Mutex">type Mutex</a></li>
+<li> <a href="#Mutex.Lock">func (m *Mutex) Lock()</a>
+</li>
+<li> <a href="#Mutex.TryLock">func (m *Mutex) TryLock() bool</a>
+</li>
+<li> <a href="#Mutex.Unlock">func (m *Mutex) Unlock()</a>
+</li>
+<li><a href="#Once">type Once</a></li>
+<li> <a href="#Once.Do">func (o *Once) Do(f func())</a>
+</li>
+<li><a href="#Pool">type Pool</a></li>
+<li> <a href="#Pool.Get">func (p *Pool) Get() any</a>
+</li>
+<li> <a href="#Pool.Put">func (p *Pool) Put(x any)</a>
+</li>
+<li><a href="#RWMutex">type RWMutex</a></li>
+<li> <a href="#RWMutex.Lock">func (rw *RWMutex) Lock()</a>
+</li>
+<li> <a href="#RWMutex.RLock">func (rw *RWMutex) RLock()</a>
+</li>
+<li> <a href="#RWMutex.RLocker">func (rw *RWMutex) RLocker() Locker</a>
+</li>
+<li> <a href="#RWMutex.RUnlock">func (rw *RWMutex) RUnlock()</a>
+</li>
+<li> <a href="#RWMutex.TryLock">func (rw *RWMutex) TryLock() bool</a>
+</li>
+<li> <a href="#RWMutex.TryRLock">func (rw *RWMutex) TryRLock() bool</a>
+</li>
+<li> <a href="#RWMutex.Unlock">func (rw *RWMutex) Unlock()</a>
+</li>
+<li><a href="#WaitGroup">type WaitGroup</a></li>
+<li> <a href="#WaitGroup.Add">func (wg *WaitGroup) Add(delta int)</a>
+</li>
+<li> <a href="#WaitGroup.Done">func (wg *WaitGroup) Done()</a>
+</li>
+<li> <a href="#WaitGroup.Wait">func (wg *WaitGroup) Wait()</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Once">Once</a></dd> <dd><a class="exampleLink" href="#example_Pool">Pool</a></dd> <dd><a class="exampleLink" href="#example_WaitGroup">WaitGroup</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>cond.go</span> <span>map.go</span> <span>mutex.go</span> <span>once.go</span> <span>oncefunc.go</span> <span>pool.go</span> <span>poolqueue.go</span> <span>runtime.go</span> <span>runtime2.go</span> <span>rwmutex.go</span> <span>waitgroup.go</span> </p> <h2 id="OnceFunc">func <span>OnceFunc</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func OnceFunc(f func()) func()</pre> <p>OnceFunc returns a function that invokes f only once. The returned function may be called concurrently. </p>
+<p>If f panics, the returned function will panic with the same value on every call. </p>
+<h2 id="OnceValue">func <span>OnceValue</span> </h2> <pre data-language="go">func OnceValue[T any](f func() T) func() T</pre> <p>OnceValue returns a function that invokes f only once and returns the value returned by f. The returned function may be called concurrently. </p>
+<p>If f panics, the returned function will panic with the same value on every call. </p>
+<h2 id="OnceValues">func <span>OnceValues</span> </h2> <pre data-language="go">func OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2)</pre> <p>OnceValues returns a function that invokes f only once and returns the values returned by f. The returned function may be called concurrently. </p>
+<p>If f panics, the returned function will panic with the same value on every call. </p>
+<h2 id="Cond">type <span>Cond</span> </h2> <p>Cond implements a condition variable, a rendezvous point for goroutines waiting for or announcing the occurrence of an event. </p>
+<p>Each Cond has an associated Locker L (often a *Mutex or *RWMutex), which must be held when changing the condition and when calling the Wait method. </p>
+<p>A Cond must not be copied after first use. </p>
+<p>In the terminology of the Go memory model, Cond arranges that a call to Broadcast or Signal “synchronizes before” any Wait call that it unblocks. </p>
+<p>For many simple use cases, users will be better off using channels than a Cond (Broadcast corresponds to closing a channel, and Signal corresponds to sending on a channel). </p>
+<p>For more on replacements for sync.Cond, see <a href="https://blogtitle.github.io/categories/concurrency/">Roberto Clapis's series on advanced concurrency patterns</a>, as well as <a href="https://drive.google.com/file/d/1nPdvhB0PutEJzdCq5ms6UI58dp50fcAN/view">Bryan Mills's talk on concurrency patterns</a>. </p>
+<pre data-language="go">type Cond struct {
+
+ // L is held while observing or changing the condition
+ L Locker
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewCond">func <span>NewCond</span> </h3> <pre data-language="go">func NewCond(l Locker) *Cond</pre> <p>NewCond returns a new Cond with Locker l. </p>
+<h3 id="Cond.Broadcast">func (*Cond) <span>Broadcast</span> </h3> <pre data-language="go">func (c *Cond) Broadcast()</pre> <p>Broadcast wakes all goroutines waiting on c. </p>
+<p>It is allowed but not required for the caller to hold c.L during the call. </p>
+<h3 id="Cond.Signal">func (*Cond) <span>Signal</span> </h3> <pre data-language="go">func (c *Cond) Signal()</pre> <p>Signal wakes one goroutine waiting on c, if there is any. </p>
+<p>It is allowed but not required for the caller to hold c.L during the call. </p>
+<p>Signal() does not affect goroutine scheduling priority; if other goroutines are attempting to lock c.L, they may be awoken before a "waiting" goroutine. </p>
+<h3 id="Cond.Wait">func (*Cond) <span>Wait</span> </h3> <pre data-language="go">func (c *Cond) Wait()</pre> <p>Wait atomically unlocks c.L and suspends execution of the calling goroutine. After later resuming execution, Wait locks c.L before returning. Unlike in other systems, Wait cannot return unless awoken by Broadcast or Signal. </p>
+<p>Because c.L is not locked while Wait is waiting, the caller typically cannot assume that the condition is true when Wait returns. Instead, the caller should Wait in a loop: </p>
+<pre data-language="go">c.L.Lock()
+for !condition() {
+ c.Wait()
+}
+... make use of condition ...
+c.L.Unlock()
+</pre> <h2 id="Locker">type <span>Locker</span> </h2> <p>A Locker represents an object that can be locked and unlocked. </p>
+<pre data-language="go">type Locker interface {
+ Lock()
+ Unlock()
+}</pre> <h2 id="Map">type <span>Map</span> <span title="Added in Go 1.9">1.9</span> </h2> <p>Map is like a Go map[any]any but is safe for concurrent use by multiple goroutines without additional locking or coordination. Loads, stores, and deletes run in amortized constant time. </p>
+<p>The Map type is specialized. Most code should use a plain Go map instead, with separate locking or coordination, for better type safety and to make it easier to maintain other invariants along with the map content. </p>
+<p>The Map type is optimized for two common use cases: (1) when the entry for a given key is only ever written once but read many times, as in caches that only grow, or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex. </p>
+<p>The zero Map is empty and ready for use. A Map must not be copied after first use. </p>
+<p>In the terminology of the Go memory model, Map arranges that a write operation “synchronizes before” any read operation that observes the effect of the write, where read and write operations are defined as follows. Load, LoadAndDelete, LoadOrStore, Swap, CompareAndSwap, and CompareAndDelete are read operations; Delete, LoadAndDelete, Store, and Swap are write operations; LoadOrStore is a write operation when it returns loaded set to false; CompareAndSwap is a write operation when it returns swapped set to true; and CompareAndDelete is a write operation when it returns deleted set to true. </p>
+<pre data-language="go">type Map struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Map.CompareAndDelete">func (*Map) <span>CompareAndDelete</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (m *Map) CompareAndDelete(key, old any) (deleted bool)</pre> <p>CompareAndDelete deletes the entry for key if its value is equal to old. The old value must be of a comparable type. </p>
+<p>If there is no current value for key in the map, CompareAndDelete returns false (even if the old value is the nil interface value). </p>
+<h3 id="Map.CompareAndSwap">func (*Map) <span>CompareAndSwap</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (m *Map) CompareAndSwap(key, old, new any) bool</pre> <p>CompareAndSwap swaps the old and new values for key if the value stored in the map is equal to old. The old value must be of a comparable type. </p>
+<h3 id="Map.Delete">func (*Map) <span>Delete</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (m *Map) Delete(key any)</pre> <p>Delete deletes the value for a key. </p>
+<h3 id="Map.Load">func (*Map) <span>Load</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (m *Map) Load(key any) (value any, ok bool)</pre> <p>Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map. </p>
+<h3 id="Map.LoadAndDelete">func (*Map) <span>LoadAndDelete</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (m *Map) LoadAndDelete(key any) (value any, loaded bool)</pre> <p>LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. </p>
+<h3 id="Map.LoadOrStore">func (*Map) <span>LoadOrStore</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (m *Map) LoadOrStore(key, value any) (actual any, loaded bool)</pre> <p>LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. </p>
+<h3 id="Map.Range">func (*Map) <span>Range</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (m *Map) Range(f func(key, value any) bool)</pre> <p>Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration. </p>
+<p>Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently (including by f), Range may reflect any mapping for that key from any point during the Range call. Range does not block other methods on the receiver; even f itself may call any method on m. </p>
+<p>Range may be O(N) with the number of elements in the map even if f returns false after a constant number of calls. </p>
+<h3 id="Map.Store">func (*Map) <span>Store</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (m *Map) Store(key, value any)</pre> <p>Store sets the value for a key. </p>
+<h3 id="Map.Swap">func (*Map) <span>Swap</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (m *Map) Swap(key, value any) (previous any, loaded bool)</pre> <p>Swap swaps the value for a key and returns the previous value if any. The loaded result reports whether the key was present. </p>
+<h2 id="Mutex">type <span>Mutex</span> </h2> <p>A Mutex is a mutual exclusion lock. The zero value for a Mutex is an unlocked mutex. </p>
+<p>A Mutex must not be copied after first use. </p>
+<p>In the terminology of the Go memory model, the n'th call to Unlock “synchronizes before” the m'th call to Lock for any n &lt; m. A successful call to TryLock is equivalent to a call to Lock. A failed call to TryLock does not establish any “synchronizes before” relation at all. </p>
+<pre data-language="go">type Mutex struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Mutex.Lock">func (*Mutex) <span>Lock</span> </h3> <pre data-language="go">func (m *Mutex) Lock()</pre> <p>Lock locks m. If the lock is already in use, the calling goroutine blocks until the mutex is available. </p>
+<h3 id="Mutex.TryLock">func (*Mutex) <span>TryLock</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (m *Mutex) TryLock() bool</pre> <p>TryLock tries to lock m and reports whether it succeeded. </p>
+<p>Note that while correct uses of TryLock do exist, they are rare, and use of TryLock is often a sign of a deeper problem in a particular use of mutexes. </p>
+<h3 id="Mutex.Unlock">func (*Mutex) <span>Unlock</span> </h3> <pre data-language="go">func (m *Mutex) Unlock()</pre> <p>Unlock unlocks m. It is a run-time error if m is not locked on entry to Unlock. </p>
+<p>A locked Mutex is not associated with a particular goroutine. It is allowed for one goroutine to lock a Mutex and then arrange for another goroutine to unlock it. </p>
+<h2 id="Once">type <span>Once</span> </h2> <p>Once is an object that will perform exactly one action. </p>
+<p>A Once must not be copied after first use. </p>
+<p>In the terminology of the Go memory model, the return from f “synchronizes before” the return from any call of once.Do(f). </p>
+<pre data-language="go">type Once struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Once"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">var once sync.Once
+onceBody := func() {
+ fmt.Println("Only once")
+}
+done := make(chan bool)
+for i := 0; i &lt; 10; i++ {
+ go func() {
+ once.Do(onceBody)
+ done &lt;- true
+ }()
+}
+for i := 0; i &lt; 10; i++ {
+ &lt;-done
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">Only once
+</pre> <h3 id="Once.Do">func (*Once) <span>Do</span> </h3> <pre data-language="go">func (o *Once) Do(f func())</pre> <p>Do calls the function f if and only if Do is being called for the first time for this instance of Once. In other words, given </p>
+<pre data-language="go">var once Once
+</pre> <p>if once.Do(f) is called multiple times, only the first call will invoke f, even if f has a different value in each invocation. A new instance of Once is required for each function to execute. </p>
+<p>Do is intended for initialization that must be run exactly once. Since f is niladic, it may be necessary to use a function literal to capture the arguments to a function to be invoked by Do: </p>
+<pre data-language="go">config.once.Do(func() { config.init(filename) })
+</pre> <p>Because no call to Do returns until the one call to f returns, if f causes Do to be called, it will deadlock. </p>
+<p>If f panics, Do considers it to have returned; future calls of Do return without calling f. </p>
+<h2 id="Pool">type <span>Pool</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A Pool is a set of temporary objects that may be individually saved and retrieved. </p>
+<p>Any item stored in the Pool may be removed automatically at any time without notification. If the Pool holds the only reference when this happens, the item might be deallocated. </p>
+<p>A Pool is safe for use by multiple goroutines simultaneously. </p>
+<p>Pool's purpose is to cache allocated but unused items for later reuse, relieving pressure on the garbage collector. That is, it makes it easy to build efficient, thread-safe free lists. However, it is not suitable for all free lists. </p>
+<p>An appropriate use of a Pool is to manage a group of temporary items silently shared among and potentially reused by concurrent independent clients of a package. Pool provides a way to amortize allocation overhead across many clients. </p>
+<p>An example of good use of a Pool is in the fmt package, which maintains a dynamically-sized store of temporary output buffers. The store scales under load (when many goroutines are actively printing) and shrinks when quiescent. </p>
+<p>On the other hand, a free list maintained as part of a short-lived object is not a suitable use for a Pool, since the overhead does not amortize well in that scenario. It is more efficient to have such objects implement their own free list. </p>
+<p>A Pool must not be copied after first use. </p>
+<p>In the terminology of the Go memory model, a call to Put(x) “synchronizes before” a call to Get returning that same value x. Similarly, a call to New returning x “synchronizes before” a call to Get returning that same value x. </p>
+<pre data-language="go">type Pool struct {
+
+ // New optionally specifies a function to generate
+ // a value when Get would otherwise return nil.
+ // It may not be changed concurrently with calls to Get.
+ New func() any
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Pool"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">package sync_test
+
+import (
+ "bytes"
+ "io"
+ "os"
+ "sync"
+ "time"
+)
+
+var bufPool = sync.Pool{
+ New: func() any {
+ // The Pool's New function should generally only return pointer
+ // types, since a pointer can be put into the return interface
+ // value without an allocation:
+ return new(bytes.Buffer)
+ },
+}
+
+// timeNow is a fake version of time.Now for tests.
+func timeNow() time.Time {
+ return time.Unix(1136214245, 0)
+}
+
+func Log(w io.Writer, key, val string) {
+ b := bufPool.Get().(*bytes.Buffer)
+ b.Reset()
+ // Replace this with time.Now() in a real logger.
+ b.WriteString(timeNow().UTC().Format(time.RFC3339))
+ b.WriteByte(' ')
+ b.WriteString(key)
+ b.WriteByte('=')
+ b.WriteString(val)
+ w.Write(b.Bytes())
+ bufPool.Put(b)
+}
+
+func ExamplePool() {
+ Log(os.Stdout, "path", "/search?q=flowers")
+ // Output: 2006-01-02T15:04:05Z path=/search?q=flowers
+}
+</pre> <h3 id="Pool.Get">func (*Pool) <span>Get</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (p *Pool) Get() any</pre> <p>Get selects an arbitrary item from the Pool, removes it from the Pool, and returns it to the caller. Get may choose to ignore the pool and treat it as empty. Callers should not assume any relation between values passed to Put and the values returned by Get. </p>
+<p>If Get would otherwise return nil and p.New is non-nil, Get returns the result of calling p.New. </p>
+<h3 id="Pool.Put">func (*Pool) <span>Put</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (p *Pool) Put(x any)</pre> <p>Put adds x to the pool. </p>
+<h2 id="RWMutex">type <span>RWMutex</span> </h2> <p>A RWMutex is a reader/writer mutual exclusion lock. The lock can be held by an arbitrary number of readers or a single writer. The zero value for a RWMutex is an unlocked mutex. </p>
+<p>A RWMutex must not be copied after first use. </p>
+<p>If any goroutine calls Lock while the lock is already held by one or more readers, concurrent calls to RLock will block until the writer has acquired (and released) the lock, to ensure that the lock eventually becomes available to the writer. Note that this prohibits recursive read-locking. </p>
+<p>In the terminology of the Go memory model, the n'th call to Unlock “synchronizes before” the m'th call to Lock for any n &lt; m, just as for Mutex. For any call to RLock, there exists an n such that the n'th call to Unlock “synchronizes before” that call to RLock, and the corresponding call to RUnlock “synchronizes before” the n+1'th call to Lock. </p>
+<pre data-language="go">type RWMutex struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="RWMutex.Lock">func (*RWMutex) <span>Lock</span> </h3> <pre data-language="go">func (rw *RWMutex) Lock()</pre> <p>Lock locks rw for writing. If the lock is already locked for reading or writing, Lock blocks until the lock is available. </p>
+<h3 id="RWMutex.RLock">func (*RWMutex) <span>RLock</span> </h3> <pre data-language="go">func (rw *RWMutex) RLock()</pre> <p>RLock locks rw for reading. </p>
+<p>It should not be used for recursive read locking; a blocked Lock call excludes new readers from acquiring the lock. See the documentation on the RWMutex type. </p>
+<h3 id="RWMutex.RLocker">func (*RWMutex) <span>RLocker</span> </h3> <pre data-language="go">func (rw *RWMutex) RLocker() Locker</pre> <p>RLocker returns a Locker interface that implements the Lock and Unlock methods by calling rw.RLock and rw.RUnlock. </p>
+<h3 id="RWMutex.RUnlock">func (*RWMutex) <span>RUnlock</span> </h3> <pre data-language="go">func (rw *RWMutex) RUnlock()</pre> <p>RUnlock undoes a single RLock call; it does not affect other simultaneous readers. It is a run-time error if rw is not locked for reading on entry to RUnlock. </p>
+<h3 id="RWMutex.TryLock">func (*RWMutex) <span>TryLock</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (rw *RWMutex) TryLock() bool</pre> <p>TryLock tries to lock rw for writing and reports whether it succeeded. </p>
+<p>Note that while correct uses of TryLock do exist, they are rare, and use of TryLock is often a sign of a deeper problem in a particular use of mutexes. </p>
+<h3 id="RWMutex.TryRLock">func (*RWMutex) <span>TryRLock</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (rw *RWMutex) TryRLock() bool</pre> <p>TryRLock tries to lock rw for reading and reports whether it succeeded. </p>
+<p>Note that while correct uses of TryRLock do exist, they are rare, and use of TryRLock is often a sign of a deeper problem in a particular use of mutexes. </p>
+<h3 id="RWMutex.Unlock">func (*RWMutex) <span>Unlock</span> </h3> <pre data-language="go">func (rw *RWMutex) Unlock()</pre> <p>Unlock unlocks rw for writing. It is a run-time error if rw is not locked for writing on entry to Unlock. </p>
+<p>As with Mutexes, a locked RWMutex is not associated with a particular goroutine. One goroutine may RLock (Lock) a RWMutex and then arrange for another goroutine to RUnlock (Unlock) it. </p>
+<h2 id="WaitGroup">type <span>WaitGroup</span> </h2> <p>A WaitGroup waits for a collection of goroutines to finish. The main goroutine calls Add to set the number of goroutines to wait for. Then each of the goroutines runs and calls Done when finished. At the same time, Wait can be used to block until all goroutines have finished. </p>
+<p>A WaitGroup must not be copied after first use. </p>
+<p>In the terminology of the Go memory model, a call to Done “synchronizes before” the return of any Wait call that it unblocks. </p>
+<pre data-language="go">type WaitGroup struct {
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_WaitGroup"> <span class="text">Example</span>
+</h4> <p>This example fetches several URLs concurrently, using a WaitGroup to block until all the fetches are complete. </p> <p>Code:</p> <pre class="code" data-language="go">
+var wg sync.WaitGroup
+var urls = []string{
+ "http://www.golang.org/",
+ "http://www.google.com/",
+ "http://www.example.com/",
+}
+for _, url := range urls {
+ // Increment the WaitGroup counter.
+ wg.Add(1)
+ // Launch a goroutine to fetch the URL.
+ go func(url string) {
+ // Decrement the counter when the goroutine completes.
+ defer wg.Done()
+ // Fetch the URL.
+ http.Get(url)
+ }(url)
+}
+// Wait for all HTTP fetches to complete.
+wg.Wait()
+</pre> <h3 id="WaitGroup.Add">func (*WaitGroup) <span>Add</span> </h3> <pre data-language="go">func (wg *WaitGroup) Add(delta int)</pre> <p>Add adds delta, which may be negative, to the WaitGroup counter. If the counter becomes zero, all goroutines blocked on Wait are released. If the counter goes negative, Add panics. </p>
+<p>Note that calls with a positive delta that occur when the counter is zero must happen before a Wait. Calls with a negative delta, or calls with a positive delta that start when the counter is greater than zero, may happen at any time. Typically this means the calls to Add should execute before the statement creating the goroutine or other event to be waited for. If a WaitGroup is reused to wait for several independent sets of events, new Add calls must happen after all previous Wait calls have returned. See the WaitGroup example. </p>
+<h3 id="WaitGroup.Done">func (*WaitGroup) <span>Done</span> </h3> <pre data-language="go">func (wg *WaitGroup) Done()</pre> <p>Done decrements the WaitGroup counter by one. </p>
+<h3 id="WaitGroup.Wait">func (*WaitGroup) <span>Wait</span> </h3> <pre data-language="go">func (wg *WaitGroup) Wait()</pre> <p>Wait blocks until the WaitGroup counter is zero. </p>
+<h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="atomic/index">atomic</a> </td> <td class="pkg-synopsis"> Package atomic provides low-level atomic memory primitives useful for implementing synchronization algorithms. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/sync/" class="_attribution-link">http://golang.org/pkg/sync/</a>
+ </p>
+</div>
diff --git a/devdocs/go/syscall%2Findex.html b/devdocs/go/syscall%2Findex.html
new file mode 100644
index 00000000..98841565
--- /dev/null
+++ b/devdocs/go/syscall%2Findex.html
@@ -0,0 +1,2897 @@
+<h1> Package syscall </h1> <ul id="short-nav">
+<li><code>import "syscall"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package syscall contains an interface to the low-level operating system primitives. The details vary depending on the underlying system, and by default, godoc will display the syscall documentation for the current system. If you want godoc to display syscall documentation for another system, set $GOOS and $GOARCH to the desired system. For example, if you want to view documentation for freebsd/arm on linux/amd64, set $GOOS to freebsd and $GOARCH to arm. The primary use of syscall is inside other packages that provide a more portable interface to the system, such as "os", "time" and "net". Use those packages rather than this one if you can. For details of the functions and data types in this package consult the manuals for the appropriate operating system. These calls return err == nil to indicate success; otherwise err is an operating system error describing the failure. On most systems, that error has type syscall.Errno. </p>
+<p>NOTE: Most of the functions, types, and constants defined in this package are also available in the <span>golang.org/x/sys</span> package. That package has more system call support than this one, and most new code should prefer that package where possible. See <a href="https://golang.org/s/go1.4-syscall">https://golang.org/s/go1.4-syscall</a> for more information. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#Access">func Access(path string, mode uint32) (err error)</a></li>
+<li><a href="#Acct">func Acct(path string) (err error)</a></li>
+<li><a href="#Adjtimex">func Adjtimex(buf *Timex) (state int, err error)</a></li>
+<li><a href="#AttachLsf">func AttachLsf(fd int, i []SockFilter) error</a></li>
+<li><a href="#Bind">func Bind(fd int, sa Sockaddr) (err error)</a></li>
+<li><a href="#BindToDevice">func BindToDevice(fd int, device string) (err error)</a></li>
+<li><a href="#BytePtrFromString">func BytePtrFromString(s string) (*byte, error)</a></li>
+<li><a href="#ByteSliceFromString">func ByteSliceFromString(s string) ([]byte, error)</a></li>
+<li><a href="#Chdir">func Chdir(path string) (err error)</a></li>
+<li><a href="#Chmod">func Chmod(path string, mode uint32) (err error)</a></li>
+<li><a href="#Chown">func Chown(path string, uid int, gid int) (err error)</a></li>
+<li><a href="#Chroot">func Chroot(path string) (err error)</a></li>
+<li><a href="#Clearenv">func Clearenv()</a></li>
+<li><a href="#Close">func Close(fd int) (err error)</a></li>
+<li><a href="#CloseOnExec">func CloseOnExec(fd int)</a></li>
+<li><a href="#CmsgLen">func CmsgLen(datalen int) int</a></li>
+<li><a href="#CmsgSpace">func CmsgSpace(datalen int) int</a></li>
+<li><a href="#Connect">func Connect(fd int, sa Sockaddr) (err error)</a></li>
+<li><a href="#Creat">func Creat(path string, mode uint32) (fd int, err error)</a></li>
+<li><a href="#DetachLsf">func DetachLsf(fd int) error</a></li>
+<li><a href="#Dup">func Dup(oldfd int) (fd int, err error)</a></li>
+<li><a href="#Dup2">func Dup2(oldfd int, newfd int) (err error)</a></li>
+<li><a href="#Dup3">func Dup3(oldfd int, newfd int, flags int) (err error)</a></li>
+<li><a href="#Environ">func Environ() []string</a></li>
+<li><a href="#EpollCreate">func EpollCreate(size int) (fd int, err error)</a></li>
+<li><a href="#EpollCreate1">func EpollCreate1(flag int) (fd int, err error)</a></li>
+<li><a href="#EpollCtl">func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)</a></li>
+<li><a href="#EpollWait">func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)</a></li>
+<li><a href="#Exec">func Exec(argv0 string, argv []string, envv []string) (err error)</a></li>
+<li><a href="#Exit">func Exit(code int)</a></li>
+<li><a href="#Faccessat">func Faccessat(dirfd int, path string, mode uint32, flags int) (err error)</a></li>
+<li><a href="#Fallocate">func Fallocate(fd int, mode uint32, off int64, len int64) (err error)</a></li>
+<li><a href="#Fchdir">func Fchdir(fd int) (err error)</a></li>
+<li><a href="#Fchmod">func Fchmod(fd int, mode uint32) (err error)</a></li>
+<li><a href="#Fchmodat">func Fchmodat(dirfd int, path string, mode uint32, flags int) error</a></li>
+<li><a href="#Fchown">func Fchown(fd int, uid int, gid int) (err error)</a></li>
+<li><a href="#Fchownat">func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)</a></li>
+<li><a href="#FcntlFlock">func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error</a></li>
+<li><a href="#Fdatasync">func Fdatasync(fd int) (err error)</a></li>
+<li><a href="#Flock">func Flock(fd int, how int) (err error)</a></li>
+<li><a href="#ForkExec">func ForkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)</a></li>
+<li><a href="#Fstat">func Fstat(fd int, stat *Stat_t) (err error)</a></li>
+<li><a href="#Fstatfs">func Fstatfs(fd int, buf *Statfs_t) (err error)</a></li>
+<li><a href="#Fsync">func Fsync(fd int) (err error)</a></li>
+<li><a href="#Ftruncate">func Ftruncate(fd int, length int64) (err error)</a></li>
+<li><a href="#Futimes">func Futimes(fd int, tv []Timeval) (err error)</a></li>
+<li><a href="#Futimesat">func Futimesat(dirfd int, path string, tv []Timeval) (err error)</a></li>
+<li><a href="#Getcwd">func Getcwd(buf []byte) (n int, err error)</a></li>
+<li><a href="#Getdents">func Getdents(fd int, buf []byte) (n int, err error)</a></li>
+<li><a href="#Getegid">func Getegid() (egid int)</a></li>
+<li><a href="#Getenv">func Getenv(key string) (value string, found bool)</a></li>
+<li><a href="#Geteuid">func Geteuid() (euid int)</a></li>
+<li><a href="#Getgid">func Getgid() (gid int)</a></li>
+<li><a href="#Getgroups">func Getgroups() (gids []int, err error)</a></li>
+<li><a href="#Getpagesize">func Getpagesize() int</a></li>
+<li><a href="#Getpgid">func Getpgid(pid int) (pgid int, err error)</a></li>
+<li><a href="#Getpgrp">func Getpgrp() (pid int)</a></li>
+<li><a href="#Getpid">func Getpid() (pid int)</a></li>
+<li><a href="#Getppid">func Getppid() (ppid int)</a></li>
+<li><a href="#Getpriority">func Getpriority(which int, who int) (prio int, err error)</a></li>
+<li><a href="#Getrlimit">func Getrlimit(resource int, rlim *Rlimit) (err error)</a></li>
+<li><a href="#Getrusage">func Getrusage(who int, rusage *Rusage) (err error)</a></li>
+<li><a href="#GetsockoptInet4Addr">func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error)</a></li>
+<li><a href="#GetsockoptInt">func GetsockoptInt(fd, level, opt int) (value int, err error)</a></li>
+<li><a href="#Gettid">func Gettid() (tid int)</a></li>
+<li><a href="#Gettimeofday">func Gettimeofday(tv *Timeval) (err error)</a></li>
+<li><a href="#Getuid">func Getuid() (uid int)</a></li>
+<li><a href="#Getwd">func Getwd() (wd string, err error)</a></li>
+<li><a href="#Getxattr">func Getxattr(path string, attr string, dest []byte) (sz int, err error)</a></li>
+<li><a href="#InotifyAddWatch">func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)</a></li>
+<li><a href="#InotifyInit">func InotifyInit() (fd int, err error)</a></li>
+<li><a href="#InotifyInit1">func InotifyInit1(flags int) (fd int, err error)</a></li>
+<li><a href="#InotifyRmWatch">func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error)</a></li>
+<li><a href="#Ioperm">func Ioperm(from int, num int, on int) (err error)</a></li>
+<li><a href="#Iopl">func Iopl(level int) (err error)</a></li>
+<li><a href="#Kill">func Kill(pid int, sig Signal) (err error)</a></li>
+<li><a href="#Klogctl">func Klogctl(typ int, buf []byte) (n int, err error)</a></li>
+<li><a href="#Lchown">func Lchown(path string, uid int, gid int) (err error)</a></li>
+<li><a href="#Link">func Link(oldpath string, newpath string) (err error)</a></li>
+<li><a href="#Listen">func Listen(s int, n int) (err error)</a></li>
+<li><a href="#Listxattr">func Listxattr(path string, dest []byte) (sz int, err error)</a></li>
+<li><a href="#LsfSocket">func LsfSocket(ifindex, proto int) (int, error)</a></li>
+<li><a href="#Lstat">func Lstat(path string, stat *Stat_t) (err error)</a></li>
+<li><a href="#Madvise">func Madvise(b []byte, advice int) (err error)</a></li>
+<li><a href="#Mkdir">func Mkdir(path string, mode uint32) (err error)</a></li>
+<li><a href="#Mkdirat">func Mkdirat(dirfd int, path string, mode uint32) (err error)</a></li>
+<li><a href="#Mkfifo">func Mkfifo(path string, mode uint32) (err error)</a></li>
+<li><a href="#Mknod">func Mknod(path string, mode uint32, dev int) (err error)</a></li>
+<li><a href="#Mknodat">func Mknodat(dirfd int, path string, mode uint32, dev int) (err error)</a></li>
+<li><a href="#Mlock">func Mlock(b []byte) (err error)</a></li>
+<li><a href="#Mlockall">func Mlockall(flags int) (err error)</a></li>
+<li><a href="#Mmap">func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error)</a></li>
+<li><a href="#Mount">func Mount(source string, target string, fstype string, flags uintptr, data string) (err error)</a></li>
+<li><a href="#Mprotect">func Mprotect(b []byte, prot int) (err error)</a></li>
+<li><a href="#Munlock">func Munlock(b []byte) (err error)</a></li>
+<li><a href="#Munlockall">func Munlockall() (err error)</a></li>
+<li><a href="#Munmap">func Munmap(b []byte) (err error)</a></li>
+<li><a href="#Nanosleep">func Nanosleep(time *Timespec, leftover *Timespec) (err error)</a></li>
+<li><a href="#NetlinkRIB">func NetlinkRIB(proto, family int) ([]byte, error)</a></li>
+<li><a href="#Open">func Open(path string, mode int, perm uint32) (fd int, err error)</a></li>
+<li><a href="#Openat">func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)</a></li>
+<li><a href="#ParseDirent">func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string)</a></li>
+<li><a href="#ParseUnixRights">func ParseUnixRights(m *SocketControlMessage) ([]int, error)</a></li>
+<li><a href="#Pause">func Pause() (err error)</a></li>
+<li><a href="#Pipe">func Pipe(p []int) error</a></li>
+<li><a href="#Pipe2">func Pipe2(p []int, flags int) error</a></li>
+<li><a href="#PivotRoot">func PivotRoot(newroot string, putold string) (err error)</a></li>
+<li><a href="#Pread">func Pread(fd int, p []byte, offset int64) (n int, err error)</a></li>
+<li><a href="#PtraceAttach">func PtraceAttach(pid int) (err error)</a></li>
+<li><a href="#PtraceCont">func PtraceCont(pid int, signal int) (err error)</a></li>
+<li><a href="#PtraceDetach">func PtraceDetach(pid int) (err error)</a></li>
+<li><a href="#PtraceGetEventMsg">func PtraceGetEventMsg(pid int) (msg uint, err error)</a></li>
+<li><a href="#PtraceGetRegs">func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error)</a></li>
+<li><a href="#PtracePeekData">func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error)</a></li>
+<li><a href="#PtracePeekText">func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error)</a></li>
+<li><a href="#PtracePokeData">func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error)</a></li>
+<li><a href="#PtracePokeText">func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error)</a></li>
+<li><a href="#PtraceSetOptions">func PtraceSetOptions(pid int, options int) (err error)</a></li>
+<li><a href="#PtraceSetRegs">func PtraceSetRegs(pid int, regs *PtraceRegs) (err error)</a></li>
+<li><a href="#PtraceSingleStep">func PtraceSingleStep(pid int) (err error)</a></li>
+<li><a href="#PtraceSyscall">func PtraceSyscall(pid int, signal int) (err error)</a></li>
+<li><a href="#Pwrite">func Pwrite(fd int, p []byte, offset int64) (n int, err error)</a></li>
+<li><a href="#Read">func Read(fd int, p []byte) (n int, err error)</a></li>
+<li><a href="#ReadDirent">func ReadDirent(fd int, buf []byte) (n int, err error)</a></li>
+<li><a href="#Readlink">func Readlink(path string, buf []byte) (n int, err error)</a></li>
+<li><a href="#Reboot">func Reboot(cmd int) (err error)</a></li>
+<li><a href="#Removexattr">func Removexattr(path string, attr string) (err error)</a></li>
+<li><a href="#Rename">func Rename(oldpath string, newpath string) (err error)</a></li>
+<li><a href="#Renameat">func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)</a></li>
+<li><a href="#Rmdir">func Rmdir(path string) error</a></li>
+<li><a href="#Seek">func Seek(fd int, offset int64, whence int) (off int64, err error)</a></li>
+<li><a href="#Select">func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)</a></li>
+<li><a href="#Sendfile">func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)</a></li>
+<li><a href="#Sendmsg">func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error)</a></li>
+<li><a href="#SendmsgN">func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)</a></li>
+<li><a href="#Sendto">func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error)</a></li>
+<li><a href="#SetLsfPromisc">func SetLsfPromisc(name string, m bool) error</a></li>
+<li><a href="#SetNonblock">func SetNonblock(fd int, nonblocking bool) (err error)</a></li>
+<li><a href="#Setdomainname">func Setdomainname(p []byte) (err error)</a></li>
+<li><a href="#Setegid">func Setegid(egid int) (err error)</a></li>
+<li><a href="#Setenv">func Setenv(key, value string) error</a></li>
+<li><a href="#Seteuid">func Seteuid(euid int) (err error)</a></li>
+<li><a href="#Setfsgid">func Setfsgid(gid int) (err error)</a></li>
+<li><a href="#Setfsuid">func Setfsuid(uid int) (err error)</a></li>
+<li><a href="#Setgid">func Setgid(gid int) (err error)</a></li>
+<li><a href="#Setgroups">func Setgroups(gids []int) (err error)</a></li>
+<li><a href="#Sethostname">func Sethostname(p []byte) (err error)</a></li>
+<li><a href="#Setpgid">func Setpgid(pid int, pgid int) (err error)</a></li>
+<li><a href="#Setpriority">func Setpriority(which int, who int, prio int) (err error)</a></li>
+<li><a href="#Setregid">func Setregid(rgid, egid int) (err error)</a></li>
+<li><a href="#Setresgid">func Setresgid(rgid, egid, sgid int) (err error)</a></li>
+<li><a href="#Setresuid">func Setresuid(ruid, euid, suid int) (err error)</a></li>
+<li><a href="#Setreuid">func Setreuid(ruid, euid int) (err error)</a></li>
+<li><a href="#Setrlimit">func Setrlimit(resource int, rlim *Rlimit) error</a></li>
+<li><a href="#Setsid">func Setsid() (pid int, err error)</a></li>
+<li><a href="#SetsockoptByte">func SetsockoptByte(fd, level, opt int, value byte) (err error)</a></li>
+<li><a href="#SetsockoptICMPv6Filter">func SetsockoptICMPv6Filter(fd, level, opt int, filter *ICMPv6Filter) error</a></li>
+<li><a href="#SetsockoptIPMreq">func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error)</a></li>
+<li><a href="#SetsockoptIPMreqn">func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error)</a></li>
+<li><a href="#SetsockoptIPv6Mreq">func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error)</a></li>
+<li><a href="#SetsockoptInet4Addr">func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error)</a></li>
+<li><a href="#SetsockoptInt">func SetsockoptInt(fd, level, opt int, value int) (err error)</a></li>
+<li><a href="#SetsockoptLinger">func SetsockoptLinger(fd, level, opt int, l *Linger) (err error)</a></li>
+<li><a href="#SetsockoptString">func SetsockoptString(fd, level, opt int, s string) (err error)</a></li>
+<li><a href="#SetsockoptTimeval">func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error)</a></li>
+<li><a href="#Settimeofday">func Settimeofday(tv *Timeval) (err error)</a></li>
+<li><a href="#Setuid">func Setuid(uid int) (err error)</a></li>
+<li><a href="#Setxattr">func Setxattr(path string, attr string, data []byte, flags int) (err error)</a></li>
+<li><a href="#Shutdown">func Shutdown(fd int, how int) (err error)</a></li>
+<li><a href="#SlicePtrFromStrings">func SlicePtrFromStrings(ss []string) ([]*byte, error)</a></li>
+<li><a href="#Socket">func Socket(domain, typ, proto int) (fd int, err error)</a></li>
+<li><a href="#Socketpair">func Socketpair(domain, typ, proto int) (fd [2]int, err error)</a></li>
+<li><a href="#Splice">func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)</a></li>
+<li><a href="#StartProcess">func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error)</a></li>
+<li><a href="#Stat">func Stat(path string, stat *Stat_t) (err error)</a></li>
+<li><a href="#Statfs">func Statfs(path string, buf *Statfs_t) (err error)</a></li>
+<li><a href="#StringBytePtr">func StringBytePtr(s string) *byte</a></li>
+<li><a href="#StringByteSlice">func StringByteSlice(s string) []byte</a></li>
+<li><a href="#StringSlicePtr">func StringSlicePtr(ss []string) []*byte</a></li>
+<li><a href="#Symlink">func Symlink(oldpath string, newpath string) (err error)</a></li>
+<li><a href="#Sync">func Sync()</a></li>
+<li><a href="#SyncFileRange">func SyncFileRange(fd int, off int64, n int64, flags int) (err error)</a></li>
+<li><a href="#Sysinfo">func Sysinfo(info *Sysinfo_t) (err error)</a></li>
+<li><a href="#Tee">func Tee(rfd int, wfd int, len int, flags int) (n int64, err error)</a></li>
+<li><a href="#Tgkill">func Tgkill(tgid int, tid int, sig Signal) (err error)</a></li>
+<li><a href="#Times">func Times(tms *Tms) (ticks uintptr, err error)</a></li>
+<li><a href="#TimespecToNsec">func TimespecToNsec(ts Timespec) int64</a></li>
+<li><a href="#TimevalToNsec">func TimevalToNsec(tv Timeval) int64</a></li>
+<li><a href="#Truncate">func Truncate(path string, length int64) (err error)</a></li>
+<li><a href="#Umask">func Umask(mask int) (oldmask int)</a></li>
+<li><a href="#Uname">func Uname(buf *Utsname) (err error)</a></li>
+<li><a href="#UnixCredentials">func UnixCredentials(ucred *Ucred) []byte</a></li>
+<li><a href="#UnixRights">func UnixRights(fds ...int) []byte</a></li>
+<li><a href="#Unlink">func Unlink(path string) error</a></li>
+<li><a href="#Unlinkat">func Unlinkat(dirfd int, path string) error</a></li>
+<li><a href="#Unmount">func Unmount(target string, flags int) (err error)</a></li>
+<li><a href="#Unsetenv">func Unsetenv(key string) error</a></li>
+<li><a href="#Unshare">func Unshare(flags int) (err error)</a></li>
+<li><a href="#Ustat">func Ustat(dev int, ubuf *Ustat_t) (err error)</a></li>
+<li><a href="#Utime">func Utime(path string, buf *Utimbuf) (err error)</a></li>
+<li><a href="#Utimes">func Utimes(path string, tv []Timeval) (err error)</a></li>
+<li><a href="#UtimesNano">func UtimesNano(path string, ts []Timespec) (err error)</a></li>
+<li><a href="#Wait4">func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error)</a></li>
+<li><a href="#Write">func Write(fd int, p []byte) (n int, err error)</a></li>
+<li><a href="#Cmsghdr">type Cmsghdr</a></li>
+<li> <a href="#Cmsghdr.SetLen">func (cmsg *Cmsghdr) SetLen(length int)</a>
+</li>
+<li><a href="#Conn">type Conn</a></li>
+<li><a href="#Credential">type Credential</a></li>
+<li><a href="#Dirent">type Dirent</a></li>
+<li><a href="#EpollEvent">type EpollEvent</a></li>
+<li><a href="#Errno">type Errno</a></li>
+<li> <a href="#AllThreadsSyscall">func AllThreadsSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)</a>
+</li>
+<li> <a href="#AllThreadsSyscall6">func AllThreadsSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)</a>
+</li>
+<li> <a href="#RawSyscall">func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)</a>
+</li>
+<li> <a href="#RawSyscall6">func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)</a>
+</li>
+<li> <a href="#Syscall">func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)</a>
+</li>
+<li> <a href="#Syscall6">func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)</a>
+</li>
+<li> <a href="#Errno.Error">func (e Errno) Error() string</a>
+</li>
+<li> <a href="#Errno.Is">func (e Errno) Is(target error) bool</a>
+</li>
+<li> <a href="#Errno.Temporary">func (e Errno) Temporary() bool</a>
+</li>
+<li> <a href="#Errno.Timeout">func (e Errno) Timeout() bool</a>
+</li>
+<li><a href="#FdSet">type FdSet</a></li>
+<li><a href="#Flock_t">type Flock_t</a></li>
+<li><a href="#Fsid">type Fsid</a></li>
+<li><a href="#ICMPv6Filter">type ICMPv6Filter</a></li>
+<li> <a href="#GetsockoptICMPv6Filter">func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error)</a>
+</li>
+<li><a href="#IPMreq">type IPMreq</a></li>
+<li> <a href="#GetsockoptIPMreq">func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error)</a>
+</li>
+<li><a href="#IPMreqn">type IPMreqn</a></li>
+<li> <a href="#GetsockoptIPMreqn">func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error)</a>
+</li>
+<li><a href="#IPv6MTUInfo">type IPv6MTUInfo</a></li>
+<li> <a href="#GetsockoptIPv6MTUInfo">func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error)</a>
+</li>
+<li><a href="#IPv6Mreq">type IPv6Mreq</a></li>
+<li> <a href="#GetsockoptIPv6Mreq">func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error)</a>
+</li>
+<li><a href="#IfAddrmsg">type IfAddrmsg</a></li>
+<li><a href="#IfInfomsg">type IfInfomsg</a></li>
+<li><a href="#Inet4Pktinfo">type Inet4Pktinfo</a></li>
+<li><a href="#Inet6Pktinfo">type Inet6Pktinfo</a></li>
+<li><a href="#InotifyEvent">type InotifyEvent</a></li>
+<li><a href="#Iovec">type Iovec</a></li>
+<li> <a href="#Iovec.SetLen">func (iov *Iovec) SetLen(length int)</a>
+</li>
+<li><a href="#Linger">type Linger</a></li>
+<li><a href="#Msghdr">type Msghdr</a></li>
+<li> <a href="#Msghdr.SetControllen">func (msghdr *Msghdr) SetControllen(length int)</a>
+</li>
+<li><a href="#NetlinkMessage">type NetlinkMessage</a></li>
+<li> <a href="#ParseNetlinkMessage">func ParseNetlinkMessage(b []byte) ([]NetlinkMessage, error)</a>
+</li>
+<li><a href="#NetlinkRouteAttr">type NetlinkRouteAttr</a></li>
+<li> <a href="#ParseNetlinkRouteAttr">func ParseNetlinkRouteAttr(m *NetlinkMessage) ([]NetlinkRouteAttr, error)</a>
+</li>
+<li><a href="#NetlinkRouteRequest">type NetlinkRouteRequest</a></li>
+<li><a href="#NlAttr">type NlAttr</a></li>
+<li><a href="#NlMsgerr">type NlMsgerr</a></li>
+<li><a href="#NlMsghdr">type NlMsghdr</a></li>
+<li><a href="#ProcAttr">type ProcAttr</a></li>
+<li><a href="#PtraceRegs">type PtraceRegs</a></li>
+<li> <a href="#PtraceRegs.PC">func (r *PtraceRegs) PC() uint64</a>
+</li>
+<li> <a href="#PtraceRegs.SetPC">func (r *PtraceRegs) SetPC(pc uint64)</a>
+</li>
+<li><a href="#RawConn">type RawConn</a></li>
+<li><a href="#RawSockaddr">type RawSockaddr</a></li>
+<li><a href="#RawSockaddrAny">type RawSockaddrAny</a></li>
+<li><a href="#RawSockaddrInet4">type RawSockaddrInet4</a></li>
+<li><a href="#RawSockaddrInet6">type RawSockaddrInet6</a></li>
+<li><a href="#RawSockaddrLinklayer">type RawSockaddrLinklayer</a></li>
+<li><a href="#RawSockaddrNetlink">type RawSockaddrNetlink</a></li>
+<li><a href="#RawSockaddrUnix">type RawSockaddrUnix</a></li>
+<li><a href="#Rlimit">type Rlimit</a></li>
+<li><a href="#RtAttr">type RtAttr</a></li>
+<li><a href="#RtGenmsg">type RtGenmsg</a></li>
+<li><a href="#RtMsg">type RtMsg</a></li>
+<li><a href="#RtNexthop">type RtNexthop</a></li>
+<li><a href="#Rusage">type Rusage</a></li>
+<li><a href="#Signal">type Signal</a></li>
+<li> <a href="#Signal.Signal">func (s Signal) Signal()</a>
+</li>
+<li> <a href="#Signal.String">func (s Signal) String() string</a>
+</li>
+<li><a href="#SockFilter">type SockFilter</a></li>
+<li> <a href="#LsfJump">func LsfJump(code, k, jt, jf int) *SockFilter</a>
+</li>
+<li> <a href="#LsfStmt">func LsfStmt(code, k int) *SockFilter</a>
+</li>
+<li><a href="#SockFprog">type SockFprog</a></li>
+<li><a href="#Sockaddr">type Sockaddr</a></li>
+<li> <a href="#Accept">func Accept(fd int) (nfd int, sa Sockaddr, err error)</a>
+</li>
+<li> <a href="#Accept4">func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error)</a>
+</li>
+<li> <a href="#Getpeername">func Getpeername(fd int) (sa Sockaddr, err error)</a>
+</li>
+<li> <a href="#Getsockname">func Getsockname(fd int) (sa Sockaddr, err error)</a>
+</li>
+<li> <a href="#Recvfrom">func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error)</a>
+</li>
+<li> <a href="#Recvmsg">func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error)</a>
+</li>
+<li><a href="#SockaddrInet4">type SockaddrInet4</a></li>
+<li><a href="#SockaddrInet6">type SockaddrInet6</a></li>
+<li><a href="#SockaddrLinklayer">type SockaddrLinklayer</a></li>
+<li><a href="#SockaddrNetlink">type SockaddrNetlink</a></li>
+<li><a href="#SockaddrUnix">type SockaddrUnix</a></li>
+<li><a href="#SocketControlMessage">type SocketControlMessage</a></li>
+<li> <a href="#ParseSocketControlMessage">func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error)</a>
+</li>
+<li><a href="#Stat_t">type Stat_t</a></li>
+<li><a href="#Statfs_t">type Statfs_t</a></li>
+<li><a href="#SysProcAttr">type SysProcAttr</a></li>
+<li><a href="#SysProcIDMap">type SysProcIDMap</a></li>
+<li><a href="#Sysinfo_t">type Sysinfo_t</a></li>
+<li><a href="#TCPInfo">type TCPInfo</a></li>
+<li><a href="#Termios">type Termios</a></li>
+<li><a href="#Time_t">type Time_t</a></li>
+<li> <a href="#Time">func Time(t *Time_t) (tt Time_t, err error)</a>
+</li>
+<li><a href="#Timespec">type Timespec</a></li>
+<li> <a href="#NsecToTimespec">func NsecToTimespec(nsec int64) Timespec</a>
+</li>
+<li> <a href="#Timespec.Nano">func (ts *Timespec) Nano() int64</a>
+</li>
+<li> <a href="#Timespec.Unix">func (ts *Timespec) Unix() (sec int64, nsec int64)</a>
+</li>
+<li><a href="#Timeval">type Timeval</a></li>
+<li> <a href="#NsecToTimeval">func NsecToTimeval(nsec int64) Timeval</a>
+</li>
+<li> <a href="#Timeval.Nano">func (tv *Timeval) Nano() int64</a>
+</li>
+<li> <a href="#Timeval.Unix">func (tv *Timeval) Unix() (sec int64, nsec int64)</a>
+</li>
+<li><a href="#Timex">type Timex</a></li>
+<li><a href="#Tms">type Tms</a></li>
+<li><a href="#Ucred">type Ucred</a></li>
+<li> <a href="#GetsockoptUcred">func GetsockoptUcred(fd, level, opt int) (*Ucred, error)</a>
+</li>
+<li> <a href="#ParseUnixCredentials">func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error)</a>
+</li>
+<li><a href="#Ustat_t">type Ustat_t</a></li>
+<li><a href="#Utimbuf">type Utimbuf</a></li>
+<li><a href="#Utsname">type Utsname</a></li>
+<li><a href="#WaitStatus">type WaitStatus</a></li>
+<li> <a href="#WaitStatus.Continued">func (w WaitStatus) Continued() bool</a>
+</li>
+<li> <a href="#WaitStatus.CoreDump">func (w WaitStatus) CoreDump() bool</a>
+</li>
+<li> <a href="#WaitStatus.ExitStatus">func (w WaitStatus) ExitStatus() int</a>
+</li>
+<li> <a href="#WaitStatus.Exited">func (w WaitStatus) Exited() bool</a>
+</li>
+<li> <a href="#WaitStatus.Signal">func (w WaitStatus) Signal() Signal</a>
+</li>
+<li> <a href="#WaitStatus.Signaled">func (w WaitStatus) Signaled() bool</a>
+</li>
+<li> <a href="#WaitStatus.StopSignal">func (w WaitStatus) StopSignal() Signal</a>
+</li>
+<li> <a href="#WaitStatus.Stopped">func (w WaitStatus) Stopped() bool</a>
+</li>
+<li> <a href="#WaitStatus.TrapCause">func (w WaitStatus) TrapCause() int</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>asan0.go</span> <span>dirent.go</span> <span>endian_little.go</span> <span>env_unix.go</span> <span>exec_linux.go</span> <span>exec_unix.go</span> <span>flock_linux.go</span> <span>forkpipe2.go</span> <span>lsf_linux.go</span> <span>msan0.go</span> <span>net.go</span> <span>netlink_linux.go</span> <span>rlimit.go</span> <span>rlimit_stub.go</span> <span>setuidgid_linux.go</span> <span>sockcmsg_linux.go</span> <span>sockcmsg_unix.go</span> <span>sockcmsg_unix_other.go</span> <span>syscall.go</span> <span>syscall_linux.go</span> <span>syscall_linux_accept4.go</span> <span>syscall_linux_amd64.go</span> <span>syscall_unix.go</span> <span>time_nofake.go</span> <span>timestruct.go</span> <span>zerrors_linux_amd64.go</span> <span>zsyscall_linux_amd64.go</span> <span>zsysnum_linux_amd64.go</span> <span>ztypes_linux_amd64.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Linux unshare/clone/clone2/clone3 flags, architecture-independent, copied from linux/sched.h. </p>
+<pre data-language="go">const (
+ CLONE_VM = 0x00000100 // set if VM shared between processes
+ CLONE_FS = 0x00000200 // set if fs info shared between processes
+ CLONE_FILES = 0x00000400 // set if open files shared between processes
+ CLONE_SIGHAND = 0x00000800 // set if signal handlers and blocked signals shared
+ CLONE_PIDFD = 0x00001000 // set if a pidfd should be placed in parent
+ CLONE_PTRACE = 0x00002000 // set if we want to let tracing continue on the child too
+ CLONE_VFORK = 0x00004000 // set if the parent wants the child to wake it up on mm_release
+ CLONE_PARENT = 0x00008000 // set if we want to have the same parent as the cloner
+ CLONE_THREAD = 0x00010000 // Same thread group?
+ CLONE_NEWNS = 0x00020000 // New mount namespace group
+ CLONE_SYSVSEM = 0x00040000 // share system V SEM_UNDO semantics
+ CLONE_SETTLS = 0x00080000 // create a new TLS for the child
+ CLONE_PARENT_SETTID = 0x00100000 // set the TID in the parent
+ CLONE_CHILD_CLEARTID = 0x00200000 // clear the TID in the child
+ CLONE_DETACHED = 0x00400000 // Unused, ignored
+ CLONE_UNTRACED = 0x00800000 // set if the tracing process can't force CLONE_PTRACE on this clone
+ CLONE_CHILD_SETTID = 0x01000000 // set the TID in the child
+ CLONE_NEWCGROUP = 0x02000000 // New cgroup namespace
+ CLONE_NEWUTS = 0x04000000 // New utsname namespace
+ CLONE_NEWIPC = 0x08000000 // New ipc namespace
+ CLONE_NEWUSER = 0x10000000 // New user namespace
+ CLONE_NEWPID = 0x20000000 // New pid namespace
+ CLONE_NEWNET = 0x40000000 // New network namespace
+ CLONE_IO = 0x80000000 // Clone io context
+
+ CLONE_CLEAR_SIGHAND = 0x100000000 // Clear any signal handler and reset to SIG_DFL.
+ CLONE_INTO_CGROUP = 0x200000000 // Clone into a specific cgroup given the right permissions.
+
+ CLONE_NEWTIME = 0x00000080 // New time namespace
+)</pre> <pre data-language="go">const (
+ AF_ALG = 0x26
+ AF_APPLETALK = 0x5
+ AF_ASH = 0x12
+ AF_ATMPVC = 0x8
+ AF_ATMSVC = 0x14
+ AF_AX25 = 0x3
+ AF_BLUETOOTH = 0x1f
+ AF_BRIDGE = 0x7
+ AF_CAIF = 0x25
+ AF_CAN = 0x1d
+ AF_DECnet = 0xc
+ AF_ECONET = 0x13
+ AF_FILE = 0x1
+ AF_IEEE802154 = 0x24
+ AF_INET = 0x2
+ AF_INET6 = 0xa
+ AF_IPX = 0x4
+ AF_IRDA = 0x17
+ AF_ISDN = 0x22
+ AF_IUCV = 0x20
+ AF_KEY = 0xf
+ AF_LLC = 0x1a
+ AF_LOCAL = 0x1
+ AF_MAX = 0x27
+ AF_NETBEUI = 0xd
+ AF_NETLINK = 0x10
+ AF_NETROM = 0x6
+ AF_PACKET = 0x11
+ AF_PHONET = 0x23
+ AF_PPPOX = 0x18
+ AF_RDS = 0x15
+ AF_ROSE = 0xb
+ AF_ROUTE = 0x10
+ AF_RXRPC = 0x21
+ AF_SECURITY = 0xe
+ AF_SNA = 0x16
+ AF_TIPC = 0x1e
+ AF_UNIX = 0x1
+ AF_UNSPEC = 0x0
+ AF_WANPIPE = 0x19
+ AF_X25 = 0x9
+ ARPHRD_ADAPT = 0x108
+ ARPHRD_APPLETLK = 0x8
+ ARPHRD_ARCNET = 0x7
+ ARPHRD_ASH = 0x30d
+ ARPHRD_ATM = 0x13
+ ARPHRD_AX25 = 0x3
+ ARPHRD_BIF = 0x307
+ ARPHRD_CHAOS = 0x5
+ ARPHRD_CISCO = 0x201
+ ARPHRD_CSLIP = 0x101
+ ARPHRD_CSLIP6 = 0x103
+ ARPHRD_DDCMP = 0x205
+ ARPHRD_DLCI = 0xf
+ ARPHRD_ECONET = 0x30e
+ ARPHRD_EETHER = 0x2
+ ARPHRD_ETHER = 0x1
+ ARPHRD_EUI64 = 0x1b
+ ARPHRD_FCAL = 0x311
+ ARPHRD_FCFABRIC = 0x313
+ ARPHRD_FCPL = 0x312
+ ARPHRD_FCPP = 0x310
+ ARPHRD_FDDI = 0x306
+ ARPHRD_FRAD = 0x302
+ ARPHRD_HDLC = 0x201
+ ARPHRD_HIPPI = 0x30c
+ ARPHRD_HWX25 = 0x110
+ ARPHRD_IEEE1394 = 0x18
+ ARPHRD_IEEE802 = 0x6
+ ARPHRD_IEEE80211 = 0x321
+ ARPHRD_IEEE80211_PRISM = 0x322
+ ARPHRD_IEEE80211_RADIOTAP = 0x323
+ ARPHRD_IEEE802154 = 0x324
+ ARPHRD_IEEE802154_PHY = 0x325
+ ARPHRD_IEEE802_TR = 0x320
+ ARPHRD_INFINIBAND = 0x20
+ ARPHRD_IPDDP = 0x309
+ ARPHRD_IPGRE = 0x30a
+ ARPHRD_IRDA = 0x30f
+ ARPHRD_LAPB = 0x204
+ ARPHRD_LOCALTLK = 0x305
+ ARPHRD_LOOPBACK = 0x304
+ ARPHRD_METRICOM = 0x17
+ ARPHRD_NETROM = 0x0
+ ARPHRD_NONE = 0xfffe
+ ARPHRD_PIMREG = 0x30b
+ ARPHRD_PPP = 0x200
+ ARPHRD_PRONET = 0x4
+ ARPHRD_RAWHDLC = 0x206
+ ARPHRD_ROSE = 0x10e
+ ARPHRD_RSRVD = 0x104
+ ARPHRD_SIT = 0x308
+ ARPHRD_SKIP = 0x303
+ ARPHRD_SLIP = 0x100
+ ARPHRD_SLIP6 = 0x102
+ ARPHRD_TUNNEL = 0x300
+ ARPHRD_TUNNEL6 = 0x301
+ ARPHRD_VOID = 0xffff
+ ARPHRD_X25 = 0x10f
+ BPF_A = 0x10
+ BPF_ABS = 0x20
+ BPF_ADD = 0x0
+ BPF_ALU = 0x4
+ BPF_AND = 0x50
+ BPF_B = 0x10
+ BPF_DIV = 0x30
+ BPF_H = 0x8
+ BPF_IMM = 0x0
+ BPF_IND = 0x40
+ BPF_JA = 0x0
+ BPF_JEQ = 0x10
+ BPF_JGE = 0x30
+ BPF_JGT = 0x20
+ BPF_JMP = 0x5
+ BPF_JSET = 0x40
+ BPF_K = 0x0
+ BPF_LD = 0x0
+ BPF_LDX = 0x1
+ BPF_LEN = 0x80
+ BPF_LSH = 0x60
+ BPF_MAJOR_VERSION = 0x1
+ BPF_MAXINSNS = 0x1000
+ BPF_MEM = 0x60
+ BPF_MEMWORDS = 0x10
+ BPF_MINOR_VERSION = 0x1
+ BPF_MISC = 0x7
+ BPF_MSH = 0xa0
+ BPF_MUL = 0x20
+ BPF_NEG = 0x80
+ BPF_OR = 0x40
+ BPF_RET = 0x6
+ BPF_RSH = 0x70
+ BPF_ST = 0x2
+ BPF_STX = 0x3
+ BPF_SUB = 0x10
+ BPF_TAX = 0x0
+ BPF_TXA = 0x80
+ BPF_W = 0x0
+ BPF_X = 0x8
+ DT_BLK = 0x6
+ DT_CHR = 0x2
+ DT_DIR = 0x4
+ DT_FIFO = 0x1
+ DT_LNK = 0xa
+ DT_REG = 0x8
+ DT_SOCK = 0xc
+ DT_UNKNOWN = 0x0
+ DT_WHT = 0xe
+ EPOLLERR = 0x8
+ EPOLLET = -0x80000000
+ EPOLLHUP = 0x10
+ EPOLLIN = 0x1
+ EPOLLMSG = 0x400
+ EPOLLONESHOT = 0x40000000
+ EPOLLOUT = 0x4
+ EPOLLPRI = 0x2
+ EPOLLRDBAND = 0x80
+ EPOLLRDHUP = 0x2000
+ EPOLLRDNORM = 0x40
+ EPOLLWRBAND = 0x200
+ EPOLLWRNORM = 0x100
+ EPOLL_CLOEXEC = 0x80000
+ EPOLL_CTL_ADD = 0x1
+ EPOLL_CTL_DEL = 0x2
+ EPOLL_CTL_MOD = 0x3
+ EPOLL_NONBLOCK = 0x800
+ ETH_P_1588 = 0x88f7
+ ETH_P_8021Q = 0x8100
+ ETH_P_802_2 = 0x4
+ ETH_P_802_3 = 0x1
+ ETH_P_AARP = 0x80f3
+ ETH_P_ALL = 0x3
+ ETH_P_AOE = 0x88a2
+ ETH_P_ARCNET = 0x1a
+ ETH_P_ARP = 0x806
+ ETH_P_ATALK = 0x809b
+ ETH_P_ATMFATE = 0x8884
+ ETH_P_ATMMPOA = 0x884c
+ ETH_P_AX25 = 0x2
+ ETH_P_BPQ = 0x8ff
+ ETH_P_CAIF = 0xf7
+ ETH_P_CAN = 0xc
+ ETH_P_CONTROL = 0x16
+ ETH_P_CUST = 0x6006
+ ETH_P_DDCMP = 0x6
+ ETH_P_DEC = 0x6000
+ ETH_P_DIAG = 0x6005
+ ETH_P_DNA_DL = 0x6001
+ ETH_P_DNA_RC = 0x6002
+ ETH_P_DNA_RT = 0x6003
+ ETH_P_DSA = 0x1b
+ ETH_P_ECONET = 0x18
+ ETH_P_EDSA = 0xdada
+ ETH_P_FCOE = 0x8906
+ ETH_P_FIP = 0x8914
+ ETH_P_HDLC = 0x19
+ ETH_P_IEEE802154 = 0xf6
+ ETH_P_IEEEPUP = 0xa00
+ ETH_P_IEEEPUPAT = 0xa01
+ ETH_P_IP = 0x800
+ ETH_P_IPV6 = 0x86dd
+ ETH_P_IPX = 0x8137
+ ETH_P_IRDA = 0x17
+ ETH_P_LAT = 0x6004
+ ETH_P_LINK_CTL = 0x886c
+ ETH_P_LOCALTALK = 0x9
+ ETH_P_LOOP = 0x60
+ ETH_P_MOBITEX = 0x15
+ ETH_P_MPLS_MC = 0x8848
+ ETH_P_MPLS_UC = 0x8847
+ ETH_P_PAE = 0x888e
+ ETH_P_PAUSE = 0x8808
+ ETH_P_PHONET = 0xf5
+ ETH_P_PPPTALK = 0x10
+ ETH_P_PPP_DISC = 0x8863
+ ETH_P_PPP_MP = 0x8
+ ETH_P_PPP_SES = 0x8864
+ ETH_P_PUP = 0x200
+ ETH_P_PUPAT = 0x201
+ ETH_P_RARP = 0x8035
+ ETH_P_SCA = 0x6007
+ ETH_P_SLOW = 0x8809
+ ETH_P_SNAP = 0x5
+ ETH_P_TEB = 0x6558
+ ETH_P_TIPC = 0x88ca
+ ETH_P_TRAILER = 0x1c
+ ETH_P_TR_802_2 = 0x11
+ ETH_P_WAN_PPP = 0x7
+ ETH_P_WCCP = 0x883e
+ ETH_P_X25 = 0x805
+ FD_CLOEXEC = 0x1
+ FD_SETSIZE = 0x400
+ F_DUPFD = 0x0
+ F_DUPFD_CLOEXEC = 0x406
+ F_EXLCK = 0x4
+ F_GETFD = 0x1
+ F_GETFL = 0x3
+ F_GETLEASE = 0x401
+ F_GETLK = 0x5
+ F_GETLK64 = 0x5
+ F_GETOWN = 0x9
+ F_GETOWN_EX = 0x10
+ F_GETPIPE_SZ = 0x408
+ F_GETSIG = 0xb
+ F_LOCK = 0x1
+ F_NOTIFY = 0x402
+ F_OK = 0x0
+ F_RDLCK = 0x0
+ F_SETFD = 0x2
+ F_SETFL = 0x4
+ F_SETLEASE = 0x400
+ F_SETLK = 0x6
+ F_SETLK64 = 0x6
+ F_SETLKW = 0x7
+ F_SETLKW64 = 0x7
+ F_SETOWN = 0x8
+ F_SETOWN_EX = 0xf
+ F_SETPIPE_SZ = 0x407
+ F_SETSIG = 0xa
+ F_SHLCK = 0x8
+ F_TEST = 0x3
+ F_TLOCK = 0x2
+ F_ULOCK = 0x0
+ F_UNLCK = 0x2
+ F_WRLCK = 0x1
+ ICMPV6_FILTER = 0x1
+ IFA_F_DADFAILED = 0x8
+ IFA_F_DEPRECATED = 0x20
+ IFA_F_HOMEADDRESS = 0x10
+ IFA_F_NODAD = 0x2
+ IFA_F_OPTIMISTIC = 0x4
+ IFA_F_PERMANENT = 0x80
+ IFA_F_SECONDARY = 0x1
+ IFA_F_TEMPORARY = 0x1
+ IFA_F_TENTATIVE = 0x40
+ IFA_MAX = 0x7
+ IFF_ALLMULTI = 0x200
+ IFF_AUTOMEDIA = 0x4000
+ IFF_BROADCAST = 0x2
+ IFF_DEBUG = 0x4
+ IFF_DYNAMIC = 0x8000
+ IFF_LOOPBACK = 0x8
+ IFF_MASTER = 0x400
+ IFF_MULTICAST = 0x1000
+ IFF_NOARP = 0x80
+ IFF_NOTRAILERS = 0x20
+ IFF_NO_PI = 0x1000
+ IFF_ONE_QUEUE = 0x2000
+ IFF_POINTOPOINT = 0x10
+ IFF_PORTSEL = 0x2000
+ IFF_PROMISC = 0x100
+ IFF_RUNNING = 0x40
+ IFF_SLAVE = 0x800
+ IFF_TAP = 0x2
+ IFF_TUN = 0x1
+ IFF_TUN_EXCL = 0x8000
+ IFF_UP = 0x1
+ IFF_VNET_HDR = 0x4000
+ IFNAMSIZ = 0x10
+ IN_ACCESS = 0x1
+ IN_ALL_EVENTS = 0xfff
+ IN_ATTRIB = 0x4
+ IN_CLASSA_HOST = 0xffffff
+ IN_CLASSA_MAX = 0x80
+ IN_CLASSA_NET = 0xff000000
+ IN_CLASSA_NSHIFT = 0x18
+ IN_CLASSB_HOST = 0xffff
+ IN_CLASSB_MAX = 0x10000
+ IN_CLASSB_NET = 0xffff0000
+ IN_CLASSB_NSHIFT = 0x10
+ IN_CLASSC_HOST = 0xff
+ IN_CLASSC_NET = 0xffffff00
+ IN_CLASSC_NSHIFT = 0x8
+ IN_CLOEXEC = 0x80000
+ IN_CLOSE = 0x18
+ IN_CLOSE_NOWRITE = 0x10
+ IN_CLOSE_WRITE = 0x8
+ IN_CREATE = 0x100
+ IN_DELETE = 0x200
+ IN_DELETE_SELF = 0x400
+ IN_DONT_FOLLOW = 0x2000000
+ IN_EXCL_UNLINK = 0x4000000
+ IN_IGNORED = 0x8000
+ IN_ISDIR = 0x40000000
+ IN_LOOPBACKNET = 0x7f
+ IN_MASK_ADD = 0x20000000
+ IN_MODIFY = 0x2
+ IN_MOVE = 0xc0
+ IN_MOVED_FROM = 0x40
+ IN_MOVED_TO = 0x80
+ IN_MOVE_SELF = 0x800
+ IN_NONBLOCK = 0x800
+ IN_ONESHOT = 0x80000000
+ IN_ONLYDIR = 0x1000000
+ IN_OPEN = 0x20
+ IN_Q_OVERFLOW = 0x4000
+ IN_UNMOUNT = 0x2000
+ IPPROTO_AH = 0x33
+ IPPROTO_COMP = 0x6c
+ IPPROTO_DCCP = 0x21
+ IPPROTO_DSTOPTS = 0x3c
+ IPPROTO_EGP = 0x8
+ IPPROTO_ENCAP = 0x62
+ IPPROTO_ESP = 0x32
+ IPPROTO_FRAGMENT = 0x2c
+ IPPROTO_GRE = 0x2f
+ IPPROTO_HOPOPTS = 0x0
+ IPPROTO_ICMP = 0x1
+ IPPROTO_ICMPV6 = 0x3a
+ IPPROTO_IDP = 0x16
+ IPPROTO_IGMP = 0x2
+ IPPROTO_IP = 0x0
+ IPPROTO_IPIP = 0x4
+ IPPROTO_IPV6 = 0x29
+ IPPROTO_MTP = 0x5c
+ IPPROTO_NONE = 0x3b
+ IPPROTO_PIM = 0x67
+ IPPROTO_PUP = 0xc
+ IPPROTO_RAW = 0xff
+ IPPROTO_ROUTING = 0x2b
+ IPPROTO_RSVP = 0x2e
+ IPPROTO_SCTP = 0x84
+ IPPROTO_TCP = 0x6
+ IPPROTO_TP = 0x1d
+ IPPROTO_UDP = 0x11
+ IPPROTO_UDPLITE = 0x88
+ IPV6_2292DSTOPTS = 0x4
+ IPV6_2292HOPLIMIT = 0x8
+ IPV6_2292HOPOPTS = 0x3
+ IPV6_2292PKTINFO = 0x2
+ IPV6_2292PKTOPTIONS = 0x6
+ IPV6_2292RTHDR = 0x5
+ IPV6_ADDRFORM = 0x1
+ IPV6_ADD_MEMBERSHIP = 0x14
+ IPV6_AUTHHDR = 0xa
+ IPV6_CHECKSUM = 0x7
+ IPV6_DROP_MEMBERSHIP = 0x15
+ IPV6_DSTOPTS = 0x3b
+ IPV6_HOPLIMIT = 0x34
+ IPV6_HOPOPTS = 0x36
+ IPV6_IPSEC_POLICY = 0x22
+ IPV6_JOIN_ANYCAST = 0x1b
+ IPV6_JOIN_GROUP = 0x14
+ IPV6_LEAVE_ANYCAST = 0x1c
+ IPV6_LEAVE_GROUP = 0x15
+ IPV6_MTU = 0x18
+ IPV6_MTU_DISCOVER = 0x17
+ IPV6_MULTICAST_HOPS = 0x12
+ IPV6_MULTICAST_IF = 0x11
+ IPV6_MULTICAST_LOOP = 0x13
+ IPV6_NEXTHOP = 0x9
+ IPV6_PKTINFO = 0x32
+ IPV6_PMTUDISC_DO = 0x2
+ IPV6_PMTUDISC_DONT = 0x0
+ IPV6_PMTUDISC_PROBE = 0x3
+ IPV6_PMTUDISC_WANT = 0x1
+ IPV6_RECVDSTOPTS = 0x3a
+ IPV6_RECVERR = 0x19
+ IPV6_RECVHOPLIMIT = 0x33
+ IPV6_RECVHOPOPTS = 0x35
+ IPV6_RECVPKTINFO = 0x31
+ IPV6_RECVRTHDR = 0x38
+ IPV6_RECVTCLASS = 0x42
+ IPV6_ROUTER_ALERT = 0x16
+ IPV6_RTHDR = 0x39
+ IPV6_RTHDRDSTOPTS = 0x37
+ IPV6_RTHDR_LOOSE = 0x0
+ IPV6_RTHDR_STRICT = 0x1
+ IPV6_RTHDR_TYPE_0 = 0x0
+ IPV6_RXDSTOPTS = 0x3b
+ IPV6_RXHOPOPTS = 0x36
+ IPV6_TCLASS = 0x43
+ IPV6_UNICAST_HOPS = 0x10
+ IPV6_V6ONLY = 0x1a
+ IPV6_XFRM_POLICY = 0x23
+ IP_ADD_MEMBERSHIP = 0x23
+ IP_ADD_SOURCE_MEMBERSHIP = 0x27
+ IP_BLOCK_SOURCE = 0x26
+ IP_DEFAULT_MULTICAST_LOOP = 0x1
+ IP_DEFAULT_MULTICAST_TTL = 0x1
+ IP_DF = 0x4000
+ IP_DROP_MEMBERSHIP = 0x24
+ IP_DROP_SOURCE_MEMBERSHIP = 0x28
+ IP_FREEBIND = 0xf
+ IP_HDRINCL = 0x3
+ IP_IPSEC_POLICY = 0x10
+ IP_MAXPACKET = 0xffff
+ IP_MAX_MEMBERSHIPS = 0x14
+ IP_MF = 0x2000
+ IP_MINTTL = 0x15
+ IP_MSFILTER = 0x29
+ IP_MSS = 0x240
+ IP_MTU = 0xe
+ IP_MTU_DISCOVER = 0xa
+ IP_MULTICAST_IF = 0x20
+ IP_MULTICAST_LOOP = 0x22
+ IP_MULTICAST_TTL = 0x21
+ IP_OFFMASK = 0x1fff
+ IP_OPTIONS = 0x4
+ IP_ORIGDSTADDR = 0x14
+ IP_PASSSEC = 0x12
+ IP_PKTINFO = 0x8
+ IP_PKTOPTIONS = 0x9
+ IP_PMTUDISC = 0xa
+ IP_PMTUDISC_DO = 0x2
+ IP_PMTUDISC_DONT = 0x0
+ IP_PMTUDISC_PROBE = 0x3
+ IP_PMTUDISC_WANT = 0x1
+ IP_RECVERR = 0xb
+ IP_RECVOPTS = 0x6
+ IP_RECVORIGDSTADDR = 0x14
+ IP_RECVRETOPTS = 0x7
+ IP_RECVTOS = 0xd
+ IP_RECVTTL = 0xc
+ IP_RETOPTS = 0x7
+ IP_RF = 0x8000
+ IP_ROUTER_ALERT = 0x5
+ IP_TOS = 0x1
+ IP_TRANSPARENT = 0x13
+ IP_TTL = 0x2
+ IP_UNBLOCK_SOURCE = 0x25
+ IP_XFRM_POLICY = 0x11
+ LINUX_REBOOT_CMD_CAD_OFF = 0x0
+ LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef
+ LINUX_REBOOT_CMD_HALT = 0xcdef0123
+ LINUX_REBOOT_CMD_KEXEC = 0x45584543
+ LINUX_REBOOT_CMD_POWER_OFF = 0x4321fedc
+ LINUX_REBOOT_CMD_RESTART = 0x1234567
+ LINUX_REBOOT_CMD_RESTART2 = 0xa1b2c3d4
+ LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2
+ LINUX_REBOOT_MAGIC1 = 0xfee1dead
+ LINUX_REBOOT_MAGIC2 = 0x28121969
+ LOCK_EX = 0x2
+ LOCK_NB = 0x4
+ LOCK_SH = 0x1
+ LOCK_UN = 0x8
+ MADV_DOFORK = 0xb
+ MADV_DONTFORK = 0xa
+ MADV_DONTNEED = 0x4
+ MADV_HUGEPAGE = 0xe
+ MADV_HWPOISON = 0x64
+ MADV_MERGEABLE = 0xc
+ MADV_NOHUGEPAGE = 0xf
+ MADV_NORMAL = 0x0
+ MADV_RANDOM = 0x1
+ MADV_REMOVE = 0x9
+ MADV_SEQUENTIAL = 0x2
+ MADV_UNMERGEABLE = 0xd
+ MADV_WILLNEED = 0x3
+ MAP_32BIT = 0x40
+ MAP_ANON = 0x20
+ MAP_ANONYMOUS = 0x20
+ MAP_DENYWRITE = 0x800
+ MAP_EXECUTABLE = 0x1000
+ MAP_FILE = 0x0
+ MAP_FIXED = 0x10
+ MAP_GROWSDOWN = 0x100
+ MAP_HUGETLB = 0x40000
+ MAP_LOCKED = 0x2000
+ MAP_NONBLOCK = 0x10000
+ MAP_NORESERVE = 0x4000
+ MAP_POPULATE = 0x8000
+ MAP_PRIVATE = 0x2
+ MAP_SHARED = 0x1
+ MAP_STACK = 0x20000
+ MAP_TYPE = 0xf
+ MCL_CURRENT = 0x1
+ MCL_FUTURE = 0x2
+ MNT_DETACH = 0x2
+ MNT_EXPIRE = 0x4
+ MNT_FORCE = 0x1
+ MSG_CMSG_CLOEXEC = 0x40000000
+ MSG_CONFIRM = 0x800
+ MSG_CTRUNC = 0x8
+ MSG_DONTROUTE = 0x4
+ MSG_DONTWAIT = 0x40
+ MSG_EOR = 0x80
+ MSG_ERRQUEUE = 0x2000
+ MSG_FASTOPEN = 0x20000000
+ MSG_FIN = 0x200
+ MSG_MORE = 0x8000
+ MSG_NOSIGNAL = 0x4000
+ MSG_OOB = 0x1
+ MSG_PEEK = 0x2
+ MSG_PROXY = 0x10
+ MSG_RST = 0x1000
+ MSG_SYN = 0x400
+ MSG_TRUNC = 0x20
+ MSG_TRYHARD = 0x4
+ MSG_WAITALL = 0x100
+ MSG_WAITFORONE = 0x10000
+ MS_ACTIVE = 0x40000000
+ MS_ASYNC = 0x1
+ MS_BIND = 0x1000
+ MS_DIRSYNC = 0x80
+ MS_INVALIDATE = 0x2
+ MS_I_VERSION = 0x800000
+ MS_KERNMOUNT = 0x400000
+ MS_MANDLOCK = 0x40
+ MS_MGC_MSK = 0xffff0000
+ MS_MGC_VAL = 0xc0ed0000
+ MS_MOVE = 0x2000
+ MS_NOATIME = 0x400
+ MS_NODEV = 0x4
+ MS_NODIRATIME = 0x800
+ MS_NOEXEC = 0x8
+ MS_NOSUID = 0x2
+ MS_NOUSER = -0x80000000
+ MS_POSIXACL = 0x10000
+ MS_PRIVATE = 0x40000
+ MS_RDONLY = 0x1
+ MS_REC = 0x4000
+ MS_RELATIME = 0x200000
+ MS_REMOUNT = 0x20
+ MS_RMT_MASK = 0x800051
+ MS_SHARED = 0x100000
+ MS_SILENT = 0x8000
+ MS_SLAVE = 0x80000
+ MS_STRICTATIME = 0x1000000
+ MS_SYNC = 0x4
+ MS_SYNCHRONOUS = 0x10
+ MS_UNBINDABLE = 0x20000
+ NAME_MAX = 0xff
+ NETLINK_ADD_MEMBERSHIP = 0x1
+ NETLINK_AUDIT = 0x9
+ NETLINK_BROADCAST_ERROR = 0x4
+ NETLINK_CONNECTOR = 0xb
+ NETLINK_DNRTMSG = 0xe
+ NETLINK_DROP_MEMBERSHIP = 0x2
+ NETLINK_ECRYPTFS = 0x13
+ NETLINK_FIB_LOOKUP = 0xa
+ NETLINK_FIREWALL = 0x3
+ NETLINK_GENERIC = 0x10
+ NETLINK_INET_DIAG = 0x4
+ NETLINK_IP6_FW = 0xd
+ NETLINK_ISCSI = 0x8
+ NETLINK_KOBJECT_UEVENT = 0xf
+ NETLINK_NETFILTER = 0xc
+ NETLINK_NFLOG = 0x5
+ NETLINK_NO_ENOBUFS = 0x5
+ NETLINK_PKTINFO = 0x3
+ NETLINK_ROUTE = 0x0
+ NETLINK_SCSITRANSPORT = 0x12
+ NETLINK_SELINUX = 0x7
+ NETLINK_UNUSED = 0x1
+ NETLINK_USERSOCK = 0x2
+ NETLINK_XFRM = 0x6
+ NLA_ALIGNTO = 0x4
+ NLA_F_NESTED = 0x8000
+ NLA_F_NET_BYTEORDER = 0x4000
+ NLA_HDRLEN = 0x4
+ NLMSG_ALIGNTO = 0x4
+ NLMSG_DONE = 0x3
+ NLMSG_ERROR = 0x2
+ NLMSG_HDRLEN = 0x10
+ NLMSG_MIN_TYPE = 0x10
+ NLMSG_NOOP = 0x1
+ NLMSG_OVERRUN = 0x4
+ NLM_F_ACK = 0x4
+ NLM_F_APPEND = 0x800
+ NLM_F_ATOMIC = 0x400
+ NLM_F_CREATE = 0x400
+ NLM_F_DUMP = 0x300
+ NLM_F_ECHO = 0x8
+ NLM_F_EXCL = 0x200
+ NLM_F_MATCH = 0x200
+ NLM_F_MULTI = 0x2
+ NLM_F_REPLACE = 0x100
+ NLM_F_REQUEST = 0x1
+ NLM_F_ROOT = 0x100
+ O_ACCMODE = 0x3
+ O_APPEND = 0x400
+ O_ASYNC = 0x2000
+ O_CLOEXEC = 0x80000
+ O_CREAT = 0x40
+ O_DIRECT = 0x4000
+ O_DIRECTORY = 0x10000
+ O_DSYNC = 0x1000
+ O_EXCL = 0x80
+ O_FSYNC = 0x101000
+ O_LARGEFILE = 0x0
+ O_NDELAY = 0x800
+ O_NOATIME = 0x40000
+ O_NOCTTY = 0x100
+ O_NOFOLLOW = 0x20000
+ O_NONBLOCK = 0x800
+ O_RDONLY = 0x0
+ O_RDWR = 0x2
+ O_RSYNC = 0x101000
+ O_SYNC = 0x101000
+ O_TRUNC = 0x200
+ O_WRONLY = 0x1
+ PACKET_ADD_MEMBERSHIP = 0x1
+ PACKET_BROADCAST = 0x1
+ PACKET_DROP_MEMBERSHIP = 0x2
+ PACKET_FASTROUTE = 0x6
+ PACKET_HOST = 0x0
+ PACKET_LOOPBACK = 0x5
+ PACKET_MR_ALLMULTI = 0x2
+ PACKET_MR_MULTICAST = 0x0
+ PACKET_MR_PROMISC = 0x1
+ PACKET_MULTICAST = 0x2
+ PACKET_OTHERHOST = 0x3
+ PACKET_OUTGOING = 0x4
+ PACKET_RECV_OUTPUT = 0x3
+ PACKET_RX_RING = 0x5
+ PACKET_STATISTICS = 0x6
+ PRIO_PGRP = 0x1
+ PRIO_PROCESS = 0x0
+ PRIO_USER = 0x2
+ PROT_EXEC = 0x4
+ PROT_GROWSDOWN = 0x1000000
+ PROT_GROWSUP = 0x2000000
+ PROT_NONE = 0x0
+ PROT_READ = 0x1
+ PROT_WRITE = 0x2
+ PR_CAPBSET_DROP = 0x18
+ PR_CAPBSET_READ = 0x17
+ PR_ENDIAN_BIG = 0x0
+ PR_ENDIAN_LITTLE = 0x1
+ PR_ENDIAN_PPC_LITTLE = 0x2
+ PR_FPEMU_NOPRINT = 0x1
+ PR_FPEMU_SIGFPE = 0x2
+ PR_FP_EXC_ASYNC = 0x2
+ PR_FP_EXC_DISABLED = 0x0
+ PR_FP_EXC_DIV = 0x10000
+ PR_FP_EXC_INV = 0x100000
+ PR_FP_EXC_NONRECOV = 0x1
+ PR_FP_EXC_OVF = 0x20000
+ PR_FP_EXC_PRECISE = 0x3
+ PR_FP_EXC_RES = 0x80000
+ PR_FP_EXC_SW_ENABLE = 0x80
+ PR_FP_EXC_UND = 0x40000
+ PR_GET_DUMPABLE = 0x3
+ PR_GET_ENDIAN = 0x13
+ PR_GET_FPEMU = 0x9
+ PR_GET_FPEXC = 0xb
+ PR_GET_KEEPCAPS = 0x7
+ PR_GET_NAME = 0x10
+ PR_GET_PDEATHSIG = 0x2
+ PR_GET_SECCOMP = 0x15
+ PR_GET_SECUREBITS = 0x1b
+ PR_GET_TIMERSLACK = 0x1e
+ PR_GET_TIMING = 0xd
+ PR_GET_TSC = 0x19
+ PR_GET_UNALIGN = 0x5
+ PR_MCE_KILL = 0x21
+ PR_MCE_KILL_CLEAR = 0x0
+ PR_MCE_KILL_DEFAULT = 0x2
+ PR_MCE_KILL_EARLY = 0x1
+ PR_MCE_KILL_GET = 0x22
+ PR_MCE_KILL_LATE = 0x0
+ PR_MCE_KILL_SET = 0x1
+ PR_SET_DUMPABLE = 0x4
+ PR_SET_ENDIAN = 0x14
+ PR_SET_FPEMU = 0xa
+ PR_SET_FPEXC = 0xc
+ PR_SET_KEEPCAPS = 0x8
+ PR_SET_NAME = 0xf
+ PR_SET_PDEATHSIG = 0x1
+ PR_SET_PTRACER = 0x59616d61
+ PR_SET_SECCOMP = 0x16
+ PR_SET_SECUREBITS = 0x1c
+ PR_SET_TIMERSLACK = 0x1d
+ PR_SET_TIMING = 0xe
+ PR_SET_TSC = 0x1a
+ PR_SET_UNALIGN = 0x6
+ PR_TASK_PERF_EVENTS_DISABLE = 0x1f
+ PR_TASK_PERF_EVENTS_ENABLE = 0x20
+ PR_TIMING_STATISTICAL = 0x0
+ PR_TIMING_TIMESTAMP = 0x1
+ PR_TSC_ENABLE = 0x1
+ PR_TSC_SIGSEGV = 0x2
+ PR_UNALIGN_NOPRINT = 0x1
+ PR_UNALIGN_SIGBUS = 0x2
+ PTRACE_ARCH_PRCTL = 0x1e
+ PTRACE_ATTACH = 0x10
+ PTRACE_CONT = 0x7
+ PTRACE_DETACH = 0x11
+ PTRACE_EVENT_CLONE = 0x3
+ PTRACE_EVENT_EXEC = 0x4
+ PTRACE_EVENT_EXIT = 0x6
+ PTRACE_EVENT_FORK = 0x1
+ PTRACE_EVENT_VFORK = 0x2
+ PTRACE_EVENT_VFORK_DONE = 0x5
+ PTRACE_GETEVENTMSG = 0x4201
+ PTRACE_GETFPREGS = 0xe
+ PTRACE_GETFPXREGS = 0x12
+ PTRACE_GETREGS = 0xc
+ PTRACE_GETREGSET = 0x4204
+ PTRACE_GETSIGINFO = 0x4202
+ PTRACE_GET_THREAD_AREA = 0x19
+ PTRACE_KILL = 0x8
+ PTRACE_OLDSETOPTIONS = 0x15
+ PTRACE_O_MASK = 0x7f
+ PTRACE_O_TRACECLONE = 0x8
+ PTRACE_O_TRACEEXEC = 0x10
+ PTRACE_O_TRACEEXIT = 0x40
+ PTRACE_O_TRACEFORK = 0x2
+ PTRACE_O_TRACESYSGOOD = 0x1
+ PTRACE_O_TRACEVFORK = 0x4
+ PTRACE_O_TRACEVFORKDONE = 0x20
+ PTRACE_PEEKDATA = 0x2
+ PTRACE_PEEKTEXT = 0x1
+ PTRACE_PEEKUSR = 0x3
+ PTRACE_POKEDATA = 0x5
+ PTRACE_POKETEXT = 0x4
+ PTRACE_POKEUSR = 0x6
+ PTRACE_SETFPREGS = 0xf
+ PTRACE_SETFPXREGS = 0x13
+ PTRACE_SETOPTIONS = 0x4200
+ PTRACE_SETREGS = 0xd
+ PTRACE_SETREGSET = 0x4205
+ PTRACE_SETSIGINFO = 0x4203
+ PTRACE_SET_THREAD_AREA = 0x1a
+ PTRACE_SINGLEBLOCK = 0x21
+ PTRACE_SINGLESTEP = 0x9
+ PTRACE_SYSCALL = 0x18
+ PTRACE_SYSEMU = 0x1f
+ PTRACE_SYSEMU_SINGLESTEP = 0x20
+ PTRACE_TRACEME = 0x0
+ RLIMIT_AS = 0x9
+ RLIMIT_CORE = 0x4
+ RLIMIT_CPU = 0x0
+ RLIMIT_DATA = 0x2
+ RLIMIT_FSIZE = 0x1
+ RLIMIT_NOFILE = 0x7
+ RLIMIT_STACK = 0x3
+ RLIM_INFINITY = -0x1
+ RTAX_ADVMSS = 0x8
+ RTAX_CWND = 0x7
+ RTAX_FEATURES = 0xc
+ RTAX_FEATURE_ALLFRAG = 0x8
+ RTAX_FEATURE_ECN = 0x1
+ RTAX_FEATURE_SACK = 0x2
+ RTAX_FEATURE_TIMESTAMP = 0x4
+ RTAX_HOPLIMIT = 0xa
+ RTAX_INITCWND = 0xb
+ RTAX_INITRWND = 0xe
+ RTAX_LOCK = 0x1
+ RTAX_MAX = 0xe
+ RTAX_MTU = 0x2
+ RTAX_REORDERING = 0x9
+ RTAX_RTO_MIN = 0xd
+ RTAX_RTT = 0x4
+ RTAX_RTTVAR = 0x5
+ RTAX_SSTHRESH = 0x6
+ RTAX_UNSPEC = 0x0
+ RTAX_WINDOW = 0x3
+ RTA_ALIGNTO = 0x4
+ RTA_MAX = 0x10
+ RTCF_DIRECTSRC = 0x4000000
+ RTCF_DOREDIRECT = 0x1000000
+ RTCF_LOG = 0x2000000
+ RTCF_MASQ = 0x400000
+ RTCF_NAT = 0x800000
+ RTCF_VALVE = 0x200000
+ RTF_ADDRCLASSMASK = 0xf8000000
+ RTF_ADDRCONF = 0x40000
+ RTF_ALLONLINK = 0x20000
+ RTF_BROADCAST = 0x10000000
+ RTF_CACHE = 0x1000000
+ RTF_DEFAULT = 0x10000
+ RTF_DYNAMIC = 0x10
+ RTF_FLOW = 0x2000000
+ RTF_GATEWAY = 0x2
+ RTF_HOST = 0x4
+ RTF_INTERFACE = 0x40000000
+ RTF_IRTT = 0x100
+ RTF_LINKRT = 0x100000
+ RTF_LOCAL = 0x80000000
+ RTF_MODIFIED = 0x20
+ RTF_MSS = 0x40
+ RTF_MTU = 0x40
+ RTF_MULTICAST = 0x20000000
+ RTF_NAT = 0x8000000
+ RTF_NOFORWARD = 0x1000
+ RTF_NONEXTHOP = 0x200000
+ RTF_NOPMTUDISC = 0x4000
+ RTF_POLICY = 0x4000000
+ RTF_REINSTATE = 0x8
+ RTF_REJECT = 0x200
+ RTF_STATIC = 0x400
+ RTF_THROW = 0x2000
+ RTF_UP = 0x1
+ RTF_WINDOW = 0x80
+ RTF_XRESOLVE = 0x800
+ RTM_BASE = 0x10
+ RTM_DELACTION = 0x31
+ RTM_DELADDR = 0x15
+ RTM_DELADDRLABEL = 0x49
+ RTM_DELLINK = 0x11
+ RTM_DELNEIGH = 0x1d
+ RTM_DELQDISC = 0x25
+ RTM_DELROUTE = 0x19
+ RTM_DELRULE = 0x21
+ RTM_DELTCLASS = 0x29
+ RTM_DELTFILTER = 0x2d
+ RTM_F_CLONED = 0x200
+ RTM_F_EQUALIZE = 0x400
+ RTM_F_NOTIFY = 0x100
+ RTM_F_PREFIX = 0x800
+ RTM_GETACTION = 0x32
+ RTM_GETADDR = 0x16
+ RTM_GETADDRLABEL = 0x4a
+ RTM_GETANYCAST = 0x3e
+ RTM_GETDCB = 0x4e
+ RTM_GETLINK = 0x12
+ RTM_GETMULTICAST = 0x3a
+ RTM_GETNEIGH = 0x1e
+ RTM_GETNEIGHTBL = 0x42
+ RTM_GETQDISC = 0x26
+ RTM_GETROUTE = 0x1a
+ RTM_GETRULE = 0x22
+ RTM_GETTCLASS = 0x2a
+ RTM_GETTFILTER = 0x2e
+ RTM_MAX = 0x4f
+ RTM_NEWACTION = 0x30
+ RTM_NEWADDR = 0x14
+ RTM_NEWADDRLABEL = 0x48
+ RTM_NEWLINK = 0x10
+ RTM_NEWNDUSEROPT = 0x44
+ RTM_NEWNEIGH = 0x1c
+ RTM_NEWNEIGHTBL = 0x40
+ RTM_NEWPREFIX = 0x34
+ RTM_NEWQDISC = 0x24
+ RTM_NEWROUTE = 0x18
+ RTM_NEWRULE = 0x20
+ RTM_NEWTCLASS = 0x28
+ RTM_NEWTFILTER = 0x2c
+ RTM_NR_FAMILIES = 0x10
+ RTM_NR_MSGTYPES = 0x40
+ RTM_SETDCB = 0x4f
+ RTM_SETLINK = 0x13
+ RTM_SETNEIGHTBL = 0x43
+ RTNH_ALIGNTO = 0x4
+ RTNH_F_DEAD = 0x1
+ RTNH_F_ONLINK = 0x4
+ RTNH_F_PERVASIVE = 0x2
+ RTN_MAX = 0xb
+ RTPROT_BIRD = 0xc
+ RTPROT_BOOT = 0x3
+ RTPROT_DHCP = 0x10
+ RTPROT_DNROUTED = 0xd
+ RTPROT_GATED = 0x8
+ RTPROT_KERNEL = 0x2
+ RTPROT_MRT = 0xa
+ RTPROT_NTK = 0xf
+ RTPROT_RA = 0x9
+ RTPROT_REDIRECT = 0x1
+ RTPROT_STATIC = 0x4
+ RTPROT_UNSPEC = 0x0
+ RTPROT_XORP = 0xe
+ RTPROT_ZEBRA = 0xb
+ RT_CLASS_DEFAULT = 0xfd
+ RT_CLASS_LOCAL = 0xff
+ RT_CLASS_MAIN = 0xfe
+ RT_CLASS_MAX = 0xff
+ RT_CLASS_UNSPEC = 0x0
+ RUSAGE_CHILDREN = -0x1
+ RUSAGE_SELF = 0x0
+ RUSAGE_THREAD = 0x1
+ SCM_CREDENTIALS = 0x2
+ SCM_RIGHTS = 0x1
+ SCM_TIMESTAMP = 0x1d
+ SCM_TIMESTAMPING = 0x25
+ SCM_TIMESTAMPNS = 0x23
+ SHUT_RD = 0x0
+ SHUT_RDWR = 0x2
+ SHUT_WR = 0x1
+ SIOCADDDLCI = 0x8980
+ SIOCADDMULTI = 0x8931
+ SIOCADDRT = 0x890b
+ SIOCATMARK = 0x8905
+ SIOCDARP = 0x8953
+ SIOCDELDLCI = 0x8981
+ SIOCDELMULTI = 0x8932
+ SIOCDELRT = 0x890c
+ SIOCDEVPRIVATE = 0x89f0
+ SIOCDIFADDR = 0x8936
+ SIOCDRARP = 0x8960
+ SIOCGARP = 0x8954
+ SIOCGIFADDR = 0x8915
+ SIOCGIFBR = 0x8940
+ SIOCGIFBRDADDR = 0x8919
+ SIOCGIFCONF = 0x8912
+ SIOCGIFCOUNT = 0x8938
+ SIOCGIFDSTADDR = 0x8917
+ SIOCGIFENCAP = 0x8925
+ SIOCGIFFLAGS = 0x8913
+ SIOCGIFHWADDR = 0x8927
+ SIOCGIFINDEX = 0x8933
+ SIOCGIFMAP = 0x8970
+ SIOCGIFMEM = 0x891f
+ SIOCGIFMETRIC = 0x891d
+ SIOCGIFMTU = 0x8921
+ SIOCGIFNAME = 0x8910
+ SIOCGIFNETMASK = 0x891b
+ SIOCGIFPFLAGS = 0x8935
+ SIOCGIFSLAVE = 0x8929
+ SIOCGIFTXQLEN = 0x8942
+ SIOCGPGRP = 0x8904
+ SIOCGRARP = 0x8961
+ SIOCGSTAMP = 0x8906
+ SIOCGSTAMPNS = 0x8907
+ SIOCPROTOPRIVATE = 0x89e0
+ SIOCRTMSG = 0x890d
+ SIOCSARP = 0x8955
+ SIOCSIFADDR = 0x8916
+ SIOCSIFBR = 0x8941
+ SIOCSIFBRDADDR = 0x891a
+ SIOCSIFDSTADDR = 0x8918
+ SIOCSIFENCAP = 0x8926
+ SIOCSIFFLAGS = 0x8914
+ SIOCSIFHWADDR = 0x8924
+ SIOCSIFHWBROADCAST = 0x8937
+ SIOCSIFLINK = 0x8911
+ SIOCSIFMAP = 0x8971
+ SIOCSIFMEM = 0x8920
+ SIOCSIFMETRIC = 0x891e
+ SIOCSIFMTU = 0x8922
+ SIOCSIFNAME = 0x8923
+ SIOCSIFNETMASK = 0x891c
+ SIOCSIFPFLAGS = 0x8934
+ SIOCSIFSLAVE = 0x8930
+ SIOCSIFTXQLEN = 0x8943
+ SIOCSPGRP = 0x8902
+ SIOCSRARP = 0x8962
+ SOCK_CLOEXEC = 0x80000
+ SOCK_DCCP = 0x6
+ SOCK_DGRAM = 0x2
+ SOCK_NONBLOCK = 0x800
+ SOCK_PACKET = 0xa
+ SOCK_RAW = 0x3
+ SOCK_RDM = 0x4
+ SOCK_SEQPACKET = 0x5
+ SOCK_STREAM = 0x1
+ SOL_AAL = 0x109
+ SOL_ATM = 0x108
+ SOL_DECNET = 0x105
+ SOL_ICMPV6 = 0x3a
+ SOL_IP = 0x0
+ SOL_IPV6 = 0x29
+ SOL_IRDA = 0x10a
+ SOL_PACKET = 0x107
+ SOL_RAW = 0xff
+ SOL_SOCKET = 0x1
+ SOL_TCP = 0x6
+ SOL_X25 = 0x106
+ SOMAXCONN = 0x80
+ SO_ACCEPTCONN = 0x1e
+ SO_ATTACH_FILTER = 0x1a
+ SO_BINDTODEVICE = 0x19
+ SO_BROADCAST = 0x6
+ SO_BSDCOMPAT = 0xe
+ SO_DEBUG = 0x1
+ SO_DETACH_FILTER = 0x1b
+ SO_DOMAIN = 0x27
+ SO_DONTROUTE = 0x5
+ SO_ERROR = 0x4
+ SO_KEEPALIVE = 0x9
+ SO_LINGER = 0xd
+ SO_MARK = 0x24
+ SO_NO_CHECK = 0xb
+ SO_OOBINLINE = 0xa
+ SO_PASSCRED = 0x10
+ SO_PASSSEC = 0x22
+ SO_PEERCRED = 0x11
+ SO_PEERNAME = 0x1c
+ SO_PEERSEC = 0x1f
+ SO_PRIORITY = 0xc
+ SO_PROTOCOL = 0x26
+ SO_RCVBUF = 0x8
+ SO_RCVBUFFORCE = 0x21
+ SO_RCVLOWAT = 0x12
+ SO_RCVTIMEO = 0x14
+ SO_REUSEADDR = 0x2
+ SO_RXQ_OVFL = 0x28
+ SO_SECURITY_AUTHENTICATION = 0x16
+ SO_SECURITY_ENCRYPTION_NETWORK = 0x18
+ SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17
+ SO_SNDBUF = 0x7
+ SO_SNDBUFFORCE = 0x20
+ SO_SNDLOWAT = 0x13
+ SO_SNDTIMEO = 0x15
+ SO_TIMESTAMP = 0x1d
+ SO_TIMESTAMPING = 0x25
+ SO_TIMESTAMPNS = 0x23
+ SO_TYPE = 0x3
+ S_BLKSIZE = 0x200
+ S_IEXEC = 0x40
+ S_IFBLK = 0x6000
+ S_IFCHR = 0x2000
+ S_IFDIR = 0x4000
+ S_IFIFO = 0x1000
+ S_IFLNK = 0xa000
+ S_IFMT = 0xf000
+ S_IFREG = 0x8000
+ S_IFSOCK = 0xc000
+ S_IREAD = 0x100
+ S_IRGRP = 0x20
+ S_IROTH = 0x4
+ S_IRUSR = 0x100
+ S_IRWXG = 0x38
+ S_IRWXO = 0x7
+ S_IRWXU = 0x1c0
+ S_ISGID = 0x400
+ S_ISUID = 0x800
+ S_ISVTX = 0x200
+ S_IWGRP = 0x10
+ S_IWOTH = 0x2
+ S_IWRITE = 0x80
+ S_IWUSR = 0x80
+ S_IXGRP = 0x8
+ S_IXOTH = 0x1
+ S_IXUSR = 0x40
+ TCIFLUSH = 0x0
+ TCIOFLUSH = 0x2
+ TCOFLUSH = 0x1
+ TCP_CONGESTION = 0xd
+ TCP_CORK = 0x3
+ TCP_DEFER_ACCEPT = 0x9
+ TCP_INFO = 0xb
+ TCP_KEEPCNT = 0x6
+ TCP_KEEPIDLE = 0x4
+ TCP_KEEPINTVL = 0x5
+ TCP_LINGER2 = 0x8
+ TCP_MAXSEG = 0x2
+ TCP_MAXWIN = 0xffff
+ TCP_MAX_WINSHIFT = 0xe
+ TCP_MD5SIG = 0xe
+ TCP_MD5SIG_MAXKEYLEN = 0x50
+ TCP_MSS = 0x200
+ TCP_NODELAY = 0x1
+ TCP_QUICKACK = 0xc
+ TCP_SYNCNT = 0x7
+ TCP_WINDOW_CLAMP = 0xa
+ TIOCCBRK = 0x5428
+ TIOCCONS = 0x541d
+ TIOCEXCL = 0x540c
+ TIOCGDEV = 0x80045432
+ TIOCGETD = 0x5424
+ TIOCGICOUNT = 0x545d
+ TIOCGLCKTRMIOS = 0x5456
+ TIOCGPGRP = 0x540f
+ TIOCGPTN = 0x80045430
+ TIOCGRS485 = 0x542e
+ TIOCGSERIAL = 0x541e
+ TIOCGSID = 0x5429
+ TIOCGSOFTCAR = 0x5419
+ TIOCGWINSZ = 0x5413
+ TIOCINQ = 0x541b
+ TIOCLINUX = 0x541c
+ TIOCMBIC = 0x5417
+ TIOCMBIS = 0x5416
+ TIOCMGET = 0x5415
+ TIOCMIWAIT = 0x545c
+ TIOCMSET = 0x5418
+ TIOCM_CAR = 0x40
+ TIOCM_CD = 0x40
+ TIOCM_CTS = 0x20
+ TIOCM_DSR = 0x100
+ TIOCM_DTR = 0x2
+ TIOCM_LE = 0x1
+ TIOCM_RI = 0x80
+ TIOCM_RNG = 0x80
+ TIOCM_RTS = 0x4
+ TIOCM_SR = 0x10
+ TIOCM_ST = 0x8
+ TIOCNOTTY = 0x5422
+ TIOCNXCL = 0x540d
+ TIOCOUTQ = 0x5411
+ TIOCPKT = 0x5420
+ TIOCPKT_DATA = 0x0
+ TIOCPKT_DOSTOP = 0x20
+ TIOCPKT_FLUSHREAD = 0x1
+ TIOCPKT_FLUSHWRITE = 0x2
+ TIOCPKT_IOCTL = 0x40
+ TIOCPKT_NOSTOP = 0x10
+ TIOCPKT_START = 0x8
+ TIOCPKT_STOP = 0x4
+ TIOCSBRK = 0x5427
+ TIOCSCTTY = 0x540e
+ TIOCSERCONFIG = 0x5453
+ TIOCSERGETLSR = 0x5459
+ TIOCSERGETMULTI = 0x545a
+ TIOCSERGSTRUCT = 0x5458
+ TIOCSERGWILD = 0x5454
+ TIOCSERSETMULTI = 0x545b
+ TIOCSERSWILD = 0x5455
+ TIOCSER_TEMT = 0x1
+ TIOCSETD = 0x5423
+ TIOCSIG = 0x40045436
+ TIOCSLCKTRMIOS = 0x5457
+ TIOCSPGRP = 0x5410
+ TIOCSPTLCK = 0x40045431
+ TIOCSRS485 = 0x542f
+ TIOCSSERIAL = 0x541f
+ TIOCSSOFTCAR = 0x541a
+ TIOCSTI = 0x5412
+ TIOCSWINSZ = 0x5414
+ TUNATTACHFILTER = 0x401054d5
+ TUNDETACHFILTER = 0x401054d6
+ TUNGETFEATURES = 0x800454cf
+ TUNGETIFF = 0x800454d2
+ TUNGETSNDBUF = 0x800454d3
+ TUNGETVNETHDRSZ = 0x800454d7
+ TUNSETDEBUG = 0x400454c9
+ TUNSETGROUP = 0x400454ce
+ TUNSETIFF = 0x400454ca
+ TUNSETLINK = 0x400454cd
+ TUNSETNOCSUM = 0x400454c8
+ TUNSETOFFLOAD = 0x400454d0
+ TUNSETOWNER = 0x400454cc
+ TUNSETPERSIST = 0x400454cb
+ TUNSETSNDBUF = 0x400454d4
+ TUNSETTXFILTER = 0x400454d1
+ TUNSETVNETHDRSZ = 0x400454d8
+ WALL = 0x40000000
+ WCLONE = 0x80000000
+ WCONTINUED = 0x8
+ WEXITED = 0x4
+ WNOHANG = 0x1
+ WNOTHREAD = 0x20000000
+ WNOWAIT = 0x1000000
+ WORDSIZE = 0x40
+ WSTOPPED = 0x2
+ WUNTRACED = 0x2
+)</pre> <p>Errors </p>
+<pre data-language="go">const (
+ E2BIG = Errno(0x7)
+ EACCES = Errno(0xd)
+ EADDRINUSE = Errno(0x62)
+ EADDRNOTAVAIL = Errno(0x63)
+ EADV = Errno(0x44)
+ EAFNOSUPPORT = Errno(0x61)
+ EAGAIN = Errno(0xb)
+ EALREADY = Errno(0x72)
+ EBADE = Errno(0x34)
+ EBADF = Errno(0x9)
+ EBADFD = Errno(0x4d)
+ EBADMSG = Errno(0x4a)
+ EBADR = Errno(0x35)
+ EBADRQC = Errno(0x38)
+ EBADSLT = Errno(0x39)
+ EBFONT = Errno(0x3b)
+ EBUSY = Errno(0x10)
+ ECANCELED = Errno(0x7d)
+ ECHILD = Errno(0xa)
+ ECHRNG = Errno(0x2c)
+ ECOMM = Errno(0x46)
+ ECONNABORTED = Errno(0x67)
+ ECONNREFUSED = Errno(0x6f)
+ ECONNRESET = Errno(0x68)
+ EDEADLK = Errno(0x23)
+ EDEADLOCK = Errno(0x23)
+ EDESTADDRREQ = Errno(0x59)
+ EDOM = Errno(0x21)
+ EDOTDOT = Errno(0x49)
+ EDQUOT = Errno(0x7a)
+ EEXIST = Errno(0x11)
+ EFAULT = Errno(0xe)
+ EFBIG = Errno(0x1b)
+ EHOSTDOWN = Errno(0x70)
+ EHOSTUNREACH = Errno(0x71)
+ EIDRM = Errno(0x2b)
+ EILSEQ = Errno(0x54)
+ EINPROGRESS = Errno(0x73)
+ EINTR = Errno(0x4)
+ EINVAL = Errno(0x16)
+ EIO = Errno(0x5)
+ EISCONN = Errno(0x6a)
+ EISDIR = Errno(0x15)
+ EISNAM = Errno(0x78)
+ EKEYEXPIRED = Errno(0x7f)
+ EKEYREJECTED = Errno(0x81)
+ EKEYREVOKED = Errno(0x80)
+ EL2HLT = Errno(0x33)
+ EL2NSYNC = Errno(0x2d)
+ EL3HLT = Errno(0x2e)
+ EL3RST = Errno(0x2f)
+ ELIBACC = Errno(0x4f)
+ ELIBBAD = Errno(0x50)
+ ELIBEXEC = Errno(0x53)
+ ELIBMAX = Errno(0x52)
+ ELIBSCN = Errno(0x51)
+ ELNRNG = Errno(0x30)
+ ELOOP = Errno(0x28)
+ EMEDIUMTYPE = Errno(0x7c)
+ EMFILE = Errno(0x18)
+ EMLINK = Errno(0x1f)
+ EMSGSIZE = Errno(0x5a)
+ EMULTIHOP = Errno(0x48)
+ ENAMETOOLONG = Errno(0x24)
+ ENAVAIL = Errno(0x77)
+ ENETDOWN = Errno(0x64)
+ ENETRESET = Errno(0x66)
+ ENETUNREACH = Errno(0x65)
+ ENFILE = Errno(0x17)
+ ENOANO = Errno(0x37)
+ ENOBUFS = Errno(0x69)
+ ENOCSI = Errno(0x32)
+ ENODATA = Errno(0x3d)
+ ENODEV = Errno(0x13)
+ ENOENT = Errno(0x2)
+ ENOEXEC = Errno(0x8)
+ ENOKEY = Errno(0x7e)
+ ENOLCK = Errno(0x25)
+ ENOLINK = Errno(0x43)
+ ENOMEDIUM = Errno(0x7b)
+ ENOMEM = Errno(0xc)
+ ENOMSG = Errno(0x2a)
+ ENONET = Errno(0x40)
+ ENOPKG = Errno(0x41)
+ ENOPROTOOPT = Errno(0x5c)
+ ENOSPC = Errno(0x1c)
+ ENOSR = Errno(0x3f)
+ ENOSTR = Errno(0x3c)
+ ENOSYS = Errno(0x26)
+ ENOTBLK = Errno(0xf)
+ ENOTCONN = Errno(0x6b)
+ ENOTDIR = Errno(0x14)
+ ENOTEMPTY = Errno(0x27)
+ ENOTNAM = Errno(0x76)
+ ENOTRECOVERABLE = Errno(0x83)
+ ENOTSOCK = Errno(0x58)
+ ENOTSUP = Errno(0x5f)
+ ENOTTY = Errno(0x19)
+ ENOTUNIQ = Errno(0x4c)
+ ENXIO = Errno(0x6)
+ EOPNOTSUPP = Errno(0x5f)
+ EOVERFLOW = Errno(0x4b)
+ EOWNERDEAD = Errno(0x82)
+ EPERM = Errno(0x1)
+ EPFNOSUPPORT = Errno(0x60)
+ EPIPE = Errno(0x20)
+ EPROTO = Errno(0x47)
+ EPROTONOSUPPORT = Errno(0x5d)
+ EPROTOTYPE = Errno(0x5b)
+ ERANGE = Errno(0x22)
+ EREMCHG = Errno(0x4e)
+ EREMOTE = Errno(0x42)
+ EREMOTEIO = Errno(0x79)
+ ERESTART = Errno(0x55)
+ ERFKILL = Errno(0x84)
+ EROFS = Errno(0x1e)
+ ESHUTDOWN = Errno(0x6c)
+ ESOCKTNOSUPPORT = Errno(0x5e)
+ ESPIPE = Errno(0x1d)
+ ESRCH = Errno(0x3)
+ ESRMNT = Errno(0x45)
+ ESTALE = Errno(0x74)
+ ESTRPIPE = Errno(0x56)
+ ETIME = Errno(0x3e)
+ ETIMEDOUT = Errno(0x6e)
+ ETOOMANYREFS = Errno(0x6d)
+ ETXTBSY = Errno(0x1a)
+ EUCLEAN = Errno(0x75)
+ EUNATCH = Errno(0x31)
+ EUSERS = Errno(0x57)
+ EWOULDBLOCK = Errno(0xb)
+ EXDEV = Errno(0x12)
+ EXFULL = Errno(0x36)
+)</pre> <p>Signals </p>
+<pre data-language="go">const (
+ SIGABRT = Signal(0x6)
+ SIGALRM = Signal(0xe)
+ SIGBUS = Signal(0x7)
+ SIGCHLD = Signal(0x11)
+ SIGCLD = Signal(0x11)
+ SIGCONT = Signal(0x12)
+ SIGFPE = Signal(0x8)
+ SIGHUP = Signal(0x1)
+ SIGILL = Signal(0x4)
+ SIGINT = Signal(0x2)
+ SIGIO = Signal(0x1d)
+ SIGIOT = Signal(0x6)
+ SIGKILL = Signal(0x9)
+ SIGPIPE = Signal(0xd)
+ SIGPOLL = Signal(0x1d)
+ SIGPROF = Signal(0x1b)
+ SIGPWR = Signal(0x1e)
+ SIGQUIT = Signal(0x3)
+ SIGSEGV = Signal(0xb)
+ SIGSTKFLT = Signal(0x10)
+ SIGSTOP = Signal(0x13)
+ SIGSYS = Signal(0x1f)
+ SIGTERM = Signal(0xf)
+ SIGTRAP = Signal(0x5)
+ SIGTSTP = Signal(0x14)
+ SIGTTIN = Signal(0x15)
+ SIGTTOU = Signal(0x16)
+ SIGUNUSED = Signal(0x1f)
+ SIGURG = Signal(0x17)
+ SIGUSR1 = Signal(0xa)
+ SIGUSR2 = Signal(0xc)
+ SIGVTALRM = Signal(0x1a)
+ SIGWINCH = Signal(0x1c)
+ SIGXCPU = Signal(0x18)
+ SIGXFSZ = Signal(0x19)
+)</pre> <pre data-language="go">const (
+ SYS_READ = 0
+ SYS_WRITE = 1
+ SYS_OPEN = 2
+ SYS_CLOSE = 3
+ SYS_STAT = 4
+ SYS_FSTAT = 5
+ SYS_LSTAT = 6
+ SYS_POLL = 7
+ SYS_LSEEK = 8
+ SYS_MMAP = 9
+ SYS_MPROTECT = 10
+ SYS_MUNMAP = 11
+ SYS_BRK = 12
+ SYS_RT_SIGACTION = 13
+ SYS_RT_SIGPROCMASK = 14
+ SYS_RT_SIGRETURN = 15
+ SYS_IOCTL = 16
+ SYS_PREAD64 = 17
+ SYS_PWRITE64 = 18
+ SYS_READV = 19
+ SYS_WRITEV = 20
+ SYS_ACCESS = 21
+ SYS_PIPE = 22
+ SYS_SELECT = 23
+ SYS_SCHED_YIELD = 24
+ SYS_MREMAP = 25
+ SYS_MSYNC = 26
+ SYS_MINCORE = 27
+ SYS_MADVISE = 28
+ SYS_SHMGET = 29
+ SYS_SHMAT = 30
+ SYS_SHMCTL = 31
+ SYS_DUP = 32
+ SYS_DUP2 = 33
+ SYS_PAUSE = 34
+ SYS_NANOSLEEP = 35
+ SYS_GETITIMER = 36
+ SYS_ALARM = 37
+ SYS_SETITIMER = 38
+ SYS_GETPID = 39
+ SYS_SENDFILE = 40
+ SYS_SOCKET = 41
+ SYS_CONNECT = 42
+ SYS_ACCEPT = 43
+ SYS_SENDTO = 44
+ SYS_RECVFROM = 45
+ SYS_SENDMSG = 46
+ SYS_RECVMSG = 47
+ SYS_SHUTDOWN = 48
+ SYS_BIND = 49
+ SYS_LISTEN = 50
+ SYS_GETSOCKNAME = 51
+ SYS_GETPEERNAME = 52
+ SYS_SOCKETPAIR = 53
+ SYS_SETSOCKOPT = 54
+ SYS_GETSOCKOPT = 55
+ SYS_CLONE = 56
+ SYS_FORK = 57
+ SYS_VFORK = 58
+ SYS_EXECVE = 59
+ SYS_EXIT = 60
+ SYS_WAIT4 = 61
+ SYS_KILL = 62
+ SYS_UNAME = 63
+ SYS_SEMGET = 64
+ SYS_SEMOP = 65
+ SYS_SEMCTL = 66
+ SYS_SHMDT = 67
+ SYS_MSGGET = 68
+ SYS_MSGSND = 69
+ SYS_MSGRCV = 70
+ SYS_MSGCTL = 71
+ SYS_FCNTL = 72
+ SYS_FLOCK = 73
+ SYS_FSYNC = 74
+ SYS_FDATASYNC = 75
+ SYS_TRUNCATE = 76
+ SYS_FTRUNCATE = 77
+ SYS_GETDENTS = 78
+ SYS_GETCWD = 79
+ SYS_CHDIR = 80
+ SYS_FCHDIR = 81
+ SYS_RENAME = 82
+ SYS_MKDIR = 83
+ SYS_RMDIR = 84
+ SYS_CREAT = 85
+ SYS_LINK = 86
+ SYS_UNLINK = 87
+ SYS_SYMLINK = 88
+ SYS_READLINK = 89
+ SYS_CHMOD = 90
+ SYS_FCHMOD = 91
+ SYS_CHOWN = 92
+ SYS_FCHOWN = 93
+ SYS_LCHOWN = 94
+ SYS_UMASK = 95
+ SYS_GETTIMEOFDAY = 96
+ SYS_GETRLIMIT = 97
+ SYS_GETRUSAGE = 98
+ SYS_SYSINFO = 99
+ SYS_TIMES = 100
+ SYS_PTRACE = 101
+ SYS_GETUID = 102
+ SYS_SYSLOG = 103
+ SYS_GETGID = 104
+ SYS_SETUID = 105
+ SYS_SETGID = 106
+ SYS_GETEUID = 107
+ SYS_GETEGID = 108
+ SYS_SETPGID = 109
+ SYS_GETPPID = 110
+ SYS_GETPGRP = 111
+ SYS_SETSID = 112
+ SYS_SETREUID = 113
+ SYS_SETREGID = 114
+ SYS_GETGROUPS = 115
+ SYS_SETGROUPS = 116
+ SYS_SETRESUID = 117
+ SYS_GETRESUID = 118
+ SYS_SETRESGID = 119
+ SYS_GETRESGID = 120
+ SYS_GETPGID = 121
+ SYS_SETFSUID = 122
+ SYS_SETFSGID = 123
+ SYS_GETSID = 124
+ SYS_CAPGET = 125
+ SYS_CAPSET = 126
+ SYS_RT_SIGPENDING = 127
+ SYS_RT_SIGTIMEDWAIT = 128
+ SYS_RT_SIGQUEUEINFO = 129
+ SYS_RT_SIGSUSPEND = 130
+ SYS_SIGALTSTACK = 131
+ SYS_UTIME = 132
+ SYS_MKNOD = 133
+ SYS_USELIB = 134
+ SYS_PERSONALITY = 135
+ SYS_USTAT = 136
+ SYS_STATFS = 137
+ SYS_FSTATFS = 138
+ SYS_SYSFS = 139
+ SYS_GETPRIORITY = 140
+ SYS_SETPRIORITY = 141
+ SYS_SCHED_SETPARAM = 142
+ SYS_SCHED_GETPARAM = 143
+ SYS_SCHED_SETSCHEDULER = 144
+ SYS_SCHED_GETSCHEDULER = 145
+ SYS_SCHED_GET_PRIORITY_MAX = 146
+ SYS_SCHED_GET_PRIORITY_MIN = 147
+ SYS_SCHED_RR_GET_INTERVAL = 148
+ SYS_MLOCK = 149
+ SYS_MUNLOCK = 150
+ SYS_MLOCKALL = 151
+ SYS_MUNLOCKALL = 152
+ SYS_VHANGUP = 153
+ SYS_MODIFY_LDT = 154
+ SYS_PIVOT_ROOT = 155
+ SYS__SYSCTL = 156
+ SYS_PRCTL = 157
+ SYS_ARCH_PRCTL = 158
+ SYS_ADJTIMEX = 159
+ SYS_SETRLIMIT = 160
+ SYS_CHROOT = 161
+ SYS_SYNC = 162
+ SYS_ACCT = 163
+ SYS_SETTIMEOFDAY = 164
+ SYS_MOUNT = 165
+ SYS_UMOUNT2 = 166
+ SYS_SWAPON = 167
+ SYS_SWAPOFF = 168
+ SYS_REBOOT = 169
+ SYS_SETHOSTNAME = 170
+ SYS_SETDOMAINNAME = 171
+ SYS_IOPL = 172
+ SYS_IOPERM = 173
+ SYS_CREATE_MODULE = 174
+ SYS_INIT_MODULE = 175
+ SYS_DELETE_MODULE = 176
+ SYS_GET_KERNEL_SYMS = 177
+ SYS_QUERY_MODULE = 178
+ SYS_QUOTACTL = 179
+ SYS_NFSSERVCTL = 180
+ SYS_GETPMSG = 181
+ SYS_PUTPMSG = 182
+ SYS_AFS_SYSCALL = 183
+ SYS_TUXCALL = 184
+ SYS_SECURITY = 185
+ SYS_GETTID = 186
+ SYS_READAHEAD = 187
+ SYS_SETXATTR = 188
+ SYS_LSETXATTR = 189
+ SYS_FSETXATTR = 190
+ SYS_GETXATTR = 191
+ SYS_LGETXATTR = 192
+ SYS_FGETXATTR = 193
+ SYS_LISTXATTR = 194
+ SYS_LLISTXATTR = 195
+ SYS_FLISTXATTR = 196
+ SYS_REMOVEXATTR = 197
+ SYS_LREMOVEXATTR = 198
+ SYS_FREMOVEXATTR = 199
+ SYS_TKILL = 200
+ SYS_TIME = 201
+ SYS_FUTEX = 202
+ SYS_SCHED_SETAFFINITY = 203
+ SYS_SCHED_GETAFFINITY = 204
+ SYS_SET_THREAD_AREA = 205
+ SYS_IO_SETUP = 206
+ SYS_IO_DESTROY = 207
+ SYS_IO_GETEVENTS = 208
+ SYS_IO_SUBMIT = 209
+ SYS_IO_CANCEL = 210
+ SYS_GET_THREAD_AREA = 211
+ SYS_LOOKUP_DCOOKIE = 212
+ SYS_EPOLL_CREATE = 213
+ SYS_EPOLL_CTL_OLD = 214
+ SYS_EPOLL_WAIT_OLD = 215
+ SYS_REMAP_FILE_PAGES = 216
+ SYS_GETDENTS64 = 217
+ SYS_SET_TID_ADDRESS = 218
+ SYS_RESTART_SYSCALL = 219
+ SYS_SEMTIMEDOP = 220
+ SYS_FADVISE64 = 221
+ SYS_TIMER_CREATE = 222
+ SYS_TIMER_SETTIME = 223
+ SYS_TIMER_GETTIME = 224
+ SYS_TIMER_GETOVERRUN = 225
+ SYS_TIMER_DELETE = 226
+ SYS_CLOCK_SETTIME = 227
+ SYS_CLOCK_GETTIME = 228
+ SYS_CLOCK_GETRES = 229
+ SYS_CLOCK_NANOSLEEP = 230
+ SYS_EXIT_GROUP = 231
+ SYS_EPOLL_WAIT = 232
+ SYS_EPOLL_CTL = 233
+ SYS_TGKILL = 234
+ SYS_UTIMES = 235
+ SYS_VSERVER = 236
+ SYS_MBIND = 237
+ SYS_SET_MEMPOLICY = 238
+ SYS_GET_MEMPOLICY = 239
+ SYS_MQ_OPEN = 240
+ SYS_MQ_UNLINK = 241
+ SYS_MQ_TIMEDSEND = 242
+ SYS_MQ_TIMEDRECEIVE = 243
+ SYS_MQ_NOTIFY = 244
+ SYS_MQ_GETSETATTR = 245
+ SYS_KEXEC_LOAD = 246
+ SYS_WAITID = 247
+ SYS_ADD_KEY = 248
+ SYS_REQUEST_KEY = 249
+ SYS_KEYCTL = 250
+ SYS_IOPRIO_SET = 251
+ SYS_IOPRIO_GET = 252
+ SYS_INOTIFY_INIT = 253
+ SYS_INOTIFY_ADD_WATCH = 254
+ SYS_INOTIFY_RM_WATCH = 255
+ SYS_MIGRATE_PAGES = 256
+ SYS_OPENAT = 257
+ SYS_MKDIRAT = 258
+ SYS_MKNODAT = 259
+ SYS_FCHOWNAT = 260
+ SYS_FUTIMESAT = 261
+ SYS_NEWFSTATAT = 262
+ SYS_UNLINKAT = 263
+ SYS_RENAMEAT = 264
+ SYS_LINKAT = 265
+ SYS_SYMLINKAT = 266
+ SYS_READLINKAT = 267
+ SYS_FCHMODAT = 268
+ SYS_FACCESSAT = 269
+ SYS_PSELECT6 = 270
+ SYS_PPOLL = 271
+ SYS_UNSHARE = 272
+ SYS_SET_ROBUST_LIST = 273
+ SYS_GET_ROBUST_LIST = 274
+ SYS_SPLICE = 275
+ SYS_TEE = 276
+ SYS_SYNC_FILE_RANGE = 277
+ SYS_VMSPLICE = 278
+ SYS_MOVE_PAGES = 279
+ SYS_UTIMENSAT = 280
+ SYS_EPOLL_PWAIT = 281
+ SYS_SIGNALFD = 282
+ SYS_TIMERFD_CREATE = 283
+ SYS_EVENTFD = 284
+ SYS_FALLOCATE = 285
+ SYS_TIMERFD_SETTIME = 286
+ SYS_TIMERFD_GETTIME = 287
+ SYS_ACCEPT4 = 288
+ SYS_SIGNALFD4 = 289
+ SYS_EVENTFD2 = 290
+ SYS_EPOLL_CREATE1 = 291
+ SYS_DUP3 = 292
+ SYS_PIPE2 = 293
+ SYS_INOTIFY_INIT1 = 294
+ SYS_PREADV = 295
+ SYS_PWRITEV = 296
+ SYS_RT_TGSIGQUEUEINFO = 297
+ SYS_PERF_EVENT_OPEN = 298
+ SYS_RECVMMSG = 299
+ SYS_FANOTIFY_INIT = 300
+ SYS_FANOTIFY_MARK = 301
+ SYS_PRLIMIT64 = 302
+)</pre> <pre data-language="go">const (
+ SizeofSockaddrInet4 = 0x10
+ SizeofSockaddrInet6 = 0x1c
+ SizeofSockaddrAny = 0x70
+ SizeofSockaddrUnix = 0x6e
+ SizeofSockaddrLinklayer = 0x14
+ SizeofSockaddrNetlink = 0xc
+ SizeofLinger = 0x8
+ SizeofIPMreq = 0x8
+ SizeofIPMreqn = 0xc
+ SizeofIPv6Mreq = 0x14
+ SizeofMsghdr = 0x38
+ SizeofCmsghdr = 0x10
+ SizeofInet4Pktinfo = 0xc
+ SizeofInet6Pktinfo = 0x14
+ SizeofIPv6MTUInfo = 0x20
+ SizeofICMPv6Filter = 0x20
+ SizeofUcred = 0xc
+ SizeofTCPInfo = 0x68
+)</pre> <pre data-language="go">const (
+ IFA_UNSPEC = 0x0
+ IFA_ADDRESS = 0x1
+ IFA_LOCAL = 0x2
+ IFA_LABEL = 0x3
+ IFA_BROADCAST = 0x4
+ IFA_ANYCAST = 0x5
+ IFA_CACHEINFO = 0x6
+ IFA_MULTICAST = 0x7
+ IFLA_UNSPEC = 0x0
+ IFLA_ADDRESS = 0x1
+ IFLA_BROADCAST = 0x2
+ IFLA_IFNAME = 0x3
+ IFLA_MTU = 0x4
+ IFLA_LINK = 0x5
+ IFLA_QDISC = 0x6
+ IFLA_STATS = 0x7
+ IFLA_COST = 0x8
+ IFLA_PRIORITY = 0x9
+ IFLA_MASTER = 0xa
+ IFLA_WIRELESS = 0xb
+ IFLA_PROTINFO = 0xc
+ IFLA_TXQLEN = 0xd
+ IFLA_MAP = 0xe
+ IFLA_WEIGHT = 0xf
+ IFLA_OPERSTATE = 0x10
+ IFLA_LINKMODE = 0x11
+ IFLA_LINKINFO = 0x12
+ IFLA_NET_NS_PID = 0x13
+ IFLA_IFALIAS = 0x14
+ IFLA_MAX = 0x1d
+ RT_SCOPE_UNIVERSE = 0x0
+ RT_SCOPE_SITE = 0xc8
+ RT_SCOPE_LINK = 0xfd
+ RT_SCOPE_HOST = 0xfe
+ RT_SCOPE_NOWHERE = 0xff
+ RT_TABLE_UNSPEC = 0x0
+ RT_TABLE_COMPAT = 0xfc
+ RT_TABLE_DEFAULT = 0xfd
+ RT_TABLE_MAIN = 0xfe
+ RT_TABLE_LOCAL = 0xff
+ RT_TABLE_MAX = 0xffffffff
+ RTA_UNSPEC = 0x0
+ RTA_DST = 0x1
+ RTA_SRC = 0x2
+ RTA_IIF = 0x3
+ RTA_OIF = 0x4
+ RTA_GATEWAY = 0x5
+ RTA_PRIORITY = 0x6
+ RTA_PREFSRC = 0x7
+ RTA_METRICS = 0x8
+ RTA_MULTIPATH = 0x9
+ RTA_FLOW = 0xb
+ RTA_CACHEINFO = 0xc
+ RTA_TABLE = 0xf
+ RTN_UNSPEC = 0x0
+ RTN_UNICAST = 0x1
+ RTN_LOCAL = 0x2
+ RTN_BROADCAST = 0x3
+ RTN_ANYCAST = 0x4
+ RTN_MULTICAST = 0x5
+ RTN_BLACKHOLE = 0x6
+ RTN_UNREACHABLE = 0x7
+ RTN_PROHIBIT = 0x8
+ RTN_THROW = 0x9
+ RTN_NAT = 0xa
+ RTN_XRESOLVE = 0xb
+ RTNLGRP_NONE = 0x0
+ RTNLGRP_LINK = 0x1
+ RTNLGRP_NOTIFY = 0x2
+ RTNLGRP_NEIGH = 0x3
+ RTNLGRP_TC = 0x4
+ RTNLGRP_IPV4_IFADDR = 0x5
+ RTNLGRP_IPV4_MROUTE = 0x6
+ RTNLGRP_IPV4_ROUTE = 0x7
+ RTNLGRP_IPV4_RULE = 0x8
+ RTNLGRP_IPV6_IFADDR = 0x9
+ RTNLGRP_IPV6_MROUTE = 0xa
+ RTNLGRP_IPV6_ROUTE = 0xb
+ RTNLGRP_IPV6_IFINFO = 0xc
+ RTNLGRP_IPV6_PREFIX = 0x12
+ RTNLGRP_IPV6_RULE = 0x13
+ RTNLGRP_ND_USEROPT = 0x14
+ SizeofNlMsghdr = 0x10
+ SizeofNlMsgerr = 0x14
+ SizeofRtGenmsg = 0x1
+ SizeofNlAttr = 0x4
+ SizeofRtAttr = 0x4
+ SizeofIfInfomsg = 0x10
+ SizeofIfAddrmsg = 0x8
+ SizeofRtMsg = 0xc
+ SizeofRtNexthop = 0x8
+)</pre> <pre data-language="go">const (
+ SizeofSockFilter = 0x8
+ SizeofSockFprog = 0x10
+)</pre> <pre data-language="go">const (
+ VINTR = 0x0
+ VQUIT = 0x1
+ VERASE = 0x2
+ VKILL = 0x3
+ VEOF = 0x4
+ VTIME = 0x5
+ VMIN = 0x6
+ VSWTC = 0x7
+ VSTART = 0x8
+ VSTOP = 0x9
+ VSUSP = 0xa
+ VEOL = 0xb
+ VREPRINT = 0xc
+ VDISCARD = 0xd
+ VWERASE = 0xe
+ VLNEXT = 0xf
+ VEOL2 = 0x10
+ IGNBRK = 0x1
+ BRKINT = 0x2
+ IGNPAR = 0x4
+ PARMRK = 0x8
+ INPCK = 0x10
+ ISTRIP = 0x20
+ INLCR = 0x40
+ IGNCR = 0x80
+ ICRNL = 0x100
+ IUCLC = 0x200
+ IXON = 0x400
+ IXANY = 0x800
+ IXOFF = 0x1000
+ IMAXBEL = 0x2000
+ IUTF8 = 0x4000
+ OPOST = 0x1
+ OLCUC = 0x2
+ ONLCR = 0x4
+ OCRNL = 0x8
+ ONOCR = 0x10
+ ONLRET = 0x20
+ OFILL = 0x40
+ OFDEL = 0x80
+ B0 = 0x0
+ B50 = 0x1
+ B75 = 0x2
+ B110 = 0x3
+ B134 = 0x4
+ B150 = 0x5
+ B200 = 0x6
+ B300 = 0x7
+ B600 = 0x8
+ B1200 = 0x9
+ B1800 = 0xa
+ B2400 = 0xb
+ B4800 = 0xc
+ B9600 = 0xd
+ B19200 = 0xe
+ B38400 = 0xf
+ CSIZE = 0x30
+ CS5 = 0x0
+ CS6 = 0x10
+ CS7 = 0x20
+ CS8 = 0x30
+ CSTOPB = 0x40
+ CREAD = 0x80
+ PARENB = 0x100
+ PARODD = 0x200
+ HUPCL = 0x400
+ CLOCAL = 0x800
+ B57600 = 0x1001
+ B115200 = 0x1002
+ B230400 = 0x1003
+ B460800 = 0x1004
+ B500000 = 0x1005
+ B576000 = 0x1006
+ B921600 = 0x1007
+ B1000000 = 0x1008
+ B1152000 = 0x1009
+ B1500000 = 0x100a
+ B2000000 = 0x100b
+ B2500000 = 0x100c
+ B3000000 = 0x100d
+ B3500000 = 0x100e
+ B4000000 = 0x100f
+ ISIG = 0x1
+ ICANON = 0x2
+ XCASE = 0x4
+ ECHO = 0x8
+ ECHOE = 0x10
+ ECHOK = 0x20
+ ECHONL = 0x40
+ NOFLSH = 0x80
+ TOSTOP = 0x100
+ ECHOCTL = 0x200
+ ECHOPRT = 0x400
+ ECHOKE = 0x800
+ FLUSHO = 0x1000
+ PENDIN = 0x4000
+ IEXTEN = 0x8000
+ TCGETS = 0x5401
+ TCSETS = 0x5402
+)</pre> <pre data-language="go">const ImplementsGetwd = true</pre> <pre data-language="go">const (
+ PathMax = 0x1000
+)</pre> <pre data-language="go">const SizeofInotifyEvent = 0x10</pre> <h2 id="pkg-variables">Variables</h2> <pre data-language="go">var (
+ Stdin = 0
+ Stdout = 1
+ Stderr = 2
+)</pre> <p>ForkLock is used to synchronize creation of new file descriptors with fork. </p>
+<p>We want the child in a fork/exec sequence to inherit only the file descriptors we intend. To do that, we mark all file descriptors close-on-exec and then, in the child, explicitly unmark the ones we want the exec'ed program to keep. Unix doesn't make this easy: there is, in general, no way to allocate a new file descriptor close-on-exec. Instead you have to allocate the descriptor and then mark it close-on-exec. If a fork happens between those two events, the child's exec will inherit an unwanted file descriptor. </p>
+<p>This lock solves that race: the create new fd/mark close-on-exec operation is done holding ForkLock for reading, and the fork itself is done holding ForkLock for writing. At least, that's the idea. There are some complications. </p>
+<p>Some system calls that create new file descriptors can block for arbitrarily long times: open on a hung NFS server or named pipe, accept on a socket, and so on. We can't reasonably grab the lock across those operations. </p>
+<p>It is worse to inherit some file descriptors than others. If a non-malicious child accidentally inherits an open ordinary file, that's not a big deal. On the other hand, if a long-lived child accidentally inherits the write end of a pipe, then the reader of that pipe will not see EOF until that child exits, potentially causing the parent program to hang. This is a common problem in threaded C programs that use popen. </p>
+<p>Luckily, the file descriptors that are most important not to inherit are not the ones that can take an arbitrarily long time to create: pipe returns instantly, and the net package uses non-blocking I/O to accept on a listening socket. The rules for which file descriptor-creating operations use the ForkLock are as follows: </p>
+<ul> <li>Pipe. Use pipe2 if available. Otherwise, does not block, so use ForkLock. </li>
+<li>Socket. Use SOCK_CLOEXEC if available. Otherwise, does not block, so use ForkLock. </li>
+<li>Open. Use O_CLOEXEC if available. Otherwise, may block, so live with the race. </li>
+<li>Dup. Use F_DUPFD_CLOEXEC or dup3 if available. Otherwise, does not block, so use ForkLock. </li>
+</ul> <pre data-language="go">var ForkLock sync.RWMutex</pre> <p>For testing: clients can set this flag to force creation of IPv6 sockets to return EAFNOSUPPORT. </p>
+<pre data-language="go">var SocketDisableIPv6 bool</pre> <h2 id="Access">func <span>Access</span> </h2> <pre data-language="go">func Access(path string, mode uint32) (err error)</pre> <h2 id="Acct">func <span>Acct</span> </h2> <pre data-language="go">func Acct(path string) (err error)</pre> <h2 id="Adjtimex">func <span>Adjtimex</span> </h2> <pre data-language="go">func Adjtimex(buf *Timex) (state int, err error)</pre> <h2 id="AttachLsf">func <span>AttachLsf</span> </h2> <pre data-language="go">func AttachLsf(fd int, i []SockFilter) error</pre> <p>Deprecated: Use golang.org/x/net/bpf instead. </p>
+<h2 id="Bind">func <span>Bind</span> </h2> <pre data-language="go">func Bind(fd int, sa Sockaddr) (err error)</pre> <h2 id="BindToDevice">func <span>BindToDevice</span> </h2> <pre data-language="go">func BindToDevice(fd int, device string) (err error)</pre> <p>BindToDevice binds the socket associated with fd to device. </p>
+<h2 id="BytePtrFromString">func <span>BytePtrFromString</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func BytePtrFromString(s string) (*byte, error)</pre> <p>BytePtrFromString returns a pointer to a NUL-terminated array of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL). </p>
+<h2 id="ByteSliceFromString">func <span>ByteSliceFromString</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func ByteSliceFromString(s string) ([]byte, error)</pre> <p>ByteSliceFromString returns a NUL-terminated slice of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL). </p>
+<h2 id="Chdir">func <span>Chdir</span> </h2> <pre data-language="go">func Chdir(path string) (err error)</pre> <h2 id="Chmod">func <span>Chmod</span> </h2> <pre data-language="go">func Chmod(path string, mode uint32) (err error)</pre> <h2 id="Chown">func <span>Chown</span> </h2> <pre data-language="go">func Chown(path string, uid int, gid int) (err error)</pre> <h2 id="Chroot">func <span>Chroot</span> </h2> <pre data-language="go">func Chroot(path string) (err error)</pre> <h2 id="Clearenv">func <span>Clearenv</span> </h2> <pre data-language="go">func Clearenv()</pre> <h2 id="Close">func <span>Close</span> </h2> <pre data-language="go">func Close(fd int) (err error)</pre> <h2 id="CloseOnExec">func <span>CloseOnExec</span> </h2> <pre data-language="go">func CloseOnExec(fd int)</pre> <h2 id="CmsgLen">func <span>CmsgLen</span> </h2> <pre data-language="go">func CmsgLen(datalen int) int</pre> <p>CmsgLen returns the value to store in the Len field of the Cmsghdr structure, taking into account any necessary alignment. </p>
+<h2 id="CmsgSpace">func <span>CmsgSpace</span> </h2> <pre data-language="go">func CmsgSpace(datalen int) int</pre> <p>CmsgSpace returns the number of bytes an ancillary element with payload of the passed data length occupies. </p>
+<h2 id="Connect">func <span>Connect</span> </h2> <pre data-language="go">func Connect(fd int, sa Sockaddr) (err error)</pre> <h2 id="Creat">func <span>Creat</span> </h2> <pre data-language="go">func Creat(path string, mode uint32) (fd int, err error)</pre> <h2 id="DetachLsf">func <span>DetachLsf</span> </h2> <pre data-language="go">func DetachLsf(fd int) error</pre> <p>Deprecated: Use golang.org/x/net/bpf instead. </p>
+<h2 id="Dup">func <span>Dup</span> </h2> <pre data-language="go">func Dup(oldfd int) (fd int, err error)</pre> <h2 id="Dup2">func <span>Dup2</span> </h2> <pre data-language="go">func Dup2(oldfd int, newfd int) (err error)</pre> <h2 id="Dup3">func <span>Dup3</span> </h2> <pre data-language="go">func Dup3(oldfd int, newfd int, flags int) (err error)</pre> <h2 id="Environ">func <span>Environ</span> </h2> <pre data-language="go">func Environ() []string</pre> <h2 id="EpollCreate">func <span>EpollCreate</span> </h2> <pre data-language="go">func EpollCreate(size int) (fd int, err error)</pre> <h2 id="EpollCreate1">func <span>EpollCreate1</span> </h2> <pre data-language="go">func EpollCreate1(flag int) (fd int, err error)</pre> <h2 id="EpollCtl">func <span>EpollCtl</span> </h2> <pre data-language="go">func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)</pre> <h2 id="EpollWait">func <span>EpollWait</span> </h2> <pre data-language="go">func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)</pre> <h2 id="Exec">func <span>Exec</span> </h2> <pre data-language="go">func Exec(argv0 string, argv []string, envv []string) (err error)</pre> <p>Exec invokes the execve(2) system call. </p>
+<h2 id="Exit">func <span>Exit</span> </h2> <pre data-language="go">func Exit(code int)</pre> <h2 id="Faccessat">func <span>Faccessat</span> </h2> <pre data-language="go">func Faccessat(dirfd int, path string, mode uint32, flags int) (err error)</pre> <h2 id="Fallocate">func <span>Fallocate</span> </h2> <pre data-language="go">func Fallocate(fd int, mode uint32, off int64, len int64) (err error)</pre> <h2 id="Fchdir">func <span>Fchdir</span> </h2> <pre data-language="go">func Fchdir(fd int) (err error)</pre> <h2 id="Fchmod">func <span>Fchmod</span> </h2> <pre data-language="go">func Fchmod(fd int, mode uint32) (err error)</pre> <h2 id="Fchmodat">func <span>Fchmodat</span> </h2> <pre data-language="go">func Fchmodat(dirfd int, path string, mode uint32, flags int) error</pre> <h2 id="Fchown">func <span>Fchown</span> </h2> <pre data-language="go">func Fchown(fd int, uid int, gid int) (err error)</pre> <h2 id="Fchownat">func <span>Fchownat</span> </h2> <pre data-language="go">func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)</pre> <h2 id="FcntlFlock">func <span>FcntlFlock</span> </h2> <pre data-language="go">func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error</pre> <p>FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. </p>
+<h2 id="Fdatasync">func <span>Fdatasync</span> </h2> <pre data-language="go">func Fdatasync(fd int) (err error)</pre> <h2 id="Flock">func <span>Flock</span> </h2> <pre data-language="go">func Flock(fd int, how int) (err error)</pre> <h2 id="ForkExec">func <span>ForkExec</span> </h2> <pre data-language="go">func ForkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)</pre> <p>Combination of fork and exec, careful to be thread safe. </p>
+<h2 id="Fstat">func <span>Fstat</span> </h2> <pre data-language="go">func Fstat(fd int, stat *Stat_t) (err error)</pre> <h2 id="Fstatfs">func <span>Fstatfs</span> </h2> <pre data-language="go">func Fstatfs(fd int, buf *Statfs_t) (err error)</pre> <h2 id="Fsync">func <span>Fsync</span> </h2> <pre data-language="go">func Fsync(fd int) (err error)</pre> <h2 id="Ftruncate">func <span>Ftruncate</span> </h2> <pre data-language="go">func Ftruncate(fd int, length int64) (err error)</pre> <h2 id="Futimes">func <span>Futimes</span> </h2> <pre data-language="go">func Futimes(fd int, tv []Timeval) (err error)</pre> <h2 id="Futimesat">func <span>Futimesat</span> </h2> <pre data-language="go">func Futimesat(dirfd int, path string, tv []Timeval) (err error)</pre> <h2 id="Getcwd">func <span>Getcwd</span> </h2> <pre data-language="go">func Getcwd(buf []byte) (n int, err error)</pre> <h2 id="Getdents">func <span>Getdents</span> </h2> <pre data-language="go">func Getdents(fd int, buf []byte) (n int, err error)</pre> <h2 id="Getegid">func <span>Getegid</span> </h2> <pre data-language="go">func Getegid() (egid int)</pre> <h2 id="Getenv">func <span>Getenv</span> </h2> <pre data-language="go">func Getenv(key string) (value string, found bool)</pre> <h2 id="Geteuid">func <span>Geteuid</span> </h2> <pre data-language="go">func Geteuid() (euid int)</pre> <h2 id="Getgid">func <span>Getgid</span> </h2> <pre data-language="go">func Getgid() (gid int)</pre> <h2 id="Getgroups">func <span>Getgroups</span> </h2> <pre data-language="go">func Getgroups() (gids []int, err error)</pre> <h2 id="Getpagesize">func <span>Getpagesize</span> </h2> <pre data-language="go">func Getpagesize() int</pre> <h2 id="Getpgid">func <span>Getpgid</span> </h2> <pre data-language="go">func Getpgid(pid int) (pgid int, err error)</pre> <h2 id="Getpgrp">func <span>Getpgrp</span> </h2> <pre data-language="go">func Getpgrp() (pid int)</pre> <h2 id="Getpid">func <span>Getpid</span> </h2> <pre data-language="go">func Getpid() (pid int)</pre> <h2 id="Getppid">func <span>Getppid</span> </h2> <pre data-language="go">func Getppid() (ppid int)</pre> <h2 id="Getpriority">func <span>Getpriority</span> </h2> <pre data-language="go">func Getpriority(which int, who int) (prio int, err error)</pre> <h2 id="Getrlimit">func <span>Getrlimit</span> </h2> <pre data-language="go">func Getrlimit(resource int, rlim *Rlimit) (err error)</pre> <h2 id="Getrusage">func <span>Getrusage</span> </h2> <pre data-language="go">func Getrusage(who int, rusage *Rusage) (err error)</pre> <h2 id="GetsockoptInet4Addr">func <span>GetsockoptInet4Addr</span> </h2> <pre data-language="go">func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error)</pre> <h2 id="GetsockoptInt">func <span>GetsockoptInt</span> </h2> <pre data-language="go">func GetsockoptInt(fd, level, opt int) (value int, err error)</pre> <h2 id="Gettid">func <span>Gettid</span> </h2> <pre data-language="go">func Gettid() (tid int)</pre> <h2 id="Gettimeofday">func <span>Gettimeofday</span> </h2> <pre data-language="go">func Gettimeofday(tv *Timeval) (err error)</pre> <h2 id="Getuid">func <span>Getuid</span> </h2> <pre data-language="go">func Getuid() (uid int)</pre> <h2 id="Getwd">func <span>Getwd</span> </h2> <pre data-language="go">func Getwd() (wd string, err error)</pre> <h2 id="Getxattr">func <span>Getxattr</span> </h2> <pre data-language="go">func Getxattr(path string, attr string, dest []byte) (sz int, err error)</pre> <h2 id="InotifyAddWatch">func <span>InotifyAddWatch</span> </h2> <pre data-language="go">func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)</pre> <h2 id="InotifyInit">func <span>InotifyInit</span> </h2> <pre data-language="go">func InotifyInit() (fd int, err error)</pre> <h2 id="InotifyInit1">func <span>InotifyInit1</span> </h2> <pre data-language="go">func InotifyInit1(flags int) (fd int, err error)</pre> <h2 id="InotifyRmWatch">func <span>InotifyRmWatch</span> </h2> <pre data-language="go">func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error)</pre> <h2 id="Ioperm">func <span>Ioperm</span> </h2> <pre data-language="go">func Ioperm(from int, num int, on int) (err error)</pre> <h2 id="Iopl">func <span>Iopl</span> </h2> <pre data-language="go">func Iopl(level int) (err error)</pre> <h2 id="Kill">func <span>Kill</span> </h2> <pre data-language="go">func Kill(pid int, sig Signal) (err error)</pre> <h2 id="Klogctl">func <span>Klogctl</span> </h2> <pre data-language="go">func Klogctl(typ int, buf []byte) (n int, err error)</pre> <h2 id="Lchown">func <span>Lchown</span> </h2> <pre data-language="go">func Lchown(path string, uid int, gid int) (err error)</pre> <h2 id="Link">func <span>Link</span> </h2> <pre data-language="go">func Link(oldpath string, newpath string) (err error)</pre> <h2 id="Listen">func <span>Listen</span> </h2> <pre data-language="go">func Listen(s int, n int) (err error)</pre> <h2 id="Listxattr">func <span>Listxattr</span> </h2> <pre data-language="go">func Listxattr(path string, dest []byte) (sz int, err error)</pre> <h2 id="LsfSocket">func <span>LsfSocket</span> </h2> <pre data-language="go">func LsfSocket(ifindex, proto int) (int, error)</pre> <p>Deprecated: Use golang.org/x/net/bpf instead. </p>
+<h2 id="Lstat">func <span>Lstat</span> </h2> <pre data-language="go">func Lstat(path string, stat *Stat_t) (err error)</pre> <h2 id="Madvise">func <span>Madvise</span> </h2> <pre data-language="go">func Madvise(b []byte, advice int) (err error)</pre> <h2 id="Mkdir">func <span>Mkdir</span> </h2> <pre data-language="go">func Mkdir(path string, mode uint32) (err error)</pre> <h2 id="Mkdirat">func <span>Mkdirat</span> </h2> <pre data-language="go">func Mkdirat(dirfd int, path string, mode uint32) (err error)</pre> <h2 id="Mkfifo">func <span>Mkfifo</span> </h2> <pre data-language="go">func Mkfifo(path string, mode uint32) (err error)</pre> <h2 id="Mknod">func <span>Mknod</span> </h2> <pre data-language="go">func Mknod(path string, mode uint32, dev int) (err error)</pre> <h2 id="Mknodat">func <span>Mknodat</span> </h2> <pre data-language="go">func Mknodat(dirfd int, path string, mode uint32, dev int) (err error)</pre> <h2 id="Mlock">func <span>Mlock</span> </h2> <pre data-language="go">func Mlock(b []byte) (err error)</pre> <h2 id="Mlockall">func <span>Mlockall</span> </h2> <pre data-language="go">func Mlockall(flags int) (err error)</pre> <h2 id="Mmap">func <span>Mmap</span> </h2> <pre data-language="go">func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error)</pre> <h2 id="Mount">func <span>Mount</span> </h2> <pre data-language="go">func Mount(source string, target string, fstype string, flags uintptr, data string) (err error)</pre> <h2 id="Mprotect">func <span>Mprotect</span> </h2> <pre data-language="go">func Mprotect(b []byte, prot int) (err error)</pre> <h2 id="Munlock">func <span>Munlock</span> </h2> <pre data-language="go">func Munlock(b []byte) (err error)</pre> <h2 id="Munlockall">func <span>Munlockall</span> </h2> <pre data-language="go">func Munlockall() (err error)</pre> <h2 id="Munmap">func <span>Munmap</span> </h2> <pre data-language="go">func Munmap(b []byte) (err error)</pre> <h2 id="Nanosleep">func <span>Nanosleep</span> </h2> <pre data-language="go">func Nanosleep(time *Timespec, leftover *Timespec) (err error)</pre> <h2 id="NetlinkRIB">func <span>NetlinkRIB</span> </h2> <pre data-language="go">func NetlinkRIB(proto, family int) ([]byte, error)</pre> <p>NetlinkRIB returns routing information base, as known as RIB, which consists of network facility information, states and parameters. </p>
+<h2 id="Open">func <span>Open</span> </h2> <pre data-language="go">func Open(path string, mode int, perm uint32) (fd int, err error)</pre> <h2 id="Openat">func <span>Openat</span> </h2> <pre data-language="go">func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)</pre> <h2 id="ParseDirent">func <span>ParseDirent</span> </h2> <pre data-language="go">func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string)</pre> <p>ParseDirent parses up to max directory entries in buf, appending the names to names. It returns the number of bytes consumed from buf, the number of entries added to names, and the new names slice. </p>
+<h2 id="ParseUnixRights">func <span>ParseUnixRights</span> </h2> <pre data-language="go">func ParseUnixRights(m *SocketControlMessage) ([]int, error)</pre> <p>ParseUnixRights decodes a socket control message that contains an integer array of open file descriptors from another process. </p>
+<h2 id="Pause">func <span>Pause</span> </h2> <pre data-language="go">func Pause() (err error)</pre> <h2 id="Pipe">func <span>Pipe</span> </h2> <pre data-language="go">func Pipe(p []int) error</pre> <h2 id="Pipe2">func <span>Pipe2</span> </h2> <pre data-language="go">func Pipe2(p []int, flags int) error</pre> <h2 id="PivotRoot">func <span>PivotRoot</span> </h2> <pre data-language="go">func PivotRoot(newroot string, putold string) (err error)</pre> <h2 id="Pread">func <span>Pread</span> </h2> <pre data-language="go">func Pread(fd int, p []byte, offset int64) (n int, err error)</pre> <h2 id="PtraceAttach">func <span>PtraceAttach</span> </h2> <pre data-language="go">func PtraceAttach(pid int) (err error)</pre> <h2 id="PtraceCont">func <span>PtraceCont</span> </h2> <pre data-language="go">func PtraceCont(pid int, signal int) (err error)</pre> <h2 id="PtraceDetach">func <span>PtraceDetach</span> </h2> <pre data-language="go">func PtraceDetach(pid int) (err error)</pre> <h2 id="PtraceGetEventMsg">func <span>PtraceGetEventMsg</span> </h2> <pre data-language="go">func PtraceGetEventMsg(pid int) (msg uint, err error)</pre> <h2 id="PtraceGetRegs">func <span>PtraceGetRegs</span> </h2> <pre data-language="go">func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error)</pre> <h2 id="PtracePeekData">func <span>PtracePeekData</span> </h2> <pre data-language="go">func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error)</pre> <h2 id="PtracePeekText">func <span>PtracePeekText</span> </h2> <pre data-language="go">func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error)</pre> <h2 id="PtracePokeData">func <span>PtracePokeData</span> </h2> <pre data-language="go">func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error)</pre> <h2 id="PtracePokeText">func <span>PtracePokeText</span> </h2> <pre data-language="go">func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error)</pre> <h2 id="PtraceSetOptions">func <span>PtraceSetOptions</span> </h2> <pre data-language="go">func PtraceSetOptions(pid int, options int) (err error)</pre> <h2 id="PtraceSetRegs">func <span>PtraceSetRegs</span> </h2> <pre data-language="go">func PtraceSetRegs(pid int, regs *PtraceRegs) (err error)</pre> <h2 id="PtraceSingleStep">func <span>PtraceSingleStep</span> </h2> <pre data-language="go">func PtraceSingleStep(pid int) (err error)</pre> <h2 id="PtraceSyscall">func <span>PtraceSyscall</span> </h2> <pre data-language="go">func PtraceSyscall(pid int, signal int) (err error)</pre> <h2 id="Pwrite">func <span>Pwrite</span> </h2> <pre data-language="go">func Pwrite(fd int, p []byte, offset int64) (n int, err error)</pre> <h2 id="Read">func <span>Read</span> </h2> <pre data-language="go">func Read(fd int, p []byte) (n int, err error)</pre> <h2 id="ReadDirent">func <span>ReadDirent</span> </h2> <pre data-language="go">func ReadDirent(fd int, buf []byte) (n int, err error)</pre> <h2 id="Readlink">func <span>Readlink</span> </h2> <pre data-language="go">func Readlink(path string, buf []byte) (n int, err error)</pre> <h2 id="Reboot">func <span>Reboot</span> </h2> <pre data-language="go">func Reboot(cmd int) (err error)</pre> <h2 id="Removexattr">func <span>Removexattr</span> </h2> <pre data-language="go">func Removexattr(path string, attr string) (err error)</pre> <h2 id="Rename">func <span>Rename</span> </h2> <pre data-language="go">func Rename(oldpath string, newpath string) (err error)</pre> <h2 id="Renameat">func <span>Renameat</span> </h2> <pre data-language="go">func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)</pre> <h2 id="Rmdir">func <span>Rmdir</span> </h2> <pre data-language="go">func Rmdir(path string) error</pre> <h2 id="Seek">func <span>Seek</span> </h2> <pre data-language="go">func Seek(fd int, offset int64, whence int) (off int64, err error)</pre> <h2 id="Select">func <span>Select</span> </h2> <pre data-language="go">func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)</pre> <h2 id="Sendfile">func <span>Sendfile</span> </h2> <pre data-language="go">func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)</pre> <h2 id="Sendmsg">func <span>Sendmsg</span> </h2> <pre data-language="go">func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error)</pre> <h2 id="SendmsgN">func <span>SendmsgN</span> </h2> <pre data-language="go">func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)</pre> <h2 id="Sendto">func <span>Sendto</span> </h2> <pre data-language="go">func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error)</pre> <h2 id="SetLsfPromisc">func <span>SetLsfPromisc</span> </h2> <pre data-language="go">func SetLsfPromisc(name string, m bool) error</pre> <p>Deprecated: Use golang.org/x/net/bpf instead. </p>
+<h2 id="SetNonblock">func <span>SetNonblock</span> </h2> <pre data-language="go">func SetNonblock(fd int, nonblocking bool) (err error)</pre> <h2 id="Setdomainname">func <span>Setdomainname</span> </h2> <pre data-language="go">func Setdomainname(p []byte) (err error)</pre> <h2 id="Setegid">func <span>Setegid</span> </h2> <pre data-language="go">func Setegid(egid int) (err error)</pre> <h2 id="Setenv">func <span>Setenv</span> </h2> <pre data-language="go">func Setenv(key, value string) error</pre> <h2 id="Seteuid">func <span>Seteuid</span> </h2> <pre data-language="go">func Seteuid(euid int) (err error)</pre> <h2 id="Setfsgid">func <span>Setfsgid</span> </h2> <pre data-language="go">func Setfsgid(gid int) (err error)</pre> <h2 id="Setfsuid">func <span>Setfsuid</span> </h2> <pre data-language="go">func Setfsuid(uid int) (err error)</pre> <h2 id="Setgid">func <span>Setgid</span> </h2> <pre data-language="go">func Setgid(gid int) (err error)</pre> <h2 id="Setgroups">func <span>Setgroups</span> </h2> <pre data-language="go">func Setgroups(gids []int) (err error)</pre> <h2 id="Sethostname">func <span>Sethostname</span> </h2> <pre data-language="go">func Sethostname(p []byte) (err error)</pre> <h2 id="Setpgid">func <span>Setpgid</span> </h2> <pre data-language="go">func Setpgid(pid int, pgid int) (err error)</pre> <h2 id="Setpriority">func <span>Setpriority</span> </h2> <pre data-language="go">func Setpriority(which int, who int, prio int) (err error)</pre> <h2 id="Setregid">func <span>Setregid</span> </h2> <pre data-language="go">func Setregid(rgid, egid int) (err error)</pre> <h2 id="Setresgid">func <span>Setresgid</span> </h2> <pre data-language="go">func Setresgid(rgid, egid, sgid int) (err error)</pre> <h2 id="Setresuid">func <span>Setresuid</span> </h2> <pre data-language="go">func Setresuid(ruid, euid, suid int) (err error)</pre> <h2 id="Setreuid">func <span>Setreuid</span> </h2> <pre data-language="go">func Setreuid(ruid, euid int) (err error)</pre> <h2 id="Setrlimit">func <span>Setrlimit</span> </h2> <pre data-language="go">func Setrlimit(resource int, rlim *Rlimit) error</pre> <h2 id="Setsid">func <span>Setsid</span> </h2> <pre data-language="go">func Setsid() (pid int, err error)</pre> <h2 id="SetsockoptByte">func <span>SetsockoptByte</span> </h2> <pre data-language="go">func SetsockoptByte(fd, level, opt int, value byte) (err error)</pre> <h2 id="SetsockoptICMPv6Filter">func <span>SetsockoptICMPv6Filter</span> </h2> <pre data-language="go">func SetsockoptICMPv6Filter(fd, level, opt int, filter *ICMPv6Filter) error</pre> <h2 id="SetsockoptIPMreq">func <span>SetsockoptIPMreq</span> </h2> <pre data-language="go">func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error)</pre> <h2 id="SetsockoptIPMreqn">func <span>SetsockoptIPMreqn</span> </h2> <pre data-language="go">func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error)</pre> <h2 id="SetsockoptIPv6Mreq">func <span>SetsockoptIPv6Mreq</span> </h2> <pre data-language="go">func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error)</pre> <h2 id="SetsockoptInet4Addr">func <span>SetsockoptInet4Addr</span> </h2> <pre data-language="go">func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error)</pre> <h2 id="SetsockoptInt">func <span>SetsockoptInt</span> </h2> <pre data-language="go">func SetsockoptInt(fd, level, opt int, value int) (err error)</pre> <h2 id="SetsockoptLinger">func <span>SetsockoptLinger</span> </h2> <pre data-language="go">func SetsockoptLinger(fd, level, opt int, l *Linger) (err error)</pre> <h2 id="SetsockoptString">func <span>SetsockoptString</span> </h2> <pre data-language="go">func SetsockoptString(fd, level, opt int, s string) (err error)</pre> <h2 id="SetsockoptTimeval">func <span>SetsockoptTimeval</span> </h2> <pre data-language="go">func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error)</pre> <h2 id="Settimeofday">func <span>Settimeofday</span> </h2> <pre data-language="go">func Settimeofday(tv *Timeval) (err error)</pre> <h2 id="Setuid">func <span>Setuid</span> </h2> <pre data-language="go">func Setuid(uid int) (err error)</pre> <h2 id="Setxattr">func <span>Setxattr</span> </h2> <pre data-language="go">func Setxattr(path string, attr string, data []byte, flags int) (err error)</pre> <h2 id="Shutdown">func <span>Shutdown</span> </h2> <pre data-language="go">func Shutdown(fd int, how int) (err error)</pre> <h2 id="SlicePtrFromStrings">func <span>SlicePtrFromStrings</span> </h2> <pre data-language="go">func SlicePtrFromStrings(ss []string) ([]*byte, error)</pre> <p>SlicePtrFromStrings converts a slice of strings to a slice of pointers to NUL-terminated byte arrays. If any string contains a NUL byte, it returns (nil, EINVAL). </p>
+<h2 id="Socket">func <span>Socket</span> </h2> <pre data-language="go">func Socket(domain, typ, proto int) (fd int, err error)</pre> <h2 id="Socketpair">func <span>Socketpair</span> </h2> <pre data-language="go">func Socketpair(domain, typ, proto int) (fd [2]int, err error)</pre> <h2 id="Splice">func <span>Splice</span> </h2> <pre data-language="go">func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)</pre> <h2 id="StartProcess">func <span>StartProcess</span> </h2> <pre data-language="go">func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error)</pre> <p>StartProcess wraps ForkExec for package os. </p>
+<h2 id="Stat">func <span>Stat</span> </h2> <pre data-language="go">func Stat(path string, stat *Stat_t) (err error)</pre> <h2 id="Statfs">func <span>Statfs</span> </h2> <pre data-language="go">func Statfs(path string, buf *Statfs_t) (err error)</pre> <h2 id="StringBytePtr">func <span>StringBytePtr</span> </h2> <pre data-language="go">func StringBytePtr(s string) *byte</pre> <p>StringBytePtr returns a pointer to a NUL-terminated array of bytes. If s contains a NUL byte this function panics instead of returning an error. </p>
+<p>Deprecated: Use BytePtrFromString instead. </p>
+<h2 id="StringByteSlice">func <span>StringByteSlice</span> </h2> <pre data-language="go">func StringByteSlice(s string) []byte</pre> <p>StringByteSlice converts a string to a NUL-terminated []byte, If s contains a NUL byte this function panics instead of returning an error. </p>
+<p>Deprecated: Use ByteSliceFromString instead. </p>
+<h2 id="StringSlicePtr">func <span>StringSlicePtr</span> </h2> <pre data-language="go">func StringSlicePtr(ss []string) []*byte</pre> <p>StringSlicePtr converts a slice of strings to a slice of pointers to NUL-terminated byte arrays. If any string contains a NUL byte this function panics instead of returning an error. </p>
+<p>Deprecated: Use SlicePtrFromStrings instead. </p>
+<h2 id="Symlink">func <span>Symlink</span> </h2> <pre data-language="go">func Symlink(oldpath string, newpath string) (err error)</pre> <h2 id="Sync">func <span>Sync</span> </h2> <pre data-language="go">func Sync()</pre> <h2 id="SyncFileRange">func <span>SyncFileRange</span> </h2> <pre data-language="go">func SyncFileRange(fd int, off int64, n int64, flags int) (err error)</pre> <h2 id="Sysinfo">func <span>Sysinfo</span> </h2> <pre data-language="go">func Sysinfo(info *Sysinfo_t) (err error)</pre> <h2 id="Tee">func <span>Tee</span> </h2> <pre data-language="go">func Tee(rfd int, wfd int, len int, flags int) (n int64, err error)</pre> <h2 id="Tgkill">func <span>Tgkill</span> </h2> <pre data-language="go">func Tgkill(tgid int, tid int, sig Signal) (err error)</pre> <h2 id="Times">func <span>Times</span> </h2> <pre data-language="go">func Times(tms *Tms) (ticks uintptr, err error)</pre> <h2 id="TimespecToNsec">func <span>TimespecToNsec</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func TimespecToNsec(ts Timespec) int64</pre> <p>TimespecToNsec returns the time stored in ts as nanoseconds. </p>
+<h2 id="TimevalToNsec">func <span>TimevalToNsec</span> </h2> <pre data-language="go">func TimevalToNsec(tv Timeval) int64</pre> <p>TimevalToNsec returns the time stored in tv as nanoseconds. </p>
+<h2 id="Truncate">func <span>Truncate</span> </h2> <pre data-language="go">func Truncate(path string, length int64) (err error)</pre> <h2 id="Umask">func <span>Umask</span> </h2> <pre data-language="go">func Umask(mask int) (oldmask int)</pre> <h2 id="Uname">func <span>Uname</span> </h2> <pre data-language="go">func Uname(buf *Utsname) (err error)</pre> <h2 id="UnixCredentials">func <span>UnixCredentials</span> </h2> <pre data-language="go">func UnixCredentials(ucred *Ucred) []byte</pre> <p>UnixCredentials encodes credentials into a socket control message for sending to another process. This can be used for authentication. </p>
+<h2 id="UnixRights">func <span>UnixRights</span> </h2> <pre data-language="go">func UnixRights(fds ...int) []byte</pre> <p>UnixRights encodes a set of open file descriptors into a socket control message for sending to another process. </p>
+<h2 id="Unlink">func <span>Unlink</span> </h2> <pre data-language="go">func Unlink(path string) error</pre> <h2 id="Unlinkat">func <span>Unlinkat</span> </h2> <pre data-language="go">func Unlinkat(dirfd int, path string) error</pre> <h2 id="Unmount">func <span>Unmount</span> </h2> <pre data-language="go">func Unmount(target string, flags int) (err error)</pre> <h2 id="Unsetenv">func <span>Unsetenv</span> <span title="Added in Go 1.4">1.4</span> </h2> <pre data-language="go">func Unsetenv(key string) error</pre> <h2 id="Unshare">func <span>Unshare</span> </h2> <pre data-language="go">func Unshare(flags int) (err error)</pre> <h2 id="Ustat">func <span>Ustat</span> </h2> <pre data-language="go">func Ustat(dev int, ubuf *Ustat_t) (err error)</pre> <h2 id="Utime">func <span>Utime</span> </h2> <pre data-language="go">func Utime(path string, buf *Utimbuf) (err error)</pre> <h2 id="Utimes">func <span>Utimes</span> </h2> <pre data-language="go">func Utimes(path string, tv []Timeval) (err error)</pre> <h2 id="UtimesNano">func <span>UtimesNano</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func UtimesNano(path string, ts []Timespec) (err error)</pre> <h2 id="Wait4">func <span>Wait4</span> </h2> <pre data-language="go">func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error)</pre> <h2 id="Write">func <span>Write</span> </h2> <pre data-language="go">func Write(fd int, p []byte) (n int, err error)</pre> <h2 id="Cmsghdr">type <span>Cmsghdr</span> </h2> <pre data-language="go">type Cmsghdr struct {
+ Len uint64
+ Level int32
+ Type int32
+}
+</pre> <h3 id="Cmsghdr.SetLen">func (*Cmsghdr) <span>SetLen</span> </h3> <pre data-language="go">func (cmsg *Cmsghdr) SetLen(length int)</pre> <h2 id="Conn">type <span>Conn</span> <span title="Added in Go 1.9">1.9</span> </h2> <p>Conn is implemented by some types in the net and os packages to provide access to the underlying file descriptor or handle. </p>
+<pre data-language="go">type Conn interface {
+ // SyscallConn returns a raw network connection.
+ SyscallConn() (RawConn, error)
+}</pre> <h2 id="Credential">type <span>Credential</span> </h2> <p>Credential holds user and group identities to be assumed by a child process started by StartProcess. </p>
+<pre data-language="go">type Credential struct {
+ Uid uint32 // User ID.
+ Gid uint32 // Group ID.
+ Groups []uint32 // Supplementary group IDs.
+ NoSetGroups bool // If true, don't set supplementary groups
+}
+</pre> <h2 id="Dirent">type <span>Dirent</span> </h2> <pre data-language="go">type Dirent struct {
+ Ino uint64
+ Off int64
+ Reclen uint16
+ Type uint8
+ Name [256]int8
+ Pad_cgo_0 [5]byte
+}
+</pre> <h2 id="EpollEvent">type <span>EpollEvent</span> </h2> <pre data-language="go">type EpollEvent struct {
+ Events uint32
+ Fd int32
+ Pad int32
+}
+</pre> <h2 id="Errno">type <span>Errno</span> </h2> <p>An Errno is an unsigned number describing an error condition. It implements the error interface. The zero Errno is by convention a non-error, so code to convert from Errno to error should use: </p>
+<pre data-language="go">err = nil
+if errno != 0 {
+ err = errno
+}
+</pre> <p>Errno values can be tested against error values using errors.Is. For example: </p>
+<pre data-language="go">_, _, err := syscall.Syscall(...)
+if errors.Is(err, fs.ErrNotExist) ...
+</pre> <pre data-language="go">type Errno uintptr</pre> <h3 id="AllThreadsSyscall">func <span>AllThreadsSyscall</span> </h3> <pre data-language="go">func AllThreadsSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)</pre> <p>AllThreadsSyscall performs a syscall on each OS thread of the Go runtime. It first invokes the syscall on one thread. Should that invocation fail, it returns immediately with the error status. Otherwise, it invokes the syscall on all of the remaining threads in parallel. It will terminate the program if it observes any invoked syscall's return value differs from that of the first invocation. </p>
+<p>AllThreadsSyscall is intended for emulating simultaneous process-wide state changes that require consistently modifying per-thread state of the Go runtime. </p>
+<p>AllThreadsSyscall is unaware of any threads that are launched explicitly by cgo linked code, so the function always returns ENOTSUP in binaries that use cgo. </p>
+<h3 id="AllThreadsSyscall6">func <span>AllThreadsSyscall6</span> </h3> <pre data-language="go">func AllThreadsSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)</pre> <p>AllThreadsSyscall6 is like AllThreadsSyscall, but extended to six arguments. </p>
+<h3 id="RawSyscall">func <span>RawSyscall</span> </h3> <pre data-language="go">func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)</pre> <h3 id="RawSyscall6">func <span>RawSyscall6</span> </h3> <pre data-language="go">func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)</pre> <h3 id="Syscall">func <span>Syscall</span> </h3> <pre data-language="go">func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)</pre> <h3 id="Syscall6">func <span>Syscall6</span> </h3> <pre data-language="go">func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)</pre> <h3 id="Errno.Error">func (Errno) <span>Error</span> </h3> <pre data-language="go">func (e Errno) Error() string</pre> <h3 id="Errno.Is">func (Errno) <span>Is</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e Errno) Is(target error) bool</pre> <h3 id="Errno.Temporary">func (Errno) <span>Temporary</span> </h3> <pre data-language="go">func (e Errno) Temporary() bool</pre> <h3 id="Errno.Timeout">func (Errno) <span>Timeout</span> </h3> <pre data-language="go">func (e Errno) Timeout() bool</pre> <h2 id="FdSet">type <span>FdSet</span> </h2> <pre data-language="go">type FdSet struct {
+ Bits [16]int64
+}
+</pre> <h2 id="Flock_t">type <span>Flock_t</span> </h2> <pre data-language="go">type Flock_t struct {
+ Type int16
+ Whence int16
+ Pad_cgo_0 [4]byte
+ Start int64
+ Len int64
+ Pid int32
+ Pad_cgo_1 [4]byte
+}
+</pre> <h2 id="Fsid">type <span>Fsid</span> </h2> <pre data-language="go">type Fsid struct {
+ X__val [2]int32
+}
+</pre> <h2 id="ICMPv6Filter">type <span>ICMPv6Filter</span> </h2> <pre data-language="go">type ICMPv6Filter struct {
+ Data [8]uint32
+}
+</pre> <h3 id="GetsockoptICMPv6Filter">func <span>GetsockoptICMPv6Filter</span> </h3> <pre data-language="go">func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error)</pre> <h2 id="IPMreq">type <span>IPMreq</span> </h2> <pre data-language="go">type IPMreq struct {
+ Multiaddr [4]byte /* in_addr */
+ Interface [4]byte /* in_addr */
+}
+</pre> <h3 id="GetsockoptIPMreq">func <span>GetsockoptIPMreq</span> </h3> <pre data-language="go">func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error)</pre> <h2 id="IPMreqn">type <span>IPMreqn</span> </h2> <pre data-language="go">type IPMreqn struct {
+ Multiaddr [4]byte /* in_addr */
+ Address [4]byte /* in_addr */
+ Ifindex int32
+}
+</pre> <h3 id="GetsockoptIPMreqn">func <span>GetsockoptIPMreqn</span> </h3> <pre data-language="go">func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error)</pre> <h2 id="IPv6MTUInfo">type <span>IPv6MTUInfo</span> </h2> <pre data-language="go">type IPv6MTUInfo struct {
+ Addr RawSockaddrInet6
+ Mtu uint32
+}
+</pre> <h3 id="GetsockoptIPv6MTUInfo">func <span>GetsockoptIPv6MTUInfo</span> </h3> <pre data-language="go">func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error)</pre> <h2 id="IPv6Mreq">type <span>IPv6Mreq</span> </h2> <pre data-language="go">type IPv6Mreq struct {
+ Multiaddr [16]byte /* in6_addr */
+ Interface uint32
+}
+</pre> <h3 id="GetsockoptIPv6Mreq">func <span>GetsockoptIPv6Mreq</span> </h3> <pre data-language="go">func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error)</pre> <h2 id="IfAddrmsg">type <span>IfAddrmsg</span> </h2> <pre data-language="go">type IfAddrmsg struct {
+ Family uint8
+ Prefixlen uint8
+ Flags uint8
+ Scope uint8
+ Index uint32
+}
+</pre> <h2 id="IfInfomsg">type <span>IfInfomsg</span> </h2> <pre data-language="go">type IfInfomsg struct {
+ Family uint8
+ X__ifi_pad uint8
+ Type uint16
+ Index int32
+ Flags uint32
+ Change uint32
+}
+</pre> <h2 id="Inet4Pktinfo">type <span>Inet4Pktinfo</span> </h2> <pre data-language="go">type Inet4Pktinfo struct {
+ Ifindex int32
+ Spec_dst [4]byte /* in_addr */
+ Addr [4]byte /* in_addr */
+}
+</pre> <h2 id="Inet6Pktinfo">type <span>Inet6Pktinfo</span> </h2> <pre data-language="go">type Inet6Pktinfo struct {
+ Addr [16]byte /* in6_addr */
+ Ifindex uint32
+}
+</pre> <h2 id="InotifyEvent">type <span>InotifyEvent</span> </h2> <pre data-language="go">type InotifyEvent struct {
+ Wd int32
+ Mask uint32
+ Cookie uint32
+ Len uint32
+ Name [0]uint8
+}
+</pre> <h2 id="Iovec">type <span>Iovec</span> </h2> <pre data-language="go">type Iovec struct {
+ Base *byte
+ Len uint64
+}
+</pre> <h3 id="Iovec.SetLen">func (*Iovec) <span>SetLen</span> </h3> <pre data-language="go">func (iov *Iovec) SetLen(length int)</pre> <h2 id="Linger">type <span>Linger</span> </h2> <pre data-language="go">type Linger struct {
+ Onoff int32
+ Linger int32
+}
+</pre> <h2 id="Msghdr">type <span>Msghdr</span> </h2> <pre data-language="go">type Msghdr struct {
+ Name *byte
+ Namelen uint32
+ Pad_cgo_0 [4]byte
+ Iov *Iovec
+ Iovlen uint64
+ Control *byte
+ Controllen uint64
+ Flags int32
+ Pad_cgo_1 [4]byte
+}
+</pre> <h3 id="Msghdr.SetControllen">func (*Msghdr) <span>SetControllen</span> </h3> <pre data-language="go">func (msghdr *Msghdr) SetControllen(length int)</pre> <h2 id="NetlinkMessage">type <span>NetlinkMessage</span> </h2> <p>NetlinkMessage represents a netlink message. </p>
+<pre data-language="go">type NetlinkMessage struct {
+ Header NlMsghdr
+ Data []byte
+}
+</pre> <h3 id="ParseNetlinkMessage">func <span>ParseNetlinkMessage</span> </h3> <pre data-language="go">func ParseNetlinkMessage(b []byte) ([]NetlinkMessage, error)</pre> <p>ParseNetlinkMessage parses b as an array of netlink messages and returns the slice containing the NetlinkMessage structures. </p>
+<h2 id="NetlinkRouteAttr">type <span>NetlinkRouteAttr</span> </h2> <p>NetlinkRouteAttr represents a netlink route attribute. </p>
+<pre data-language="go">type NetlinkRouteAttr struct {
+ Attr RtAttr
+ Value []byte
+}
+</pre> <h3 id="ParseNetlinkRouteAttr">func <span>ParseNetlinkRouteAttr</span> </h3> <pre data-language="go">func ParseNetlinkRouteAttr(m *NetlinkMessage) ([]NetlinkRouteAttr, error)</pre> <p>ParseNetlinkRouteAttr parses m's payload as an array of netlink route attributes and returns the slice containing the NetlinkRouteAttr structures. </p>
+<h2 id="NetlinkRouteRequest">type <span>NetlinkRouteRequest</span> </h2> <p>NetlinkRouteRequest represents a request message to receive routing and link states from the kernel. </p>
+<pre data-language="go">type NetlinkRouteRequest struct {
+ Header NlMsghdr
+ Data RtGenmsg
+}
+</pre> <h2 id="NlAttr">type <span>NlAttr</span> </h2> <pre data-language="go">type NlAttr struct {
+ Len uint16
+ Type uint16
+}
+</pre> <h2 id="NlMsgerr">type <span>NlMsgerr</span> </h2> <pre data-language="go">type NlMsgerr struct {
+ Error int32
+ Msg NlMsghdr
+}
+</pre> <h2 id="NlMsghdr">type <span>NlMsghdr</span> </h2> <pre data-language="go">type NlMsghdr struct {
+ Len uint32
+ Type uint16
+ Flags uint16
+ Seq uint32
+ Pid uint32
+}
+</pre> <h2 id="ProcAttr">type <span>ProcAttr</span> </h2> <p>ProcAttr holds attributes that will be applied to a new process started by StartProcess. </p>
+<pre data-language="go">type ProcAttr struct {
+ Dir string // Current working directory.
+ Env []string // Environment.
+ Files []uintptr // File descriptors.
+ Sys *SysProcAttr
+}
+</pre> <h2 id="PtraceRegs">type <span>PtraceRegs</span> </h2> <pre data-language="go">type PtraceRegs struct {
+ R15 uint64
+ R14 uint64
+ R13 uint64
+ R12 uint64
+ Rbp uint64
+ Rbx uint64
+ R11 uint64
+ R10 uint64
+ R9 uint64
+ R8 uint64
+ Rax uint64
+ Rcx uint64
+ Rdx uint64
+ Rsi uint64
+ Rdi uint64
+ Orig_rax uint64
+ Rip uint64
+ Cs uint64
+ Eflags uint64
+ Rsp uint64
+ Ss uint64
+ Fs_base uint64
+ Gs_base uint64
+ Ds uint64
+ Es uint64
+ Fs uint64
+ Gs uint64
+}
+</pre> <h3 id="PtraceRegs.PC">func (*PtraceRegs) <span>PC</span> </h3> <pre data-language="go">func (r *PtraceRegs) PC() uint64</pre> <h3 id="PtraceRegs.SetPC">func (*PtraceRegs) <span>SetPC</span> </h3> <pre data-language="go">func (r *PtraceRegs) SetPC(pc uint64)</pre> <h2 id="RawConn">type <span>RawConn</span> <span title="Added in Go 1.9">1.9</span> </h2> <p>A RawConn is a raw network connection. </p>
+<pre data-language="go">type RawConn interface {
+ // Control invokes f on the underlying connection's file
+ // descriptor or handle.
+ // The file descriptor fd is guaranteed to remain valid while
+ // f executes but not after f returns.
+ Control(f func(fd uintptr)) error
+
+ // Read invokes f on the underlying connection's file
+ // descriptor or handle; f is expected to try to read from the
+ // file descriptor.
+ // If f returns true, Read returns. Otherwise Read blocks
+ // waiting for the connection to be ready for reading and
+ // tries again repeatedly.
+ // The file descriptor is guaranteed to remain valid while f
+ // executes but not after f returns.
+ Read(f func(fd uintptr) (done bool)) error
+
+ // Write is like Read but for writing.
+ Write(f func(fd uintptr) (done bool)) error
+}</pre> <h2 id="RawSockaddr">type <span>RawSockaddr</span> </h2> <pre data-language="go">type RawSockaddr struct {
+ Family uint16
+ Data [14]int8
+}
+</pre> <h2 id="RawSockaddrAny">type <span>RawSockaddrAny</span> </h2> <pre data-language="go">type RawSockaddrAny struct {
+ Addr RawSockaddr
+ Pad [96]int8
+}
+</pre> <h2 id="RawSockaddrInet4">type <span>RawSockaddrInet4</span> </h2> <pre data-language="go">type RawSockaddrInet4 struct {
+ Family uint16
+ Port uint16
+ Addr [4]byte /* in_addr */
+ Zero [8]uint8
+}
+</pre> <h2 id="RawSockaddrInet6">type <span>RawSockaddrInet6</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">type RawSockaddrInet6 struct {
+ Family uint16
+ Port uint16
+ Flowinfo uint32
+ Addr [16]byte /* in6_addr */
+ Scope_id uint32
+}
+</pre> <h2 id="RawSockaddrLinklayer">type <span>RawSockaddrLinklayer</span> </h2> <pre data-language="go">type RawSockaddrLinklayer struct {
+ Family uint16
+ Protocol uint16
+ Ifindex int32
+ Hatype uint16
+ Pkttype uint8
+ Halen uint8
+ Addr [8]uint8
+}
+</pre> <h2 id="RawSockaddrNetlink">type <span>RawSockaddrNetlink</span> </h2> <pre data-language="go">type RawSockaddrNetlink struct {
+ Family uint16
+ Pad uint16
+ Pid uint32
+ Groups uint32
+}
+</pre> <h2 id="RawSockaddrUnix">type <span>RawSockaddrUnix</span> <span title="Added in Go 1.12">1.12</span> </h2> <pre data-language="go">type RawSockaddrUnix struct {
+ Family uint16
+ Path [108]int8
+}
+</pre> <h2 id="Rlimit">type <span>Rlimit</span> </h2> <pre data-language="go">type Rlimit struct {
+ Cur uint64
+ Max uint64
+}
+</pre> <h2 id="RtAttr">type <span>RtAttr</span> </h2> <pre data-language="go">type RtAttr struct {
+ Len uint16
+ Type uint16
+}
+</pre> <h2 id="RtGenmsg">type <span>RtGenmsg</span> </h2> <pre data-language="go">type RtGenmsg struct {
+ Family uint8
+}
+</pre> <h2 id="RtMsg">type <span>RtMsg</span> </h2> <pre data-language="go">type RtMsg struct {
+ Family uint8
+ Dst_len uint8
+ Src_len uint8
+ Tos uint8
+ Table uint8
+ Protocol uint8
+ Scope uint8
+ Type uint8
+ Flags uint32
+}
+</pre> <h2 id="RtNexthop">type <span>RtNexthop</span> </h2> <pre data-language="go">type RtNexthop struct {
+ Len uint16
+ Flags uint8
+ Hops uint8
+ Ifindex int32
+}
+</pre> <h2 id="Rusage">type <span>Rusage</span> </h2> <pre data-language="go">type Rusage struct {
+ Utime Timeval
+ Stime Timeval
+ Maxrss int64
+ Ixrss int64
+ Idrss int64
+ Isrss int64
+ Minflt int64
+ Majflt int64
+ Nswap int64
+ Inblock int64
+ Oublock int64
+ Msgsnd int64
+ Msgrcv int64
+ Nsignals int64
+ Nvcsw int64
+ Nivcsw int64
+}
+</pre> <h2 id="Signal">type <span>Signal</span> </h2> <p>A Signal is a number describing a process signal. It implements the os.Signal interface. </p>
+<pre data-language="go">type Signal int</pre> <h3 id="Signal.Signal">func (Signal) <span>Signal</span> </h3> <pre data-language="go">func (s Signal) Signal()</pre> <h3 id="Signal.String">func (Signal) <span>String</span> </h3> <pre data-language="go">func (s Signal) String() string</pre> <h2 id="SockFilter">type <span>SockFilter</span> </h2> <pre data-language="go">type SockFilter struct {
+ Code uint16
+ Jt uint8
+ Jf uint8
+ K uint32
+}
+</pre> <h3 id="LsfJump">func <span>LsfJump</span> </h3> <pre data-language="go">func LsfJump(code, k, jt, jf int) *SockFilter</pre> <p>Deprecated: Use golang.org/x/net/bpf instead. </p>
+<h3 id="LsfStmt">func <span>LsfStmt</span> </h3> <pre data-language="go">func LsfStmt(code, k int) *SockFilter</pre> <p>Deprecated: Use golang.org/x/net/bpf instead. </p>
+<h2 id="SockFprog">type <span>SockFprog</span> </h2> <pre data-language="go">type SockFprog struct {
+ Len uint16
+ Pad_cgo_0 [6]byte
+ Filter *SockFilter
+}
+</pre> <h2 id="Sockaddr">type <span>Sockaddr</span> </h2> <pre data-language="go">type Sockaddr interface {
+ // contains filtered or unexported methods
+}</pre> <h3 id="Accept">func <span>Accept</span> </h3> <pre data-language="go">func Accept(fd int) (nfd int, sa Sockaddr, err error)</pre> <h3 id="Accept4">func <span>Accept4</span> </h3> <pre data-language="go">func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error)</pre> <h3 id="Getpeername">func <span>Getpeername</span> </h3> <pre data-language="go">func Getpeername(fd int) (sa Sockaddr, err error)</pre> <h3 id="Getsockname">func <span>Getsockname</span> </h3> <pre data-language="go">func Getsockname(fd int) (sa Sockaddr, err error)</pre> <h3 id="Recvfrom">func <span>Recvfrom</span> </h3> <pre data-language="go">func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error)</pre> <h3 id="Recvmsg">func <span>Recvmsg</span> </h3> <pre data-language="go">func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error)</pre> <h2 id="SockaddrInet4">type <span>SockaddrInet4</span> </h2> <pre data-language="go">type SockaddrInet4 struct {
+ Port int
+ Addr [4]byte
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="SockaddrInet6">type <span>SockaddrInet6</span> </h2> <pre data-language="go">type SockaddrInet6 struct {
+ Port int
+ ZoneId uint32
+ Addr [16]byte
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="SockaddrLinklayer">type <span>SockaddrLinklayer</span> </h2> <pre data-language="go">type SockaddrLinklayer struct {
+ Protocol uint16
+ Ifindex int
+ Hatype uint16
+ Pkttype uint8
+ Halen uint8
+ Addr [8]byte
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="SockaddrNetlink">type <span>SockaddrNetlink</span> </h2> <pre data-language="go">type SockaddrNetlink struct {
+ Family uint16
+ Pad uint16
+ Pid uint32
+ Groups uint32
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="SockaddrUnix">type <span>SockaddrUnix</span> </h2> <pre data-language="go">type SockaddrUnix struct {
+ Name string
+ // contains filtered or unexported fields
+}
+</pre> <h2 id="SocketControlMessage">type <span>SocketControlMessage</span> </h2> <p>SocketControlMessage represents a socket control message. </p>
+<pre data-language="go">type SocketControlMessage struct {
+ Header Cmsghdr
+ Data []byte
+}
+</pre> <h3 id="ParseSocketControlMessage">func <span>ParseSocketControlMessage</span> </h3> <pre data-language="go">func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error)</pre> <p>ParseSocketControlMessage parses b as an array of socket control messages. </p>
+<h2 id="Stat_t">type <span>Stat_t</span> </h2> <pre data-language="go">type Stat_t struct {
+ Dev uint64
+ Ino uint64
+ Nlink uint64
+ Mode uint32
+ Uid uint32
+ Gid uint32
+ X__pad0 int32
+ Rdev uint64
+ Size int64
+ Blksize int64
+ Blocks int64
+ Atim Timespec
+ Mtim Timespec
+ Ctim Timespec
+ X__unused [3]int64
+}
+</pre> <h2 id="Statfs_t">type <span>Statfs_t</span> </h2> <pre data-language="go">type Statfs_t struct {
+ Type int64
+ Bsize int64
+ Blocks uint64
+ Bfree uint64
+ Bavail uint64
+ Files uint64
+ Ffree uint64
+ Fsid Fsid
+ Namelen int64
+ Frsize int64
+ Flags int64
+ Spare [4]int64
+}
+</pre> <h2 id="SysProcAttr">type <span>SysProcAttr</span> </h2> <pre data-language="go">type SysProcAttr struct {
+ Chroot string // Chroot.
+ Credential *Credential // Credential.
+ // Ptrace tells the child to call ptrace(PTRACE_TRACEME).
+ // Call runtime.LockOSThread before starting a process with this set,
+ // and don't call UnlockOSThread until done with PtraceSyscall calls.
+ Ptrace bool
+ Setsid bool // Create session.
+ // Setpgid sets the process group ID of the child to Pgid,
+ // or, if Pgid == 0, to the new child's process ID.
+ Setpgid bool
+ // Setctty sets the controlling terminal of the child to
+ // file descriptor Ctty. Ctty must be a descriptor number
+ // in the child process: an index into ProcAttr.Files.
+ // This is only meaningful if Setsid is true.
+ Setctty bool
+ Noctty bool // Detach fd 0 from controlling terminal.
+ Ctty int // Controlling TTY fd.
+ // Foreground places the child process group in the foreground.
+ // This implies Setpgid. The Ctty field must be set to
+ // the descriptor of the controlling TTY.
+ // Unlike Setctty, in this case Ctty must be a descriptor
+ // number in the parent process.
+ Foreground bool
+ Pgid int // Child's process group ID if Setpgid.
+ // Pdeathsig, if non-zero, is a signal that the kernel will send to
+ // the child process when the creating thread dies. Note that the signal
+ // is sent on thread termination, which may happen before process termination.
+ // There are more details at https://go.dev/issue/27505.
+ Pdeathsig Signal
+ Cloneflags uintptr // Flags for clone calls.
+ Unshareflags uintptr // Flags for unshare calls.
+ UidMappings []SysProcIDMap // User ID mappings for user namespaces.
+ GidMappings []SysProcIDMap // Group ID mappings for user namespaces.
+ // GidMappingsEnableSetgroups enabling setgroups syscall.
+ // If false, then setgroups syscall will be disabled for the child process.
+ // This parameter is no-op if GidMappings == nil. Otherwise for unprivileged
+ // users this should be set to false for mappings work.
+ GidMappingsEnableSetgroups bool
+ AmbientCaps []uintptr // Ambient capabilities.
+ UseCgroupFD bool // Whether to make use of the CgroupFD field.
+ CgroupFD int // File descriptor of a cgroup to put the new process into.
+ // PidFD, if not nil, is used to store the pidfd of a child, if the
+ // functionality is supported by the kernel, or -1. Note *PidFD is
+ // changed only if the process starts successfully.
+ PidFD *int
+}
+</pre> <h2 id="SysProcIDMap">type <span>SysProcIDMap</span> </h2> <p>SysProcIDMap holds Container ID to Host ID mappings used for User Namespaces in Linux. See user_namespaces(7). </p>
+<pre data-language="go">type SysProcIDMap struct {
+ ContainerID int // Container ID.
+ HostID int // Host ID.
+ Size int // Size.
+}
+</pre> <h2 id="Sysinfo_t">type <span>Sysinfo_t</span> </h2> <pre data-language="go">type Sysinfo_t struct {
+ Uptime int64
+ Loads [3]uint64
+ Totalram uint64
+ Freeram uint64
+ Sharedram uint64
+ Bufferram uint64
+ Totalswap uint64
+ Freeswap uint64
+ Procs uint16
+ Pad uint16
+ Pad_cgo_0 [4]byte
+ Totalhigh uint64
+ Freehigh uint64
+ Unit uint32
+ X_f [0]byte
+ Pad_cgo_1 [4]byte
+}
+</pre> <h2 id="TCPInfo">type <span>TCPInfo</span> </h2> <pre data-language="go">type TCPInfo struct {
+ State uint8
+ Ca_state uint8
+ Retransmits uint8
+ Probes uint8
+ Backoff uint8
+ Options uint8
+ Pad_cgo_0 [2]byte
+ Rto uint32
+ Ato uint32
+ Snd_mss uint32
+ Rcv_mss uint32
+ Unacked uint32
+ Sacked uint32
+ Lost uint32
+ Retrans uint32
+ Fackets uint32
+ Last_data_sent uint32
+ Last_ack_sent uint32
+ Last_data_recv uint32
+ Last_ack_recv uint32
+ Pmtu uint32
+ Rcv_ssthresh uint32
+ Rtt uint32
+ Rttvar uint32
+ Snd_ssthresh uint32
+ Snd_cwnd uint32
+ Advmss uint32
+ Reordering uint32
+ Rcv_rtt uint32
+ Rcv_space uint32
+ Total_retrans uint32
+}
+</pre> <h2 id="Termios">type <span>Termios</span> </h2> <pre data-language="go">type Termios struct {
+ Iflag uint32
+ Oflag uint32
+ Cflag uint32
+ Lflag uint32
+ Line uint8
+ Cc [32]uint8
+ Pad_cgo_0 [3]byte
+ Ispeed uint32
+ Ospeed uint32
+}
+</pre> <h2 id="Time_t">type <span>Time_t</span> </h2> <pre data-language="go">type Time_t int64</pre> <h3 id="Time">func <span>Time</span> </h3> <pre data-language="go">func Time(t *Time_t) (tt Time_t, err error)</pre> <h2 id="Timespec">type <span>Timespec</span> </h2> <pre data-language="go">type Timespec struct {
+ Sec int64
+ Nsec int64
+}
+</pre> <h3 id="NsecToTimespec">func <span>NsecToTimespec</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func NsecToTimespec(nsec int64) Timespec</pre> <p>NsecToTimespec converts a number of nanoseconds into a Timespec. </p>
+<h3 id="Timespec.Nano">func (*Timespec) <span>Nano</span> </h3> <pre data-language="go">func (ts *Timespec) Nano() int64</pre> <p>Nano returns the time stored in ts as nanoseconds. </p>
+<h3 id="Timespec.Unix">func (*Timespec) <span>Unix</span> </h3> <pre data-language="go">func (ts *Timespec) Unix() (sec int64, nsec int64)</pre> <p>Unix returns the time stored in ts as seconds plus nanoseconds. </p>
+<h2 id="Timeval">type <span>Timeval</span> </h2> <pre data-language="go">type Timeval struct {
+ Sec int64
+ Usec int64
+}
+</pre> <h3 id="NsecToTimeval">func <span>NsecToTimeval</span> </h3> <pre data-language="go">func NsecToTimeval(nsec int64) Timeval</pre> <p>NsecToTimeval converts a number of nanoseconds into a Timeval. </p>
+<h3 id="Timeval.Nano">func (*Timeval) <span>Nano</span> </h3> <pre data-language="go">func (tv *Timeval) Nano() int64</pre> <p>Nano returns the time stored in tv as nanoseconds. </p>
+<h3 id="Timeval.Unix">func (*Timeval) <span>Unix</span> </h3> <pre data-language="go">func (tv *Timeval) Unix() (sec int64, nsec int64)</pre> <p>Unix returns the time stored in tv as seconds plus nanoseconds. </p>
+<h2 id="Timex">type <span>Timex</span> </h2> <pre data-language="go">type Timex struct {
+ Modes uint32
+ Pad_cgo_0 [4]byte
+ Offset int64
+ Freq int64
+ Maxerror int64
+ Esterror int64
+ Status int32
+ Pad_cgo_1 [4]byte
+ Constant int64
+ Precision int64
+ Tolerance int64
+ Time Timeval
+ Tick int64
+ Ppsfreq int64
+ Jitter int64
+ Shift int32
+ Pad_cgo_2 [4]byte
+ Stabil int64
+ Jitcnt int64
+ Calcnt int64
+ Errcnt int64
+ Stbcnt int64
+ Tai int32
+ Pad_cgo_3 [44]byte
+}
+</pre> <h2 id="Tms">type <span>Tms</span> </h2> <pre data-language="go">type Tms struct {
+ Utime int64
+ Stime int64
+ Cutime int64
+ Cstime int64
+}
+</pre> <h2 id="Ucred">type <span>Ucred</span> </h2> <pre data-language="go">type Ucred struct {
+ Pid int32
+ Uid uint32
+ Gid uint32
+}
+</pre> <h3 id="GetsockoptUcred">func <span>GetsockoptUcred</span> </h3> <pre data-language="go">func GetsockoptUcred(fd, level, opt int) (*Ucred, error)</pre> <h3 id="ParseUnixCredentials">func <span>ParseUnixCredentials</span> </h3> <pre data-language="go">func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error)</pre> <p>ParseUnixCredentials decodes a socket control message that contains credentials in a Ucred structure. To receive such a message, the SO_PASSCRED option must be enabled on the socket. </p>
+<h2 id="Ustat_t">type <span>Ustat_t</span> </h2> <pre data-language="go">type Ustat_t struct {
+ Tfree int32
+ Pad_cgo_0 [4]byte
+ Tinode uint64
+ Fname [6]int8
+ Fpack [6]int8
+ Pad_cgo_1 [4]byte
+}
+</pre> <h2 id="Utimbuf">type <span>Utimbuf</span> </h2> <pre data-language="go">type Utimbuf struct {
+ Actime int64
+ Modtime int64
+}
+</pre> <h2 id="Utsname">type <span>Utsname</span> </h2> <pre data-language="go">type Utsname struct {
+ Sysname [65]int8
+ Nodename [65]int8
+ Release [65]int8
+ Version [65]int8
+ Machine [65]int8
+ Domainname [65]int8
+}
+</pre> <h2 id="WaitStatus">type <span>WaitStatus</span> </h2> <pre data-language="go">type WaitStatus uint32</pre> <h3 id="WaitStatus.Continued">func (WaitStatus) <span>Continued</span> </h3> <pre data-language="go">func (w WaitStatus) Continued() bool</pre> <h3 id="WaitStatus.CoreDump">func (WaitStatus) <span>CoreDump</span> </h3> <pre data-language="go">func (w WaitStatus) CoreDump() bool</pre> <h3 id="WaitStatus.ExitStatus">func (WaitStatus) <span>ExitStatus</span> </h3> <pre data-language="go">func (w WaitStatus) ExitStatus() int</pre> <h3 id="WaitStatus.Exited">func (WaitStatus) <span>Exited</span> </h3> <pre data-language="go">func (w WaitStatus) Exited() bool</pre> <h3 id="WaitStatus.Signal">func (WaitStatus) <span>Signal</span> </h3> <pre data-language="go">func (w WaitStatus) Signal() Signal</pre> <h3 id="WaitStatus.Signaled">func (WaitStatus) <span>Signaled</span> </h3> <pre data-language="go">func (w WaitStatus) Signaled() bool</pre> <h3 id="WaitStatus.StopSignal">func (WaitStatus) <span>StopSignal</span> </h3> <pre data-language="go">func (w WaitStatus) StopSignal() Signal</pre> <h3 id="WaitStatus.Stopped">func (WaitStatus) <span>Stopped</span> </h3> <pre data-language="go">func (w WaitStatus) Stopped() bool</pre> <h3 id="WaitStatus.TrapCause">func (WaitStatus) <span>TrapCause</span> </h3> <pre data-language="go">func (w WaitStatus) TrapCause() int</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="js/index">js</a> </td> <td class="pkg-synopsis"> Package js gives access to the WebAssembly host environment when using the js/wasm architecture. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/syscall/" class="_attribution-link">http://golang.org/pkg/syscall/</a>
+ </p>
+</div>
diff --git a/devdocs/go/syscall%2Fjs%2Findex.html b/devdocs/go/syscall%2Fjs%2Findex.html
new file mode 100644
index 00000000..c82ff5a6
--- /dev/null
+++ b/devdocs/go/syscall%2Fjs%2Findex.html
@@ -0,0 +1,159 @@
+<h1> Package js </h1> <ul id="short-nav">
+<li><code>import "syscall/js"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package js gives access to the WebAssembly host environment when using the js/wasm architecture. Its API is based on JavaScript semantics. </p>
+<p>This package is EXPERIMENTAL. Its current scope is only to allow tests to run, but not yet to provide a comprehensive API for users. It is exempt from the Go compatibility promise. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#CopyBytesToGo">func CopyBytesToGo(dst []byte, src Value) int</a></li>
+<li><a href="#CopyBytesToJS">func CopyBytesToJS(dst Value, src []byte) int</a></li>
+<li><a href="#Error">type Error</a></li>
+<li> <a href="#Error.Error">func (e Error) Error() string</a>
+</li>
+<li><a href="#Func">type Func</a></li>
+<li> <a href="#FuncOf">func FuncOf(fn func(this Value, args []Value) any) Func</a>
+</li>
+<li> <a href="#Func.Release">func (c Func) Release()</a>
+</li>
+<li><a href="#Type">type Type</a></li>
+<li> <a href="#Type.String">func (t Type) String() string</a>
+</li>
+<li><a href="#Value">type Value</a></li>
+<li> <a href="#Global">func Global() Value</a>
+</li>
+<li> <a href="#Null">func Null() Value</a>
+</li>
+<li> <a href="#Undefined">func Undefined() Value</a>
+</li>
+<li> <a href="#ValueOf">func ValueOf(x any) Value</a>
+</li>
+<li> <a href="#Value.Bool">func (v Value) Bool() bool</a>
+</li>
+<li> <a href="#Value.Call">func (v Value) Call(m string, args ...any) Value</a>
+</li>
+<li> <a href="#Value.Delete">func (v Value) Delete(p string)</a>
+</li>
+<li> <a href="#Value.Equal">func (v Value) Equal(w Value) bool</a>
+</li>
+<li> <a href="#Value.Float">func (v Value) Float() float64</a>
+</li>
+<li> <a href="#Value.Get">func (v Value) Get(p string) Value</a>
+</li>
+<li> <a href="#Value.Index">func (v Value) Index(i int) Value</a>
+</li>
+<li> <a href="#Value.InstanceOf">func (v Value) InstanceOf(t Value) bool</a>
+</li>
+<li> <a href="#Value.Int">func (v Value) Int() int</a>
+</li>
+<li> <a href="#Value.Invoke">func (v Value) Invoke(args ...any) Value</a>
+</li>
+<li> <a href="#Value.IsNaN">func (v Value) IsNaN() bool</a>
+</li>
+<li> <a href="#Value.IsNull">func (v Value) IsNull() bool</a>
+</li>
+<li> <a href="#Value.IsUndefined">func (v Value) IsUndefined() bool</a>
+</li>
+<li> <a href="#Value.Length">func (v Value) Length() int</a>
+</li>
+<li> <a href="#Value.New">func (v Value) New(args ...any) Value</a>
+</li>
+<li> <a href="#Value.Set">func (v Value) Set(p string, x any)</a>
+</li>
+<li> <a href="#Value.SetIndex">func (v Value) SetIndex(i int, x any)</a>
+</li>
+<li> <a href="#Value.String">func (v Value) String() string</a>
+</li>
+<li> <a href="#Value.Truthy">func (v Value) Truthy() bool</a>
+</li>
+<li> <a href="#Value.Type">func (v Value) Type() Type</a>
+</li>
+<li><a href="#ValueError">type ValueError</a></li>
+<li> <a href="#ValueError.Error">func (e *ValueError) Error() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_FuncOf">FuncOf</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>func.go</span> <span>js.go</span> </p> <h2 id="CopyBytesToGo">func <span>CopyBytesToGo</span> </h2> <pre data-language="go">func CopyBytesToGo(dst []byte, src Value) int</pre> <p>CopyBytesToGo copies bytes from src to dst. It panics if src is not a Uint8Array or Uint8ClampedArray. It returns the number of bytes copied, which will be the minimum of the lengths of src and dst. </p>
+<h2 id="CopyBytesToJS">func <span>CopyBytesToJS</span> </h2> <pre data-language="go">func CopyBytesToJS(dst Value, src []byte) int</pre> <p>CopyBytesToJS copies bytes from src to dst. It panics if dst is not a Uint8Array or Uint8ClampedArray. It returns the number of bytes copied, which will be the minimum of the lengths of src and dst. </p>
+<h2 id="Error">type <span>Error</span> </h2> <p>Error wraps a JavaScript error. </p>
+<pre data-language="go">type Error struct {
+ // Value is the underlying JavaScript error value.
+ Value
+}
+</pre> <h3 id="Error.Error">func (Error) <span>Error</span> </h3> <pre data-language="go">func (e Error) Error() string</pre> <p>Error implements the error interface. </p>
+<h2 id="Func">type <span>Func</span> </h2> <p>Func is a wrapped Go function to be called by JavaScript. </p>
+<pre data-language="go">type Func struct {
+ Value // the JavaScript function that invokes the Go function
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="FuncOf">func <span>FuncOf</span> </h3> <pre data-language="go">func FuncOf(fn func(this Value, args []Value) any) Func</pre> <p>FuncOf returns a function to be used by JavaScript. </p>
+<p>The Go function fn is called with the value of JavaScript's "this" keyword and the arguments of the invocation. The return value of the invocation is the result of the Go function mapped back to JavaScript according to ValueOf. </p>
+<p>Invoking the wrapped Go function from JavaScript will pause the event loop and spawn a new goroutine. Other wrapped functions which are triggered during a call from Go to JavaScript get executed on the same goroutine. </p>
+<p>As a consequence, if one wrapped function blocks, JavaScript's event loop is blocked until that function returns. Hence, calling any async JavaScript API, which requires the event loop, like fetch (http.Client), will cause an immediate deadlock. Therefore a blocking function should explicitly start a new goroutine. </p>
+<p>Func.Release must be called to free up resources when the function will not be invoked any more. </p> <h4 id="example_FuncOf"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+var cb js.Func
+cb = js.FuncOf(func(this js.Value, args []js.Value) any {
+ fmt.Println("button clicked")
+ cb.Release() // release the function if the button will not be clicked again
+ return nil
+})
+js.Global().Get("document").Call("getElementById", "myButton").Call("addEventListener", "click", cb)
+</pre> <h3 id="Func.Release">func (Func) <span>Release</span> </h3> <pre data-language="go">func (c Func) Release()</pre> <p>Release frees up resources allocated for the function. The function must not be invoked after calling Release. It is allowed to call Release while the function is still running. </p>
+<h2 id="Type">type <span>Type</span> </h2> <p>Type represents the JavaScript type of a Value. </p>
+<pre data-language="go">type Type int</pre> <pre data-language="go">const (
+ TypeUndefined Type = iota
+ TypeNull
+ TypeBoolean
+ TypeNumber
+ TypeString
+ TypeSymbol
+ TypeObject
+ TypeFunction
+)</pre> <h3 id="Type.String">func (Type) <span>String</span> </h3> <pre data-language="go">func (t Type) String() string</pre> <h2 id="Value">type <span>Value</span> </h2> <p>Value represents a JavaScript value. The zero value is the JavaScript value "undefined". Values can be checked for equality with the Equal method. </p>
+<pre data-language="go">type Value struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Global">func <span>Global</span> </h3> <pre data-language="go">func Global() Value</pre> <p>Global returns the JavaScript global object, usually "window" or "global". </p>
+<h3 id="Null">func <span>Null</span> </h3> <pre data-language="go">func Null() Value</pre> <p>Null returns the JavaScript value "null". </p>
+<h3 id="Undefined">func <span>Undefined</span> </h3> <pre data-language="go">func Undefined() Value</pre> <p>Undefined returns the JavaScript value "undefined". </p>
+<h3 id="ValueOf">func <span>ValueOf</span> </h3> <pre data-language="go">func ValueOf(x any) Value</pre> <p>ValueOf returns x as a JavaScript value: </p>
+<pre data-language="go">| Go | JavaScript |
+| ---------------------- | ---------------------- |
+| js.Value | [its value] |
+| js.Func | function |
+| nil | null |
+| bool | boolean |
+| integers and floats | number |
+| string | string |
+| []interface{} | new array |
+| map[string]interface{} | new object |
+</pre> <p>Panics if x is not one of the expected types. </p>
+<h3 id="Value.Bool">func (Value) <span>Bool</span> </h3> <pre data-language="go">func (v Value) Bool() bool</pre> <p>Bool returns the value v as a bool. It panics if v is not a JavaScript boolean. </p>
+<h3 id="Value.Call">func (Value) <span>Call</span> </h3> <pre data-language="go">func (v Value) Call(m string, args ...any) Value</pre> <p>Call does a JavaScript call to the method m of value v with the given arguments. It panics if v has no method m. The arguments get mapped to JavaScript values according to the ValueOf function. </p>
+<h3 id="Value.Delete">func (Value) <span>Delete</span> </h3> <pre data-language="go">func (v Value) Delete(p string)</pre> <p>Delete deletes the JavaScript property p of value v. It panics if v is not a JavaScript object. </p>
+<h3 id="Value.Equal">func (Value) <span>Equal</span> </h3> <pre data-language="go">func (v Value) Equal(w Value) bool</pre> <p>Equal reports whether v and w are equal according to JavaScript's === operator. </p>
+<h3 id="Value.Float">func (Value) <span>Float</span> </h3> <pre data-language="go">func (v Value) Float() float64</pre> <p>Float returns the value v as a float64. It panics if v is not a JavaScript number. </p>
+<h3 id="Value.Get">func (Value) <span>Get</span> </h3> <pre data-language="go">func (v Value) Get(p string) Value</pre> <p>Get returns the JavaScript property p of value v. It panics if v is not a JavaScript object. </p>
+<h3 id="Value.Index">func (Value) <span>Index</span> </h3> <pre data-language="go">func (v Value) Index(i int) Value</pre> <p>Index returns JavaScript index i of value v. It panics if v is not a JavaScript object. </p>
+<h3 id="Value.InstanceOf">func (Value) <span>InstanceOf</span> </h3> <pre data-language="go">func (v Value) InstanceOf(t Value) bool</pre> <p>InstanceOf reports whether v is an instance of type t according to JavaScript's instanceof operator. </p>
+<h3 id="Value.Int">func (Value) <span>Int</span> </h3> <pre data-language="go">func (v Value) Int() int</pre> <p>Int returns the value v truncated to an int. It panics if v is not a JavaScript number. </p>
+<h3 id="Value.Invoke">func (Value) <span>Invoke</span> </h3> <pre data-language="go">func (v Value) Invoke(args ...any) Value</pre> <p>Invoke does a JavaScript call of the value v with the given arguments. It panics if v is not a JavaScript function. The arguments get mapped to JavaScript values according to the ValueOf function. </p>
+<h3 id="Value.IsNaN">func (Value) <span>IsNaN</span> </h3> <pre data-language="go">func (v Value) IsNaN() bool</pre> <p>IsNaN reports whether v is the JavaScript value "NaN". </p>
+<h3 id="Value.IsNull">func (Value) <span>IsNull</span> </h3> <pre data-language="go">func (v Value) IsNull() bool</pre> <p>IsNull reports whether v is the JavaScript value "null". </p>
+<h3 id="Value.IsUndefined">func (Value) <span>IsUndefined</span> </h3> <pre data-language="go">func (v Value) IsUndefined() bool</pre> <p>IsUndefined reports whether v is the JavaScript value "undefined". </p>
+<h3 id="Value.Length">func (Value) <span>Length</span> </h3> <pre data-language="go">func (v Value) Length() int</pre> <p>Length returns the JavaScript property "length" of v. It panics if v is not a JavaScript object. </p>
+<h3 id="Value.New">func (Value) <span>New</span> </h3> <pre data-language="go">func (v Value) New(args ...any) Value</pre> <p>New uses JavaScript's "new" operator with value v as constructor and the given arguments. It panics if v is not a JavaScript function. The arguments get mapped to JavaScript values according to the ValueOf function. </p>
+<h3 id="Value.Set">func (Value) <span>Set</span> </h3> <pre data-language="go">func (v Value) Set(p string, x any)</pre> <p>Set sets the JavaScript property p of value v to ValueOf(x). It panics if v is not a JavaScript object. </p>
+<h3 id="Value.SetIndex">func (Value) <span>SetIndex</span> </h3> <pre data-language="go">func (v Value) SetIndex(i int, x any)</pre> <p>SetIndex sets the JavaScript index i of value v to ValueOf(x). It panics if v is not a JavaScript object. </p>
+<h3 id="Value.String">func (Value) <span>String</span> </h3> <pre data-language="go">func (v Value) String() string</pre> <p>String returns the value v as a string. String is a special case because of Go's String method convention. Unlike the other getters, it does not panic if v's Type is not TypeString. Instead, it returns a string of the form "&lt;T&gt;" or "&lt;T: V&gt;" where T is v's type and V is a string representation of v's value. </p>
+<h3 id="Value.Truthy">func (Value) <span>Truthy</span> </h3> <pre data-language="go">func (v Value) Truthy() bool</pre> <p>Truthy returns the JavaScript "truthiness" of the value v. In JavaScript, false, 0, "", null, undefined, and NaN are "falsy", and everything else is "truthy". See <a href="https://developer.mozilla.org/en-US/docs/Glossary/Truthy">https://developer.mozilla.org/en-US/docs/Glossary/Truthy</a>. </p>
+<h3 id="Value.Type">func (Value) <span>Type</span> </h3> <pre data-language="go">func (v Value) Type() Type</pre> <p>Type returns the JavaScript type of the value v. It is similar to JavaScript's typeof operator, except that it returns TypeNull instead of TypeObject for null. </p>
+<h2 id="ValueError">type <span>ValueError</span> </h2> <p>A ValueError occurs when a Value method is invoked on a Value that does not support it. Such cases are documented in the description of each method. </p>
+<pre data-language="go">type ValueError struct {
+ Method string
+ Type Type
+}
+</pre> <h3 id="ValueError.Error">func (*ValueError) <span>Error</span> </h3> <pre data-language="go">func (e *ValueError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/syscall/js/" class="_attribution-link">http://golang.org/pkg/syscall/js/</a>
+ </p>
+</div>
diff --git a/devdocs/go/testing%2Ffstest%2Findex.html b/devdocs/go/testing%2Ffstest%2Findex.html
new file mode 100644
index 00000000..3fb1d250
--- /dev/null
+++ b/devdocs/go/testing%2Ffstest%2Findex.html
@@ -0,0 +1,43 @@
+<h1> Package fstest </h1> <ul id="short-nav">
+<li><code>import "testing/fstest"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package fstest implements support for testing implementations and users of file systems. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#TestFS">func TestFS(fsys fs.FS, expected ...string) error</a></li>
+<li><a href="#MapFS">type MapFS</a></li>
+<li> <a href="#MapFS.Glob">func (fsys MapFS) Glob(pattern string) ([]string, error)</a>
+</li>
+<li> <a href="#MapFS.Open">func (fsys MapFS) Open(name string) (fs.File, error)</a>
+</li>
+<li> <a href="#MapFS.ReadDir">func (fsys MapFS) ReadDir(name string) ([]fs.DirEntry, error)</a>
+</li>
+<li> <a href="#MapFS.ReadFile">func (fsys MapFS) ReadFile(name string) ([]byte, error)</a>
+</li>
+<li> <a href="#MapFS.Stat">func (fsys MapFS) Stat(name string) (fs.FileInfo, error)</a>
+</li>
+<li> <a href="#MapFS.Sub">func (fsys MapFS) Sub(dir string) (fs.FS, error)</a>
+</li>
+<li><a href="#MapFile">type MapFile</a></li>
+</ul> <h3>Package files</h3> <p> <span>mapfs.go</span> <span>testfs.go</span> </p> <h2 id="TestFS">func <span>TestFS</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func TestFS(fsys fs.FS, expected ...string) error</pre> <p>TestFS tests a file system implementation. It walks the entire tree of files in fsys, opening and checking that each file behaves correctly. It also checks that the file system contains at least the expected files. As a special case, if no expected files are listed, fsys must be empty. Otherwise, fsys must contain at least the listed files; it can also contain others. The contents of fsys must not change concurrently with TestFS. </p>
+<p>If TestFS finds any misbehaviors, it returns an error reporting all of them. The error text spans multiple lines, one per detected misbehavior. </p>
+<p>Typical usage inside a test is: </p>
+<pre data-language="go">if err := fstest.TestFS(myFS, "file/that/should/be/present"); err != nil {
+ t.Fatal(err)
+}
+</pre> <h2 id="MapFS">type <span>MapFS</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A MapFS is a simple in-memory file system for use in tests, represented as a map from path names (arguments to Open) to information about the files or directories they represent. </p>
+<p>The map need not include parent directories for files contained in the map; those will be synthesized if needed. But a directory can still be included by setting the [MapFile.Mode]'s <span>fs.ModeDir</span> bit; this may be necessary for detailed control over the directory's <span>fs.FileInfo</span> or to create an empty directory. </p>
+<p>File system operations read directly from the map, so that the file system can be changed by editing the map as needed. An implication is that file system operations must not run concurrently with changes to the map, which would be a race. Another implication is that opening or reading a directory requires iterating over the entire map, so a MapFS should typically be used with not more than a few hundred entries or directory reads. </p>
+<pre data-language="go">type MapFS map[string]*MapFile</pre> <h3 id="MapFS.Glob">func (MapFS) <span>Glob</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (fsys MapFS) Glob(pattern string) ([]string, error)</pre> <h3 id="MapFS.Open">func (MapFS) <span>Open</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (fsys MapFS) Open(name string) (fs.File, error)</pre> <p>Open opens the named file. </p>
+<h3 id="MapFS.ReadDir">func (MapFS) <span>ReadDir</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (fsys MapFS) ReadDir(name string) ([]fs.DirEntry, error)</pre> <h3 id="MapFS.ReadFile">func (MapFS) <span>ReadFile</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (fsys MapFS) ReadFile(name string) ([]byte, error)</pre> <h3 id="MapFS.Stat">func (MapFS) <span>Stat</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (fsys MapFS) Stat(name string) (fs.FileInfo, error)</pre> <h3 id="MapFS.Sub">func (MapFS) <span>Sub</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (fsys MapFS) Sub(dir string) (fs.FS, error)</pre> <h2 id="MapFile">type <span>MapFile</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A MapFile describes a single file in a <a href="#MapFS">MapFS</a>. </p>
+<pre data-language="go">type MapFile struct {
+ Data []byte // file content
+ Mode fs.FileMode // fs.FileInfo.Mode
+ ModTime time.Time // fs.FileInfo.ModTime
+ Sys any // fs.FileInfo.Sys
+}
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/testing/fstest/" class="_attribution-link">http://golang.org/pkg/testing/fstest/</a>
+ </p>
+</div>
diff --git a/devdocs/go/testing%2Findex.html b/devdocs/go/testing%2Findex.html
new file mode 100644
index 00000000..15c0b37c
--- /dev/null
+++ b/devdocs/go/testing%2Findex.html
@@ -0,0 +1,661 @@
+<h1> Package testing </h1> <ul id="short-nav">
+<li><code>import "testing"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package testing provides support for automated testing of Go packages. It is intended to be used in concert with the "go test" command, which automates execution of any function of the form </p>
+<pre data-language="go">func TestXxx(*testing.T)
+</pre> <p>where Xxx does not start with a lowercase letter. The function name serves to identify the test routine. </p>
+<p>Within these functions, use the Error, Fail or related methods to signal failure. </p>
+<p>To write a new test suite, create a file that contains the TestXxx functions as described here, and give that file a name ending in "_test.go". The file will be excluded from regular package builds but will be included when the "go test" command is run. </p>
+<p>The test file can be in the same package as the one being tested, or in a corresponding package with the suffix "_test". </p>
+<p>If the test file is in the same package, it may refer to unexported identifiers within the package, as in this example: </p>
+<pre data-language="go">package abs
+
+import "testing"
+
+func TestAbs(t *testing.T) {
+ got := Abs(-1)
+ if got != 1 {
+ t.Errorf("Abs(-1) = %d; want 1", got)
+ }
+}
+</pre> <p>If the file is in a separate "_test" package, the package being tested must be imported explicitly and only its exported identifiers may be used. This is known as "black box" testing. </p>
+<pre data-language="go">package abs_test
+
+import (
+ "testing"
+
+ "path_to_pkg/abs"
+)
+
+func TestAbs(t *testing.T) {
+ got := abs.Abs(-1)
+ if got != 1 {
+ t.Errorf("Abs(-1) = %d; want 1", got)
+ }
+}
+</pre> <p>For more detail, run "go help test" and "go help testflag". </p>
+<h3 id="hdr-Benchmarks">Benchmarks</h3> <p>Functions of the form </p>
+<pre data-language="go">func BenchmarkXxx(*testing.B)
+</pre> <p>are considered benchmarks, and are executed by the "go test" command when its -bench flag is provided. Benchmarks are run sequentially. </p>
+<p>For a description of the testing flags, see <a href="https://golang.org/cmd/go/#hdr-Testing_flags">https://golang.org/cmd/go/#hdr-Testing_flags</a>. </p>
+<p>A sample benchmark function looks like this: </p>
+<pre data-language="go">func BenchmarkRandInt(b *testing.B) {
+ for i := 0; i &lt; b.N; i++ {
+ rand.Int()
+ }
+}
+</pre> <p>The benchmark function must run the target code b.N times. During benchmark execution, b.N is adjusted until the benchmark function lasts long enough to be timed reliably. The output </p>
+<pre data-language="go">BenchmarkRandInt-8 68453040 17.8 ns/op
+</pre> <p>means that the loop ran 68453040 times at a speed of 17.8 ns per loop. </p>
+<p>If a benchmark needs some expensive setup before running, the timer may be reset: </p>
+<pre data-language="go">func BenchmarkBigLen(b *testing.B) {
+ big := NewBig()
+ b.ResetTimer()
+ for i := 0; i &lt; b.N; i++ {
+ big.Len()
+ }
+}
+</pre> <p>If a benchmark needs to test performance in a parallel setting, it may use the RunParallel helper function; such benchmarks are intended to be used with the go test -cpu flag: </p>
+<pre data-language="go">func BenchmarkTemplateParallel(b *testing.B) {
+ templ := template.Must(template.New("test").Parse("Hello, {{.}}!"))
+ b.RunParallel(func(pb *testing.PB) {
+ var buf bytes.Buffer
+ for pb.Next() {
+ buf.Reset()
+ templ.Execute(&amp;buf, "World")
+ }
+ })
+}
+</pre> <p>A detailed specification of the benchmark results format is given in <a href="https://golang.org/design/14313-benchmark-format">https://golang.org/design/14313-benchmark-format</a>. </p>
+<p>There are standard tools for working with benchmark results at <a href="https://golang.org/x/perf/cmd">https://golang.org/x/perf/cmd</a>. In particular, <a href="https://golang.org/x/perf/cmd/benchstat">https://golang.org/x/perf/cmd/benchstat</a> performs statistically robust A/B comparisons. </p>
+<h3 id="hdr-Examples">Examples</h3> <p>The package also runs and verifies example code. Example functions may include a concluding line comment that begins with "Output:" and is compared with the standard output of the function when the tests are run. (The comparison ignores leading and trailing space.) These are examples of an example: </p>
+<pre data-language="go">func ExampleHello() {
+ fmt.Println("hello")
+ // Output: hello
+}
+
+func ExampleSalutations() {
+ fmt.Println("hello, and")
+ fmt.Println("goodbye")
+ // Output:
+ // hello, and
+ // goodbye
+}
+</pre> <p>The comment prefix "Unordered output:" is like "Output:", but matches any line order: </p>
+<pre data-language="go">func ExamplePerm() {
+ for _, value := range Perm(5) {
+ fmt.Println(value)
+ }
+ // Unordered output: 4
+ // 2
+ // 1
+ // 3
+ // 0
+}
+</pre> <p>Example functions without output comments are compiled but not executed. </p>
+<p>The naming convention to declare examples for the package, a function F, a type T and method M on type T are: </p>
+<pre data-language="go">func Example() { ... }
+func ExampleF() { ... }
+func ExampleT() { ... }
+func ExampleT_M() { ... }
+</pre> <p>Multiple example functions for a package/type/function/method may be provided by appending a distinct suffix to the name. The suffix must start with a lower-case letter. </p>
+<pre data-language="go">func Example_suffix() { ... }
+func ExampleF_suffix() { ... }
+func ExampleT_suffix() { ... }
+func ExampleT_M_suffix() { ... }
+</pre> <p>The entire test file is presented as the example when it contains a single example function, at least one other function, type, variable, or constant declaration, and no test or benchmark functions. </p>
+<h3 id="hdr-Fuzzing">Fuzzing</h3> <p>'go test' and the testing package support fuzzing, a testing technique where a function is called with randomly generated inputs to find bugs not anticipated by unit tests. </p>
+<p>Functions of the form </p>
+<pre data-language="go">func FuzzXxx(*testing.F)
+</pre> <p>are considered fuzz tests. </p>
+<p>For example: </p>
+<pre data-language="go">func FuzzHex(f *testing.F) {
+ for _, seed := range [][]byte{{}, {0}, {9}, {0xa}, {0xf}, {1, 2, 3, 4}} {
+ f.Add(seed)
+ }
+ f.Fuzz(func(t *testing.T, in []byte) {
+ enc := hex.EncodeToString(in)
+ out, err := hex.DecodeString(enc)
+ if err != nil {
+ t.Fatalf("%v: decode: %v", in, err)
+ }
+ if !bytes.Equal(in, out) {
+ t.Fatalf("%v: not equal after round trip: %v", in, out)
+ }
+ })
+}
+</pre> <p>A fuzz test maintains a seed corpus, or a set of inputs which are run by default, and can seed input generation. Seed inputs may be registered by calling (*F).Add or by storing files in the directory testdata/fuzz/&lt;Name&gt; (where &lt;Name&gt; is the name of the fuzz test) within the package containing the fuzz test. Seed inputs are optional, but the fuzzing engine may find bugs more efficiently when provided with a set of small seed inputs with good code coverage. These seed inputs can also serve as regression tests for bugs identified through fuzzing. </p>
+<p>The function passed to (*F).Fuzz within the fuzz test is considered the fuzz target. A fuzz target must accept a *T parameter, followed by one or more parameters for random inputs. The types of arguments passed to (*F).Add must be identical to the types of these parameters. The fuzz target may signal that it's found a problem the same way tests do: by calling T.Fail (or any method that calls it like T.Error or T.Fatal) or by panicking. </p>
+<p>When fuzzing is enabled (by setting the -fuzz flag to a regular expression that matches a specific fuzz test), the fuzz target is called with arguments generated by repeatedly making random changes to the seed inputs. On supported platforms, 'go test' compiles the test executable with fuzzing coverage instrumentation. The fuzzing engine uses that instrumentation to find and cache inputs that expand coverage, increasing the likelihood of finding bugs. If the fuzz target fails for a given input, the fuzzing engine writes the inputs that caused the failure to a file in the directory testdata/fuzz/&lt;Name&gt; within the package directory. This file later serves as a seed input. If the file can't be written at that location (for example, because the directory is read-only), the fuzzing engine writes the file to the fuzz cache directory within the build cache instead. </p>
+<p>When fuzzing is disabled, the fuzz target is called with the seed inputs registered with F.Add and seed inputs from testdata/fuzz/&lt;Name&gt;. In this mode, the fuzz test acts much like a regular test, with subtests started with F.Fuzz instead of T.Run. </p>
+<p>See <a href="https://go.dev/doc/fuzz">https://go.dev/doc/fuzz</a> for documentation about fuzzing. </p>
+<h3 id="hdr-Skipping">Skipping</h3> <p>Tests or benchmarks may be skipped at run time with a call to the Skip method of *T or *B: </p>
+<pre data-language="go">func TestTimeConsuming(t *testing.T) {
+ if testing.Short() {
+ t.Skip("skipping test in short mode.")
+ }
+ ...
+}
+</pre> <p>The Skip method of *T can be used in a fuzz target if the input is invalid, but should not be considered a failing input. For example: </p>
+<pre data-language="go">func FuzzJSONMarshaling(f *testing.F) {
+ f.Fuzz(func(t *testing.T, b []byte) {
+ var v interface{}
+ if err := json.Unmarshal(b, &amp;v); err != nil {
+ t.Skip()
+ }
+ if _, err := json.Marshal(v); err != nil {
+ t.Errorf("Marshal: %v", err)
+ }
+ })
+}
+</pre> <h3 id="hdr-Subtests_and_Sub_benchmarks">Subtests and Sub-benchmarks</h3> <p>The Run methods of T and B allow defining subtests and sub-benchmarks, without having to define separate functions for each. This enables uses like table-driven benchmarks and creating hierarchical tests. It also provides a way to share common setup and tear-down code: </p>
+<pre data-language="go">func TestFoo(t *testing.T) {
+ // &lt;setup code&gt;
+ t.Run("A=1", func(t *testing.T) { ... })
+ t.Run("A=2", func(t *testing.T) { ... })
+ t.Run("B=1", func(t *testing.T) { ... })
+ // &lt;tear-down code&gt;
+}
+</pre> <p>Each subtest and sub-benchmark has a unique name: the combination of the name of the top-level test and the sequence of names passed to Run, separated by slashes, with an optional trailing sequence number for disambiguation. </p>
+<p>The argument to the -run, -bench, and -fuzz command-line flags is an unanchored regular expression that matches the test's name. For tests with multiple slash-separated elements, such as subtests, the argument is itself slash-separated, with expressions matching each name element in turn. Because it is unanchored, an empty expression matches any string. For example, using "matching" to mean "whose name contains": </p>
+<pre data-language="go">go test -run '' # Run all tests.
+go test -run Foo # Run top-level tests matching "Foo", such as "TestFooBar".
+go test -run Foo/A= # For top-level tests matching "Foo", run subtests matching "A=".
+go test -run /A=1 # For all top-level tests, run subtests matching "A=1".
+go test -fuzz FuzzFoo # Fuzz the target matching "FuzzFoo"
+</pre> <p>The -run argument can also be used to run a specific value in the seed corpus, for debugging. For example: </p>
+<pre data-language="go">go test -run=FuzzFoo/9ddb952d9814
+</pre> <p>The -fuzz and -run flags can both be set, in order to fuzz a target but skip the execution of all other tests. </p>
+<p>Subtests can also be used to control parallelism. A parent test will only complete once all of its subtests complete. In this example, all tests are run in parallel with each other, and only with each other, regardless of other top-level tests that may be defined: </p>
+<pre data-language="go">func TestGroupedParallel(t *testing.T) {
+ for _, tc := range tests {
+ tc := tc // capture range variable
+ t.Run(tc.Name, func(t *testing.T) {
+ t.Parallel()
+ ...
+ })
+ }
+}
+</pre> <p>Run does not return until parallel subtests have completed, providing a way to clean up after a group of parallel tests: </p>
+<pre data-language="go">func TestTeardownParallel(t *testing.T) {
+ // This Run will not return until the parallel tests finish.
+ t.Run("group", func(t *testing.T) {
+ t.Run("Test1", parallelTest1)
+ t.Run("Test2", parallelTest2)
+ t.Run("Test3", parallelTest3)
+ })
+ // &lt;tear-down code&gt;
+}
+</pre> <h3 id="hdr-Main">Main</h3> <p>It is sometimes necessary for a test or benchmark program to do extra setup or teardown before or after it executes. It is also sometimes necessary to control which code runs on the main thread. To support these and other cases, if a test file contains a function: </p>
+<pre data-language="go">func TestMain(m *testing.M)
+</pre> <p>then the generated test will call TestMain(m) instead of running the tests or benchmarks directly. TestMain runs in the main goroutine and can do whatever setup and teardown is necessary around a call to m.Run. m.Run will return an exit code that may be passed to os.Exit. If TestMain returns, the test wrapper will pass the result of m.Run to os.Exit itself. </p>
+<p>When TestMain is called, flag.Parse has not been run. If TestMain depends on command-line flags, including those of the testing package, it should call flag.Parse explicitly. Command line flags are always parsed by the time test or benchmark functions run. </p>
+<p>A simple implementation of TestMain is: </p>
+<pre data-language="go">func TestMain(m *testing.M) {
+ // call flag.Parse() here if TestMain uses flags
+ os.Exit(m.Run())
+}
+</pre> <p>TestMain is a low-level primitive and should not be necessary for casual testing needs, where ordinary test functions suffice. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#AllocsPerRun">func AllocsPerRun(runs int, f func()) (avg float64)</a></li>
+<li><a href="#CoverMode">func CoverMode() string</a></li>
+<li><a href="#Coverage">func Coverage() float64</a></li>
+<li><a href="#Init">func Init()</a></li>
+<li><a href="#Main">func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)</a></li>
+<li><a href="#RegisterCover">func RegisterCover(c Cover)</a></li>
+<li><a href="#RunBenchmarks">func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)</a></li>
+<li><a href="#RunExamples">func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)</a></li>
+<li><a href="#RunTests">func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)</a></li>
+<li><a href="#Short">func Short() bool</a></li>
+<li><a href="#Testing">func Testing() bool</a></li>
+<li><a href="#Verbose">func Verbose() bool</a></li>
+<li><a href="#B">type B</a></li>
+<li> <a href="#B.Cleanup">func (c *B) Cleanup(f func())</a>
+</li>
+<li> <a href="#B.Elapsed">func (b *B) Elapsed() time.Duration</a>
+</li>
+<li> <a href="#B.Error">func (c *B) Error(args ...any)</a>
+</li>
+<li> <a href="#B.Errorf">func (c *B) Errorf(format string, args ...any)</a>
+</li>
+<li> <a href="#B.Fail">func (c *B) Fail()</a>
+</li>
+<li> <a href="#B.FailNow">func (c *B) FailNow()</a>
+</li>
+<li> <a href="#B.Failed">func (c *B) Failed() bool</a>
+</li>
+<li> <a href="#B.Fatal">func (c *B) Fatal(args ...any)</a>
+</li>
+<li> <a href="#B.Fatalf">func (c *B) Fatalf(format string, args ...any)</a>
+</li>
+<li> <a href="#B.Helper">func (c *B) Helper()</a>
+</li>
+<li> <a href="#B.Log">func (c *B) Log(args ...any)</a>
+</li>
+<li> <a href="#B.Logf">func (c *B) Logf(format string, args ...any)</a>
+</li>
+<li> <a href="#B.Name">func (c *B) Name() string</a>
+</li>
+<li> <a href="#B.ReportAllocs">func (b *B) ReportAllocs()</a>
+</li>
+<li> <a href="#B.ReportMetric">func (b *B) ReportMetric(n float64, unit string)</a>
+</li>
+<li> <a href="#B.ResetTimer">func (b *B) ResetTimer()</a>
+</li>
+<li> <a href="#B.Run">func (b *B) Run(name string, f func(b *B)) bool</a>
+</li>
+<li> <a href="#B.RunParallel">func (b *B) RunParallel(body func(*PB))</a>
+</li>
+<li> <a href="#B.SetBytes">func (b *B) SetBytes(n int64)</a>
+</li>
+<li> <a href="#B.SetParallelism">func (b *B) SetParallelism(p int)</a>
+</li>
+<li> <a href="#B.Setenv">func (c *B) Setenv(key, value string)</a>
+</li>
+<li> <a href="#B.Skip">func (c *B) Skip(args ...any)</a>
+</li>
+<li> <a href="#B.SkipNow">func (c *B) SkipNow()</a>
+</li>
+<li> <a href="#B.Skipf">func (c *B) Skipf(format string, args ...any)</a>
+</li>
+<li> <a href="#B.Skipped">func (c *B) Skipped() bool</a>
+</li>
+<li> <a href="#B.StartTimer">func (b *B) StartTimer()</a>
+</li>
+<li> <a href="#B.StopTimer">func (b *B) StopTimer()</a>
+</li>
+<li> <a href="#B.TempDir">func (c *B) TempDir() string</a>
+</li>
+<li><a href="#BenchmarkResult">type BenchmarkResult</a></li>
+<li> <a href="#Benchmark">func Benchmark(f func(b *B)) BenchmarkResult</a>
+</li>
+<li> <a href="#BenchmarkResult.AllocedBytesPerOp">func (r BenchmarkResult) AllocedBytesPerOp() int64</a>
+</li>
+<li> <a href="#BenchmarkResult.AllocsPerOp">func (r BenchmarkResult) AllocsPerOp() int64</a>
+</li>
+<li> <a href="#BenchmarkResult.MemString">func (r BenchmarkResult) MemString() string</a>
+</li>
+<li> <a href="#BenchmarkResult.NsPerOp">func (r BenchmarkResult) NsPerOp() int64</a>
+</li>
+<li> <a href="#BenchmarkResult.String">func (r BenchmarkResult) String() string</a>
+</li>
+<li><a href="#Cover">type Cover</a></li>
+<li><a href="#CoverBlock">type CoverBlock</a></li>
+<li><a href="#F">type F</a></li>
+<li> <a href="#F.Add">func (f *F) Add(args ...any)</a>
+</li>
+<li> <a href="#F.Cleanup">func (c *F) Cleanup(f func())</a>
+</li>
+<li> <a href="#F.Error">func (c *F) Error(args ...any)</a>
+</li>
+<li> <a href="#F.Errorf">func (c *F) Errorf(format string, args ...any)</a>
+</li>
+<li> <a href="#F.Fail">func (f *F) Fail()</a>
+</li>
+<li> <a href="#F.FailNow">func (c *F) FailNow()</a>
+</li>
+<li> <a href="#F.Failed">func (c *F) Failed() bool</a>
+</li>
+<li> <a href="#F.Fatal">func (c *F) Fatal(args ...any)</a>
+</li>
+<li> <a href="#F.Fatalf">func (c *F) Fatalf(format string, args ...any)</a>
+</li>
+<li> <a href="#F.Fuzz">func (f *F) Fuzz(ff any)</a>
+</li>
+<li> <a href="#F.Helper">func (f *F) Helper()</a>
+</li>
+<li> <a href="#F.Log">func (c *F) Log(args ...any)</a>
+</li>
+<li> <a href="#F.Logf">func (c *F) Logf(format string, args ...any)</a>
+</li>
+<li> <a href="#F.Name">func (c *F) Name() string</a>
+</li>
+<li> <a href="#F.Setenv">func (c *F) Setenv(key, value string)</a>
+</li>
+<li> <a href="#F.Skip">func (c *F) Skip(args ...any)</a>
+</li>
+<li> <a href="#F.SkipNow">func (c *F) SkipNow()</a>
+</li>
+<li> <a href="#F.Skipf">func (c *F) Skipf(format string, args ...any)</a>
+</li>
+<li> <a href="#F.Skipped">func (f *F) Skipped() bool</a>
+</li>
+<li> <a href="#F.TempDir">func (c *F) TempDir() string</a>
+</li>
+<li><a href="#InternalBenchmark">type InternalBenchmark</a></li>
+<li><a href="#InternalExample">type InternalExample</a></li>
+<li><a href="#InternalFuzzTarget">type InternalFuzzTarget</a></li>
+<li><a href="#InternalTest">type InternalTest</a></li>
+<li><a href="#M">type M</a></li>
+<li> <a href="#MainStart">func MainStart(deps testDeps, tests []InternalTest, benchmarks []InternalBenchmark, fuzzTargets []InternalFuzzTarget, examples []InternalExample) *M</a>
+</li>
+<li> <a href="#M.Run">func (m *M) Run() (code int)</a>
+</li>
+<li><a href="#PB">type PB</a></li>
+<li> <a href="#PB.Next">func (pb *PB) Next() bool</a>
+</li>
+<li><a href="#T">type T</a></li>
+<li> <a href="#T.Cleanup">func (c *T) Cleanup(f func())</a>
+</li>
+<li> <a href="#T.Deadline">func (t *T) Deadline() (deadline time.Time, ok bool)</a>
+</li>
+<li> <a href="#T.Error">func (c *T) Error(args ...any)</a>
+</li>
+<li> <a href="#T.Errorf">func (c *T) Errorf(format string, args ...any)</a>
+</li>
+<li> <a href="#T.Fail">func (c *T) Fail()</a>
+</li>
+<li> <a href="#T.FailNow">func (c *T) FailNow()</a>
+</li>
+<li> <a href="#T.Failed">func (c *T) Failed() bool</a>
+</li>
+<li> <a href="#T.Fatal">func (c *T) Fatal(args ...any)</a>
+</li>
+<li> <a href="#T.Fatalf">func (c *T) Fatalf(format string, args ...any)</a>
+</li>
+<li> <a href="#T.Helper">func (c *T) Helper()</a>
+</li>
+<li> <a href="#T.Log">func (c *T) Log(args ...any)</a>
+</li>
+<li> <a href="#T.Logf">func (c *T) Logf(format string, args ...any)</a>
+</li>
+<li> <a href="#T.Name">func (c *T) Name() string</a>
+</li>
+<li> <a href="#T.Parallel">func (t *T) Parallel()</a>
+</li>
+<li> <a href="#T.Run">func (t *T) Run(name string, f func(t *T)) bool</a>
+</li>
+<li> <a href="#T.Setenv">func (t *T) Setenv(key, value string)</a>
+</li>
+<li> <a href="#T.Skip">func (c *T) Skip(args ...any)</a>
+</li>
+<li> <a href="#T.SkipNow">func (c *T) SkipNow()</a>
+</li>
+<li> <a href="#T.Skipf">func (c *T) Skipf(format string, args ...any)</a>
+</li>
+<li> <a href="#T.Skipped">func (c *T) Skipped() bool</a>
+</li>
+<li> <a href="#T.TempDir">func (c *T) TempDir() string</a>
+</li>
+<li><a href="#TB">type TB</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_B_ReportMetric">B.ReportMetric</a></dd> <dd><a class="exampleLink" href="#example_B_ReportMetric_parallel">B.ReportMetric (Parallel)</a></dd> <dd><a class="exampleLink" href="#example_B_RunParallel">B.RunParallel</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>allocs.go</span> <span>benchmark.go</span> <span>cover.go</span> <span>example.go</span> <span>fuzz.go</span> <span>match.go</span> <span>newcover.go</span> <span>run_example.go</span> <span>testing.go</span> <span>testing_other.go</span> </p> <h2 id="AllocsPerRun">func <span>AllocsPerRun</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func AllocsPerRun(runs int, f func()) (avg float64)</pre> <p>AllocsPerRun returns the average number of allocations during calls to f. Although the return value has type float64, it will always be an integral value. </p>
+<p>To compute the number of allocations, the function will first be run once as a warm-up. The average number of allocations over the specified number of runs will then be measured and returned. </p>
+<p>AllocsPerRun sets GOMAXPROCS to 1 during its measurement and will restore it before returning. </p>
+<h2 id="CoverMode">func <span>CoverMode</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func CoverMode() string</pre> <p>CoverMode reports what the test coverage mode is set to. The values are "set", "count", or "atomic". The return value will be empty if test coverage is not enabled. </p>
+<h2 id="Coverage">func <span>Coverage</span> <span title="Added in Go 1.4">1.4</span> </h2> <pre data-language="go">func Coverage() float64</pre> <p>Coverage reports the current code coverage as a fraction in the range [0, 1]. If coverage is not enabled, Coverage returns 0. </p>
+<p>When running a large set of sequential test cases, checking Coverage after each one can be useful for identifying which test cases exercise new code paths. It is not a replacement for the reports generated by 'go test -cover' and 'go tool cover'. </p>
+<h2 id="Init">func <span>Init</span> <span title="Added in Go 1.13">1.13</span> </h2> <pre data-language="go">func Init()</pre> <p>Init registers testing flags. These flags are automatically registered by the "go test" command before running test functions, so Init is only needed when calling functions such as Benchmark without using "go test". </p>
+<p>Init is not safe to call concurrently. It has no effect if it was already called. </p>
+<h2 id="Main">func <span>Main</span> </h2> <pre data-language="go">func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)</pre> <p>Main is an internal function, part of the implementation of the "go test" command. It was exported because it is cross-package and predates "internal" packages. It is no longer used by "go test" but preserved, as much as possible, for other systems that simulate "go test" using Main, but Main sometimes cannot be updated as new functionality is added to the testing package. Systems simulating "go test" should be updated to use MainStart. </p>
+<h2 id="RegisterCover">func <span>RegisterCover</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func RegisterCover(c Cover)</pre> <p>RegisterCover records the coverage data accumulators for the tests. NOTE: This function is internal to the testing infrastructure and may change. It is not covered (yet) by the Go 1 compatibility guidelines. </p>
+<h2 id="RunBenchmarks">func <span>RunBenchmarks</span> </h2> <pre data-language="go">func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)</pre> <p>RunBenchmarks is an internal function but exported because it is cross-package; it is part of the implementation of the "go test" command. </p>
+<h2 id="RunExamples">func <span>RunExamples</span> </h2> <pre data-language="go">func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)</pre> <p>RunExamples is an internal function but exported because it is cross-package; it is part of the implementation of the "go test" command. </p>
+<h2 id="RunTests">func <span>RunTests</span> </h2> <pre data-language="go">func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)</pre> <p>RunTests is an internal function but exported because it is cross-package; it is part of the implementation of the "go test" command. </p>
+<h2 id="Short">func <span>Short</span> </h2> <pre data-language="go">func Short() bool</pre> <p>Short reports whether the -test.short flag is set. </p>
+<h2 id="Testing">func <span>Testing</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func Testing() bool</pre> <p>Testing reports whether the current code is being run in a test. This will report true in programs created by "go test", false in programs created by "go build". </p>
+<h2 id="Verbose">func <span>Verbose</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func Verbose() bool</pre> <p>Verbose reports whether the -test.v flag is set. </p>
+<h2 id="B">type <span>B</span> </h2> <p>B is a type passed to <a href="#Benchmark">Benchmark</a> functions to manage benchmark timing and to specify the number of iterations to run. </p>
+<p>A benchmark ends when its Benchmark function returns or calls any of the methods FailNow, Fatal, Fatalf, SkipNow, Skip, or Skipf. Those methods must be called only from the goroutine running the Benchmark function. The other reporting methods, such as the variations of Log and Error, may be called simultaneously from multiple goroutines. </p>
+<p>Like in tests, benchmark logs are accumulated during execution and dumped to standard output when done. Unlike in tests, benchmark logs are always printed, so as not to hide output whose existence may be affecting benchmark results. </p>
+<pre data-language="go">type B struct {
+ N int
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="B.Cleanup">func (*B) <span>Cleanup</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (c *B) Cleanup(f func())</pre> <p>Cleanup registers a function to be called when the test (or subtest) and all its subtests complete. Cleanup functions will be called in last added, first called order. </p>
+<h3 id="B.Elapsed">func (*B) <span>Elapsed</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (b *B) Elapsed() time.Duration</pre> <p>Elapsed returns the measured elapsed time of the benchmark. The duration reported by Elapsed matches the one measured by <a href="#B.StartTimer">B.StartTimer</a>, <a href="#B.StopTimer">B.StopTimer</a>, and <a href="#B.ResetTimer">B.ResetTimer</a>. </p>
+<h3 id="B.Error">func (*B) <span>Error</span> </h3> <pre data-language="go">func (c *B) Error(args ...any)</pre> <p>Error is equivalent to Log followed by Fail. </p>
+<h3 id="B.Errorf">func (*B) <span>Errorf</span> </h3> <pre data-language="go">func (c *B) Errorf(format string, args ...any)</pre> <p>Errorf is equivalent to Logf followed by Fail. </p>
+<h3 id="B.Fail">func (*B) <span>Fail</span> </h3> <pre data-language="go">func (c *B) Fail()</pre> <p>Fail marks the function as having failed but continues execution. </p>
+<h3 id="B.FailNow">func (*B) <span>FailNow</span> </h3> <pre data-language="go">func (c *B) FailNow()</pre> <p>FailNow marks the function as having failed and stops its execution by calling runtime.Goexit (which then runs all deferred calls in the current goroutine). Execution will continue at the next test or benchmark. FailNow must be called from the goroutine running the test or benchmark function, not from other goroutines created during the test. Calling FailNow does not stop those other goroutines. </p>
+<h3 id="B.Failed">func (*B) <span>Failed</span> </h3> <pre data-language="go">func (c *B) Failed() bool</pre> <p>Failed reports whether the function has failed. </p>
+<h3 id="B.Fatal">func (*B) <span>Fatal</span> </h3> <pre data-language="go">func (c *B) Fatal(args ...any)</pre> <p>Fatal is equivalent to Log followed by FailNow. </p>
+<h3 id="B.Fatalf">func (*B) <span>Fatalf</span> </h3> <pre data-language="go">func (c *B) Fatalf(format string, args ...any)</pre> <p>Fatalf is equivalent to Logf followed by FailNow. </p>
+<h3 id="B.Helper">func (*B) <span>Helper</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *B) Helper()</pre> <p>Helper marks the calling function as a test helper function. When printing file and line information, that function will be skipped. Helper may be called simultaneously from multiple goroutines. </p>
+<h3 id="B.Log">func (*B) <span>Log</span> </h3> <pre data-language="go">func (c *B) Log(args ...any)</pre> <p>Log formats its arguments using default formatting, analogous to Println, and records the text in the error log. For tests, the text will be printed only if the test fails or the -test.v flag is set. For benchmarks, the text is always printed to avoid having performance depend on the value of the -test.v flag. </p>
+<h3 id="B.Logf">func (*B) <span>Logf</span> </h3> <pre data-language="go">func (c *B) Logf(format string, args ...any)</pre> <p>Logf formats its arguments according to the format, analogous to Printf, and records the text in the error log. A final newline is added if not provided. For tests, the text will be printed only if the test fails or the -test.v flag is set. For benchmarks, the text is always printed to avoid having performance depend on the value of the -test.v flag. </p>
+<h3 id="B.Name">func (*B) <span>Name</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (c *B) Name() string</pre> <p>Name returns the name of the running (sub-) test or benchmark. </p>
+<p>The name will include the name of the test along with the names of any nested sub-tests. If two sibling sub-tests have the same name, Name will append a suffix to guarantee the returned name is unique. </p>
+<h3 id="B.ReportAllocs">func (*B) <span>ReportAllocs</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (b *B) ReportAllocs()</pre> <p>ReportAllocs enables malloc statistics for this benchmark. It is equivalent to setting -test.benchmem, but it only affects the benchmark function that calls ReportAllocs. </p>
+<h3 id="B.ReportMetric">func (*B) <span>ReportMetric</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (b *B) ReportMetric(n float64, unit string)</pre> <p>ReportMetric adds "n unit" to the reported benchmark results. If the metric is per-iteration, the caller should divide by b.N, and by convention units should end in "/op". ReportMetric overrides any previously reported value for the same unit. ReportMetric panics if unit is the empty string or if unit contains any whitespace. If unit is a unit normally reported by the benchmark framework itself (such as "allocs/op"), ReportMetric will override that metric. Setting "ns/op" to 0 will suppress that built-in metric. </p> <h4 id="example_B_ReportMetric"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// This reports a custom benchmark metric relevant to a
+// specific algorithm (in this case, sorting).
+testing.Benchmark(func(b *testing.B) {
+ var compares int64
+ for i := 0; i &lt; b.N; i++ {
+ s := []int{5, 4, 3, 2, 1}
+ sort.Slice(s, func(i, j int) bool {
+ compares++
+ return s[i] &lt; s[j]
+ })
+ }
+ // This metric is per-operation, so divide by b.N and
+ // report it as a "/op" unit.
+ b.ReportMetric(float64(compares)/float64(b.N), "compares/op")
+ // This metric is per-time, so divide by b.Elapsed and
+ // report it as a "/ns" unit.
+ b.ReportMetric(float64(compares)/float64(b.Elapsed().Nanoseconds()), "compares/ns")
+})
+</pre> <h4 id="example_B_ReportMetric_parallel"> <span class="text">Example (Parallel)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// This reports a custom benchmark metric relevant to a
+// specific algorithm (in this case, sorting) in parallel.
+testing.Benchmark(func(b *testing.B) {
+ var compares atomic.Int64
+ b.RunParallel(func(pb *testing.PB) {
+ for pb.Next() {
+ s := []int{5, 4, 3, 2, 1}
+ sort.Slice(s, func(i, j int) bool {
+ // Because RunParallel runs the function many
+ // times in parallel, we must increment the
+ // counter atomically to avoid racing writes.
+ compares.Add(1)
+ return s[i] &lt; s[j]
+ })
+ }
+ })
+
+ // NOTE: Report each metric once, after all of the parallel
+ // calls have completed.
+
+ // This metric is per-operation, so divide by b.N and
+ // report it as a "/op" unit.
+ b.ReportMetric(float64(compares.Load())/float64(b.N), "compares/op")
+ // This metric is per-time, so divide by b.Elapsed and
+ // report it as a "/ns" unit.
+ b.ReportMetric(float64(compares.Load())/float64(b.Elapsed().Nanoseconds()), "compares/ns")
+})
+</pre> <h3 id="B.ResetTimer">func (*B) <span>ResetTimer</span> </h3> <pre data-language="go">func (b *B) ResetTimer()</pre> <p>ResetTimer zeroes the elapsed benchmark time and memory allocation counters and deletes user-reported metrics. It does not affect whether the timer is running. </p>
+<h3 id="B.Run">func (*B) <span>Run</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (b *B) Run(name string, f func(b *B)) bool</pre> <p>Run benchmarks f as a subbenchmark with the given name. It reports whether there were any failures. </p>
+<p>A subbenchmark is like any other benchmark. A benchmark that calls Run at least once will not be measured itself and will be called once with N=1. </p>
+<h3 id="B.RunParallel">func (*B) <span>RunParallel</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (b *B) RunParallel(body func(*PB))</pre> <p>RunParallel runs a benchmark in parallel. It creates multiple goroutines and distributes b.N iterations among them. The number of goroutines defaults to GOMAXPROCS. To increase parallelism for non-CPU-bound benchmarks, call <a href="#B.SetParallelism">B.SetParallelism</a> before RunParallel. RunParallel is usually used with the go test -cpu flag. </p>
+<p>The body function will be run in each goroutine. It should set up any goroutine-local state and then iterate until pb.Next returns false. It should not use the <a href="#B.StartTimer">B.StartTimer</a>, <a href="#B.StopTimer">B.StopTimer</a>, or <a href="#B.ResetTimer">B.ResetTimer</a> functions, because they have global effect. It should also not call <a href="#B.Run">B.Run</a>. </p>
+<p>RunParallel reports ns/op values as wall time for the benchmark as a whole, not the sum of wall time or CPU time over each parallel goroutine. </p> <h4 id="example_B_RunParallel"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+// Parallel benchmark for text/template.Template.Execute on a single object.
+testing.Benchmark(func(b *testing.B) {
+ templ := template.Must(template.New("test").Parse("Hello, {{.}}!"))
+ // RunParallel will create GOMAXPROCS goroutines
+ // and distribute work among them.
+ b.RunParallel(func(pb *testing.PB) {
+ // Each goroutine has its own bytes.Buffer.
+ var buf bytes.Buffer
+ for pb.Next() {
+ // The loop body is executed b.N times total across all goroutines.
+ buf.Reset()
+ templ.Execute(&amp;buf, "World")
+ }
+ })
+})
+</pre> <h3 id="B.SetBytes">func (*B) <span>SetBytes</span> </h3> <pre data-language="go">func (b *B) SetBytes(n int64)</pre> <p>SetBytes records the number of bytes processed in a single operation. If this is called, the benchmark will report ns/op and MB/s. </p>
+<h3 id="B.SetParallelism">func (*B) <span>SetParallelism</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (b *B) SetParallelism(p int)</pre> <p>SetParallelism sets the number of goroutines used by <a href="#B.RunParallel">B.RunParallel</a> to p*GOMAXPROCS. There is usually no need to call SetParallelism for CPU-bound benchmarks. If p is less than 1, this call will have no effect. </p>
+<h3 id="B.Setenv">func (*B) <span>Setenv</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (c *B) Setenv(key, value string)</pre> <p>Setenv calls os.Setenv(key, value) and uses Cleanup to restore the environment variable to its original value after the test. </p>
+<p>Because Setenv affects the whole process, it cannot be used in parallel tests or tests with parallel ancestors. </p>
+<h3 id="B.Skip">func (*B) <span>Skip</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *B) Skip(args ...any)</pre> <p>Skip is equivalent to Log followed by SkipNow. </p>
+<h3 id="B.SkipNow">func (*B) <span>SkipNow</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *B) SkipNow()</pre> <p>SkipNow marks the test as having been skipped and stops its execution by calling <span>runtime.Goexit</span>. If a test fails (see Error, Errorf, Fail) and is then skipped, it is still considered to have failed. Execution will continue at the next test or benchmark. See also FailNow. SkipNow must be called from the goroutine running the test, not from other goroutines created during the test. Calling SkipNow does not stop those other goroutines. </p>
+<h3 id="B.Skipf">func (*B) <span>Skipf</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *B) Skipf(format string, args ...any)</pre> <p>Skipf is equivalent to Logf followed by SkipNow. </p>
+<h3 id="B.Skipped">func (*B) <span>Skipped</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *B) Skipped() bool</pre> <p>Skipped reports whether the test was skipped. </p>
+<h3 id="B.StartTimer">func (*B) <span>StartTimer</span> </h3> <pre data-language="go">func (b *B) StartTimer()</pre> <p>StartTimer starts timing a test. This function is called automatically before a benchmark starts, but it can also be used to resume timing after a call to <a href="#B.StopTimer">B.StopTimer</a>. </p>
+<h3 id="B.StopTimer">func (*B) <span>StopTimer</span> </h3> <pre data-language="go">func (b *B) StopTimer()</pre> <p>StopTimer stops timing a test. This can be used to pause the timer while performing complex initialization that you don't want to measure. </p>
+<h3 id="B.TempDir">func (*B) <span>TempDir</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (c *B) TempDir() string</pre> <p>TempDir returns a temporary directory for the test to use. The directory is automatically removed when the test and all its subtests complete. Each subsequent call to t.TempDir returns a unique directory; if the directory creation fails, TempDir terminates the test by calling Fatal. </p>
+<h2 id="BenchmarkResult">type <span>BenchmarkResult</span> </h2> <p>BenchmarkResult contains the results of a benchmark run. </p>
+<pre data-language="go">type BenchmarkResult struct {
+ N int // The number of iterations.
+ T time.Duration // The total time taken.
+ Bytes int64 // Bytes processed in one iteration.
+ MemAllocs uint64 // The total number of memory allocations; added in Go 1.1
+ MemBytes uint64 // The total number of bytes allocated; added in Go 1.1
+
+ // Extra records additional metrics reported by ReportMetric.
+ Extra map[string]float64 // Go 1.13
+}
+</pre> <h3 id="Benchmark">func <span>Benchmark</span> </h3> <pre data-language="go">func Benchmark(f func(b *B)) BenchmarkResult</pre> <p>Benchmark benchmarks a single function. It is useful for creating custom benchmarks that do not use the "go test" command. </p>
+<p>If f depends on testing flags, then <a href="#Init">Init</a> must be used to register those flags before calling Benchmark and before calling <span>flag.Parse</span>. </p>
+<p>If f calls Run, the result will be an estimate of running all its subbenchmarks that don't call Run in sequence in a single benchmark. </p>
+<h3 id="BenchmarkResult.AllocedBytesPerOp">func (BenchmarkResult) <span>AllocedBytesPerOp</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (r BenchmarkResult) AllocedBytesPerOp() int64</pre> <p>AllocedBytesPerOp returns the "B/op" metric, which is calculated as r.MemBytes / r.N. </p>
+<h3 id="BenchmarkResult.AllocsPerOp">func (BenchmarkResult) <span>AllocsPerOp</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (r BenchmarkResult) AllocsPerOp() int64</pre> <p>AllocsPerOp returns the "allocs/op" metric, which is calculated as r.MemAllocs / r.N. </p>
+<h3 id="BenchmarkResult.MemString">func (BenchmarkResult) <span>MemString</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (r BenchmarkResult) MemString() string</pre> <p>MemString returns r.AllocedBytesPerOp and r.AllocsPerOp in the same format as 'go test'. </p>
+<h3 id="BenchmarkResult.NsPerOp">func (BenchmarkResult) <span>NsPerOp</span> </h3> <pre data-language="go">func (r BenchmarkResult) NsPerOp() int64</pre> <p>NsPerOp returns the "ns/op" metric. </p>
+<h3 id="BenchmarkResult.String">func (BenchmarkResult) <span>String</span> </h3> <pre data-language="go">func (r BenchmarkResult) String() string</pre> <p>String returns a summary of the benchmark results. It follows the benchmark result line format from <a href="https://golang.org/design/14313-benchmark-format">https://golang.org/design/14313-benchmark-format</a>, not including the benchmark name. Extra metrics override built-in metrics of the same name. String does not include allocs/op or B/op, since those are reported by <a href="#BenchmarkResult.MemString">BenchmarkResult.MemString</a>. </p>
+<h2 id="Cover">type <span>Cover</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>Cover records information about test coverage checking. NOTE: This struct is internal to the testing infrastructure and may change. It is not covered (yet) by the Go 1 compatibility guidelines. </p>
+<pre data-language="go">type Cover struct {
+ Mode string
+ Counters map[string][]uint32
+ Blocks map[string][]CoverBlock
+ CoveredPackages string
+}
+</pre> <h2 id="CoverBlock">type <span>CoverBlock</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>CoverBlock records the coverage data for a single basic block. The fields are 1-indexed, as in an editor: The opening line of the file is number 1, for example. Columns are measured in bytes. NOTE: This struct is internal to the testing infrastructure and may change. It is not covered (yet) by the Go 1 compatibility guidelines. </p>
+<pre data-language="go">type CoverBlock struct {
+ Line0 uint32 // Line number for block start.
+ Col0 uint16 // Column number for block start.
+ Line1 uint32 // Line number for block end.
+ Col1 uint16 // Column number for block end.
+ Stmts uint16 // Number of statements included in this block.
+}
+</pre> <h2 id="F">type <span>F</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>F is a type passed to fuzz tests. </p>
+<p>Fuzz tests run generated inputs against a provided fuzz target, which can find and report potential bugs in the code being tested. </p>
+<p>A fuzz test runs the seed corpus by default, which includes entries provided by (*F).Add and entries in the testdata/fuzz/&lt;FuzzTestName&gt; directory. After any necessary setup and calls to (*F).Add, the fuzz test must then call (*F).Fuzz to provide the fuzz target. See the testing package documentation for an example, and see the <a href="#F.Fuzz">F.Fuzz</a> and <a href="#F.Add">F.Add</a> method documentation for details. </p>
+<p>*F methods can only be called before (*F).Fuzz. Once the test is executing the fuzz target, only (*T) methods can be used. The only *F methods that are allowed in the (*F).Fuzz function are (*F).Failed and (*F).Name. </p>
+<pre data-language="go">type F struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="F.Add">func (*F) <span>Add</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (f *F) Add(args ...any)</pre> <p>Add will add the arguments to the seed corpus for the fuzz test. This will be a no-op if called after or within the fuzz target, and args must match the arguments for the fuzz target. </p>
+<h3 id="F.Cleanup">func (*F) <span>Cleanup</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Cleanup(f func())</pre> <p>Cleanup registers a function to be called when the test (or subtest) and all its subtests complete. Cleanup functions will be called in last added, first called order. </p>
+<h3 id="F.Error">func (*F) <span>Error</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Error(args ...any)</pre> <p>Error is equivalent to Log followed by Fail. </p>
+<h3 id="F.Errorf">func (*F) <span>Errorf</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Errorf(format string, args ...any)</pre> <p>Errorf is equivalent to Logf followed by Fail. </p>
+<h3 id="F.Fail">func (*F) <span>Fail</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (f *F) Fail()</pre> <p>Fail marks the function as having failed but continues execution. </p>
+<h3 id="F.FailNow">func (*F) <span>FailNow</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) FailNow()</pre> <p>FailNow marks the function as having failed and stops its execution by calling runtime.Goexit (which then runs all deferred calls in the current goroutine). Execution will continue at the next test or benchmark. FailNow must be called from the goroutine running the test or benchmark function, not from other goroutines created during the test. Calling FailNow does not stop those other goroutines. </p>
+<h3 id="F.Failed">func (*F) <span>Failed</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Failed() bool</pre> <p>Failed reports whether the function has failed. </p>
+<h3 id="F.Fatal">func (*F) <span>Fatal</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Fatal(args ...any)</pre> <p>Fatal is equivalent to Log followed by FailNow. </p>
+<h3 id="F.Fatalf">func (*F) <span>Fatalf</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Fatalf(format string, args ...any)</pre> <p>Fatalf is equivalent to Logf followed by FailNow. </p>
+<h3 id="F.Fuzz">func (*F) <span>Fuzz</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (f *F) Fuzz(ff any)</pre> <p>Fuzz runs the fuzz function, ff, for fuzz testing. If ff fails for a set of arguments, those arguments will be added to the seed corpus. </p>
+<p>ff must be a function with no return value whose first argument is *T and whose remaining arguments are the types to be fuzzed. For example: </p>
+<pre data-language="go">f.Fuzz(func(t *testing.T, b []byte, i int) { ... })
+</pre> <p>The following types are allowed: []byte, string, bool, byte, rune, float32, float64, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64. More types may be supported in the future. </p>
+<p>ff must not call any *F methods, e.g. (*F).Log, (*F).Error, (*F).Skip. Use the corresponding *T method instead. The only *F methods that are allowed in the (*F).Fuzz function are (*F).Failed and (*F).Name. </p>
+<p>This function should be fast and deterministic, and its behavior should not depend on shared state. No mutatable input arguments, or pointers to them, should be retained between executions of the fuzz function, as the memory backing them may be mutated during a subsequent invocation. ff must not modify the underlying data of the arguments provided by the fuzzing engine. </p>
+<p>When fuzzing, F.Fuzz does not return until a problem is found, time runs out (set with -fuzztime), or the test process is interrupted by a signal. F.Fuzz should be called exactly once, unless F.Skip or <a href="#F.Fail">F.Fail</a> is called beforehand. </p>
+<h3 id="F.Helper">func (*F) <span>Helper</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (f *F) Helper()</pre> <p>Helper marks the calling function as a test helper function. When printing file and line information, that function will be skipped. Helper may be called simultaneously from multiple goroutines. </p>
+<h3 id="F.Log">func (*F) <span>Log</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Log(args ...any)</pre> <p>Log formats its arguments using default formatting, analogous to Println, and records the text in the error log. For tests, the text will be printed only if the test fails or the -test.v flag is set. For benchmarks, the text is always printed to avoid having performance depend on the value of the -test.v flag. </p>
+<h3 id="F.Logf">func (*F) <span>Logf</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Logf(format string, args ...any)</pre> <p>Logf formats its arguments according to the format, analogous to Printf, and records the text in the error log. A final newline is added if not provided. For tests, the text will be printed only if the test fails or the -test.v flag is set. For benchmarks, the text is always printed to avoid having performance depend on the value of the -test.v flag. </p>
+<h3 id="F.Name">func (*F) <span>Name</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Name() string</pre> <p>Name returns the name of the running (sub-) test or benchmark. </p>
+<p>The name will include the name of the test along with the names of any nested sub-tests. If two sibling sub-tests have the same name, Name will append a suffix to guarantee the returned name is unique. </p>
+<h3 id="F.Setenv">func (*F) <span>Setenv</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Setenv(key, value string)</pre> <p>Setenv calls os.Setenv(key, value) and uses Cleanup to restore the environment variable to its original value after the test. </p>
+<p>Because Setenv affects the whole process, it cannot be used in parallel tests or tests with parallel ancestors. </p>
+<h3 id="F.Skip">func (*F) <span>Skip</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Skip(args ...any)</pre> <p>Skip is equivalent to Log followed by SkipNow. </p>
+<h3 id="F.SkipNow">func (*F) <span>SkipNow</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) SkipNow()</pre> <p>SkipNow marks the test as having been skipped and stops its execution by calling <span>runtime.Goexit</span>. If a test fails (see Error, Errorf, Fail) and is then skipped, it is still considered to have failed. Execution will continue at the next test or benchmark. See also FailNow. SkipNow must be called from the goroutine running the test, not from other goroutines created during the test. Calling SkipNow does not stop those other goroutines. </p>
+<h3 id="F.Skipf">func (*F) <span>Skipf</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) Skipf(format string, args ...any)</pre> <p>Skipf is equivalent to Logf followed by SkipNow. </p>
+<h3 id="F.Skipped">func (*F) <span>Skipped</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (f *F) Skipped() bool</pre> <p>Skipped reports whether the test was skipped. </p>
+<h3 id="F.TempDir">func (*F) <span>TempDir</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *F) TempDir() string</pre> <p>TempDir returns a temporary directory for the test to use. The directory is automatically removed when the test and all its subtests complete. Each subsequent call to t.TempDir returns a unique directory; if the directory creation fails, TempDir terminates the test by calling Fatal. </p>
+<h2 id="InternalBenchmark">type <span>InternalBenchmark</span> </h2> <p>InternalBenchmark is an internal type but exported because it is cross-package; it is part of the implementation of the "go test" command. </p>
+<pre data-language="go">type InternalBenchmark struct {
+ Name string
+ F func(b *B)
+}
+</pre> <h2 id="InternalExample">type <span>InternalExample</span> </h2> <pre data-language="go">type InternalExample struct {
+ Name string
+ F func()
+ Output string
+ Unordered bool // Go 1.7
+}
+</pre> <h2 id="InternalFuzzTarget">type <span>InternalFuzzTarget</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>InternalFuzzTarget is an internal type but exported because it is cross-package; it is part of the implementation of the "go test" command. </p>
+<pre data-language="go">type InternalFuzzTarget struct {
+ Name string
+ Fn func(f *F)
+}
+</pre> <h2 id="InternalTest">type <span>InternalTest</span> </h2> <p>InternalTest is an internal type but exported because it is cross-package; it is part of the implementation of the "go test" command. </p>
+<pre data-language="go">type InternalTest struct {
+ Name string
+ F func(*T)
+}
+</pre> <h2 id="M">type <span>M</span> <span title="Added in Go 1.4">1.4</span> </h2> <p>M is a type passed to a TestMain function to run the actual tests. </p>
+<pre data-language="go">type M struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="MainStart">func <span>MainStart</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func MainStart(deps testDeps, tests []InternalTest, benchmarks []InternalBenchmark, fuzzTargets []InternalFuzzTarget, examples []InternalExample) *M</pre> <p>MainStart is meant for use by tests generated by 'go test'. It is not meant to be called directly and is not subject to the Go 1 compatibility document. It may change signature from release to release. </p>
+<h3 id="M.Run">func (*M) <span>Run</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (m *M) Run() (code int)</pre> <p>Run runs the tests. It returns an exit code to pass to os.Exit. </p>
+<h2 id="PB">type <span>PB</span> <span title="Added in Go 1.3">1.3</span> </h2> <p>A PB is used by RunParallel for running parallel benchmarks. </p>
+<pre data-language="go">type PB struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="PB.Next">func (*PB) <span>Next</span> <span title="Added in Go 1.3">1.3</span> </h3> <pre data-language="go">func (pb *PB) Next() bool</pre> <p>Next reports whether there are more iterations to execute. </p>
+<h2 id="T">type <span>T</span> </h2> <p>T is a type passed to Test functions to manage test state and support formatted test logs. </p>
+<p>A test ends when its Test function returns or calls any of the methods FailNow, Fatal, Fatalf, SkipNow, Skip, or Skipf. Those methods, as well as the Parallel method, must be called only from the goroutine running the Test function. </p>
+<p>The other reporting methods, such as the variations of Log and Error, may be called simultaneously from multiple goroutines. </p>
+<pre data-language="go">type T struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="T.Cleanup">func (*T) <span>Cleanup</span> <span title="Added in Go 1.14">1.14</span> </h3> <pre data-language="go">func (c *T) Cleanup(f func())</pre> <p>Cleanup registers a function to be called when the test (or subtest) and all its subtests complete. Cleanup functions will be called in last added, first called order. </p>
+<h3 id="T.Deadline">func (*T) <span>Deadline</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (t *T) Deadline() (deadline time.Time, ok bool)</pre> <p>Deadline reports the time at which the test binary will have exceeded the timeout specified by the -timeout flag. </p>
+<p>The ok result is false if the -timeout flag indicates “no timeout” (0). </p>
+<h3 id="T.Error">func (*T) <span>Error</span> </h3> <pre data-language="go">func (c *T) Error(args ...any)</pre> <p>Error is equivalent to Log followed by Fail. </p>
+<h3 id="T.Errorf">func (*T) <span>Errorf</span> </h3> <pre data-language="go">func (c *T) Errorf(format string, args ...any)</pre> <p>Errorf is equivalent to Logf followed by Fail. </p>
+<h3 id="T.Fail">func (*T) <span>Fail</span> </h3> <pre data-language="go">func (c *T) Fail()</pre> <p>Fail marks the function as having failed but continues execution. </p>
+<h3 id="T.FailNow">func (*T) <span>FailNow</span> </h3> <pre data-language="go">func (c *T) FailNow()</pre> <p>FailNow marks the function as having failed and stops its execution by calling runtime.Goexit (which then runs all deferred calls in the current goroutine). Execution will continue at the next test or benchmark. FailNow must be called from the goroutine running the test or benchmark function, not from other goroutines created during the test. Calling FailNow does not stop those other goroutines. </p>
+<h3 id="T.Failed">func (*T) <span>Failed</span> </h3> <pre data-language="go">func (c *T) Failed() bool</pre> <p>Failed reports whether the function has failed. </p>
+<h3 id="T.Fatal">func (*T) <span>Fatal</span> </h3> <pre data-language="go">func (c *T) Fatal(args ...any)</pre> <p>Fatal is equivalent to Log followed by FailNow. </p>
+<h3 id="T.Fatalf">func (*T) <span>Fatalf</span> </h3> <pre data-language="go">func (c *T) Fatalf(format string, args ...any)</pre> <p>Fatalf is equivalent to Logf followed by FailNow. </p>
+<h3 id="T.Helper">func (*T) <span>Helper</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (c *T) Helper()</pre> <p>Helper marks the calling function as a test helper function. When printing file and line information, that function will be skipped. Helper may be called simultaneously from multiple goroutines. </p>
+<h3 id="T.Log">func (*T) <span>Log</span> </h3> <pre data-language="go">func (c *T) Log(args ...any)</pre> <p>Log formats its arguments using default formatting, analogous to Println, and records the text in the error log. For tests, the text will be printed only if the test fails or the -test.v flag is set. For benchmarks, the text is always printed to avoid having performance depend on the value of the -test.v flag. </p>
+<h3 id="T.Logf">func (*T) <span>Logf</span> </h3> <pre data-language="go">func (c *T) Logf(format string, args ...any)</pre> <p>Logf formats its arguments according to the format, analogous to Printf, and records the text in the error log. A final newline is added if not provided. For tests, the text will be printed only if the test fails or the -test.v flag is set. For benchmarks, the text is always printed to avoid having performance depend on the value of the -test.v flag. </p>
+<h3 id="T.Name">func (*T) <span>Name</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (c *T) Name() string</pre> <p>Name returns the name of the running (sub-) test or benchmark. </p>
+<p>The name will include the name of the test along with the names of any nested sub-tests. If two sibling sub-tests have the same name, Name will append a suffix to guarantee the returned name is unique. </p>
+<h3 id="T.Parallel">func (*T) <span>Parallel</span> </h3> <pre data-language="go">func (t *T) Parallel()</pre> <p>Parallel signals that this test is to be run in parallel with (and only with) other parallel tests. When a test is run multiple times due to use of -test.count or -test.cpu, multiple instances of a single test never run in parallel with each other. </p>
+<h3 id="T.Run">func (*T) <span>Run</span> <span title="Added in Go 1.7">1.7</span> </h3> <pre data-language="go">func (t *T) Run(name string, f func(t *T)) bool</pre> <p>Run runs f as a subtest of t called name. It runs f in a separate goroutine and blocks until f returns or calls t.Parallel to become a parallel test. Run reports whether f succeeded (or at least did not fail before calling t.Parallel). </p>
+<p>Run may be called simultaneously from multiple goroutines, but all such calls must return before the outer test function for t returns. </p>
+<h3 id="T.Setenv">func (*T) <span>Setenv</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (t *T) Setenv(key, value string)</pre> <p>Setenv calls os.Setenv(key, value) and uses Cleanup to restore the environment variable to its original value after the test. </p>
+<p>Because Setenv affects the whole process, it cannot be used in parallel tests or tests with parallel ancestors. </p>
+<h3 id="T.Skip">func (*T) <span>Skip</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *T) Skip(args ...any)</pre> <p>Skip is equivalent to Log followed by SkipNow. </p>
+<h3 id="T.SkipNow">func (*T) <span>SkipNow</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *T) SkipNow()</pre> <p>SkipNow marks the test as having been skipped and stops its execution by calling <span>runtime.Goexit</span>. If a test fails (see Error, Errorf, Fail) and is then skipped, it is still considered to have failed. Execution will continue at the next test or benchmark. See also FailNow. SkipNow must be called from the goroutine running the test, not from other goroutines created during the test. Calling SkipNow does not stop those other goroutines. </p>
+<h3 id="T.Skipf">func (*T) <span>Skipf</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *T) Skipf(format string, args ...any)</pre> <p>Skipf is equivalent to Logf followed by SkipNow. </p>
+<h3 id="T.Skipped">func (*T) <span>Skipped</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *T) Skipped() bool</pre> <p>Skipped reports whether the test was skipped. </p>
+<h3 id="T.TempDir">func (*T) <span>TempDir</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (c *T) TempDir() string</pre> <p>TempDir returns a temporary directory for the test to use. The directory is automatically removed when the test and all its subtests complete. Each subsequent call to t.TempDir returns a unique directory; if the directory creation fails, TempDir terminates the test by calling Fatal. </p>
+<h2 id="TB">type <span>TB</span> <span title="Added in Go 1.2">1.2</span> </h2> <p>TB is the interface common to T, B, and F. </p>
+<pre data-language="go">type TB interface {
+ Cleanup(func())
+ Error(args ...any)
+ Errorf(format string, args ...any)
+ Fail()
+ FailNow()
+ Failed() bool
+ Fatal(args ...any)
+ Fatalf(format string, args ...any)
+ Helper()
+ Log(args ...any)
+ Logf(format string, args ...any)
+ Name() string
+ Setenv(key, value string)
+ Skip(args ...any)
+ SkipNow()
+ Skipf(format string, args ...any)
+ Skipped() bool
+ TempDir() string
+ // contains filtered or unexported methods
+}</pre> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="fstest/index">fstest</a> </td> <td class="pkg-synopsis"> Package fstest implements support for testing implementations and users of file systems. </td> </tr> <tr> <td class="pkg-name"> <a href="iotest/index">iotest</a> </td> <td class="pkg-synopsis"> Package iotest implements Readers and Writers useful mainly for testing. </td> </tr> <tr> <td class="pkg-name"> <a href="quick/index">quick</a> </td> <td class="pkg-synopsis"> Package quick implements utility functions to help with black box testing. </td> </tr> <tr> <td class="pkg-name"> <a href="slogtest/index">slogtest</a> </td> <td class="pkg-synopsis"> Package slogtest implements support for testing implementations of log/slog.Handler. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/testing/" class="_attribution-link">http://golang.org/pkg/testing/</a>
+ </p>
+</div>
diff --git a/devdocs/go/testing%2Fiotest%2Findex.html b/devdocs/go/testing%2Fiotest%2Findex.html
new file mode 100644
index 00000000..353a62e9
--- /dev/null
+++ b/devdocs/go/testing%2Fiotest%2Findex.html
@@ -0,0 +1,39 @@
+<h1> Package iotest </h1> <ul id="short-nav">
+<li><code>import "testing/iotest"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package iotest implements Readers and Writers useful mainly for testing. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#DataErrReader">func DataErrReader(r io.Reader) io.Reader</a></li>
+<li><a href="#ErrReader">func ErrReader(err error) io.Reader</a></li>
+<li><a href="#HalfReader">func HalfReader(r io.Reader) io.Reader</a></li>
+<li><a href="#NewReadLogger">func NewReadLogger(prefix string, r io.Reader) io.Reader</a></li>
+<li><a href="#NewWriteLogger">func NewWriteLogger(prefix string, w io.Writer) io.Writer</a></li>
+<li><a href="#OneByteReader">func OneByteReader(r io.Reader) io.Reader</a></li>
+<li><a href="#TestReader">func TestReader(r io.Reader, content []byte) error</a></li>
+<li><a href="#TimeoutReader">func TimeoutReader(r io.Reader) io.Reader</a></li>
+<li><a href="#TruncateWriter">func TruncateWriter(w io.Writer, n int64) io.Writer</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_ErrReader">ErrReader</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>logger.go</span> <span>reader.go</span> <span>writer.go</span> </p> <h2 id="pkg-variables">Variables</h2> <p>ErrTimeout is a fake timeout error. </p>
+<pre data-language="go">var ErrTimeout = errors.New("timeout")</pre> <h2 id="DataErrReader">func <span>DataErrReader</span> </h2> <pre data-language="go">func DataErrReader(r io.Reader) io.Reader</pre> <p>DataErrReader changes the way errors are handled by a Reader. Normally, a Reader returns an error (typically EOF) from the first Read call after the last piece of data is read. DataErrReader wraps a Reader and changes its behavior so the final error is returned along with the final data, instead of in the first call after the final data. </p>
+<h2 id="ErrReader">func <span>ErrReader</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func ErrReader(err error) io.Reader</pre> <p>ErrReader returns an <span>io.Reader</span> that returns 0, err from all Read calls. </p> <h4 id="example_ErrReader"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// A reader that always returns a custom error.
+r := iotest.ErrReader(errors.New("custom error"))
+n, err := r.Read(nil)
+fmt.Printf("n: %d\nerr: %q\n", n, err)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">n: 0
+err: "custom error"
+</pre> <h2 id="HalfReader">func <span>HalfReader</span> </h2> <pre data-language="go">func HalfReader(r io.Reader) io.Reader</pre> <p>HalfReader returns a Reader that implements Read by reading half as many requested bytes from r. </p>
+<h2 id="NewReadLogger">func <span>NewReadLogger</span> </h2> <pre data-language="go">func NewReadLogger(prefix string, r io.Reader) io.Reader</pre> <p>NewReadLogger returns a reader that behaves like r except that it logs (using <span>log.Printf</span>) each read to standard error, printing the prefix and the hexadecimal data read. </p>
+<h2 id="NewWriteLogger">func <span>NewWriteLogger</span> </h2> <pre data-language="go">func NewWriteLogger(prefix string, w io.Writer) io.Writer</pre> <p>NewWriteLogger returns a writer that behaves like w except that it logs (using <span>log.Printf</span>) each write to standard error, printing the prefix and the hexadecimal data written. </p>
+<h2 id="OneByteReader">func <span>OneByteReader</span> </h2> <pre data-language="go">func OneByteReader(r io.Reader) io.Reader</pre> <p>OneByteReader returns a Reader that implements each non-empty Read by reading one byte from r. </p>
+<h2 id="TestReader">func <span>TestReader</span> <span title="Added in Go 1.16">1.16</span> </h2> <pre data-language="go">func TestReader(r io.Reader, content []byte) error</pre> <p>TestReader tests that reading from r returns the expected file content. It does reads of different sizes, until EOF. If r implements <span>io.ReaderAt</span> or <span>io.Seeker</span>, TestReader also checks that those operations behave as they should. </p>
+<p>If TestReader finds any misbehaviors, it returns an error reporting them. The error text may span multiple lines. </p>
+<h2 id="TimeoutReader">func <span>TimeoutReader</span> </h2> <pre data-language="go">func TimeoutReader(r io.Reader) io.Reader</pre> <p>TimeoutReader returns <a href="#ErrTimeout">ErrTimeout</a> on the second read with no data. Subsequent calls to read succeed. </p>
+<h2 id="TruncateWriter">func <span>TruncateWriter</span> </h2> <pre data-language="go">func TruncateWriter(w io.Writer, n int64) io.Writer</pre> <p>TruncateWriter returns a Writer that writes to w but stops silently after n bytes. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/testing/iotest/" class="_attribution-link">http://golang.org/pkg/testing/iotest/</a>
+ </p>
+</div>
diff --git a/devdocs/go/testing%2Fquick%2Findex.html b/devdocs/go/testing%2Fquick%2Findex.html
new file mode 100644
index 00000000..d7c9f316
--- /dev/null
+++ b/devdocs/go/testing%2Fquick%2Findex.html
@@ -0,0 +1,74 @@
+<h1> Package quick </h1> <ul id="short-nav">
+<li><code>import "testing/quick"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package quick implements utility functions to help with black box testing. </p>
+<p>The testing/quick package is frozen and is not accepting new features. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Check">func Check(f any, config *Config) error</a></li>
+<li><a href="#CheckEqual">func CheckEqual(f, g any, config *Config) error</a></li>
+<li><a href="#Value">func Value(t reflect.Type, rand *rand.Rand) (value reflect.Value, ok bool)</a></li>
+<li><a href="#CheckEqualError">type CheckEqualError</a></li>
+<li> <a href="#CheckEqualError.Error">func (s *CheckEqualError) Error() string</a>
+</li>
+<li><a href="#CheckError">type CheckError</a></li>
+<li> <a href="#CheckError.Error">func (s *CheckError) Error() string</a>
+</li>
+<li><a href="#Config">type Config</a></li>
+<li><a href="#Generator">type Generator</a></li>
+<li><a href="#SetupError">type SetupError</a></li>
+<li> <a href="#SetupError.Error">func (s SetupError) Error() string</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>quick.go</span> </p> <h2 id="Check">func <span>Check</span> </h2> <pre data-language="go">func Check(f any, config *Config) error</pre> <p>Check looks for an input to f, any function that returns bool, such that f returns false. It calls f repeatedly, with arbitrary values for each argument. If f returns false on a given input, Check returns that input as a *<a href="#CheckError">CheckError</a>. For example: </p>
+<pre data-language="go">func TestOddMultipleOfThree(t *testing.T) {
+ f := func(x int) bool {
+ y := OddMultipleOfThree(x)
+ return y%2 == 1 &amp;&amp; y%3 == 0
+ }
+ if err := quick.Check(f, nil); err != nil {
+ t.Error(err)
+ }
+}
+</pre> <h2 id="CheckEqual">func <span>CheckEqual</span> </h2> <pre data-language="go">func CheckEqual(f, g any, config *Config) error</pre> <p>CheckEqual looks for an input on which f and g return different results. It calls f and g repeatedly with arbitrary values for each argument. If f and g return different answers, CheckEqual returns a *<a href="#CheckEqualError">CheckEqualError</a> describing the input and the outputs. </p>
+<h2 id="Value">func <span>Value</span> </h2> <pre data-language="go">func Value(t reflect.Type, rand *rand.Rand) (value reflect.Value, ok bool)</pre> <p>Value returns an arbitrary value of the given type. If the type implements the <a href="#Generator">Generator</a> interface, that will be used. Note: To create arbitrary values for structs, all the fields must be exported. </p>
+<h2 id="CheckEqualError">type <span>CheckEqualError</span> </h2> <p>A CheckEqualError is the result <a href="#CheckEqual">CheckEqual</a> finding an error. </p>
+<pre data-language="go">type CheckEqualError struct {
+ CheckError
+ Out1 []any
+ Out2 []any
+}
+</pre> <h3 id="CheckEqualError.Error">func (*CheckEqualError) <span>Error</span> </h3> <pre data-language="go">func (s *CheckEqualError) Error() string</pre> <h2 id="CheckError">type <span>CheckError</span> </h2> <p>A CheckError is the result of Check finding an error. </p>
+<pre data-language="go">type CheckError struct {
+ Count int
+ In []any
+}
+</pre> <h3 id="CheckError.Error">func (*CheckError) <span>Error</span> </h3> <pre data-language="go">func (s *CheckError) Error() string</pre> <h2 id="Config">type <span>Config</span> </h2> <p>A Config structure contains options for running a test. </p>
+<pre data-language="go">type Config struct {
+ // MaxCount sets the maximum number of iterations.
+ // If zero, MaxCountScale is used.
+ MaxCount int
+ // MaxCountScale is a non-negative scale factor applied to the
+ // default maximum.
+ // A count of zero implies the default, which is usually 100
+ // but can be set by the -quickchecks flag.
+ MaxCountScale float64
+ // Rand specifies a source of random numbers.
+ // If nil, a default pseudo-random source will be used.
+ Rand *rand.Rand
+ // Values specifies a function to generate a slice of
+ // arbitrary reflect.Values that are congruent with the
+ // arguments to the function being tested.
+ // If nil, the top-level Value function is used to generate them.
+ Values func([]reflect.Value, *rand.Rand)
+}
+</pre> <h2 id="Generator">type <span>Generator</span> </h2> <p>A Generator can generate random values of its own type. </p>
+<pre data-language="go">type Generator interface {
+ // Generate returns a random instance of the type on which it is a
+ // method using the size as a size hint.
+ Generate(rand *rand.Rand, size int) reflect.Value
+}</pre> <h2 id="SetupError">type <span>SetupError</span> </h2> <p>A SetupError is the result of an error in the way that check is being used, independent of the functions being tested. </p>
+<pre data-language="go">type SetupError string</pre> <h3 id="SetupError.Error">func (SetupError) <span>Error</span> </h3> <pre data-language="go">func (s SetupError) Error() string</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/testing/quick/" class="_attribution-link">http://golang.org/pkg/testing/quick/</a>
+ </p>
+</div>
diff --git a/devdocs/go/testing%2Fslogtest%2Findex.html b/devdocs/go/testing%2Fslogtest%2Findex.html
new file mode 100644
index 00000000..ee6e7213
--- /dev/null
+++ b/devdocs/go/testing%2Fslogtest%2Findex.html
@@ -0,0 +1,42 @@
+<h1> Package slogtest </h1> <ul id="short-nav">
+<li><code>import "testing/slogtest"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package slogtest implements support for testing implementations of log/slog.Handler. </p> <h4 id="example__parsing"> <span class="text">Example (Parsing)</span>
+</h4> <p>This example demonstrates one technique for testing a handler with this package. The handler is given a [bytes.Buffer] to write to, and each line of the resulting output is parsed. For JSON output, [encoding/json.Unmarshal] produces a result in the desired format when given a pointer to a map[string]any. </p> <p>Code:</p> <pre class="code" data-language="go">var buf bytes.Buffer
+h := slog.NewJSONHandler(&amp;buf, nil)
+
+results := func() []map[string]any {
+ var ms []map[string]any
+ for _, line := range bytes.Split(buf.Bytes(), []byte{'\n'}) {
+ if len(line) == 0 {
+ continue
+ }
+ var m map[string]any
+ if err := json.Unmarshal(line, &amp;m); err != nil {
+ panic(err) // In a real test, use t.Fatal.
+ }
+ ms = append(ms, m)
+ }
+ return ms
+}
+err := slogtest.TestHandler(h, results)
+if err != nil {
+ log.Fatal(err)
+}
+
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Run">func Run(t *testing.T, newHandler func(*testing.T) slog.Handler, result func(*testing.T) map[string]any)</a></li>
+<li><a href="#TestHandler">func TestHandler(h slog.Handler, results func() []map[string]any) error</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example__parsing">Package (Parsing)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>slogtest.go</span> </p> <h2 id="Run">func <span>Run</span> <span title="Added in Go 1.22">1.22</span> </h2> <pre data-language="go">func Run(t *testing.T, newHandler func(*testing.T) slog.Handler, result func(*testing.T) map[string]any)</pre> <p>Run exercises a <span>slog.Handler</span> on the same test cases as <a href="#TestHandler">TestHandler</a>, but runs each case in a subtest. For each test case, it first calls newHandler to get an instance of the handler under test, then runs the test case, then calls result to get the result. If the test case fails, it calls t.Error. </p>
+<h2 id="TestHandler">func <span>TestHandler</span> <span title="Added in Go 1.21">1.21</span> </h2> <pre data-language="go">func TestHandler(h slog.Handler, results func() []map[string]any) error</pre> <p>TestHandler tests a <span>slog.Handler</span>. If TestHandler finds any misbehaviors, it returns an error for each, combined into a single error with <span>errors.Join</span>. </p>
+<p>TestHandler installs the given Handler in a <span>slog.Logger</span> and makes several calls to the Logger's output methods. The Handler should be enabled for levels Info and above. </p>
+<p>The results function is invoked after all such calls. It should return a slice of map[string]any, one for each call to a Logger output method. The keys and values of the map should correspond to the keys and values of the Handler's output. Each group in the output should be represented as its own nested map[string]any. The standard keys <span>slog.TimeKey</span>, <span>slog.LevelKey</span> and <span>slog.MessageKey</span> should be used. </p>
+<p>If the Handler outputs JSON, then calling <span>encoding/json.Unmarshal</span> with a `map[string]any` will create the right data structure. </p>
+<p>If a Handler intentionally drops an attribute that is checked by a test, then the results function should check for its absence and add it to the map it returns. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/testing/slogtest/" class="_attribution-link">http://golang.org/pkg/testing/slogtest/</a>
+ </p>
+</div>
diff --git a/devdocs/go/text%2Fscanner%2Findex.html b/devdocs/go/text%2Fscanner%2Findex.html
new file mode 100644
index 00000000..b3592dee
--- /dev/null
+++ b/devdocs/go/text%2Fscanner%2Findex.html
@@ -0,0 +1,226 @@
+<h1> Package scanner </h1> <ul id="short-nav">
+<li><code>import "text/scanner"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package scanner provides a scanner and tokenizer for UTF-8-encoded text. It takes an io.Reader providing the source, which then can be tokenized through repeated calls to the Scan function. For compatibility with existing tools, the NUL character is not allowed. If the first character in the source is a UTF-8 encoded byte order mark (BOM), it is discarded. </p>
+<p>By default, a Scanner skips white space and Go comments and recognizes all literals as defined by the Go language specification. It may be customized to recognize only a subset of those literals and to recognize different identifier and white space characters. </p> <h4 id="example_"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const src = `
+// This is scanned code.
+if a &gt; 10 {
+ someParsable = text
+}`
+
+var s scanner.Scanner
+s.Init(strings.NewReader(src))
+s.Filename = "example"
+for tok := s.Scan(); tok != scanner.EOF; tok = s.Scan() {
+ fmt.Printf("%s: %s\n", s.Position, s.TokenText())
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">example:3:1: if
+example:3:4: a
+example:3:6: &gt;
+example:3:8: 10
+example:3:11: {
+example:4:2: someParsable
+example:4:15: =
+example:4:17: text
+example:5:1: }
+</pre> <h4 id="example__isIdentRune"> <span class="text">Example (IsIdentRune)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const src = "%var1 var2%"
+
+var s scanner.Scanner
+s.Init(strings.NewReader(src))
+s.Filename = "default"
+
+for tok := s.Scan(); tok != scanner.EOF; tok = s.Scan() {
+ fmt.Printf("%s: %s\n", s.Position, s.TokenText())
+}
+
+fmt.Println()
+s.Init(strings.NewReader(src))
+s.Filename = "percent"
+
+// treat leading '%' as part of an identifier
+s.IsIdentRune = func(ch rune, i int) bool {
+ return ch == '%' &amp;&amp; i == 0 || unicode.IsLetter(ch) || unicode.IsDigit(ch) &amp;&amp; i &gt; 0
+}
+
+for tok := s.Scan(); tok != scanner.EOF; tok = s.Scan() {
+ fmt.Printf("%s: %s\n", s.Position, s.TokenText())
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">default:1:1: %
+default:1:2: var1
+default:1:7: var2
+default:1:11: %
+
+percent:1:1: %var1
+percent:1:7: var2
+percent:1:11: %
+</pre> <h4 id="example__mode"> <span class="text">Example (Mode)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const src = `
+ // Comment begins at column 5.
+
+This line should not be included in the output.
+
+/*
+This multiline comment
+should be extracted in
+its entirety.
+*/
+`
+
+var s scanner.Scanner
+s.Init(strings.NewReader(src))
+s.Filename = "comments"
+s.Mode ^= scanner.SkipComments // don't skip comments
+
+for tok := s.Scan(); tok != scanner.EOF; tok = s.Scan() {
+ txt := s.TokenText()
+ if strings.HasPrefix(txt, "//") || strings.HasPrefix(txt, "/*") {
+ fmt.Printf("%s: %s\n", s.Position, txt)
+ }
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">comments:2:5: // Comment begins at column 5.
+comments:6:1: /*
+This multiline comment
+should be extracted in
+its entirety.
+*/
+</pre> <h4 id="example__whitespace"> <span class="text">Example (Whitespace)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// tab-separated values
+const src = `aa ab ac ad
+ba bb bc bd
+ca cb cc cd
+da db dc dd`
+
+var (
+ col, row int
+ s scanner.Scanner
+ tsv [4][4]string // large enough for example above
+)
+s.Init(strings.NewReader(src))
+s.Whitespace ^= 1&lt;&lt;'\t' | 1&lt;&lt;'\n' // don't skip tabs and new lines
+
+for tok := s.Scan(); tok != scanner.EOF; tok = s.Scan() {
+ switch tok {
+ case '\n':
+ row++
+ col = 0
+ case '\t':
+ col++
+ default:
+ tsv[row][col] = s.TokenText()
+ }
+}
+
+fmt.Print(tsv)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">[[aa ab ac ad] [ba bb bc bd] [ca cb cc cd] [da db dc dd]]
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#TokenString">func TokenString(tok rune) string</a></li>
+<li><a href="#Position">type Position</a></li>
+<li> <a href="#Position.IsValid">func (pos *Position) IsValid() bool</a>
+</li>
+<li> <a href="#Position.String">func (pos Position) String() string</a>
+</li>
+<li><a href="#Scanner">type Scanner</a></li>
+<li> <a href="#Scanner.Init">func (s *Scanner) Init(src io.Reader) *Scanner</a>
+</li>
+<li> <a href="#Scanner.Next">func (s *Scanner) Next() rune</a>
+</li>
+<li> <a href="#Scanner.Peek">func (s *Scanner) Peek() rune</a>
+</li>
+<li> <a href="#Scanner.Pos">func (s *Scanner) Pos() (pos Position)</a>
+</li>
+<li> <a href="#Scanner.Scan">func (s *Scanner) Scan() rune</a>
+</li>
+<li> <a href="#Scanner.TokenText">func (s *Scanner) TokenText() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_">Package</a></dd> <dd><a class="exampleLink" href="#example__isIdentRune">Package (IsIdentRune)</a></dd> <dd><a class="exampleLink" href="#example__mode">Package (Mode)</a></dd> <dd><a class="exampleLink" href="#example__whitespace">Package (Whitespace)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>scanner.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Predefined mode bits to control recognition of tokens. For instance, to configure a Scanner such that it only recognizes (Go) identifiers, integers, and skips comments, set the Scanner's Mode field to: </p>
+<pre data-language="go">ScanIdents | ScanInts | SkipComments
+</pre> <p>With the exceptions of comments, which are skipped if SkipComments is set, unrecognized tokens are not ignored. Instead, the scanner simply returns the respective individual characters (or possibly sub-tokens). For instance, if the mode is ScanIdents (not ScanStrings), the string "foo" is scanned as the token sequence '"' Ident '"'. </p>
+<p>Use GoTokens to configure the Scanner such that it accepts all Go literal tokens including Go identifiers. Comments will be skipped. </p>
+<pre data-language="go">const (
+ ScanIdents = 1 &lt;&lt; -Ident
+ ScanInts = 1 &lt;&lt; -Int
+ ScanFloats = 1 &lt;&lt; -Float // includes Ints and hexadecimal floats
+ ScanChars = 1 &lt;&lt; -Char
+ ScanStrings = 1 &lt;&lt; -String
+ ScanRawStrings = 1 &lt;&lt; -RawString
+ ScanComments = 1 &lt;&lt; -Comment
+ SkipComments = 1 &lt;&lt; -skipComment // if set with ScanComments, comments become white space
+ GoTokens = ScanIdents | ScanFloats | ScanChars | ScanStrings | ScanRawStrings | ScanComments | SkipComments
+)</pre> <p>The result of Scan is one of these tokens or a Unicode character. </p>
+<pre data-language="go">const (
+ EOF = -(iota + 1)
+ Ident
+ Int
+ Float
+ Char
+ String
+ RawString
+ Comment
+)</pre> <p>GoWhitespace is the default value for the Scanner's Whitespace field. Its value selects Go's white space characters. </p>
+<pre data-language="go">const GoWhitespace = 1&lt;&lt;'\t' | 1&lt;&lt;'\n' | 1&lt;&lt;'\r' | 1&lt;&lt;' '</pre> <h2 id="TokenString">func <span>TokenString</span> </h2> <pre data-language="go">func TokenString(tok rune) string</pre> <p>TokenString returns a printable string for a token or Unicode character. </p>
+<h2 id="Position">type <span>Position</span> </h2> <p>Position is a value that represents a source position. A position is valid if Line &gt; 0. </p>
+<pre data-language="go">type Position struct {
+ Filename string // filename, if any
+ Offset int // byte offset, starting at 0
+ Line int // line number, starting at 1
+ Column int // column number, starting at 1 (character count per line)
+}
+</pre> <h3 id="Position.IsValid">func (*Position) <span>IsValid</span> </h3> <pre data-language="go">func (pos *Position) IsValid() bool</pre> <p>IsValid reports whether the position is valid. </p>
+<h3 id="Position.String">func (Position) <span>String</span> </h3> <pre data-language="go">func (pos Position) String() string</pre> <h2 id="Scanner">type <span>Scanner</span> </h2> <p>A Scanner implements reading of Unicode characters and tokens from an io.Reader. </p>
+<pre data-language="go">type Scanner struct {
+
+ // Error is called for each error encountered. If no Error
+ // function is set, the error is reported to os.Stderr.
+ Error func(s *Scanner, msg string)
+
+ // ErrorCount is incremented by one for each error encountered.
+ ErrorCount int
+
+ // The Mode field controls which tokens are recognized. For instance,
+ // to recognize Ints, set the ScanInts bit in Mode. The field may be
+ // changed at any time.
+ Mode uint
+
+ // The Whitespace field controls which characters are recognized
+ // as white space. To recognize a character ch &lt;= ' ' as white space,
+ // set the ch'th bit in Whitespace (the Scanner's behavior is undefined
+ // for values ch &gt; ' '). The field may be changed at any time.
+ Whitespace uint64
+
+ // IsIdentRune is a predicate controlling the characters accepted
+ // as the ith rune in an identifier. The set of valid characters
+ // must not intersect with the set of white space characters.
+ // If no IsIdentRune function is set, regular Go identifiers are
+ // accepted instead. The field may be changed at any time.
+ IsIdentRune func(ch rune, i int) bool // Go 1.4
+
+ // Start position of most recently scanned token; set by Scan.
+ // Calling Init or Next invalidates the position (Line == 0).
+ // The Filename field is always left untouched by the Scanner.
+ // If an error is reported (via Error) and Position is invalid,
+ // the scanner is not inside a token. Call Pos to obtain an error
+ // position in that case, or to obtain the position immediately
+ // after the most recently scanned token.
+ Position
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Scanner.Init">func (*Scanner) <span>Init</span> </h3> <pre data-language="go">func (s *Scanner) Init(src io.Reader) *Scanner</pre> <p>Init initializes a Scanner with a new source and returns s. Error is set to nil, ErrorCount is set to 0, Mode is set to GoTokens, and Whitespace is set to GoWhitespace. </p>
+<h3 id="Scanner.Next">func (*Scanner) <span>Next</span> </h3> <pre data-language="go">func (s *Scanner) Next() rune</pre> <p>Next reads and returns the next Unicode character. It returns EOF at the end of the source. It reports a read error by calling s.Error, if not nil; otherwise it prints an error message to os.Stderr. Next does not update the Scanner's Position field; use Pos() to get the current position. </p>
+<h3 id="Scanner.Peek">func (*Scanner) <span>Peek</span> </h3> <pre data-language="go">func (s *Scanner) Peek() rune</pre> <p>Peek returns the next Unicode character in the source without advancing the scanner. It returns EOF if the scanner's position is at the last character of the source. </p>
+<h3 id="Scanner.Pos">func (*Scanner) <span>Pos</span> </h3> <pre data-language="go">func (s *Scanner) Pos() (pos Position)</pre> <p>Pos returns the position of the character immediately after the character or token returned by the last call to Next or Scan. Use the Scanner's Position field for the start position of the most recently scanned token. </p>
+<h3 id="Scanner.Scan">func (*Scanner) <span>Scan</span> </h3> <pre data-language="go">func (s *Scanner) Scan() rune</pre> <p>Scan reads the next token or Unicode character from source and returns it. It only recognizes tokens t for which the respective Mode bit (1&lt;&lt;-t) is set. It returns EOF at the end of the source. It reports scanner errors (read and token errors) by calling s.Error, if not nil; otherwise it prints an error message to os.Stderr. </p>
+<h3 id="Scanner.TokenText">func (*Scanner) <span>TokenText</span> </h3> <pre data-language="go">func (s *Scanner) TokenText() string</pre> <p>TokenText returns the string corresponding to the most recently scanned token. Valid after calling Scan and in calls of Scanner.Error. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/text/scanner/" class="_attribution-link">http://golang.org/pkg/text/scanner/</a>
+ </p>
+</div>
diff --git a/devdocs/go/text%2Ftabwriter%2Findex.html b/devdocs/go/text%2Ftabwriter%2Findex.html
new file mode 100644
index 00000000..e1582929
--- /dev/null
+++ b/devdocs/go/text%2Ftabwriter%2Findex.html
@@ -0,0 +1,134 @@
+<h1> Package tabwriter </h1> <ul id="short-nav">
+<li><code>import "text/tabwriter"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package tabwriter implements a write filter (tabwriter.Writer) that translates tabbed columns in input into properly aligned text. </p>
+<p>The package is using the Elastic Tabstops algorithm described at <a href="http://nickgravgaard.com/elastictabstops/index.html">http://nickgravgaard.com/elastictabstops/index.html</a>. </p>
+<p>The text/tabwriter package is frozen and is not accepting new features. </p> <h4 id="example__elastic"> <span class="text">Example (Elastic)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Observe how the b's and the d's, despite appearing in the
+// second cell of each line, belong to different columns.
+w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, '.', tabwriter.AlignRight|tabwriter.Debug)
+fmt.Fprintln(w, "a\tb\tc")
+fmt.Fprintln(w, "aa\tbb\tcc")
+fmt.Fprintln(w, "aaa\t") // trailing tab
+fmt.Fprintln(w, "aaaa\tdddd\teeee")
+w.Flush()
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">....a|..b|c
+...aa|.bb|cc
+..aaa|
+.aaaa|.dddd|eeee
+</pre> <h4 id="example__trailingTab"> <span class="text">Example (TrailingTab)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Observe that the third line has no trailing tab,
+// so its final cell is not part of an aligned column.
+const padding = 3
+w := tabwriter.NewWriter(os.Stdout, 0, 0, padding, '-', tabwriter.AlignRight|tabwriter.Debug)
+fmt.Fprintln(w, "a\tb\taligned\t")
+fmt.Fprintln(w, "aa\tbb\taligned\t")
+fmt.Fprintln(w, "aaa\tbbb\tunaligned") // no trailing tab
+fmt.Fprintln(w, "aaaa\tbbbb\taligned\t")
+w.Flush()
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">------a|------b|---aligned|
+-----aa|-----bb|---aligned|
+----aaa|----bbb|unaligned
+---aaaa|---bbbb|---aligned|
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#NewWriter">func NewWriter(output io.Writer, minwidth, tabwidth, padding int, padchar byte, flags uint) *Writer</a>
+</li>
+<li> <a href="#Writer.Flush">func (b *Writer) Flush() error</a>
+</li>
+<li> <a href="#Writer.Init">func (b *Writer) Init(output io.Writer, minwidth, tabwidth, padding int, padchar byte, flags uint) *Writer</a>
+</li>
+<li> <a href="#Writer.Write">func (b *Writer) Write(buf []byte) (n int, err error)</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Writer_Init">Writer.Init</a></dd> <dd><a class="exampleLink" href="#example__elastic">Package (Elastic)</a></dd> <dd><a class="exampleLink" href="#example__trailingTab">Package (TrailingTab)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>tabwriter.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Formatting can be controlled with these flags. </p>
+<pre data-language="go">const (
+ // Ignore html tags and treat entities (starting with '&amp;'
+ // and ending in ';') as single characters (width = 1).
+ FilterHTML uint = 1 &lt;&lt; iota
+
+ // Strip Escape characters bracketing escaped text segments
+ // instead of passing them through unchanged with the text.
+ StripEscape
+
+ // Force right-alignment of cell content.
+ // Default is left-alignment.
+ AlignRight
+
+ // Handle empty columns as if they were not present in
+ // the input in the first place.
+ DiscardEmptyColumns
+
+ // Always use tabs for indentation columns (i.e., padding of
+ // leading empty cells on the left) independent of padchar.
+ TabIndent
+
+ // Print a vertical bar ('|') between columns (after formatting).
+ // Discarded columns appear as zero-width columns ("||").
+ Debug
+)</pre> <p>To escape a text segment, bracket it with Escape characters. For instance, the tab in this string "Ignore this tab: \xff\t\xff" does not terminate a cell and constitutes a single character of width one for formatting purposes. </p>
+<p>The value 0xff was chosen because it cannot appear in a valid UTF-8 sequence. </p>
+<pre data-language="go">const Escape = '\xff'</pre> <h2 id="Writer">type <span>Writer</span> </h2> <p>A Writer is a filter that inserts padding around tab-delimited columns in its input to align them in the output. </p>
+<p>The Writer treats incoming bytes as UTF-8-encoded text consisting of cells terminated by horizontal ('\t') or vertical ('\v') tabs, and newline ('\n') or formfeed ('\f') characters; both newline and formfeed act as line breaks. </p>
+<p>Tab-terminated cells in contiguous lines constitute a column. The Writer inserts padding as needed to make all cells in a column have the same width, effectively aligning the columns. It assumes that all characters have the same width, except for tabs for which a tabwidth must be specified. Column cells must be tab-terminated, not tab-separated: non-tab terminated trailing text at the end of a line forms a cell but that cell is not part of an aligned column. For instance, in this example (where | stands for a horizontal tab): </p>
+<pre data-language="go">aaaa|bbb|d
+aa |b |dd
+a |
+aa |cccc|eee
+</pre> <p>the b and c are in distinct columns (the b column is not contiguous all the way). The d and e are not in a column at all (there's no terminating tab, nor would the column be contiguous). </p>
+<p>The Writer assumes that all Unicode code points have the same width; this may not be true in some fonts or if the string contains combining characters. </p>
+<p>If DiscardEmptyColumns is set, empty columns that are terminated entirely by vertical (or "soft") tabs are discarded. Columns terminated by horizontal (or "hard") tabs are not affected by this flag. </p>
+<p>If a Writer is configured to filter HTML, HTML tags and entities are passed through. The widths of tags and entities are assumed to be zero (tags) and one (entities) for formatting purposes. </p>
+<p>A segment of text may be escaped by bracketing it with Escape characters. The tabwriter passes escaped text segments through unchanged. In particular, it does not interpret any tabs or line breaks within the segment. If the StripEscape flag is set, the Escape characters are stripped from the output; otherwise they are passed through as well. For the purpose of formatting, the width of the escaped text is always computed excluding the Escape characters. </p>
+<p>The formfeed character acts like a newline but it also terminates all columns in the current line (effectively calling Flush). Tab- terminated cells in the next line start new columns. Unless found inside an HTML tag or inside an escaped text segment, formfeed characters appear as newlines in the output. </p>
+<p>The Writer must buffer input internally, because proper spacing of one line may depend on the cells in future lines. Clients must call Flush when done calling Write. </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewWriter">func <span>NewWriter</span> </h3> <pre data-language="go">func NewWriter(output io.Writer, minwidth, tabwidth, padding int, padchar byte, flags uint) *Writer</pre> <p>NewWriter allocates and initializes a new tabwriter.Writer. The parameters are the same as for the Init function. </p>
+<h3 id="Writer.Flush">func (*Writer) <span>Flush</span> </h3> <pre data-language="go">func (b *Writer) Flush() error</pre> <p>Flush should be called after the last call to Write to ensure that any data buffered in the Writer is written to output. Any incomplete escape sequence at the end is considered complete for formatting purposes. </p>
+<h3 id="Writer.Init">func (*Writer) <span>Init</span> </h3> <pre data-language="go">func (b *Writer) Init(output io.Writer, minwidth, tabwidth, padding int, padchar byte, flags uint) *Writer</pre> <p>A Writer must be initialized with a call to Init. The first parameter (output) specifies the filter output. The remaining parameters control the formatting: </p>
+<pre data-language="go">minwidth minimal cell width including any padding
+tabwidth width of tab characters (equivalent number of spaces)
+padding padding added to a cell before computing its width
+padchar ASCII char used for padding
+ if padchar == '\t', the Writer will assume that the
+ width of a '\t' in the formatted output is tabwidth,
+ and cells are left-aligned independent of align_left
+ (for correct-looking results, tabwidth must correspond
+ to the tab width in the viewer displaying the result)
+flags formatting control
+</pre> <h4 id="example_Writer_Init"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">w := new(tabwriter.Writer)
+
+// Format in tab-separated columns with a tab stop of 8.
+w.Init(os.Stdout, 0, 8, 0, '\t', 0)
+fmt.Fprintln(w, "a\tb\tc\td\t.")
+fmt.Fprintln(w, "123\t12345\t1234567\t123456789\t.")
+fmt.Fprintln(w)
+w.Flush()
+
+// Format right-aligned in space-separated columns of minimal width 5
+// and at least one blank of padding (so wider column entries do not
+// touch each other).
+w.Init(os.Stdout, 5, 0, 1, ' ', tabwriter.AlignRight)
+fmt.Fprintln(w, "a\tb\tc\td\t.")
+fmt.Fprintln(w, "123\t12345\t1234567\t123456789\t.")
+fmt.Fprintln(w)
+w.Flush()
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">a b c d .
+123 12345 1234567 123456789 .
+
+ a b c d.
+ 123 12345 1234567 123456789.
+</pre> <h3 id="Writer.Write">func (*Writer) <span>Write</span> </h3> <pre data-language="go">func (b *Writer) Write(buf []byte) (n int, err error)</pre> <p>Write writes buf to the writer b. The only errors returned are ones encountered while writing to the underlying output stream. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/text/tabwriter/" class="_attribution-link">http://golang.org/pkg/text/tabwriter/</a>
+ </p>
+</div>
diff --git a/devdocs/go/text%2Ftemplate%2Findex.html b/devdocs/go/text%2Ftemplate%2Findex.html
new file mode 100644
index 00000000..662ae149
--- /dev/null
+++ b/devdocs/go/text%2Ftemplate%2Findex.html
@@ -0,0 +1,640 @@
+<h1> Package template </h1> <ul id="short-nav">
+<li><code>import "text/template"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package template implements data-driven templates for generating textual output. </p>
+<p>To generate HTML output, see <span>html/template</span>, which has the same interface as this package but automatically secures HTML output against certain attacks. </p>
+<p>Templates are executed by applying them to a data structure. Annotations in the template refer to elements of the data structure (typically a field of a struct or a key in a map) to control execution and derive values to be displayed. Execution of the template walks the structure and sets the cursor, represented by a period '.' and called "dot", to the value at the current location in the structure as execution proceeds. </p>
+<p>The input text for a template is UTF-8-encoded text in any format. "Actions"--data evaluations or control structures--are delimited by "{{" and "}}"; all text outside actions is copied to the output unchanged. </p>
+<p>Once parsed, a template may be executed safely in parallel, although if parallel executions share a Writer the output may be interleaved. </p>
+<p>Here is a trivial example that prints "17 items are made of wool". </p>
+<pre data-language="go">type Inventory struct {
+ Material string
+ Count uint
+}
+sweaters := Inventory{"wool", 17}
+tmpl, err := template.New("test").Parse("{{.Count}} items are made of {{.Material}}")
+if err != nil { panic(err) }
+err = tmpl.Execute(os.Stdout, sweaters)
+if err != nil { panic(err) }
+</pre> <p>More intricate examples appear below. </p>
+<h3 id="hdr-Text_and_spaces">Text and spaces</h3> <p>By default, all text between actions is copied verbatim when the template is executed. For example, the string " items are made of " in the example above appears on standard output when the program is run. </p>
+<p>However, to aid in formatting template source code, if an action's left delimiter (by default "{{") is followed immediately by a minus sign and white space, all trailing white space is trimmed from the immediately preceding text. Similarly, if the right delimiter ("}}") is preceded by white space and a minus sign, all leading white space is trimmed from the immediately following text. In these trim markers, the white space must be present: "{{- 3}}" is like "{{3}}" but trims the immediately preceding text, while "{{-3}}" parses as an action containing the number -3. </p>
+<p>For instance, when executing the template whose source is </p>
+<pre data-language="go">"{{23 -}} &lt; {{- 45}}"
+</pre> <p>the generated output would be </p>
+<pre data-language="go">"23&lt;45"
+</pre> <p>For this trimming, the definition of white space characters is the same as in Go: space, horizontal tab, carriage return, and newline. </p>
+<h3 id="hdr-Actions">Actions</h3> <p>Here is the list of actions. "Arguments" and "pipelines" are evaluations of data, defined in detail in the corresponding sections that follow. </p>
+<pre data-language="go">{{/* a comment */}}
+{{- /* a comment with white space trimmed from preceding and following text */ -}}
+ A comment; discarded. May contain newlines.
+ Comments do not nest and must start and end at the
+ delimiters, as shown here.
+
+{{pipeline}}
+ The default textual representation (the same as would be
+ printed by fmt.Print) of the value of the pipeline is copied
+ to the output.
+
+{{if pipeline}} T1 {{end}}
+ If the value of the pipeline is empty, no output is generated;
+ otherwise, T1 is executed. The empty values are false, 0, any
+ nil pointer or interface value, and any array, slice, map, or
+ string of length zero.
+ Dot is unaffected.
+
+{{if pipeline}} T1 {{else}} T0 {{end}}
+ If the value of the pipeline is empty, T0 is executed;
+ otherwise, T1 is executed. Dot is unaffected.
+
+{{if pipeline}} T1 {{else if pipeline}} T0 {{end}}
+ To simplify the appearance of if-else chains, the else action
+ of an if may include another if directly; the effect is exactly
+ the same as writing
+ {{if pipeline}} T1 {{else}}{{if pipeline}} T0 {{end}}{{end}}
+
+{{range pipeline}} T1 {{end}}
+ The value of the pipeline must be an array, slice, map, or channel.
+ If the value of the pipeline has length zero, nothing is output;
+ otherwise, dot is set to the successive elements of the array,
+ slice, or map and T1 is executed. If the value is a map and the
+ keys are of basic type with a defined order, the elements will be
+ visited in sorted key order.
+
+{{range pipeline}} T1 {{else}} T0 {{end}}
+ The value of the pipeline must be an array, slice, map, or channel.
+ If the value of the pipeline has length zero, dot is unaffected and
+ T0 is executed; otherwise, dot is set to the successive elements
+ of the array, slice, or map and T1 is executed.
+
+{{break}}
+ The innermost {{range pipeline}} loop is ended early, stopping the
+ current iteration and bypassing all remaining iterations.
+
+{{continue}}
+ The current iteration of the innermost {{range pipeline}} loop is
+ stopped, and the loop starts the next iteration.
+
+{{template "name"}}
+ The template with the specified name is executed with nil data.
+
+{{template "name" pipeline}}
+ The template with the specified name is executed with dot set
+ to the value of the pipeline.
+
+{{block "name" pipeline}} T1 {{end}}
+ A block is shorthand for defining a template
+ {{define "name"}} T1 {{end}}
+ and then executing it in place
+ {{template "name" pipeline}}
+ The typical use is to define a set of root templates that are
+ then customized by redefining the block templates within.
+
+{{with pipeline}} T1 {{end}}
+ If the value of the pipeline is empty, no output is generated;
+ otherwise, dot is set to the value of the pipeline and T1 is
+ executed.
+
+{{with pipeline}} T1 {{else}} T0 {{end}}
+ If the value of the pipeline is empty, dot is unaffected and T0
+ is executed; otherwise, dot is set to the value of the pipeline
+ and T1 is executed.
+</pre> <h3 id="hdr-Arguments">Arguments</h3> <p>An argument is a simple value, denoted by one of the following. </p>
+<ul> <li>A boolean, string, character, integer, floating-point, imaginary or complex constant in Go syntax. These behave like Go's untyped constants. Note that, as in Go, whether a large integer constant overflows when assigned or passed to a function can depend on whether the host machine's ints are 32 or 64 bits. </li>
+<li>The keyword nil, representing an untyped Go nil. </li>
+<li>The character '.' (period): . The result is the value of dot. </li>
+<li>A variable name, which is a (possibly empty) alphanumeric string preceded by a dollar sign, such as $piOver2 or $ The result is the value of the variable. Variables are described below. </li>
+<li>The name of a field of the data, which must be a struct, preceded by a period, such as .Field The result is the value of the field. Field invocations may be chained: .Field1.Field2 Fields can also be evaluated on variables, including chaining: $x.Field1.Field2 </li>
+<li>The name of a key of the data, which must be a map, preceded by a period, such as .Key The result is the map element value indexed by the key. Key invocations may be chained and combined with fields to any depth: .Field1.Key1.Field2.Key2 Although the key must be an alphanumeric identifier, unlike with field names they do not need to start with an upper case letter. Keys can also be evaluated on variables, including chaining: $x.key1.key2 </li>
+<li>The name of a niladic method of the data, preceded by a period, such as .Method The result is the value of invoking the method with dot as the receiver, dot.Method(). Such a method must have one return value (of any type) or two return values, the second of which is an error. If it has two and the returned error is non-nil, execution terminates and an error is returned to the caller as the value of Execute. Method invocations may be chained and combined with fields and keys to any depth: .Field1.Key1.Method1.Field2.Key2.Method2 Methods can also be evaluated on variables, including chaining: $x.Method1.Field </li>
+<li>The name of a niladic function, such as fun The result is the value of invoking the function, fun(). The return types and values behave as in methods. Functions and function names are described below. </li>
+<li>A parenthesized instance of one the above, for grouping. The result may be accessed by a field or map key invocation. print (.F1 arg1) (.F2 arg2) (.StructValuedMethod "arg").Field </li>
+</ul> <p>Arguments may evaluate to any type; if they are pointers the implementation automatically indirects to the base type when required. If an evaluation yields a function value, such as a function-valued field of a struct, the function is not invoked automatically, but it can be used as a truth value for an if action and the like. To invoke it, use the call function, defined below. </p>
+<h3 id="hdr-Pipelines">Pipelines</h3> <p>A pipeline is a possibly chained sequence of "commands". A command is a simple value (argument) or a function or method call, possibly with multiple arguments: </p>
+<pre data-language="go">Argument
+ The result is the value of evaluating the argument.
+.Method [Argument...]
+ The method can be alone or the last element of a chain but,
+ unlike methods in the middle of a chain, it can take arguments.
+ The result is the value of calling the method with the
+ arguments:
+ dot.Method(Argument1, etc.)
+functionName [Argument...]
+ The result is the value of calling the function associated
+ with the name:
+ function(Argument1, etc.)
+ Functions and function names are described below.
+</pre> <p>A pipeline may be "chained" by separating a sequence of commands with pipeline characters '|'. In a chained pipeline, the result of each command is passed as the last argument of the following command. The output of the final command in the pipeline is the value of the pipeline. </p>
+<p>The output of a command will be either one value or two values, the second of which has type error. If that second value is present and evaluates to non-nil, execution terminates and the error is returned to the caller of Execute. </p>
+<h3 id="hdr-Variables">Variables</h3> <p>A pipeline inside an action may initialize a variable to capture the result. The initialization has syntax </p>
+<pre data-language="go">$variable := pipeline
+</pre> <p>where $variable is the name of the variable. An action that declares a variable produces no output. </p>
+<p>Variables previously declared can also be assigned, using the syntax </p>
+<pre data-language="go">$variable = pipeline
+</pre> <p>If a "range" action initializes a variable, the variable is set to the successive elements of the iteration. Also, a "range" may declare two variables, separated by a comma: </p>
+<pre data-language="go">range $index, $element := pipeline
+</pre> <p>in which case $index and $element are set to the successive values of the array/slice index or map key and element, respectively. Note that if there is only one variable, it is assigned the element; this is opposite to the convention in Go range clauses. </p>
+<p>A variable's scope extends to the "end" action of the control structure ("if", "with", or "range") in which it is declared, or to the end of the template if there is no such control structure. A template invocation does not inherit variables from the point of its invocation. </p>
+<p>When execution begins, $ is set to the data argument passed to Execute, that is, to the starting value of dot. </p>
+<h3 id="hdr-Examples">Examples</h3> <p>Here are some example one-line templates demonstrating pipelines and variables. All produce the quoted word "output": </p>
+<pre data-language="go">{{"\"output\""}}
+ A string constant.
+{{`"output"`}}
+ A raw string constant.
+{{printf "%q" "output"}}
+ A function call.
+{{"output" | printf "%q"}}
+ A function call whose final argument comes from the previous
+ command.
+{{printf "%q" (print "out" "put")}}
+ A parenthesized argument.
+{{"put" | printf "%s%s" "out" | printf "%q"}}
+ A more elaborate call.
+{{"output" | printf "%s" | printf "%q"}}
+ A longer chain.
+{{with "output"}}{{printf "%q" .}}{{end}}
+ A with action using dot.
+{{with $x := "output" | printf "%q"}}{{$x}}{{end}}
+ A with action that creates and uses a variable.
+{{with $x := "output"}}{{printf "%q" $x}}{{end}}
+ A with action that uses the variable in another action.
+{{with $x := "output"}}{{$x | printf "%q"}}{{end}}
+ The same, but pipelined.
+</pre> <h3 id="hdr-Functions">Functions</h3> <p>During execution functions are found in two function maps: first in the template, then in the global function map. By default, no functions are defined in the template but the Funcs method can be used to add them. </p>
+<p>Predefined global functions are named as follows. </p>
+<pre data-language="go">and
+ Returns the boolean AND of its arguments by returning the
+ first empty argument or the last argument. That is,
+ "and x y" behaves as "if x then y else x."
+ Evaluation proceeds through the arguments left to right
+ and returns when the result is determined.
+call
+ Returns the result of calling the first argument, which
+ must be a function, with the remaining arguments as parameters.
+ Thus "call .X.Y 1 2" is, in Go notation, dot.X.Y(1, 2) where
+ Y is a func-valued field, map entry, or the like.
+ The first argument must be the result of an evaluation
+ that yields a value of function type (as distinct from
+ a predefined function such as print). The function must
+ return either one or two result values, the second of which
+ is of type error. If the arguments don't match the function
+ or the returned error value is non-nil, execution stops.
+html
+ Returns the escaped HTML equivalent of the textual
+ representation of its arguments. This function is unavailable
+ in html/template, with a few exceptions.
+index
+ Returns the result of indexing its first argument by the
+ following arguments. Thus "index x 1 2 3" is, in Go syntax,
+ x[1][2][3]. Each indexed item must be a map, slice, or array.
+slice
+ slice returns the result of slicing its first argument by the
+ remaining arguments. Thus "slice x 1 2" is, in Go syntax, x[1:2],
+ while "slice x" is x[:], "slice x 1" is x[1:], and "slice x 1 2 3"
+ is x[1:2:3]. The first argument must be a string, slice, or array.
+js
+ Returns the escaped JavaScript equivalent of the textual
+ representation of its arguments.
+len
+ Returns the integer length of its argument.
+not
+ Returns the boolean negation of its single argument.
+or
+ Returns the boolean OR of its arguments by returning the
+ first non-empty argument or the last argument, that is,
+ "or x y" behaves as "if x then x else y".
+ Evaluation proceeds through the arguments left to right
+ and returns when the result is determined.
+print
+ An alias for fmt.Sprint
+printf
+ An alias for fmt.Sprintf
+println
+ An alias for fmt.Sprintln
+urlquery
+ Returns the escaped value of the textual representation of
+ its arguments in a form suitable for embedding in a URL query.
+ This function is unavailable in html/template, with a few
+ exceptions.
+</pre> <p>The boolean functions take any zero value to be false and a non-zero value to be true. </p>
+<p>There is also a set of binary comparison operators defined as functions: </p>
+<pre data-language="go">eq
+ Returns the boolean truth of arg1 == arg2
+ne
+ Returns the boolean truth of arg1 != arg2
+lt
+ Returns the boolean truth of arg1 &lt; arg2
+le
+ Returns the boolean truth of arg1 &lt;= arg2
+gt
+ Returns the boolean truth of arg1 &gt; arg2
+ge
+ Returns the boolean truth of arg1 &gt;= arg2
+</pre> <p>For simpler multi-way equality tests, eq (only) accepts two or more arguments and compares the second and subsequent to the first, returning in effect </p>
+<pre data-language="go">arg1==arg2 || arg1==arg3 || arg1==arg4 ...
+</pre> <p>(Unlike with || in Go, however, eq is a function call and all the arguments will be evaluated.) </p>
+<p>The comparison functions work on any values whose type Go defines as comparable. For basic types such as integers, the rules are relaxed: size and exact type are ignored, so any integer value, signed or unsigned, may be compared with any other integer value. (The arithmetic value is compared, not the bit pattern, so all negative integers are less than all unsigned integers.) However, as usual, one may not compare an int with a float32 and so on. </p>
+<h3 id="hdr-Associated_templates">Associated templates</h3> <p>Each template is named by a string specified when it is created. Also, each template is associated with zero or more other templates that it may invoke by name; such associations are transitive and form a name space of templates. </p>
+<p>A template may use a template invocation to instantiate another associated template; see the explanation of the "template" action above. The name must be that of a template associated with the template that contains the invocation. </p>
+<h3 id="hdr-Nested_template_definitions">Nested template definitions</h3> <p>When parsing a template, another template may be defined and associated with the template being parsed. Template definitions must appear at the top level of the template, much like global variables in a Go program. </p>
+<p>The syntax of such definitions is to surround each template declaration with a "define" and "end" action. </p>
+<p>The define action names the template being created by providing a string constant. Here is a simple example: </p>
+<pre data-language="go">{{define "T1"}}ONE{{end}}
+{{define "T2"}}TWO{{end}}
+{{define "T3"}}{{template "T1"}} {{template "T2"}}{{end}}
+{{template "T3"}}
+</pre> <p>This defines two templates, T1 and T2, and a third T3 that invokes the other two when it is executed. Finally it invokes T3. If executed this template will produce the text </p>
+<pre data-language="go">ONE TWO
+</pre> <p>By construction, a template may reside in only one association. If it's necessary to have a template addressable from multiple associations, the template definition must be parsed multiple times to create distinct *Template values, or must be copied with <a href="#Template.Clone">Template.Clone</a> or <a href="#Template.AddParseTree">Template.AddParseTree</a>. </p>
+<p>Parse may be called multiple times to assemble the various associated templates; see <a href="#ParseFiles">ParseFiles</a>, <a href="#ParseGlob">ParseGlob</a>, <a href="#Template.ParseFiles">Template.ParseFiles</a> and <a href="#Template.ParseGlob">Template.ParseGlob</a> for simple ways to parse related templates stored in files. </p>
+<p>A template may be executed directly or through <a href="#Template.ExecuteTemplate">Template.ExecuteTemplate</a>, which executes an associated template identified by name. To invoke our example above, we might write, </p>
+<pre data-language="go">err := tmpl.Execute(os.Stdout, "no data needed")
+if err != nil {
+ log.Fatalf("execution failed: %s", err)
+}
+</pre> <p>or to invoke a particular template explicitly by name, </p>
+<pre data-language="go">err := tmpl.ExecuteTemplate(os.Stdout, "T2", "no data needed")
+if err != nil {
+ log.Fatalf("execution failed: %s", err)
+}
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#HTMLEscape">func HTMLEscape(w io.Writer, b []byte)</a></li>
+<li><a href="#HTMLEscapeString">func HTMLEscapeString(s string) string</a></li>
+<li><a href="#HTMLEscaper">func HTMLEscaper(args ...any) string</a></li>
+<li><a href="#IsTrue">func IsTrue(val any) (truth, ok bool)</a></li>
+<li><a href="#JSEscape">func JSEscape(w io.Writer, b []byte)</a></li>
+<li><a href="#JSEscapeString">func JSEscapeString(s string) string</a></li>
+<li><a href="#JSEscaper">func JSEscaper(args ...any) string</a></li>
+<li><a href="#URLQueryEscaper">func URLQueryEscaper(args ...any) string</a></li>
+<li><a href="#ExecError">type ExecError</a></li>
+<li> <a href="#ExecError.Error">func (e ExecError) Error() string</a>
+</li>
+<li> <a href="#ExecError.Unwrap">func (e ExecError) Unwrap() error</a>
+</li>
+<li><a href="#FuncMap">type FuncMap</a></li>
+<li><a href="#Template">type Template</a></li>
+<li> <a href="#Must">func Must(t *Template, err error) *Template</a>
+</li>
+<li> <a href="#New">func New(name string) *Template</a>
+</li>
+<li> <a href="#ParseFS">func ParseFS(fsys fs.FS, patterns ...string) (*Template, error)</a>
+</li>
+<li> <a href="#ParseFiles">func ParseFiles(filenames ...string) (*Template, error)</a>
+</li>
+<li> <a href="#ParseGlob">func ParseGlob(pattern string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.AddParseTree">func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error)</a>
+</li>
+<li> <a href="#Template.Clone">func (t *Template) Clone() (*Template, error)</a>
+</li>
+<li> <a href="#Template.DefinedTemplates">func (t *Template) DefinedTemplates() string</a>
+</li>
+<li> <a href="#Template.Delims">func (t *Template) Delims(left, right string) *Template</a>
+</li>
+<li> <a href="#Template.Execute">func (t *Template) Execute(wr io.Writer, data any) error</a>
+</li>
+<li> <a href="#Template.ExecuteTemplate">func (t *Template) ExecuteTemplate(wr io.Writer, name string, data any) error</a>
+</li>
+<li> <a href="#Template.Funcs">func (t *Template) Funcs(funcMap FuncMap) *Template</a>
+</li>
+<li> <a href="#Template.Lookup">func (t *Template) Lookup(name string) *Template</a>
+</li>
+<li> <a href="#Template.Name">func (t *Template) Name() string</a>
+</li>
+<li> <a href="#Template.New">func (t *Template) New(name string) *Template</a>
+</li>
+<li> <a href="#Template.Option">func (t *Template) Option(opt ...string) *Template</a>
+</li>
+<li> <a href="#Template.Parse">func (t *Template) Parse(text string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.ParseFS">func (t *Template) ParseFS(fsys fs.FS, patterns ...string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.ParseFiles">func (t *Template) ParseFiles(filenames ...string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.ParseGlob">func (t *Template) ParseGlob(pattern string) (*Template, error)</a>
+</li>
+<li> <a href="#Template.Templates">func (t *Template) Templates() []*Template</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_Template">Template</a></dd> <dd><a class="exampleLink" href="#example_Template_block">Template (Block)</a></dd> <dd><a class="exampleLink" href="#example_Template_func">Template (Func)</a></dd> <dd><a class="exampleLink" href="#example_Template_glob">Template (Glob)</a></dd> <dd><a class="exampleLink" href="#example_Template_helpers">Template (Helpers)</a></dd> <dd><a class="exampleLink" href="#example_Template_share">Template (Share)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>doc.go</span> <span>exec.go</span> <span>funcs.go</span> <span>helper.go</span> <span>option.go</span> <span>template.go</span> </p> <h2 id="HTMLEscape">func <span>HTMLEscape</span> </h2> <pre data-language="go">func HTMLEscape(w io.Writer, b []byte)</pre> <p>HTMLEscape writes to w the escaped HTML equivalent of the plain text data b. </p>
+<h2 id="HTMLEscapeString">func <span>HTMLEscapeString</span> </h2> <pre data-language="go">func HTMLEscapeString(s string) string</pre> <p>HTMLEscapeString returns the escaped HTML equivalent of the plain text data s. </p>
+<h2 id="HTMLEscaper">func <span>HTMLEscaper</span> </h2> <pre data-language="go">func HTMLEscaper(args ...any) string</pre> <p>HTMLEscaper returns the escaped HTML equivalent of the textual representation of its arguments. </p>
+<h2 id="IsTrue">func <span>IsTrue</span> <span title="Added in Go 1.6">1.6</span> </h2> <pre data-language="go">func IsTrue(val any) (truth, ok bool)</pre> <p>IsTrue reports whether the value is 'true', in the sense of not the zero of its type, and whether the value has a meaningful truth value. This is the definition of truth used by if and other such actions. </p>
+<h2 id="JSEscape">func <span>JSEscape</span> </h2> <pre data-language="go">func JSEscape(w io.Writer, b []byte)</pre> <p>JSEscape writes to w the escaped JavaScript equivalent of the plain text data b. </p>
+<h2 id="JSEscapeString">func <span>JSEscapeString</span> </h2> <pre data-language="go">func JSEscapeString(s string) string</pre> <p>JSEscapeString returns the escaped JavaScript equivalent of the plain text data s. </p>
+<h2 id="JSEscaper">func <span>JSEscaper</span> </h2> <pre data-language="go">func JSEscaper(args ...any) string</pre> <p>JSEscaper returns the escaped JavaScript equivalent of the textual representation of its arguments. </p>
+<h2 id="URLQueryEscaper">func <span>URLQueryEscaper</span> </h2> <pre data-language="go">func URLQueryEscaper(args ...any) string</pre> <p>URLQueryEscaper returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query. </p>
+<h2 id="ExecError">type <span>ExecError</span> <span title="Added in Go 1.6">1.6</span> </h2> <p>ExecError is the custom error type returned when Execute has an error evaluating its template. (If a write error occurs, the actual error is returned; it will not be of type ExecError.) </p>
+<pre data-language="go">type ExecError struct {
+ Name string // Name of template.
+ Err error // Pre-formatted error.
+}
+</pre> <h3 id="ExecError.Error">func (ExecError) <span>Error</span> <span title="Added in Go 1.6">1.6</span> </h3> <pre data-language="go">func (e ExecError) Error() string</pre> <h3 id="ExecError.Unwrap">func (ExecError) <span>Unwrap</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (e ExecError) Unwrap() error</pre> <h2 id="FuncMap">type <span>FuncMap</span> </h2> <p>FuncMap is the type of the map defining the mapping from names to functions. Each function must have either a single return value, or two return values of which the second has type error. In that case, if the second (error) return value evaluates to non-nil during execution, execution terminates and Execute returns that error. </p>
+<p>Errors returned by Execute wrap the underlying error; call errors.As to unwrap them. </p>
+<p>When template execution invokes a function with an argument list, that list must be assignable to the function's parameter types. Functions meant to apply to arguments of arbitrary type can use parameters of type interface{} or of type reflect.Value. Similarly, functions meant to return a result of arbitrary type can return interface{} or reflect.Value. </p>
+<pre data-language="go">type FuncMap map[string]any</pre> <h2 id="Template">type <span>Template</span> </h2> <p>Template is the representation of a parsed template. The *parse.Tree field is exported only for use by html/template and should be treated as unexported by all other clients. </p>
+<pre data-language="go">type Template struct {
+ *parse.Tree
+ // contains filtered or unexported fields
+}
+</pre> <h4 id="example_Template"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Define a template.
+const letter = `
+Dear {{.Name}},
+{{if .Attended}}
+It was a pleasure to see you at the wedding.
+{{- else}}
+It is a shame you couldn't make it to the wedding.
+{{- end}}
+{{with .Gift -}}
+Thank you for the lovely {{.}}.
+{{end}}
+Best wishes,
+Josie
+`
+
+// Prepare some data to insert into the template.
+type Recipient struct {
+ Name, Gift string
+ Attended bool
+}
+var recipients = []Recipient{
+ {"Aunt Mildred", "bone china tea set", true},
+ {"Uncle John", "moleskin pants", false},
+ {"Cousin Rodney", "", false},
+}
+
+// Create a new template and parse the letter into it.
+t := template.Must(template.New("letter").Parse(letter))
+
+// Execute the template for each recipient.
+for _, r := range recipients {
+ err := t.Execute(os.Stdout, r)
+ if err != nil {
+ log.Println("executing template:", err)
+ }
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Dear Aunt Mildred,
+
+It was a pleasure to see you at the wedding.
+Thank you for the lovely bone china tea set.
+
+Best wishes,
+Josie
+
+Dear Uncle John,
+
+It is a shame you couldn't make it to the wedding.
+Thank you for the lovely moleskin pants.
+
+Best wishes,
+Josie
+
+Dear Cousin Rodney,
+
+It is a shame you couldn't make it to the wedding.
+
+Best wishes,
+Josie
+</pre> <h4 id="example_Template_block"> <span class="text">Example (Block)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const (
+ master = `Names:{{block "list" .}}{{"\n"}}{{range .}}{{println "-" .}}{{end}}{{end}}`
+ overlay = `{{define "list"}} {{join . ", "}}{{end}} `
+)
+var (
+ funcs = template.FuncMap{"join": strings.Join}
+ guardians = []string{"Gamora", "Groot", "Nebula", "Rocket", "Star-Lord"}
+)
+masterTmpl, err := template.New("master").Funcs(funcs).Parse(master)
+if err != nil {
+ log.Fatal(err)
+}
+overlayTmpl, err := template.Must(masterTmpl.Clone()).Parse(overlay)
+if err != nil {
+ log.Fatal(err)
+}
+if err := masterTmpl.Execute(os.Stdout, guardians); err != nil {
+ log.Fatal(err)
+}
+if err := overlayTmpl.Execute(os.Stdout, guardians); err != nil {
+ log.Fatal(err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">Names:
+- Gamora
+- Groot
+- Nebula
+- Rocket
+- Star-Lord
+Names: Gamora, Groot, Nebula, Rocket, Star-Lord
+</pre> <h4 id="example_Template_func"> <span class="text">Example (Func)</span>
+</h4> <p>This example demonstrates a custom function to process template text. It installs the strings.Title function and uses it to Make Title Text Look Good In Our Template's Output. </p> <p>Code:</p> <pre class="code" data-language="go">// First we create a FuncMap with which to register the function.
+funcMap := template.FuncMap{
+ // The name "title" is what the function will be called in the template text.
+ "title": strings.Title,
+}
+
+// A simple template definition to test our function.
+// We print the input text several ways:
+// - the original
+// - title-cased
+// - title-cased and then printed with %q
+// - printed with %q and then title-cased.
+const templateText = `
+Input: {{printf "%q" .}}
+Output 0: {{title .}}
+Output 1: {{title . | printf "%q"}}
+Output 2: {{printf "%q" . | title}}
+`
+
+// Create a template, add the function map, and parse the text.
+tmpl, err := template.New("titleTest").Funcs(funcMap).Parse(templateText)
+if err != nil {
+ log.Fatalf("parsing: %s", err)
+}
+
+// Run the template to verify the output.
+err = tmpl.Execute(os.Stdout, "the go programming language")
+if err != nil {
+ log.Fatalf("execution: %s", err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Input: "the go programming language"
+Output 0: The Go Programming Language
+Output 1: "The Go Programming Language"
+Output 2: "The Go Programming Language"
+</pre> <h4 id="example_Template_glob"> <span class="text">Example (Glob)</span>
+</h4> <p>Here we demonstrate loading a set of templates from a directory. </p> <p>Code:</p> <pre class="code" data-language="go">// Here we create a temporary directory and populate it with our sample
+// template definition files; usually the template files would already
+// exist in some location known to the program.
+dir := createTestDir([]templateFile{
+ // T0.tmpl is a plain template file that just invokes T1.
+ {"T0.tmpl", `T0 invokes T1: ({{template "T1"}})`},
+ // T1.tmpl defines a template, T1 that invokes T2.
+ {"T1.tmpl", `{{define "T1"}}T1 invokes T2: ({{template "T2"}}){{end}}`},
+ // T2.tmpl defines a template T2.
+ {"T2.tmpl", `{{define "T2"}}This is T2{{end}}`},
+})
+// Clean up after the test; another quirk of running as an example.
+defer os.RemoveAll(dir)
+
+// pattern is the glob pattern used to find all the template files.
+pattern := filepath.Join(dir, "*.tmpl")
+
+// Here starts the example proper.
+// T0.tmpl is the first name matched, so it becomes the starting template,
+// the value returned by ParseGlob.
+tmpl := template.Must(template.ParseGlob(pattern))
+
+err := tmpl.Execute(os.Stdout, nil)
+if err != nil {
+ log.Fatalf("template execution: %s", err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">T0 invokes T1: (T1 invokes T2: (This is T2))
+</pre> <h4 id="example_Template_helpers"> <span class="text">Example (Helpers)</span>
+</h4> <p>This example demonstrates one way to share some templates and use them in different contexts. In this variant we add multiple driver templates by hand to an existing bundle of templates. </p> <p>Code:</p> <pre class="code" data-language="go">// Here we create a temporary directory and populate it with our sample
+// template definition files; usually the template files would already
+// exist in some location known to the program.
+dir := createTestDir([]templateFile{
+ // T1.tmpl defines a template, T1 that invokes T2.
+ {"T1.tmpl", `{{define "T1"}}T1 invokes T2: ({{template "T2"}}){{end}}`},
+ // T2.tmpl defines a template T2.
+ {"T2.tmpl", `{{define "T2"}}This is T2{{end}}`},
+})
+// Clean up after the test; another quirk of running as an example.
+defer os.RemoveAll(dir)
+
+// pattern is the glob pattern used to find all the template files.
+pattern := filepath.Join(dir, "*.tmpl")
+
+// Here starts the example proper.
+// Load the helpers.
+templates := template.Must(template.ParseGlob(pattern))
+// Add one driver template to the bunch; we do this with an explicit template definition.
+_, err := templates.Parse("{{define `driver1`}}Driver 1 calls T1: ({{template `T1`}})\n{{end}}")
+if err != nil {
+ log.Fatal("parsing driver1: ", err)
+}
+// Add another driver template.
+_, err = templates.Parse("{{define `driver2`}}Driver 2 calls T2: ({{template `T2`}})\n{{end}}")
+if err != nil {
+ log.Fatal("parsing driver2: ", err)
+}
+// We load all the templates before execution. This package does not require
+// that behavior but html/template's escaping does, so it's a good habit.
+err = templates.ExecuteTemplate(os.Stdout, "driver1", nil)
+if err != nil {
+ log.Fatalf("driver1 execution: %s", err)
+}
+err = templates.ExecuteTemplate(os.Stdout, "driver2", nil)
+if err != nil {
+ log.Fatalf("driver2 execution: %s", err)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">Driver 1 calls T1: (T1 invokes T2: (This is T2))
+Driver 2 calls T2: (This is T2)
+</pre> <h4 id="example_Template_share"> <span class="text">Example (Share)</span>
+</h4> <p>This example demonstrates how to use one group of driver templates with distinct sets of helper templates. </p> <p>Code:</p> <pre class="code" data-language="go">// Here we create a temporary directory and populate it with our sample
+// template definition files; usually the template files would already
+// exist in some location known to the program.
+dir := createTestDir([]templateFile{
+ // T0.tmpl is a plain template file that just invokes T1.
+ {"T0.tmpl", "T0 ({{.}} version) invokes T1: ({{template `T1`}})\n"},
+ // T1.tmpl defines a template, T1 that invokes T2. Note T2 is not defined
+ {"T1.tmpl", `{{define "T1"}}T1 invokes T2: ({{template "T2"}}){{end}}`},
+})
+// Clean up after the test; another quirk of running as an example.
+defer os.RemoveAll(dir)
+
+// pattern is the glob pattern used to find all the template files.
+pattern := filepath.Join(dir, "*.tmpl")
+
+// Here starts the example proper.
+// Load the drivers.
+drivers := template.Must(template.ParseGlob(pattern))
+
+// We must define an implementation of the T2 template. First we clone
+// the drivers, then add a definition of T2 to the template name space.
+
+// 1. Clone the helper set to create a new name space from which to run them.
+first, err := drivers.Clone()
+if err != nil {
+ log.Fatal("cloning helpers: ", err)
+}
+// 2. Define T2, version A, and parse it.
+_, err = first.Parse("{{define `T2`}}T2, version A{{end}}")
+if err != nil {
+ log.Fatal("parsing T2: ", err)
+}
+
+// Now repeat the whole thing, using a different version of T2.
+// 1. Clone the drivers.
+second, err := drivers.Clone()
+if err != nil {
+ log.Fatal("cloning drivers: ", err)
+}
+// 2. Define T2, version B, and parse it.
+_, err = second.Parse("{{define `T2`}}T2, version B{{end}}")
+if err != nil {
+ log.Fatal("parsing T2: ", err)
+}
+
+// Execute the templates in the reverse order to verify the
+// first is unaffected by the second.
+err = second.ExecuteTemplate(os.Stdout, "T0.tmpl", "second")
+if err != nil {
+ log.Fatalf("second execution: %s", err)
+}
+err = first.ExecuteTemplate(os.Stdout, "T0.tmpl", "first")
+if err != nil {
+ log.Fatalf("first: execution: %s", err)
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">T0 (second version) invokes T1: (T1 invokes T2: (T2, version B))
+T0 (first version) invokes T1: (T1 invokes T2: (T2, version A))
+</pre> <h3 id="Must">func <span>Must</span> </h3> <pre data-language="go">func Must(t *Template, err error) *Template</pre> <p>Must is a helper that wraps a call to a function returning (*Template, error) and panics if the error is non-nil. It is intended for use in variable initializations such as </p>
+<pre data-language="go">var t = template.Must(template.New("name").Parse("text"))
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(name string) *Template</pre> <p>New allocates a new, undefined template with the given name. </p>
+<h3 id="ParseFS">func <span>ParseFS</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func ParseFS(fsys fs.FS, patterns ...string) (*Template, error)</pre> <p>ParseFS is like ParseFiles or ParseGlob but reads from the file system fsys instead of the host operating system's file system. It accepts a list of glob patterns. (Note that most file names serve as glob patterns matching only themselves.) </p>
+<h3 id="ParseFiles">func <span>ParseFiles</span> </h3> <pre data-language="go">func ParseFiles(filenames ...string) (*Template, error)</pre> <p>ParseFiles creates a new Template and parses the template definitions from the named files. The returned template's name will have the base name and parsed contents of the first file. There must be at least one file. If an error occurs, parsing stops and the returned *Template is nil. </p>
+<p>When parsing multiple files with the same name in different directories, the last one mentioned will be the one that results. For instance, ParseFiles("a/foo", "b/foo") stores "b/foo" as the template named "foo", while "a/foo" is unavailable. </p>
+<h3 id="ParseGlob">func <span>ParseGlob</span> </h3> <pre data-language="go">func ParseGlob(pattern string) (*Template, error)</pre> <p>ParseGlob creates a new Template and parses the template definitions from the files identified by the pattern. The files are matched according to the semantics of filepath.Match, and the pattern must match at least one file. The returned template will have the (base) name and (parsed) contents of the first file matched by the pattern. ParseGlob is equivalent to calling ParseFiles with the list of files matched by the pattern. </p>
+<p>When parsing multiple files with the same name in different directories, the last one mentioned will be the one that results. </p>
+<h3 id="Template.AddParseTree">func (*Template) <span>AddParseTree</span> </h3> <pre data-language="go">func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error)</pre> <p>AddParseTree associates the argument parse tree with the template t, giving it the specified name. If the template has not been defined, this tree becomes its definition. If it has been defined and already has that name, the existing definition is replaced; otherwise a new template is created, defined, and returned. </p>
+<h3 id="Template.Clone">func (*Template) <span>Clone</span> </h3> <pre data-language="go">func (t *Template) Clone() (*Template, error)</pre> <p>Clone returns a duplicate of the template, including all associated templates. The actual representation is not copied, but the name space of associated templates is, so further calls to Parse in the copy will add templates to the copy but not to the original. Clone can be used to prepare common templates and use them with variant definitions for other templates by adding the variants after the clone is made. </p>
+<h3 id="Template.DefinedTemplates">func (*Template) <span>DefinedTemplates</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Template) DefinedTemplates() string</pre> <p>DefinedTemplates returns a string listing the defined templates, prefixed by the string "; defined templates are: ". If there are none, it returns the empty string. For generating an error message here and in html/template. </p>
+<h3 id="Template.Delims">func (*Template) <span>Delims</span> </h3> <pre data-language="go">func (t *Template) Delims(left, right string) *Template</pre> <p>Delims sets the action delimiters to the specified strings, to be used in subsequent calls to Parse, ParseFiles, or ParseGlob. Nested template definitions will inherit the settings. An empty delimiter stands for the corresponding default: {{ or }}. The return value is the template, so calls can be chained. </p>
+<h3 id="Template.Execute">func (*Template) <span>Execute</span> </h3> <pre data-language="go">func (t *Template) Execute(wr io.Writer, data any) error</pre> <p>Execute applies a parsed template to the specified data object, and writes the output to wr. If an error occurs executing the template or writing its output, execution stops, but partial results may already have been written to the output writer. A template may be executed safely in parallel, although if parallel executions share a Writer the output may be interleaved. </p>
+<p>If data is a reflect.Value, the template applies to the concrete value that the reflect.Value holds, as in fmt.Print. </p>
+<h3 id="Template.ExecuteTemplate">func (*Template) <span>ExecuteTemplate</span> </h3> <pre data-language="go">func (t *Template) ExecuteTemplate(wr io.Writer, name string, data any) error</pre> <p>ExecuteTemplate applies the template associated with t that has the given name to the specified data object and writes the output to wr. If an error occurs executing the template or writing its output, execution stops, but partial results may already have been written to the output writer. A template may be executed safely in parallel, although if parallel executions share a Writer the output may be interleaved. </p>
+<h3 id="Template.Funcs">func (*Template) <span>Funcs</span> </h3> <pre data-language="go">func (t *Template) Funcs(funcMap FuncMap) *Template</pre> <p>Funcs adds the elements of the argument map to the template's function map. It must be called before the template is parsed. It panics if a value in the map is not a function with appropriate return type or if the name cannot be used syntactically as a function in a template. It is legal to overwrite elements of the map. The return value is the template, so calls can be chained. </p>
+<h3 id="Template.Lookup">func (*Template) <span>Lookup</span> </h3> <pre data-language="go">func (t *Template) Lookup(name string) *Template</pre> <p>Lookup returns the template with the given name that is associated with t. It returns nil if there is no such template or the template has no definition. </p>
+<h3 id="Template.Name">func (*Template) <span>Name</span> </h3> <pre data-language="go">func (t *Template) Name() string</pre> <p>Name returns the name of the template. </p>
+<h3 id="Template.New">func (*Template) <span>New</span> </h3> <pre data-language="go">func (t *Template) New(name string) *Template</pre> <p>New allocates a new, undefined template associated with the given one and with the same delimiters. The association, which is transitive, allows one template to invoke another with a {{template}} action. </p>
+<p>Because associated templates share underlying data, template construction cannot be done safely in parallel. Once the templates are constructed, they can be executed in parallel. </p>
+<h3 id="Template.Option">func (*Template) <span>Option</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t *Template) Option(opt ...string) *Template</pre> <p>Option sets options for the template. Options are described by strings, either a simple string or "key=value". There can be at most one equals sign in an option string. If the option string is unrecognized or otherwise invalid, Option panics. </p>
+<p>Known options: </p>
+<p>missingkey: Control the behavior during execution if a map is indexed with a key that is not present in the map. </p>
+<pre data-language="go">"missingkey=default" or "missingkey=invalid"
+ The default behavior: Do nothing and continue execution.
+ If printed, the result of the index operation is the string
+ "&lt;no value&gt;".
+"missingkey=zero"
+ The operation returns the zero value for the map type's element.
+"missingkey=error"
+ Execution stops immediately with an error.
+</pre> <h3 id="Template.Parse">func (*Template) <span>Parse</span> </h3> <pre data-language="go">func (t *Template) Parse(text string) (*Template, error)</pre> <p>Parse parses text as a template body for t. Named template definitions ({{define ...}} or {{block ...}} statements) in text define additional templates associated with t and are removed from the definition of t itself. </p>
+<p>Templates can be redefined in successive calls to Parse. A template definition with a body containing only white space and comments is considered empty and will not replace an existing template's body. This allows using Parse to add new named template definitions without overwriting the main template body. </p>
+<h3 id="Template.ParseFS">func (*Template) <span>ParseFS</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (t *Template) ParseFS(fsys fs.FS, patterns ...string) (*Template, error)</pre> <p>ParseFS is like ParseFiles or ParseGlob but reads from the file system fsys instead of the host operating system's file system. It accepts a list of glob patterns. (Note that most file names serve as glob patterns matching only themselves.) </p>
+<h3 id="Template.ParseFiles">func (*Template) <span>ParseFiles</span> </h3> <pre data-language="go">func (t *Template) ParseFiles(filenames ...string) (*Template, error)</pre> <p>ParseFiles parses the named files and associates the resulting templates with t. If an error occurs, parsing stops and the returned template is nil; otherwise it is t. There must be at least one file. Since the templates created by ParseFiles are named by the base names of the argument files, t should usually have the name of one of the (base) names of the files. If it does not, depending on t's contents before calling ParseFiles, t.Execute may fail. In that case use t.ExecuteTemplate to execute a valid template. </p>
+<p>When parsing multiple files with the same name in different directories, the last one mentioned will be the one that results. </p>
+<h3 id="Template.ParseGlob">func (*Template) <span>ParseGlob</span> </h3> <pre data-language="go">func (t *Template) ParseGlob(pattern string) (*Template, error)</pre> <p>ParseGlob parses the template definitions in the files identified by the pattern and associates the resulting templates with t. The files are matched according to the semantics of filepath.Match, and the pattern must match at least one file. ParseGlob is equivalent to calling t.ParseFiles with the list of files matched by the pattern. </p>
+<p>When parsing multiple files with the same name in different directories, the last one mentioned will be the one that results. </p>
+<h3 id="Template.Templates">func (*Template) <span>Templates</span> </h3> <pre data-language="go">func (t *Template) Templates() []*Template</pre> <p>Templates returns a slice of defined templates associated with t. </p>
+<h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="parse/index">parse</a> </td> <td class="pkg-synopsis"> Package parse builds parse trees for templates as defined by text/template and html/template. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/text/template/" class="_attribution-link">http://golang.org/pkg/text/template/</a>
+ </p>
+</div>
diff --git a/devdocs/go/text%2Ftemplate%2Fparse%2Findex.html b/devdocs/go/text%2Ftemplate%2Fparse%2Findex.html
new file mode 100644
index 00000000..d5b46c60
--- /dev/null
+++ b/devdocs/go/text%2Ftemplate%2Fparse%2Findex.html
@@ -0,0 +1,385 @@
+<h1> Package parse </h1> <ul id="short-nav">
+<li><code>import "text/template/parse"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package parse builds parse trees for templates as defined by text/template and html/template. Clients should use those packages to construct templates rather than this one, which provides shared internal data structures not intended for general use. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#IsEmptyTree">func IsEmptyTree(n Node) bool</a></li>
+<li><a href="#Parse">func Parse(name, text, leftDelim, rightDelim string, funcs ...map[string]any) (map[string]*Tree, error)</a></li>
+<li><a href="#ActionNode">type ActionNode</a></li>
+<li> <a href="#ActionNode.Copy">func (a *ActionNode) Copy() Node</a>
+</li>
+<li> <a href="#ActionNode.String">func (a *ActionNode) String() string</a>
+</li>
+<li><a href="#BoolNode">type BoolNode</a></li>
+<li> <a href="#BoolNode.Copy">func (b *BoolNode) Copy() Node</a>
+</li>
+<li> <a href="#BoolNode.String">func (b *BoolNode) String() string</a>
+</li>
+<li><a href="#BranchNode">type BranchNode</a></li>
+<li> <a href="#BranchNode.Copy">func (b *BranchNode) Copy() Node</a>
+</li>
+<li> <a href="#BranchNode.String">func (b *BranchNode) String() string</a>
+</li>
+<li><a href="#BreakNode">type BreakNode</a></li>
+<li> <a href="#BreakNode.Copy">func (b *BreakNode) Copy() Node</a>
+</li>
+<li> <a href="#BreakNode.String">func (b *BreakNode) String() string</a>
+</li>
+<li><a href="#ChainNode">type ChainNode</a></li>
+<li> <a href="#ChainNode.Add">func (c *ChainNode) Add(field string)</a>
+</li>
+<li> <a href="#ChainNode.Copy">func (c *ChainNode) Copy() Node</a>
+</li>
+<li> <a href="#ChainNode.String">func (c *ChainNode) String() string</a>
+</li>
+<li><a href="#CommandNode">type CommandNode</a></li>
+<li> <a href="#CommandNode.Copy">func (c *CommandNode) Copy() Node</a>
+</li>
+<li> <a href="#CommandNode.String">func (c *CommandNode) String() string</a>
+</li>
+<li><a href="#CommentNode">type CommentNode</a></li>
+<li> <a href="#CommentNode.Copy">func (c *CommentNode) Copy() Node</a>
+</li>
+<li> <a href="#CommentNode.String">func (c *CommentNode) String() string</a>
+</li>
+<li><a href="#ContinueNode">type ContinueNode</a></li>
+<li> <a href="#ContinueNode.Copy">func (c *ContinueNode) Copy() Node</a>
+</li>
+<li> <a href="#ContinueNode.String">func (c *ContinueNode) String() string</a>
+</li>
+<li><a href="#DotNode">type DotNode</a></li>
+<li> <a href="#DotNode.Copy">func (d *DotNode) Copy() Node</a>
+</li>
+<li> <a href="#DotNode.String">func (d *DotNode) String() string</a>
+</li>
+<li> <a href="#DotNode.Type">func (d *DotNode) Type() NodeType</a>
+</li>
+<li><a href="#FieldNode">type FieldNode</a></li>
+<li> <a href="#FieldNode.Copy">func (f *FieldNode) Copy() Node</a>
+</li>
+<li> <a href="#FieldNode.String">func (f *FieldNode) String() string</a>
+</li>
+<li><a href="#IdentifierNode">type IdentifierNode</a></li>
+<li> <a href="#NewIdentifier">func NewIdentifier(ident string) *IdentifierNode</a>
+</li>
+<li> <a href="#IdentifierNode.Copy">func (i *IdentifierNode) Copy() Node</a>
+</li>
+<li> <a href="#IdentifierNode.SetPos">func (i *IdentifierNode) SetPos(pos Pos) *IdentifierNode</a>
+</li>
+<li> <a href="#IdentifierNode.SetTree">func (i *IdentifierNode) SetTree(t *Tree) *IdentifierNode</a>
+</li>
+<li> <a href="#IdentifierNode.String">func (i *IdentifierNode) String() string</a>
+</li>
+<li><a href="#IfNode">type IfNode</a></li>
+<li> <a href="#IfNode.Copy">func (i *IfNode) Copy() Node</a>
+</li>
+<li><a href="#ListNode">type ListNode</a></li>
+<li> <a href="#ListNode.Copy">func (l *ListNode) Copy() Node</a>
+</li>
+<li> <a href="#ListNode.CopyList">func (l *ListNode) CopyList() *ListNode</a>
+</li>
+<li> <a href="#ListNode.String">func (l *ListNode) String() string</a>
+</li>
+<li><a href="#Mode">type Mode</a></li>
+<li><a href="#NilNode">type NilNode</a></li>
+<li> <a href="#NilNode.Copy">func (n *NilNode) Copy() Node</a>
+</li>
+<li> <a href="#NilNode.String">func (n *NilNode) String() string</a>
+</li>
+<li> <a href="#NilNode.Type">func (n *NilNode) Type() NodeType</a>
+</li>
+<li><a href="#Node">type Node</a></li>
+<li><a href="#NodeType">type NodeType</a></li>
+<li> <a href="#NodeType.Type">func (t NodeType) Type() NodeType</a>
+</li>
+<li><a href="#NumberNode">type NumberNode</a></li>
+<li> <a href="#NumberNode.Copy">func (n *NumberNode) Copy() Node</a>
+</li>
+<li> <a href="#NumberNode.String">func (n *NumberNode) String() string</a>
+</li>
+<li><a href="#PipeNode">type PipeNode</a></li>
+<li> <a href="#PipeNode.Copy">func (p *PipeNode) Copy() Node</a>
+</li>
+<li> <a href="#PipeNode.CopyPipe">func (p *PipeNode) CopyPipe() *PipeNode</a>
+</li>
+<li> <a href="#PipeNode.String">func (p *PipeNode) String() string</a>
+</li>
+<li><a href="#Pos">type Pos</a></li>
+<li> <a href="#Pos.Position">func (p Pos) Position() Pos</a>
+</li>
+<li><a href="#RangeNode">type RangeNode</a></li>
+<li> <a href="#RangeNode.Copy">func (r *RangeNode) Copy() Node</a>
+</li>
+<li><a href="#StringNode">type StringNode</a></li>
+<li> <a href="#StringNode.Copy">func (s *StringNode) Copy() Node</a>
+</li>
+<li> <a href="#StringNode.String">func (s *StringNode) String() string</a>
+</li>
+<li><a href="#TemplateNode">type TemplateNode</a></li>
+<li> <a href="#TemplateNode.Copy">func (t *TemplateNode) Copy() Node</a>
+</li>
+<li> <a href="#TemplateNode.String">func (t *TemplateNode) String() string</a>
+</li>
+<li><a href="#TextNode">type TextNode</a></li>
+<li> <a href="#TextNode.Copy">func (t *TextNode) Copy() Node</a>
+</li>
+<li> <a href="#TextNode.String">func (t *TextNode) String() string</a>
+</li>
+<li><a href="#Tree">type Tree</a></li>
+<li> <a href="#New">func New(name string, funcs ...map[string]any) *Tree</a>
+</li>
+<li> <a href="#Tree.Copy">func (t *Tree) Copy() *Tree</a>
+</li>
+<li> <a href="#Tree.ErrorContext">func (t *Tree) ErrorContext(n Node) (location, context string)</a>
+</li>
+<li> <a href="#Tree.Parse">func (t *Tree) Parse(text, leftDelim, rightDelim string, treeSet map[string]*Tree, funcs ...map[string]any) (tree *Tree, err error)</a>
+</li>
+<li><a href="#VariableNode">type VariableNode</a></li>
+<li> <a href="#VariableNode.Copy">func (v *VariableNode) Copy() Node</a>
+</li>
+<li> <a href="#VariableNode.String">func (v *VariableNode) String() string</a>
+</li>
+<li><a href="#WithNode">type WithNode</a></li>
+<li> <a href="#WithNode.Copy">func (w *WithNode) Copy() Node</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>lex.go</span> <span>node.go</span> <span>parse.go</span> </p> <h2 id="IsEmptyTree">func <span>IsEmptyTree</span> </h2> <pre data-language="go">func IsEmptyTree(n Node) bool</pre> <p>IsEmptyTree reports whether this tree (node) is empty of everything but space or comments. </p>
+<h2 id="Parse">func <span>Parse</span> </h2> <pre data-language="go">func Parse(name, text, leftDelim, rightDelim string, funcs ...map[string]any) (map[string]*Tree, error)</pre> <p>Parse returns a map from template name to parse.Tree, created by parsing the templates described in the argument string. The top-level template will be given the specified name. If an error is encountered, parsing stops and an empty map is returned with the error. </p>
+<h2 id="ActionNode">type <span>ActionNode</span> </h2> <p>ActionNode holds an action (something bounded by delimiters). Control actions have their own nodes; ActionNode represents simple ones such as field evaluations and parenthesized pipelines. </p>
+<pre data-language="go">type ActionNode struct {
+ NodeType
+ Pos
+
+ Line int // The line number in the input. Deprecated: Kept for compatibility.
+ Pipe *PipeNode // The pipeline in the action.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ActionNode.Copy">func (*ActionNode) <span>Copy</span> </h3> <pre data-language="go">func (a *ActionNode) Copy() Node</pre> <h3 id="ActionNode.String">func (*ActionNode) <span>String</span> </h3> <pre data-language="go">func (a *ActionNode) String() string</pre> <h2 id="BoolNode">type <span>BoolNode</span> </h2> <p>BoolNode holds a boolean constant. </p>
+<pre data-language="go">type BoolNode struct {
+ NodeType
+ Pos
+
+ True bool // The value of the boolean constant.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="BoolNode.Copy">func (*BoolNode) <span>Copy</span> </h3> <pre data-language="go">func (b *BoolNode) Copy() Node</pre> <h3 id="BoolNode.String">func (*BoolNode) <span>String</span> </h3> <pre data-language="go">func (b *BoolNode) String() string</pre> <h2 id="BranchNode">type <span>BranchNode</span> </h2> <p>BranchNode is the common representation of if, range, and with. </p>
+<pre data-language="go">type BranchNode struct {
+ NodeType
+ Pos
+
+ Line int // The line number in the input. Deprecated: Kept for compatibility.
+ Pipe *PipeNode // The pipeline to be evaluated.
+ List *ListNode // What to execute if the value is non-empty.
+ ElseList *ListNode // What to execute if the value is empty (nil if absent).
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="BranchNode.Copy">func (*BranchNode) <span>Copy</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (b *BranchNode) Copy() Node</pre> <h3 id="BranchNode.String">func (*BranchNode) <span>String</span> </h3> <pre data-language="go">func (b *BranchNode) String() string</pre> <h2 id="BreakNode">type <span>BreakNode</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>BreakNode represents a {{break}} action. </p>
+<pre data-language="go">type BreakNode struct {
+ NodeType
+ Pos
+ Line int
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="BreakNode.Copy">func (*BreakNode) <span>Copy</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (b *BreakNode) Copy() Node</pre> <h3 id="BreakNode.String">func (*BreakNode) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (b *BreakNode) String() string</pre> <h2 id="ChainNode">type <span>ChainNode</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>ChainNode holds a term followed by a chain of field accesses (identifier starting with '.'). The names may be chained ('.x.y'). The periods are dropped from each ident. </p>
+<pre data-language="go">type ChainNode struct {
+ NodeType
+ Pos
+
+ Node Node
+ Field []string // The identifiers in lexical order.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ChainNode.Add">func (*ChainNode) <span>Add</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *ChainNode) Add(field string)</pre> <p>Add adds the named field (which should start with a period) to the end of the chain. </p>
+<h3 id="ChainNode.Copy">func (*ChainNode) <span>Copy</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *ChainNode) Copy() Node</pre> <h3 id="ChainNode.String">func (*ChainNode) <span>String</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (c *ChainNode) String() string</pre> <h2 id="CommandNode">type <span>CommandNode</span> </h2> <p>CommandNode holds a command (a pipeline inside an evaluating action). </p>
+<pre data-language="go">type CommandNode struct {
+ NodeType
+ Pos
+
+ Args []Node // Arguments in lexical order: Identifier, field, or constant.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="CommandNode.Copy">func (*CommandNode) <span>Copy</span> </h3> <pre data-language="go">func (c *CommandNode) Copy() Node</pre> <h3 id="CommandNode.String">func (*CommandNode) <span>String</span> </h3> <pre data-language="go">func (c *CommandNode) String() string</pre> <h2 id="CommentNode">type <span>CommentNode</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>CommentNode holds a comment. </p>
+<pre data-language="go">type CommentNode struct {
+ NodeType
+ Pos
+
+ Text string // Comment text.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="CommentNode.Copy">func (*CommentNode) <span>Copy</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (c *CommentNode) Copy() Node</pre> <h3 id="CommentNode.String">func (*CommentNode) <span>String</span> <span title="Added in Go 1.16">1.16</span> </h3> <pre data-language="go">func (c *CommentNode) String() string</pre> <h2 id="ContinueNode">type <span>ContinueNode</span> <span title="Added in Go 1.18">1.18</span> </h2> <p>ContinueNode represents a {{continue}} action. </p>
+<pre data-language="go">type ContinueNode struct {
+ NodeType
+ Pos
+ Line int
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ContinueNode.Copy">func (*ContinueNode) <span>Copy</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *ContinueNode) Copy() Node</pre> <h3 id="ContinueNode.String">func (*ContinueNode) <span>String</span> <span title="Added in Go 1.18">1.18</span> </h3> <pre data-language="go">func (c *ContinueNode) String() string</pre> <h2 id="DotNode">type <span>DotNode</span> </h2> <p>DotNode holds the special identifier '.'. </p>
+<pre data-language="go">type DotNode struct {
+ NodeType
+ Pos
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="DotNode.Copy">func (*DotNode) <span>Copy</span> </h3> <pre data-language="go">func (d *DotNode) Copy() Node</pre> <h3 id="DotNode.String">func (*DotNode) <span>String</span> </h3> <pre data-language="go">func (d *DotNode) String() string</pre> <h3 id="DotNode.Type">func (*DotNode) <span>Type</span> </h3> <pre data-language="go">func (d *DotNode) Type() NodeType</pre> <h2 id="FieldNode">type <span>FieldNode</span> </h2> <p>FieldNode holds a field (identifier starting with '.'). The names may be chained ('.x.y'). The period is dropped from each ident. </p>
+<pre data-language="go">type FieldNode struct {
+ NodeType
+ Pos
+
+ Ident []string // The identifiers in lexical order.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="FieldNode.Copy">func (*FieldNode) <span>Copy</span> </h3> <pre data-language="go">func (f *FieldNode) Copy() Node</pre> <h3 id="FieldNode.String">func (*FieldNode) <span>String</span> </h3> <pre data-language="go">func (f *FieldNode) String() string</pre> <h2 id="IdentifierNode">type <span>IdentifierNode</span> </h2> <p>IdentifierNode holds an identifier. </p>
+<pre data-language="go">type IdentifierNode struct {
+ NodeType
+ Pos
+
+ Ident string // The identifier's name.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewIdentifier">func <span>NewIdentifier</span> </h3> <pre data-language="go">func NewIdentifier(ident string) *IdentifierNode</pre> <p>NewIdentifier returns a new IdentifierNode with the given identifier name. </p>
+<h3 id="IdentifierNode.Copy">func (*IdentifierNode) <span>Copy</span> </h3> <pre data-language="go">func (i *IdentifierNode) Copy() Node</pre> <h3 id="IdentifierNode.SetPos">func (*IdentifierNode) <span>SetPos</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (i *IdentifierNode) SetPos(pos Pos) *IdentifierNode</pre> <p>SetPos sets the position. NewIdentifier is a public method so we can't modify its signature. Chained for convenience. TODO: fix one day? </p>
+<h3 id="IdentifierNode.SetTree">func (*IdentifierNode) <span>SetTree</span> <span title="Added in Go 1.4">1.4</span> </h3> <pre data-language="go">func (i *IdentifierNode) SetTree(t *Tree) *IdentifierNode</pre> <p>SetTree sets the parent tree for the node. NewIdentifier is a public method so we can't modify its signature. Chained for convenience. TODO: fix one day? </p>
+<h3 id="IdentifierNode.String">func (*IdentifierNode) <span>String</span> </h3> <pre data-language="go">func (i *IdentifierNode) String() string</pre> <h2 id="IfNode">type <span>IfNode</span> </h2> <p>IfNode represents an {{if}} action and its commands. </p>
+<pre data-language="go">type IfNode struct {
+ BranchNode
+}
+</pre> <h3 id="IfNode.Copy">func (*IfNode) <span>Copy</span> </h3> <pre data-language="go">func (i *IfNode) Copy() Node</pre> <h2 id="ListNode">type <span>ListNode</span> </h2> <p>ListNode holds a sequence of nodes. </p>
+<pre data-language="go">type ListNode struct {
+ NodeType
+ Pos
+
+ Nodes []Node // The element nodes in lexical order.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="ListNode.Copy">func (*ListNode) <span>Copy</span> </h3> <pre data-language="go">func (l *ListNode) Copy() Node</pre> <h3 id="ListNode.CopyList">func (*ListNode) <span>CopyList</span> </h3> <pre data-language="go">func (l *ListNode) CopyList() *ListNode</pre> <h3 id="ListNode.String">func (*ListNode) <span>String</span> </h3> <pre data-language="go">func (l *ListNode) String() string</pre> <h2 id="Mode">type <span>Mode</span> <span title="Added in Go 1.16">1.16</span> </h2> <p>A mode value is a set of flags (or 0). Modes control parser behavior. </p>
+<pre data-language="go">type Mode uint</pre> <pre data-language="go">const (
+ ParseComments Mode = 1 &lt;&lt; iota // parse comments and add them to AST
+ SkipFuncCheck // do not check that functions are defined
+)</pre> <h2 id="NilNode">type <span>NilNode</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>NilNode holds the special identifier 'nil' representing an untyped nil constant. </p>
+<pre data-language="go">type NilNode struct {
+ NodeType
+ Pos
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NilNode.Copy">func (*NilNode) <span>Copy</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (n *NilNode) Copy() Node</pre> <h3 id="NilNode.String">func (*NilNode) <span>String</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (n *NilNode) String() string</pre> <h3 id="NilNode.Type">func (*NilNode) <span>Type</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (n *NilNode) Type() NodeType</pre> <h2 id="Node">type <span>Node</span> </h2> <p>A Node is an element in the parse tree. The interface is trivial. The interface contains an unexported method so that only types local to this package can satisfy it. </p>
+<pre data-language="go">type Node interface {
+ Type() NodeType
+ String() string
+ // Copy does a deep copy of the Node and all its components.
+ // To avoid type assertions, some XxxNodes also have specialized
+ // CopyXxx methods that return *XxxNode.
+ Copy() Node
+ Position() Pos // byte position of start of node in full original input string
+ // contains filtered or unexported methods
+}</pre> <h2 id="NodeType">type <span>NodeType</span> </h2> <p>NodeType identifies the type of a parse tree node. </p>
+<pre data-language="go">type NodeType int</pre> <pre data-language="go">const (
+ NodeText NodeType = iota // Plain text.
+ NodeAction // A non-control action such as a field evaluation.
+ NodeBool // A boolean constant.
+ NodeChain // A sequence of field accesses.
+ NodeCommand // An element of a pipeline.
+ NodeDot // The cursor, dot.
+
+ NodeField // A field or method name.
+ NodeIdentifier // An identifier; always a function name.
+ NodeIf // An if action.
+ NodeList // A list of Nodes.
+ NodeNil // An untyped nil constant.
+ NodeNumber // A numerical constant.
+ NodePipe // A pipeline of commands.
+ NodeRange // A range action.
+ NodeString // A string constant.
+ NodeTemplate // A template invocation action.
+ NodeVariable // A $ variable.
+ NodeWith // A with action.
+ NodeComment // A comment.
+ NodeBreak // A break action.
+ NodeContinue // A continue action.
+)</pre> <h3 id="NodeType.Type">func (NodeType) <span>Type</span> </h3> <pre data-language="go">func (t NodeType) Type() NodeType</pre> <p>Type returns itself and provides an easy default implementation for embedding in a Node. Embedded in all non-trivial Nodes. </p>
+<h2 id="NumberNode">type <span>NumberNode</span> </h2> <p>NumberNode holds a number: signed or unsigned integer, float, or complex. The value is parsed and stored under all the types that can represent the value. This simulates in a small amount of code the behavior of Go's ideal constants. </p>
+<pre data-language="go">type NumberNode struct {
+ NodeType
+ Pos
+
+ IsInt bool // Number has an integral value.
+ IsUint bool // Number has an unsigned integral value.
+ IsFloat bool // Number has a floating-point value.
+ IsComplex bool // Number is complex.
+ Int64 int64 // The signed integer value.
+ Uint64 uint64 // The unsigned integer value.
+ Float64 float64 // The floating-point value.
+ Complex128 complex128 // The complex value.
+ Text string // The original textual representation from the input.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NumberNode.Copy">func (*NumberNode) <span>Copy</span> </h3> <pre data-language="go">func (n *NumberNode) Copy() Node</pre> <h3 id="NumberNode.String">func (*NumberNode) <span>String</span> </h3> <pre data-language="go">func (n *NumberNode) String() string</pre> <h2 id="PipeNode">type <span>PipeNode</span> </h2> <p>PipeNode holds a pipeline with optional declaration </p>
+<pre data-language="go">type PipeNode struct {
+ NodeType
+ Pos
+
+ Line int // The line number in the input. Deprecated: Kept for compatibility.
+ IsAssign bool // The variables are being assigned, not declared; added in Go 1.11
+ Decl []*VariableNode // Variables in lexical order.
+ Cmds []*CommandNode // The commands in lexical order.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="PipeNode.Copy">func (*PipeNode) <span>Copy</span> </h3> <pre data-language="go">func (p *PipeNode) Copy() Node</pre> <h3 id="PipeNode.CopyPipe">func (*PipeNode) <span>CopyPipe</span> </h3> <pre data-language="go">func (p *PipeNode) CopyPipe() *PipeNode</pre> <h3 id="PipeNode.String">func (*PipeNode) <span>String</span> </h3> <pre data-language="go">func (p *PipeNode) String() string</pre> <h2 id="Pos">type <span>Pos</span> <span title="Added in Go 1.1">1.1</span> </h2> <p>Pos represents a byte position in the original input text from which this template was parsed. </p>
+<pre data-language="go">type Pos int</pre> <h3 id="Pos.Position">func (Pos) <span>Position</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (p Pos) Position() Pos</pre> <h2 id="RangeNode">type <span>RangeNode</span> </h2> <p>RangeNode represents a {{range}} action and its commands. </p>
+<pre data-language="go">type RangeNode struct {
+ BranchNode
+}
+</pre> <h3 id="RangeNode.Copy">func (*RangeNode) <span>Copy</span> </h3> <pre data-language="go">func (r *RangeNode) Copy() Node</pre> <h2 id="StringNode">type <span>StringNode</span> </h2> <p>StringNode holds a string constant. The value has been "unquoted". </p>
+<pre data-language="go">type StringNode struct {
+ NodeType
+ Pos
+
+ Quoted string // The original text of the string, with quotes.
+ Text string // The string, after quote processing.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="StringNode.Copy">func (*StringNode) <span>Copy</span> </h3> <pre data-language="go">func (s *StringNode) Copy() Node</pre> <h3 id="StringNode.String">func (*StringNode) <span>String</span> </h3> <pre data-language="go">func (s *StringNode) String() string</pre> <h2 id="TemplateNode">type <span>TemplateNode</span> </h2> <p>TemplateNode represents a {{template}} action. </p>
+<pre data-language="go">type TemplateNode struct {
+ NodeType
+ Pos
+
+ Line int // The line number in the input. Deprecated: Kept for compatibility.
+ Name string // The name of the template (unquoted).
+ Pipe *PipeNode // The command to evaluate as dot for the template.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="TemplateNode.Copy">func (*TemplateNode) <span>Copy</span> </h3> <pre data-language="go">func (t *TemplateNode) Copy() Node</pre> <h3 id="TemplateNode.String">func (*TemplateNode) <span>String</span> </h3> <pre data-language="go">func (t *TemplateNode) String() string</pre> <h2 id="TextNode">type <span>TextNode</span> </h2> <p>TextNode holds plain text. </p>
+<pre data-language="go">type TextNode struct {
+ NodeType
+ Pos
+
+ Text []byte // The text; may span newlines.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="TextNode.Copy">func (*TextNode) <span>Copy</span> </h3> <pre data-language="go">func (t *TextNode) Copy() Node</pre> <h3 id="TextNode.String">func (*TextNode) <span>String</span> </h3> <pre data-language="go">func (t *TextNode) String() string</pre> <h2 id="Tree">type <span>Tree</span> </h2> <p>Tree is the representation of a single parsed template. </p>
+<pre data-language="go">type Tree struct {
+ Name string // name of the template represented by the tree.
+ ParseName string // name of the top-level template during parsing, for error messages; added in Go 1.1
+ Root *ListNode // top-level root of the tree.
+ Mode Mode // parsing mode; added in Go 1.16
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="New">func <span>New</span> </h3> <pre data-language="go">func New(name string, funcs ...map[string]any) *Tree</pre> <p>New allocates a new parse tree with the given name. </p>
+<h3 id="Tree.Copy">func (*Tree) <span>Copy</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (t *Tree) Copy() *Tree</pre> <p>Copy returns a copy of the Tree. Any parsing state is discarded. </p>
+<h3 id="Tree.ErrorContext">func (*Tree) <span>ErrorContext</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (t *Tree) ErrorContext(n Node) (location, context string)</pre> <p>ErrorContext returns a textual representation of the location of the node in the input text. The receiver is only used when the node does not have a pointer to the tree inside, which can occur in old code. </p>
+<h3 id="Tree.Parse">func (*Tree) <span>Parse</span> </h3> <pre data-language="go">func (t *Tree) Parse(text, leftDelim, rightDelim string, treeSet map[string]*Tree, funcs ...map[string]any) (tree *Tree, err error)</pre> <p>Parse parses the template definition string to construct a representation of the template for execution. If either action delimiter string is empty, the default ("{{" or "}}") is used. Embedded template definitions are added to the treeSet map. </p>
+<h2 id="VariableNode">type <span>VariableNode</span> </h2> <p>VariableNode holds a list of variable names, possibly with chained field accesses. The dollar sign is part of the (first) name. </p>
+<pre data-language="go">type VariableNode struct {
+ NodeType
+ Pos
+
+ Ident []string // Variable name and fields in lexical order.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="VariableNode.Copy">func (*VariableNode) <span>Copy</span> </h3> <pre data-language="go">func (v *VariableNode) Copy() Node</pre> <h3 id="VariableNode.String">func (*VariableNode) <span>String</span> </h3> <pre data-language="go">func (v *VariableNode) String() string</pre> <h2 id="WithNode">type <span>WithNode</span> </h2> <p>WithNode represents a {{with}} action and its commands. </p>
+<pre data-language="go">type WithNode struct {
+ BranchNode
+}
+</pre> <h3 id="WithNode.Copy">func (*WithNode) <span>Copy</span> </h3> <pre data-language="go">func (w *WithNode) Copy() Node</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/text/template/parse/" class="_attribution-link">http://golang.org/pkg/text/template/parse/</a>
+ </p>
+</div>
diff --git a/devdocs/go/time%2Findex.html b/devdocs/go/time%2Findex.html
new file mode 100644
index 00000000..3bced765
--- /dev/null
+++ b/devdocs/go/time%2Findex.html
@@ -0,0 +1,1035 @@
+<h1> Package time </h1> <ul id="short-nav">
+<li><code>import "time"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package time provides functionality for measuring and displaying time. </p>
+<p>The calendrical calculations always assume a Gregorian calendar, with no leap seconds. </p>
+<h3 id="hdr-Monotonic_Clocks">Monotonic Clocks</h3> <p>Operating systems provide both a “wall clock,” which is subject to changes for clock synchronization, and a “monotonic clock,” which is not. The general rule is that the wall clock is for telling time and the monotonic clock is for measuring time. Rather than split the API, in this package the Time returned by time.Now contains both a wall clock reading and a monotonic clock reading; later time-telling operations use the wall clock reading, but later time-measuring operations, specifically comparisons and subtractions, use the monotonic clock reading. </p>
+<p>For example, this code always computes a positive elapsed time of approximately 20 milliseconds, even if the wall clock is changed during the operation being timed: </p>
+<pre data-language="go">start := time.Now()
+... operation that takes 20 milliseconds ...
+t := time.Now()
+elapsed := t.Sub(start)
+</pre> <p>Other idioms, such as time.Since(start), time.Until(deadline), and time.Now().Before(deadline), are similarly robust against wall clock resets. </p>
+<p>The rest of this section gives the precise details of how operations use monotonic clocks, but understanding those details is not required to use this package. </p>
+<p>The Time returned by time.Now contains a monotonic clock reading. If Time t has a monotonic clock reading, t.Add adds the same duration to both the wall clock and monotonic clock readings to compute the result. Because t.AddDate(y, m, d), t.Round(d), and t.Truncate(d) are wall time computations, they always strip any monotonic clock reading from their results. Because t.In, t.Local, and t.UTC are used for their effect on the interpretation of the wall time, they also strip any monotonic clock reading from their results. The canonical way to strip a monotonic clock reading is to use t = t.Round(0). </p>
+<p>If Times t and u both contain monotonic clock readings, the operations t.After(u), t.Before(u), t.Equal(u), t.Compare(u), and t.Sub(u) are carried out using the monotonic clock readings alone, ignoring the wall clock readings. If either t or u contains no monotonic clock reading, these operations fall back to using the wall clock readings. </p>
+<p>On some systems the monotonic clock will stop if the computer goes to sleep. On such a system, t.Sub(u) may not accurately reflect the actual time that passed between t and u. </p>
+<p>Because the monotonic clock reading has no meaning outside the current process, the serialized forms generated by t.GobEncode, t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic clock reading, and t.Format provides no format for it. Similarly, the constructors time.Date, time.Parse, time.ParseInLocation, and time.Unix, as well as the unmarshalers t.GobDecode, t.UnmarshalBinary. t.UnmarshalJSON, and t.UnmarshalText always create times with no monotonic clock reading. </p>
+<p>The monotonic clock reading exists only in Time values. It is not a part of Duration values or the Unix times returned by t.Unix and friends. </p>
+<p>Note that the Go == operator compares not just the time instant but also the Location and the monotonic clock reading. See the documentation for the Time type for a discussion of equality testing for Time values. </p>
+<p>For debugging, the result of t.String does include the monotonic clock reading if present. If t != u because of different monotonic clock readings, that difference will be visible when printing t.String() and u.String(). </p>
+<h3 id="hdr-Timer_Resolution">Timer Resolution</h3> <p>Timer resolution varies depending on the Go runtime, the operating system and the underlying hardware. On Unix, the resolution is approximately 1ms. On Windows, the default resolution is approximately 16ms, but a higher resolution may be requested using <span>golang.org/x/sys/windows.TimeBeginPeriod</span>. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#After">func After(d Duration) &lt;-chan Time</a></li>
+<li><a href="#Sleep">func Sleep(d Duration)</a></li>
+<li><a href="#Tick">func Tick(d Duration) &lt;-chan Time</a></li>
+<li><a href="#Duration">type Duration</a></li>
+<li> <a href="#ParseDuration">func ParseDuration(s string) (Duration, error)</a>
+</li>
+<li> <a href="#Since">func Since(t Time) Duration</a>
+</li>
+<li> <a href="#Until">func Until(t Time) Duration</a>
+</li>
+<li> <a href="#Duration.Abs">func (d Duration) Abs() Duration</a>
+</li>
+<li> <a href="#Duration.Hours">func (d Duration) Hours() float64</a>
+</li>
+<li> <a href="#Duration.Microseconds">func (d Duration) Microseconds() int64</a>
+</li>
+<li> <a href="#Duration.Milliseconds">func (d Duration) Milliseconds() int64</a>
+</li>
+<li> <a href="#Duration.Minutes">func (d Duration) Minutes() float64</a>
+</li>
+<li> <a href="#Duration.Nanoseconds">func (d Duration) Nanoseconds() int64</a>
+</li>
+<li> <a href="#Duration.Round">func (d Duration) Round(m Duration) Duration</a>
+</li>
+<li> <a href="#Duration.Seconds">func (d Duration) Seconds() float64</a>
+</li>
+<li> <a href="#Duration.String">func (d Duration) String() string</a>
+</li>
+<li> <a href="#Duration.Truncate">func (d Duration) Truncate(m Duration) Duration</a>
+</li>
+<li><a href="#Location">type Location</a></li>
+<li> <a href="#FixedZone">func FixedZone(name string, offset int) *Location</a>
+</li>
+<li> <a href="#LoadLocation">func LoadLocation(name string) (*Location, error)</a>
+</li>
+<li> <a href="#LoadLocationFromTZData">func LoadLocationFromTZData(name string, data []byte) (*Location, error)</a>
+</li>
+<li> <a href="#Location.String">func (l *Location) String() string</a>
+</li>
+<li><a href="#Month">type Month</a></li>
+<li> <a href="#Month.String">func (m Month) String() string</a>
+</li>
+<li><a href="#ParseError">type ParseError</a></li>
+<li> <a href="#ParseError.Error">func (e *ParseError) Error() string</a>
+</li>
+<li><a href="#Ticker">type Ticker</a></li>
+<li> <a href="#NewTicker">func NewTicker(d Duration) *Ticker</a>
+</li>
+<li> <a href="#Ticker.Reset">func (t *Ticker) Reset(d Duration)</a>
+</li>
+<li> <a href="#Ticker.Stop">func (t *Ticker) Stop()</a>
+</li>
+<li><a href="#Time">type Time</a></li>
+<li> <a href="#Date">func Date(year int, month Month, day, hour, min, sec, nsec int, loc *Location) Time</a>
+</li>
+<li> <a href="#Now">func Now() Time</a>
+</li>
+<li> <a href="#Parse">func Parse(layout, value string) (Time, error)</a>
+</li>
+<li> <a href="#ParseInLocation">func ParseInLocation(layout, value string, loc *Location) (Time, error)</a>
+</li>
+<li> <a href="#Unix">func Unix(sec int64, nsec int64) Time</a>
+</li>
+<li> <a href="#UnixMicro">func UnixMicro(usec int64) Time</a>
+</li>
+<li> <a href="#UnixMilli">func UnixMilli(msec int64) Time</a>
+</li>
+<li> <a href="#Time.Add">func (t Time) Add(d Duration) Time</a>
+</li>
+<li> <a href="#Time.AddDate">func (t Time) AddDate(years int, months int, days int) Time</a>
+</li>
+<li> <a href="#Time.After">func (t Time) After(u Time) bool</a>
+</li>
+<li> <a href="#Time.AppendFormat">func (t Time) AppendFormat(b []byte, layout string) []byte</a>
+</li>
+<li> <a href="#Time.Before">func (t Time) Before(u Time) bool</a>
+</li>
+<li> <a href="#Time.Clock">func (t Time) Clock() (hour, min, sec int)</a>
+</li>
+<li> <a href="#Time.Compare">func (t Time) Compare(u Time) int</a>
+</li>
+<li> <a href="#Time.Date">func (t Time) Date() (year int, month Month, day int)</a>
+</li>
+<li> <a href="#Time.Day">func (t Time) Day() int</a>
+</li>
+<li> <a href="#Time.Equal">func (t Time) Equal(u Time) bool</a>
+</li>
+<li> <a href="#Time.Format">func (t Time) Format(layout string) string</a>
+</li>
+<li> <a href="#Time.GoString">func (t Time) GoString() string</a>
+</li>
+<li> <a href="#Time.GobDecode">func (t *Time) GobDecode(data []byte) error</a>
+</li>
+<li> <a href="#Time.GobEncode">func (t Time) GobEncode() ([]byte, error)</a>
+</li>
+<li> <a href="#Time.Hour">func (t Time) Hour() int</a>
+</li>
+<li> <a href="#Time.ISOWeek">func (t Time) ISOWeek() (year, week int)</a>
+</li>
+<li> <a href="#Time.In">func (t Time) In(loc *Location) Time</a>
+</li>
+<li> <a href="#Time.IsDST">func (t Time) IsDST() bool</a>
+</li>
+<li> <a href="#Time.IsZero">func (t Time) IsZero() bool</a>
+</li>
+<li> <a href="#Time.Local">func (t Time) Local() Time</a>
+</li>
+<li> <a href="#Time.Location">func (t Time) Location() *Location</a>
+</li>
+<li> <a href="#Time.MarshalBinary">func (t Time) MarshalBinary() ([]byte, error)</a>
+</li>
+<li> <a href="#Time.MarshalJSON">func (t Time) MarshalJSON() ([]byte, error)</a>
+</li>
+<li> <a href="#Time.MarshalText">func (t Time) MarshalText() ([]byte, error)</a>
+</li>
+<li> <a href="#Time.Minute">func (t Time) Minute() int</a>
+</li>
+<li> <a href="#Time.Month">func (t Time) Month() Month</a>
+</li>
+<li> <a href="#Time.Nanosecond">func (t Time) Nanosecond() int</a>
+</li>
+<li> <a href="#Time.Round">func (t Time) Round(d Duration) Time</a>
+</li>
+<li> <a href="#Time.Second">func (t Time) Second() int</a>
+</li>
+<li> <a href="#Time.String">func (t Time) String() string</a>
+</li>
+<li> <a href="#Time.Sub">func (t Time) Sub(u Time) Duration</a>
+</li>
+<li> <a href="#Time.Truncate">func (t Time) Truncate(d Duration) Time</a>
+</li>
+<li> <a href="#Time.UTC">func (t Time) UTC() Time</a>
+</li>
+<li> <a href="#Time.Unix">func (t Time) Unix() int64</a>
+</li>
+<li> <a href="#Time.UnixMicro">func (t Time) UnixMicro() int64</a>
+</li>
+<li> <a href="#Time.UnixMilli">func (t Time) UnixMilli() int64</a>
+</li>
+<li> <a href="#Time.UnixNano">func (t Time) UnixNano() int64</a>
+</li>
+<li> <a href="#Time.UnmarshalBinary">func (t *Time) UnmarshalBinary(data []byte) error</a>
+</li>
+<li> <a href="#Time.UnmarshalJSON">func (t *Time) UnmarshalJSON(data []byte) error</a>
+</li>
+<li> <a href="#Time.UnmarshalText">func (t *Time) UnmarshalText(data []byte) error</a>
+</li>
+<li> <a href="#Time.Weekday">func (t Time) Weekday() Weekday</a>
+</li>
+<li> <a href="#Time.Year">func (t Time) Year() int</a>
+</li>
+<li> <a href="#Time.YearDay">func (t Time) YearDay() int</a>
+</li>
+<li> <a href="#Time.Zone">func (t Time) Zone() (name string, offset int)</a>
+</li>
+<li> <a href="#Time.ZoneBounds">func (t Time) ZoneBounds() (start, end Time)</a>
+</li>
+<li><a href="#Timer">type Timer</a></li>
+<li> <a href="#AfterFunc">func AfterFunc(d Duration, f func()) *Timer</a>
+</li>
+<li> <a href="#NewTimer">func NewTimer(d Duration) *Timer</a>
+</li>
+<li> <a href="#Timer.Reset">func (t *Timer) Reset(d Duration) bool</a>
+</li>
+<li> <a href="#Timer.Stop">func (t *Timer) Stop() bool</a>
+</li>
+<li><a href="#Weekday">type Weekday</a></li>
+<li> <a href="#Weekday.String">func (d Weekday) String() string</a>
+</li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_After">After</a></dd> <dd><a class="exampleLink" href="#example_Date">Date</a></dd> <dd><a class="exampleLink" href="#example_Duration">Duration</a></dd> <dd><a class="exampleLink" href="#example_Duration_Hours">Duration.Hours</a></dd> <dd><a class="exampleLink" href="#example_Duration_Microseconds">Duration.Microseconds</a></dd> <dd><a class="exampleLink" href="#example_Duration_Milliseconds">Duration.Milliseconds</a></dd> <dd><a class="exampleLink" href="#example_Duration_Minutes">Duration.Minutes</a></dd> <dd><a class="exampleLink" href="#example_Duration_Nanoseconds">Duration.Nanoseconds</a></dd> <dd><a class="exampleLink" href="#example_Duration_Round">Duration.Round</a></dd> <dd><a class="exampleLink" href="#example_Duration_Seconds">Duration.Seconds</a></dd> <dd><a class="exampleLink" href="#example_Duration_String">Duration.String</a></dd> <dd><a class="exampleLink" href="#example_Duration_Truncate">Duration.Truncate</a></dd> <dd><a class="exampleLink" href="#example_FixedZone">FixedZone</a></dd> <dd><a class="exampleLink" href="#example_LoadLocation">LoadLocation</a></dd> <dd><a class="exampleLink" href="#example_Location">Location</a></dd> <dd><a class="exampleLink" href="#example_Month">Month</a></dd> <dd><a class="exampleLink" href="#example_NewTicker">NewTicker</a></dd> <dd><a class="exampleLink" href="#example_Parse">Parse</a></dd> <dd><a class="exampleLink" href="#example_ParseDuration">ParseDuration</a></dd> <dd><a class="exampleLink" href="#example_ParseInLocation">ParseInLocation</a></dd> <dd><a class="exampleLink" href="#example_Sleep">Sleep</a></dd> <dd><a class="exampleLink" href="#example_Tick">Tick</a></dd> <dd><a class="exampleLink" href="#example_Time_Add">Time.Add</a></dd> <dd><a class="exampleLink" href="#example_Time_AddDate">Time.AddDate</a></dd> <dd><a class="exampleLink" href="#example_Time_After">Time.After</a></dd> <dd><a class="exampleLink" href="#example_Time_AppendFormat">Time.AppendFormat</a></dd> <dd><a class="exampleLink" href="#example_Time_Before">Time.Before</a></dd> <dd><a class="exampleLink" href="#example_Time_Date">Time.Date</a></dd> <dd><a class="exampleLink" href="#example_Time_Day">Time.Day</a></dd> <dd><a class="exampleLink" href="#example_Time_Equal">Time.Equal</a></dd> <dd><a class="exampleLink" href="#example_Time_Format">Time.Format</a></dd> <dd><a class="exampleLink" href="#example_Time_Format_pad">Time.Format (Pad)</a></dd> <dd><a class="exampleLink" href="#example_Time_GoString">Time.GoString</a></dd> <dd><a class="exampleLink" href="#example_Time_Round">Time.Round</a></dd> <dd><a class="exampleLink" href="#example_Time_String">Time.String</a></dd> <dd><a class="exampleLink" href="#example_Time_Sub">Time.Sub</a></dd> <dd><a class="exampleLink" href="#example_Time_Truncate">Time.Truncate</a></dd> <dd><a class="exampleLink" href="#example_Time_Unix">Time.Unix</a></dd> <dd><a class="exampleLink" href="#example_Unix">Unix</a></dd> <dd><a class="exampleLink" href="#example_UnixMicro">UnixMicro</a></dd> <dd><a class="exampleLink" href="#example_UnixMilli">UnixMilli</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>format.go</span> <span>format_rfc3339.go</span> <span>sleep.go</span> <span>sys_unix.go</span> <span>tick.go</span> <span>time.go</span> <span>zoneinfo.go</span> <span>zoneinfo_goroot.go</span> <span>zoneinfo_read.go</span> <span>zoneinfo_unix.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>These are predefined layouts for use in Time.Format and time.Parse. The reference time used in these layouts is the specific time stamp: </p>
+<pre data-language="go">01/02 03:04:05PM '06 -0700
+</pre> <p>(January 2, 15:04:05, 2006, in time zone seven hours west of GMT). That value is recorded as the constant named Layout, listed below. As a Unix time, this is 1136239445. Since MST is GMT-0700, the reference would be printed by the Unix date command as: </p>
+<pre data-language="go">Mon Jan 2 15:04:05 MST 2006
+</pre> <p>It is a regrettable historic error that the date uses the American convention of putting the numerical month before the day. </p>
+<p>The example for Time.Format demonstrates the working of the layout string in detail and is a good reference. </p>
+<p>Note that the RFC822, RFC850, and RFC1123 formats should be applied only to local times. Applying them to UTC times will use "UTC" as the time zone abbreviation, while strictly speaking those RFCs require the use of "GMT" in that case. In general RFC1123Z should be used instead of RFC1123 for servers that insist on that format, and RFC3339 should be preferred for new protocols. RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; when used with time.Parse they do not accept all the time formats permitted by the RFCs and they do accept time formats not formally defined. The RFC3339Nano format removes trailing zeros from the seconds field and thus may not sort correctly once formatted. </p>
+<p>Most programs can use one of the defined constants as the layout passed to Format or Parse. The rest of this comment can be ignored unless you are creating a custom layout string. </p>
+<p>To define your own format, write down what the reference time would look like formatted your way; see the values of constants like ANSIC, StampMicro or Kitchen for examples. The model is to demonstrate what the reference time looks like so that the Format and Parse methods can apply the same transformation to a general time value. </p>
+<p>Here is a summary of the components of a layout string. Each element shows by example the formatting of an element of the reference time. Only these values are recognized. Text in the layout string that is not recognized as part of the reference time is echoed verbatim during Format and expected to appear verbatim in the input to Parse. </p>
+<pre data-language="go">Year: "2006" "06"
+Month: "Jan" "January" "01" "1"
+Day of the week: "Mon" "Monday"
+Day of the month: "2" "_2" "02"
+Day of the year: "__2" "002"
+Hour: "15" "3" "03" (PM or AM)
+Minute: "4" "04"
+Second: "5" "05"
+AM/PM mark: "PM"
+</pre> <p>Numeric time zone offsets format as follows: </p>
+<pre data-language="go">"-0700" ±hhmm
+"-07:00" ±hh:mm
+"-07" ±hh
+"-070000" ±hhmmss
+"-07:00:00" ±hh:mm:ss
+</pre> <p>Replacing the sign in the format with a Z triggers the ISO 8601 behavior of printing Z instead of an offset for the UTC zone. Thus: </p>
+<pre data-language="go">"Z0700" Z or ±hhmm
+"Z07:00" Z or ±hh:mm
+"Z07" Z or ±hh
+"Z070000" Z or ±hhmmss
+"Z07:00:00" Z or ±hh:mm:ss
+</pre> <p>Within the format string, the underscores in "_2" and "__2" represent spaces that may be replaced by digits if the following number has multiple digits, for compatibility with fixed-width Unix time formats. A leading zero represents a zero-padded value. </p>
+<p>The formats __2 and 002 are space-padded and zero-padded three-character day of year; there is no unpadded day of year format. </p>
+<p>A comma or decimal point followed by one or more zeros represents a fractional second, printed to the given number of decimal places. A comma or decimal point followed by one or more nines represents a fractional second, printed to the given number of decimal places, with trailing zeros removed. For example "15:04:05,000" or "15:04:05.000" formats or parses with millisecond precision. </p>
+<p>Some valid layouts are invalid time values for time.Parse, due to formats such as _ for space padding and Z for zone information. </p>
+<pre data-language="go">const (
+ Layout = "01/02 03:04:05PM '06 -0700" // The reference time, in numerical order.
+ ANSIC = "Mon Jan _2 15:04:05 2006"
+ UnixDate = "Mon Jan _2 15:04:05 MST 2006"
+ RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
+ RFC822 = "02 Jan 06 15:04 MST"
+ RFC822Z = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
+ RFC850 = "Monday, 02-Jan-06 15:04:05 MST"
+ RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST"
+ RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
+ RFC3339 = "2006-01-02T15:04:05Z07:00"
+ RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
+ Kitchen = "3:04PM"
+ // Handy time stamps.
+ Stamp = "Jan _2 15:04:05"
+ StampMilli = "Jan _2 15:04:05.000"
+ StampMicro = "Jan _2 15:04:05.000000"
+ StampNano = "Jan _2 15:04:05.000000000"
+ DateTime = "2006-01-02 15:04:05"
+ DateOnly = "2006-01-02"
+ TimeOnly = "15:04:05"
+)</pre> <p>Common durations. There is no definition for units of Day or larger to avoid confusion across daylight savings time zone transitions. </p>
+<p>To count the number of units in a Duration, divide: </p>
+<pre data-language="go">second := time.Second
+fmt.Print(int64(second/time.Millisecond)) // prints 1000
+</pre> <p>To convert an integer number of units to a Duration, multiply: </p>
+<pre data-language="go">seconds := 10
+fmt.Print(time.Duration(seconds)*time.Second) // prints 10s
+</pre> <pre data-language="go">const (
+ Nanosecond Duration = 1
+ Microsecond = 1000 * Nanosecond
+ Millisecond = 1000 * Microsecond
+ Second = 1000 * Millisecond
+ Minute = 60 * Second
+ Hour = 60 * Minute
+)</pre> <h2 id="After">func <span>After</span> </h2> <pre data-language="go">func After(d Duration) &lt;-chan Time</pre> <p>After waits for the duration to elapse and then sends the current time on the returned channel. It is equivalent to NewTimer(d).C. The underlying Timer is not recovered by the garbage collector until the timer fires. If efficiency is a concern, use NewTimer instead and call Timer.Stop if the timer is no longer needed. </p> <h4 id="example_After"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+select {
+case m := &lt;-c:
+ handle(m)
+case &lt;-time.After(10 * time.Second):
+ fmt.Println("timed out")
+}
+</pre> <h2 id="Sleep">func <span>Sleep</span> </h2> <pre data-language="go">func Sleep(d Duration)</pre> <p>Sleep pauses the current goroutine for at least the duration d. A negative or zero duration causes Sleep to return immediately. </p> <h4 id="example_Sleep"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+time.Sleep(100 * time.Millisecond)
+</pre> <h2 id="Tick">func <span>Tick</span> </h2> <pre data-language="go">func Tick(d Duration) &lt;-chan Time</pre> <p>Tick is a convenience wrapper for NewTicker providing access to the ticking channel only. While Tick is useful for clients that have no need to shut down the Ticker, be aware that without a way to shut it down the underlying Ticker cannot be recovered by the garbage collector; it "leaks". Unlike NewTicker, Tick will return nil if d &lt;= 0. </p> <h4 id="example_Tick"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+c := time.Tick(5 * time.Second)
+for next := range c {
+ fmt.Printf("%v %s\n", next, statusUpdate())
+}
+</pre> <h2 id="Duration">type <span>Duration</span> </h2> <p>A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years. </p>
+<pre data-language="go">type Duration int64</pre> <h4 id="example_Duration"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+t0 := time.Now()
+expensiveCall()
+t1 := time.Now()
+fmt.Printf("The call took %v to run.\n", t1.Sub(t0))
+</pre> <h3 id="ParseDuration">func <span>ParseDuration</span> </h3> <pre data-language="go">func ParseDuration(s string) (Duration, error)</pre> <p>ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". </p> <h4 id="example_ParseDuration"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">hours, _ := time.ParseDuration("10h")
+complex, _ := time.ParseDuration("1h10m10s")
+micro, _ := time.ParseDuration("1µs")
+// The package also accepts the incorrect but common prefix u for micro.
+micro2, _ := time.ParseDuration("1us")
+
+fmt.Println(hours)
+fmt.Println(complex)
+fmt.Printf("There are %.0f seconds in %v.\n", complex.Seconds(), complex)
+fmt.Printf("There are %d nanoseconds in %v.\n", micro.Nanoseconds(), micro)
+fmt.Printf("There are %6.2e seconds in %v.\n", micro2.Seconds(), micro)
+</pre> <p>Output:</p> <pre class="output" data-language="go">10h0m0s
+1h10m10s
+There are 4210 seconds in 1h10m10s.
+There are 1000 nanoseconds in 1µs.
+There are 1.00e-06 seconds in 1µs.
+</pre> <h3 id="Since">func <span>Since</span> </h3> <pre data-language="go">func Since(t Time) Duration</pre> <p>Since returns the time elapsed since t. It is shorthand for time.Now().Sub(t). </p>
+<h3 id="Until">func <span>Until</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func Until(t Time) Duration</pre> <p>Until returns the duration until t. It is shorthand for t.Sub(time.Now()). </p>
+<h3 id="Duration.Abs">func (Duration) <span>Abs</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (d Duration) Abs() Duration</pre> <p>Abs returns the absolute value of d. As a special case, math.MinInt64 is converted to math.MaxInt64. </p>
+<h3 id="Duration.Hours">func (Duration) <span>Hours</span> </h3> <pre data-language="go">func (d Duration) Hours() float64</pre> <p>Hours returns the duration as a floating point number of hours. </p> <h4 id="example_Duration_Hours"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">h, _ := time.ParseDuration("4h30m")
+fmt.Printf("I've got %.1f hours of work left.", h.Hours())
+</pre> <p>Output:</p> <pre class="output" data-language="go">I've got 4.5 hours of work left.
+</pre> <h3 id="Duration.Microseconds">func (Duration) <span>Microseconds</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (d Duration) Microseconds() int64</pre> <p>Microseconds returns the duration as an integer microsecond count. </p> <h4 id="example_Duration_Microseconds"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, _ := time.ParseDuration("1s")
+fmt.Printf("One second is %d microseconds.\n", u.Microseconds())
+</pre> <p>Output:</p> <pre class="output" data-language="go">One second is 1000000 microseconds.
+</pre> <h3 id="Duration.Milliseconds">func (Duration) <span>Milliseconds</span> <span title="Added in Go 1.13">1.13</span> </h3> <pre data-language="go">func (d Duration) Milliseconds() int64</pre> <p>Milliseconds returns the duration as an integer millisecond count. </p> <h4 id="example_Duration_Milliseconds"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, _ := time.ParseDuration("1s")
+fmt.Printf("One second is %d milliseconds.\n", u.Milliseconds())
+</pre> <p>Output:</p> <pre class="output" data-language="go">One second is 1000 milliseconds.
+</pre> <h3 id="Duration.Minutes">func (Duration) <span>Minutes</span> </h3> <pre data-language="go">func (d Duration) Minutes() float64</pre> <p>Minutes returns the duration as a floating point number of minutes. </p> <h4 id="example_Duration_Minutes"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">m, _ := time.ParseDuration("1h30m")
+fmt.Printf("The movie is %.0f minutes long.", m.Minutes())
+</pre> <p>Output:</p> <pre class="output" data-language="go">The movie is 90 minutes long.
+</pre> <h3 id="Duration.Nanoseconds">func (Duration) <span>Nanoseconds</span> </h3> <pre data-language="go">func (d Duration) Nanoseconds() int64</pre> <p>Nanoseconds returns the duration as an integer nanosecond count. </p> <h4 id="example_Duration_Nanoseconds"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">u, _ := time.ParseDuration("1µs")
+fmt.Printf("One microsecond is %d nanoseconds.\n", u.Nanoseconds())
+</pre> <p>Output:</p> <pre class="output" data-language="go">One microsecond is 1000 nanoseconds.
+</pre> <h3 id="Duration.Round">func (Duration) <span>Round</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (d Duration) Round(m Duration) Duration</pre> <p>Round returns the result of rounding d to the nearest multiple of m. The rounding behavior for halfway values is to round away from zero. If the result exceeds the maximum (or minimum) value that can be stored in a Duration, Round returns the maximum (or minimum) duration. If m &lt;= 0, Round returns d unchanged. </p> <h4 id="example_Duration_Round"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">d, err := time.ParseDuration("1h15m30.918273645s")
+if err != nil {
+ panic(err)
+}
+
+round := []time.Duration{
+ time.Nanosecond,
+ time.Microsecond,
+ time.Millisecond,
+ time.Second,
+ 2 * time.Second,
+ time.Minute,
+ 10 * time.Minute,
+ time.Hour,
+}
+
+for _, r := range round {
+ fmt.Printf("d.Round(%6s) = %s\n", r, d.Round(r).String())
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">d.Round( 1ns) = 1h15m30.918273645s
+d.Round( 1µs) = 1h15m30.918274s
+d.Round( 1ms) = 1h15m30.918s
+d.Round( 1s) = 1h15m31s
+d.Round( 2s) = 1h15m30s
+d.Round( 1m0s) = 1h16m0s
+d.Round( 10m0s) = 1h20m0s
+d.Round(1h0m0s) = 1h0m0s
+</pre> <h3 id="Duration.Seconds">func (Duration) <span>Seconds</span> </h3> <pre data-language="go">func (d Duration) Seconds() float64</pre> <p>Seconds returns the duration as a floating point number of seconds. </p> <h4 id="example_Duration_Seconds"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">m, _ := time.ParseDuration("1m30s")
+fmt.Printf("Take off in t-%.0f seconds.", m.Seconds())
+</pre> <p>Output:</p> <pre class="output" data-language="go">Take off in t-90 seconds.
+</pre> <h3 id="Duration.String">func (Duration) <span>String</span> </h3> <pre data-language="go">func (d Duration) String() string</pre> <p>String returns a string representing the duration in the form "72h3m0.5s". Leading zero units are omitted. As a special case, durations less than one second format use a smaller unit (milli-, micro-, or nanoseconds) to ensure that the leading digit is non-zero. The zero duration formats as 0s. </p> <h4 id="example_Duration_String"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(1*time.Hour + 2*time.Minute + 300*time.Millisecond)
+fmt.Println(300 * time.Millisecond)
+</pre> <p>Output:</p> <pre class="output" data-language="go">1h2m0.3s
+300ms
+</pre> <h3 id="Duration.Truncate">func (Duration) <span>Truncate</span> <span title="Added in Go 1.9">1.9</span> </h3> <pre data-language="go">func (d Duration) Truncate(m Duration) Duration</pre> <p>Truncate returns the result of rounding d toward zero to a multiple of m. If m &lt;= 0, Truncate returns d unchanged. </p> <h4 id="example_Duration_Truncate"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">d, err := time.ParseDuration("1h15m30.918273645s")
+if err != nil {
+ panic(err)
+}
+
+trunc := []time.Duration{
+ time.Nanosecond,
+ time.Microsecond,
+ time.Millisecond,
+ time.Second,
+ 2 * time.Second,
+ time.Minute,
+ 10 * time.Minute,
+ time.Hour,
+}
+
+for _, t := range trunc {
+ fmt.Printf("d.Truncate(%6s) = %s\n", t, d.Truncate(t).String())
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">d.Truncate( 1ns) = 1h15m30.918273645s
+d.Truncate( 1µs) = 1h15m30.918273s
+d.Truncate( 1ms) = 1h15m30.918s
+d.Truncate( 1s) = 1h15m30s
+d.Truncate( 2s) = 1h15m30s
+d.Truncate( 1m0s) = 1h15m0s
+d.Truncate( 10m0s) = 1h10m0s
+d.Truncate(1h0m0s) = 1h0m0s
+</pre> <h2 id="Location">type <span>Location</span> </h2> <p>A Location maps time instants to the zone in use at that time. Typically, the Location represents the collection of time offsets in use in a geographical area. For many Locations the time offset varies depending on whether daylight savings time is in use at the time instant. </p>
+<p>Location is used to provide a time zone in a printed Time value and for calculations involving intervals that may cross daylight savings time boundaries. </p>
+<pre data-language="go">type Location struct {
+ // contains filtered or unexported fields
+}
+</pre> <p>Local represents the system's local time zone. On Unix systems, Local consults the TZ environment variable to find the time zone to use. No TZ means use the system default /etc/localtime. TZ="" means use UTC. TZ="foo" means use file foo in the system timezone directory. </p>
+<pre data-language="go">var Local *Location = &amp;localLoc</pre> <p>UTC represents Universal Coordinated Time (UTC). </p>
+<pre data-language="go">var UTC *Location = &amp;utcLoc</pre> <h4 id="example_Location"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// China doesn't have daylight saving. It uses a fixed 8 hour offset from UTC.
+secondsEastOfUTC := int((8 * time.Hour).Seconds())
+beijing := time.FixedZone("Beijing Time", secondsEastOfUTC)
+
+// If the system has a timezone database present, it's possible to load a location
+// from that, e.g.:
+// newYork, err := time.LoadLocation("America/New_York")
+
+// Creating a time requires a location. Common locations are time.Local and time.UTC.
+timeInUTC := time.Date(2009, 1, 1, 12, 0, 0, 0, time.UTC)
+sameTimeInBeijing := time.Date(2009, 1, 1, 20, 0, 0, 0, beijing)
+
+// Although the UTC clock time is 1200 and the Beijing clock time is 2000, Beijing is
+// 8 hours ahead so the two dates actually represent the same instant.
+timesAreEqual := timeInUTC.Equal(sameTimeInBeijing)
+fmt.Println(timesAreEqual)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+</pre> <h3 id="FixedZone">func <span>FixedZone</span> </h3> <pre data-language="go">func FixedZone(name string, offset int) *Location</pre> <p>FixedZone returns a Location that always uses the given zone name and offset (seconds east of UTC). </p> <h4 id="example_FixedZone"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">loc := time.FixedZone("UTC-8", -8*60*60)
+t := time.Date(2009, time.November, 10, 23, 0, 0, 0, loc)
+fmt.Println("The time is:", t.Format(time.RFC822))
+</pre> <p>Output:</p> <pre class="output" data-language="go">The time is: 10 Nov 09 23:00 UTC-8
+</pre> <h3 id="LoadLocation">func <span>LoadLocation</span> </h3> <pre data-language="go">func LoadLocation(name string) (*Location, error)</pre> <p>LoadLocation returns the Location with the given name. </p>
+<p>If the name is "" or "UTC", LoadLocation returns UTC. If the name is "Local", LoadLocation returns Local. </p>
+<p>Otherwise, the name is taken to be a location name corresponding to a file in the IANA Time Zone database, such as "America/New_York". </p>
+<p>LoadLocation looks for the IANA Time Zone database in the following locations in order: </p>
+<ul> <li>the directory or uncompressed zip file named by the ZONEINFO environment variable </li>
+<li>on a Unix system, the system standard installation location </li>
+<li>$GOROOT/lib/time/zoneinfo.zip </li>
+<li>the time/tzdata package, if it was imported </li>
+</ul> <h4 id="example_LoadLocation"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">location, err := time.LoadLocation("America/Los_Angeles")
+if err != nil {
+ panic(err)
+}
+
+timeInUTC := time.Date(2018, 8, 30, 12, 0, 0, 0, time.UTC)
+fmt.Println(timeInUTC.In(location))
+</pre> <p>Output:</p> <pre class="output" data-language="go">2018-08-30 05:00:00 -0700 PDT
+</pre> <h3 id="LoadLocationFromTZData">func <span>LoadLocationFromTZData</span> <span title="Added in Go 1.10">1.10</span> </h3> <pre data-language="go">func LoadLocationFromTZData(name string, data []byte) (*Location, error)</pre> <p>LoadLocationFromTZData returns a Location with the given name initialized from the IANA Time Zone database-formatted data. The data should be in the format of a standard IANA time zone file (for example, the content of /etc/localtime on Unix systems). </p>
+<h3 id="Location.String">func (*Location) <span>String</span> </h3> <pre data-language="go">func (l *Location) String() string</pre> <p>String returns a descriptive name for the time zone information, corresponding to the name argument to LoadLocation or FixedZone. </p>
+<h2 id="Month">type <span>Month</span> </h2> <p>A Month specifies a month of the year (January = 1, ...). </p>
+<pre data-language="go">type Month int</pre> <pre data-language="go">const (
+ January Month = 1 + iota
+ February
+ March
+ April
+ May
+ June
+ July
+ August
+ September
+ October
+ November
+ December
+)</pre> <h4 id="example_Month"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+_, month, day := time.Now().Date()
+if month == time.November &amp;&amp; day == 10 {
+ fmt.Println("Happy Go day!")
+}
+</pre> <h3 id="Month.String">func (Month) <span>String</span> </h3> <pre data-language="go">func (m Month) String() string</pre> <p>String returns the English name of the month ("January", "February", ...). </p>
+<h2 id="ParseError">type <span>ParseError</span> </h2> <p>ParseError describes a problem parsing a time string. </p>
+<pre data-language="go">type ParseError struct {
+ Layout string
+ Value string
+ LayoutElem string
+ ValueElem string
+ Message string
+}
+</pre> <h3 id="ParseError.Error">func (*ParseError) <span>Error</span> </h3> <pre data-language="go">func (e *ParseError) Error() string</pre> <p>Error returns the string representation of a ParseError. </p>
+<h2 id="Ticker">type <span>Ticker</span> </h2> <p>A Ticker holds a channel that delivers “ticks” of a clock at intervals. </p>
+<pre data-language="go">type Ticker struct {
+ C &lt;-chan Time // The channel on which the ticks are delivered.
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewTicker">func <span>NewTicker</span> </h3> <pre data-language="go">func NewTicker(d Duration) *Ticker</pre> <p>NewTicker returns a new Ticker containing a channel that will send the current time on the channel after each tick. The period of the ticks is specified by the duration argument. The ticker will adjust the time interval or drop ticks to make up for slow receivers. The duration d must be greater than zero; if not, NewTicker will panic. Stop the ticker to release associated resources. </p> <h4 id="example_NewTicker"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">
+ticker := time.NewTicker(time.Second)
+defer ticker.Stop()
+done := make(chan bool)
+go func() {
+ time.Sleep(10 * time.Second)
+ done &lt;- true
+}()
+for {
+ select {
+ case &lt;-done:
+ fmt.Println("Done!")
+ return
+ case t := &lt;-ticker.C:
+ fmt.Println("Current time: ", t)
+ }
+}
+</pre> <h3 id="Ticker.Reset">func (*Ticker) <span>Reset</span> <span title="Added in Go 1.15">1.15</span> </h3> <pre data-language="go">func (t *Ticker) Reset(d Duration)</pre> <p>Reset stops a ticker and resets its period to the specified duration. The next tick will arrive after the new period elapses. The duration d must be greater than zero; if not, Reset will panic. </p>
+<h3 id="Ticker.Stop">func (*Ticker) <span>Stop</span> </h3> <pre data-language="go">func (t *Ticker) Stop()</pre> <p>Stop turns off a ticker. After Stop, no more ticks will be sent. Stop does not close the channel, to prevent a concurrent goroutine reading from the channel from seeing an erroneous "tick". </p>
+<h2 id="Time">type <span>Time</span> </h2> <p>A Time represents an instant in time with nanosecond precision. </p>
+<p>Programs using times should typically store and pass them as values, not pointers. That is, time variables and struct fields should be of type time.Time, not *time.Time. </p>
+<p>A Time value can be used by multiple goroutines simultaneously except that the methods GobDecode, UnmarshalBinary, UnmarshalJSON and UnmarshalText are not concurrency-safe. </p>
+<p>Time instants can be compared using the Before, After, and Equal methods. The Sub method subtracts two instants, producing a Duration. The Add method adds a Time and a Duration, producing a Time. </p>
+<p>The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC. As this time is unlikely to come up in practice, the IsZero method gives a simple way of detecting a time that has not been initialized explicitly. </p>
+<p>Each time has an associated Location. The methods Local, UTC, and In return a Time with a specific Location. Changing the Location of a Time value with these methods does not change the actual instant it represents, only the time zone in which to interpret it. </p>
+<p>Representations of a Time value saved by the GobEncode, MarshalBinary, MarshalJSON, and MarshalText methods store the Time.Location's offset, but not the location name. They therefore lose information about Daylight Saving Time. </p>
+<p>In addition to the required “wall clock” reading, a Time may contain an optional reading of the current process's monotonic clock, to provide additional precision for comparison or subtraction. See the “Monotonic Clocks” section in the package documentation for details. </p>
+<p>Note that the Go == operator compares not just the time instant but also the Location and the monotonic clock reading. Therefore, Time values should not be used as map or database keys without first guaranteeing that the identical Location has been set for all values, which can be achieved through use of the UTC or Local method, and that the monotonic clock reading has been stripped by setting t = t.Round(0). In general, prefer t.Equal(u) to t == u, since t.Equal uses the most accurate comparison available and correctly handles the case when only one of its arguments has a monotonic clock reading. </p>
+<pre data-language="go">type Time struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Date">func <span>Date</span> </h3> <pre data-language="go">func Date(year int, month Month, day, hour, min, sec, nsec int, loc *Location) Time</pre> <p>Date returns the Time corresponding to </p>
+<pre data-language="go">yyyy-mm-dd hh:mm:ss + nsec nanoseconds
+</pre> <p>in the appropriate zone for that time in the given location. </p>
+<p>The month, day, hour, min, sec, and nsec values may be outside their usual ranges and will be normalized during the conversion. For example, October 32 converts to November 1. </p>
+<p>A daylight savings time transition skips or repeats times. For example, in the United States, March 13, 2011 2:15am never occurred, while November 6, 2011 1:15am occurred twice. In such cases, the choice of time zone, and therefore the time, is not well-defined. Date returns a time that is correct in one of the two zones involved in the transition, but it does not guarantee which. </p>
+<p>Date panics if loc is nil. </p> <h4 id="example_Date"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">t := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+fmt.Printf("Go launched at %s\n", t.Local())
+</pre> <p>Output:</p> <pre class="output" data-language="go">Go launched at 2009-11-10 15:00:00 -0800 PST
+</pre> <h3 id="Now">func <span>Now</span> </h3> <pre data-language="go">func Now() Time</pre> <p>Now returns the current local time. </p>
+<h3 id="Parse">func <span>Parse</span> </h3> <pre data-language="go">func Parse(layout, value string) (Time, error)</pre> <p>Parse parses a formatted string and returns the time value it represents. See the documentation for the constant called Layout to see how to represent the format. The second argument must be parseable using the format string (layout) provided as the first argument. </p>
+<p>The example for Time.Format demonstrates the working of the layout string in detail and is a good reference. </p>
+<p>When parsing (only), the input may contain a fractional second field immediately after the seconds field, even if the layout does not signify its presence. In that case either a comma or a decimal point followed by a maximal series of digits is parsed as a fractional second. Fractional seconds are truncated to nanosecond precision. </p>
+<p>Elements omitted from the layout are assumed to be zero or, when zero is impossible, one, so parsing "3:04pm" returns the time corresponding to Jan 1, year 0, 15:04:00 UTC (note that because the year is 0, this time is before the zero Time). Years must be in the range 0000..9999. The day of the week is checked for syntax but it is otherwise ignored. </p>
+<p>For layouts specifying the two-digit year 06, a value NN &gt;= 69 will be treated as 19NN and a value NN &lt; 69 will be treated as 20NN. </p>
+<p>The remainder of this comment describes the handling of time zones. </p>
+<p>In the absence of a time zone indicator, Parse returns a time in UTC. </p>
+<p>When parsing a time with a zone offset like -0700, if the offset corresponds to a time zone used by the current location (Local), then Parse uses that location and zone in the returned time. Otherwise it records the time as being in a fabricated location with time fixed at the given zone offset. </p>
+<p>When parsing a time with a zone abbreviation like MST, if the zone abbreviation has a defined offset in the current location, then that offset is used. The zone abbreviation "UTC" is recognized as UTC regardless of location. If the zone abbreviation is unknown, Parse records the time as being in a fabricated location with the given zone abbreviation and a zero offset. This choice means that such a time can be parsed and reformatted with the same layout losslessly, but the exact instant used in the representation will differ by the actual zone offset. To avoid such problems, prefer time layouts that use a numeric zone offset, or use ParseInLocation. </p> <h4 id="example_Parse"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// See the example for Time.Format for a thorough description of how
+// to define the layout string to parse a time.Time value; Parse and
+// Format use the same model to describe their input and output.
+
+// longForm shows by example how the reference time would be represented in
+// the desired layout.
+const longForm = "Jan 2, 2006 at 3:04pm (MST)"
+t, _ := time.Parse(longForm, "Feb 3, 2013 at 7:54pm (PST)")
+fmt.Println(t)
+
+// shortForm is another way the reference time would be represented
+// in the desired layout; it has no time zone present.
+// Note: without explicit zone, returns time in UTC.
+const shortForm = "2006-Jan-02"
+t, _ = time.Parse(shortForm, "2013-Feb-03")
+fmt.Println(t)
+
+// Some valid layouts are invalid time values, due to format specifiers
+// such as _ for space padding and Z for zone information.
+// For example the RFC3339 layout 2006-01-02T15:04:05Z07:00
+// contains both Z and a time zone offset in order to handle both valid options:
+// 2006-01-02T15:04:05Z
+// 2006-01-02T15:04:05+07:00
+t, _ = time.Parse(time.RFC3339, "2006-01-02T15:04:05Z")
+fmt.Println(t)
+t, _ = time.Parse(time.RFC3339, "2006-01-02T15:04:05+07:00")
+fmt.Println(t)
+_, err := time.Parse(time.RFC3339, time.RFC3339)
+fmt.Println("error", err) // Returns an error as the layout is not a valid time value
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">2013-02-03 19:54:00 -0800 PST
+2013-02-03 00:00:00 +0000 UTC
+2006-01-02 15:04:05 +0000 UTC
+2006-01-02 15:04:05 +0700 +0700
+error parsing time "2006-01-02T15:04:05Z07:00": extra text: "07:00"
+</pre> <h3 id="ParseInLocation">func <span>ParseInLocation</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func ParseInLocation(layout, value string, loc *Location) (Time, error)</pre> <p>ParseInLocation is like Parse but differs in two important ways. First, in the absence of time zone information, Parse interprets a time as UTC; ParseInLocation interprets the time as in the given location. Second, when given a zone offset or abbreviation, Parse tries to match it against the Local location; ParseInLocation uses the given location. </p> <h4 id="example_ParseInLocation"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">loc, _ := time.LoadLocation("Europe/Berlin")
+
+// This will look for the name CEST in the Europe/Berlin time zone.
+const longForm = "Jan 2, 2006 at 3:04pm (MST)"
+t, _ := time.ParseInLocation(longForm, "Jul 9, 2012 at 5:02am (CEST)", loc)
+fmt.Println(t)
+
+// Note: without explicit zone, returns time in given location.
+const shortForm = "2006-Jan-02"
+t, _ = time.ParseInLocation(shortForm, "2012-Jul-09", loc)
+fmt.Println(t)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">2012-07-09 05:02:00 +0200 CEST
+2012-07-09 00:00:00 +0200 CEST
+</pre> <h3 id="Unix">func <span>Unix</span> </h3> <pre data-language="go">func Unix(sec int64, nsec int64) Time</pre> <p>Unix returns the local Time corresponding to the given Unix time, sec seconds and nsec nanoseconds since January 1, 1970 UTC. It is valid to pass nsec outside the range [0, 999999999]. Not all sec values have a corresponding time value. One such value is 1&lt;&lt;63-1 (the largest int64 value). </p> <h4 id="example_Unix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">unixTime := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+fmt.Println(unixTime.Unix())
+t := time.Unix(unixTime.Unix(), 0).UTC()
+fmt.Println(t)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1257894000
+2009-11-10 23:00:00 +0000 UTC
+</pre> <h3 id="UnixMicro">func <span>UnixMicro</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func UnixMicro(usec int64) Time</pre> <p>UnixMicro returns the local Time corresponding to the given Unix time, usec microseconds since January 1, 1970 UTC. </p> <h4 id="example_UnixMicro"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">umt := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+fmt.Println(umt.UnixMicro())
+t := time.UnixMicro(umt.UnixMicro()).UTC()
+fmt.Println(t)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1257894000000000
+2009-11-10 23:00:00 +0000 UTC
+</pre> <h3 id="UnixMilli">func <span>UnixMilli</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func UnixMilli(msec int64) Time</pre> <p>UnixMilli returns the local Time corresponding to the given Unix time, msec milliseconds since January 1, 1970 UTC. </p> <h4 id="example_UnixMilli"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">umt := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+fmt.Println(umt.UnixMilli())
+t := time.UnixMilli(umt.UnixMilli()).UTC()
+fmt.Println(t)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">1257894000000
+2009-11-10 23:00:00 +0000 UTC
+</pre> <h3 id="Time.Add">func (Time) <span>Add</span> </h3> <pre data-language="go">func (t Time) Add(d Duration) Time</pre> <p>Add returns the time t+d. </p> <h4 id="example_Time_Add"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">start := time.Date(2009, 1, 1, 12, 0, 0, 0, time.UTC)
+afterTenSeconds := start.Add(time.Second * 10)
+afterTenMinutes := start.Add(time.Minute * 10)
+afterTenHours := start.Add(time.Hour * 10)
+afterTenDays := start.Add(time.Hour * 24 * 10)
+
+fmt.Printf("start = %v\n", start)
+fmt.Printf("start.Add(time.Second * 10) = %v\n", afterTenSeconds)
+fmt.Printf("start.Add(time.Minute * 10) = %v\n", afterTenMinutes)
+fmt.Printf("start.Add(time.Hour * 10) = %v\n", afterTenHours)
+fmt.Printf("start.Add(time.Hour * 24 * 10) = %v\n", afterTenDays)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">start = 2009-01-01 12:00:00 +0000 UTC
+start.Add(time.Second * 10) = 2009-01-01 12:00:10 +0000 UTC
+start.Add(time.Minute * 10) = 2009-01-01 12:10:00 +0000 UTC
+start.Add(time.Hour * 10) = 2009-01-01 22:00:00 +0000 UTC
+start.Add(time.Hour * 24 * 10) = 2009-01-11 12:00:00 +0000 UTC
+</pre> <h3 id="Time.AddDate">func (Time) <span>AddDate</span> </h3> <pre data-language="go">func (t Time) AddDate(years int, months int, days int) Time</pre> <p>AddDate returns the time corresponding to adding the given number of years, months, and days to t. For example, AddDate(-1, 2, 3) applied to January 1, 2011 returns March 4, 2010. </p>
+<p>Note that dates are fundamentally coupled to timezones, and calendrical periods like days don't have fixed durations. AddDate uses the Location of the Time value to determine these durations. That means that the same AddDate arguments can produce a different shift in absolute time depending on the base Time value and its Location. For example, AddDate(0, 0, 1) applied to 12:00 on March 27 always returns 12:00 on March 28. At some locations and in some years this is a 24 hour shift. In others it's a 23 hour shift due to daylight savings time transitions. </p>
+<p>AddDate normalizes its result in the same way that Date does, so, for example, adding one month to October 31 yields December 1, the normalized form for November 31. </p> <h4 id="example_Time_AddDate"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">start := time.Date(2023, 03, 25, 12, 0, 0, 0, time.UTC)
+oneDayLater := start.AddDate(0, 0, 1)
+dayDuration := oneDayLater.Sub(start)
+oneMonthLater := start.AddDate(0, 1, 0)
+oneYearLater := start.AddDate(1, 0, 0)
+
+zurich, err := time.LoadLocation("Europe/Zurich")
+if err != nil {
+ panic(err)
+}
+// This was the day before a daylight saving time transition in Zürich.
+startZurich := time.Date(2023, 03, 25, 12, 0, 0, 0, zurich)
+oneDayLaterZurich := startZurich.AddDate(0, 0, 1)
+dayDurationZurich := oneDayLaterZurich.Sub(startZurich)
+
+fmt.Printf("oneDayLater: start.AddDate(0, 0, 1) = %v\n", oneDayLater)
+fmt.Printf("oneMonthLater: start.AddDate(0, 1, 0) = %v\n", oneMonthLater)
+fmt.Printf("oneYearLater: start.AddDate(1, 0, 0) = %v\n", oneYearLater)
+fmt.Printf("oneDayLaterZurich: startZurich.AddDate(0, 0, 1) = %v\n", oneDayLaterZurich)
+fmt.Printf("Day duration in UTC: %v | Day duration in Zürich: %v\n", dayDuration, dayDurationZurich)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">oneDayLater: start.AddDate(0, 0, 1) = 2023-03-26 12:00:00 +0000 UTC
+oneMonthLater: start.AddDate(0, 1, 0) = 2023-04-25 12:00:00 +0000 UTC
+oneYearLater: start.AddDate(1, 0, 0) = 2024-03-25 12:00:00 +0000 UTC
+oneDayLaterZurich: startZurich.AddDate(0, 0, 1) = 2023-03-26 12:00:00 +0200 CEST
+Day duration in UTC: 24h0m0s | Day duration in Zürich: 23h0m0s
+</pre> <h3 id="Time.After">func (Time) <span>After</span> </h3> <pre data-language="go">func (t Time) After(u Time) bool</pre> <p>After reports whether the time instant t is after u. </p> <h4 id="example_Time_After"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">year2000 := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)
+year3000 := time.Date(3000, 1, 1, 0, 0, 0, 0, time.UTC)
+
+isYear3000AfterYear2000 := year3000.After(year2000) // True
+isYear2000AfterYear3000 := year2000.After(year3000) // False
+
+fmt.Printf("year3000.After(year2000) = %v\n", isYear3000AfterYear2000)
+fmt.Printf("year2000.After(year3000) = %v\n", isYear2000AfterYear3000)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">year3000.After(year2000) = true
+year2000.After(year3000) = false
+</pre> <h3 id="Time.AppendFormat">func (Time) <span>AppendFormat</span> <span title="Added in Go 1.5">1.5</span> </h3> <pre data-language="go">func (t Time) AppendFormat(b []byte, layout string) []byte</pre> <p>AppendFormat is like Format but appends the textual representation to b and returns the extended buffer. </p> <h4 id="example_Time_AppendFormat"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">t := time.Date(2017, time.November, 4, 11, 0, 0, 0, time.UTC)
+text := []byte("Time: ")
+
+text = t.AppendFormat(text, time.Kitchen)
+fmt.Println(string(text))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Time: 11:00AM
+</pre> <h3 id="Time.Before">func (Time) <span>Before</span> </h3> <pre data-language="go">func (t Time) Before(u Time) bool</pre> <p>Before reports whether the time instant t is before u. </p> <h4 id="example_Time_Before"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">year2000 := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)
+year3000 := time.Date(3000, 1, 1, 0, 0, 0, 0, time.UTC)
+
+isYear2000BeforeYear3000 := year2000.Before(year3000) // True
+isYear3000BeforeYear2000 := year3000.Before(year2000) // False
+
+fmt.Printf("year2000.Before(year3000) = %v\n", isYear2000BeforeYear3000)
+fmt.Printf("year3000.Before(year2000) = %v\n", isYear3000BeforeYear2000)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">year2000.Before(year3000) = true
+year3000.Before(year2000) = false
+</pre> <h3 id="Time.Clock">func (Time) <span>Clock</span> </h3> <pre data-language="go">func (t Time) Clock() (hour, min, sec int)</pre> <p>Clock returns the hour, minute, and second within the day specified by t. </p>
+<h3 id="Time.Compare">func (Time) <span>Compare</span> <span title="Added in Go 1.20">1.20</span> </h3> <pre data-language="go">func (t Time) Compare(u Time) int</pre> <p>Compare compares the time instant t with u. If t is before u, it returns -1; if t is after u, it returns +1; if they're the same, it returns 0. </p>
+<h3 id="Time.Date">func (Time) <span>Date</span> </h3> <pre data-language="go">func (t Time) Date() (year int, month Month, day int)</pre> <p>Date returns the year, month, and day in which t occurs. </p> <h4 id="example_Time_Date"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">d := time.Date(2000, 2, 1, 12, 30, 0, 0, time.UTC)
+year, month, day := d.Date()
+
+fmt.Printf("year = %v\n", year)
+fmt.Printf("month = %v\n", month)
+fmt.Printf("day = %v\n", day)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">year = 2000
+month = February
+day = 1
+</pre> <h3 id="Time.Day">func (Time) <span>Day</span> </h3> <pre data-language="go">func (t Time) Day() int</pre> <p>Day returns the day of the month specified by t. </p> <h4 id="example_Time_Day"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">d := time.Date(2000, 2, 1, 12, 30, 0, 0, time.UTC)
+day := d.Day()
+
+fmt.Printf("day = %v\n", day)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">day = 1
+</pre> <h3 id="Time.Equal">func (Time) <span>Equal</span> </h3> <pre data-language="go">func (t Time) Equal(u Time) bool</pre> <p>Equal reports whether t and u represent the same time instant. Two times can be equal even if they are in different locations. For example, 6:00 +0200 and 4:00 UTC are Equal. See the documentation on the Time type for the pitfalls of using == with Time values; most code should use Equal instead. </p> <h4 id="example_Time_Equal"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">secondsEastOfUTC := int((8 * time.Hour).Seconds())
+beijing := time.FixedZone("Beijing Time", secondsEastOfUTC)
+
+// Unlike the equal operator, Equal is aware that d1 and d2 are the
+// same instant but in different time zones.
+d1 := time.Date(2000, 2, 1, 12, 30, 0, 0, time.UTC)
+d2 := time.Date(2000, 2, 1, 20, 30, 0, 0, beijing)
+
+datesEqualUsingEqualOperator := d1 == d2
+datesEqualUsingFunction := d1.Equal(d2)
+
+fmt.Printf("datesEqualUsingEqualOperator = %v\n", datesEqualUsingEqualOperator)
+fmt.Printf("datesEqualUsingFunction = %v\n", datesEqualUsingFunction)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">datesEqualUsingEqualOperator = false
+datesEqualUsingFunction = true
+</pre> <h3 id="Time.Format">func (Time) <span>Format</span> </h3> <pre data-language="go">func (t Time) Format(layout string) string</pre> <p>Format returns a textual representation of the time value formatted according to the layout defined by the argument. See the documentation for the constant called Layout to see how to represent the layout format. </p>
+<p>The executable example for Time.Format demonstrates the working of the layout string in detail and is a good reference. </p> <h4 id="example_Time_Format"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Parse a time value from a string in the standard Unix format.
+t, err := time.Parse(time.UnixDate, "Wed Feb 25 11:06:39 PST 2015")
+if err != nil { // Always check errors even if they should not happen.
+ panic(err)
+}
+
+tz, err := time.LoadLocation("Asia/Shanghai")
+if err != nil { // Always check errors even if they should not happen.
+ panic(err)
+}
+
+// time.Time's Stringer method is useful without any format.
+fmt.Println("default format:", t)
+
+// Predefined constants in the package implement common layouts.
+fmt.Println("Unix format:", t.Format(time.UnixDate))
+
+// The time zone attached to the time value affects its output.
+fmt.Println("Same, in UTC:", t.UTC().Format(time.UnixDate))
+
+fmt.Println("in Shanghai with seconds:", t.In(tz).Format("2006-01-02T15:04:05 -070000"))
+
+fmt.Println("in Shanghai with colon seconds:", t.In(tz).Format("2006-01-02T15:04:05 -07:00:00"))
+
+// The rest of this function demonstrates the properties of the
+// layout string used in the format.
+
+// The layout string used by the Parse function and Format method
+// shows by example how the reference time should be represented.
+// We stress that one must show how the reference time is formatted,
+// not a time of the user's choosing. Thus each layout string is a
+// representation of the time stamp,
+// Jan 2 15:04:05 2006 MST
+// An easy way to remember this value is that it holds, when presented
+// in this order, the values (lined up with the elements above):
+// 1 2 3 4 5 6 -7
+// There are some wrinkles illustrated below.
+
+// Most uses of Format and Parse use constant layout strings such as
+// the ones defined in this package, but the interface is flexible,
+// as these examples show.
+
+// Define a helper function to make the examples' output look nice.
+do := func(name, layout, want string) {
+ got := t.Format(layout)
+ if want != got {
+ fmt.Printf("error: for %q got %q; expected %q\n", layout, got, want)
+ return
+ }
+ fmt.Printf("%-16s %q gives %q\n", name, layout, got)
+}
+
+// Print a header in our output.
+fmt.Printf("\nFormats:\n\n")
+
+// Simple starter examples.
+do("Basic full date", "Mon Jan 2 15:04:05 MST 2006", "Wed Feb 25 11:06:39 PST 2015")
+do("Basic short date", "2006/01/02", "2015/02/25")
+
+// The hour of the reference time is 15, or 3PM. The layout can express
+// it either way, and since our value is the morning we should see it as
+// an AM time. We show both in one format string. Lower case too.
+do("AM/PM", "3PM==3pm==15h", "11AM==11am==11h")
+
+// When parsing, if the seconds value is followed by a decimal point
+// and some digits, that is taken as a fraction of a second even if
+// the layout string does not represent the fractional second.
+// Here we add a fractional second to our time value used above.
+t, err = time.Parse(time.UnixDate, "Wed Feb 25 11:06:39.1234 PST 2015")
+if err != nil {
+ panic(err)
+}
+// It does not appear in the output if the layout string does not contain
+// a representation of the fractional second.
+do("No fraction", time.UnixDate, "Wed Feb 25 11:06:39 PST 2015")
+
+// Fractional seconds can be printed by adding a run of 0s or 9s after
+// a decimal point in the seconds value in the layout string.
+// If the layout digits are 0s, the fractional second is of the specified
+// width. Note that the output has a trailing zero.
+do("0s for fraction", "15:04:05.00000", "11:06:39.12340")
+
+// If the fraction in the layout is 9s, trailing zeros are dropped.
+do("9s for fraction", "15:04:05.99999999", "11:06:39.1234")
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">default format: 2015-02-25 11:06:39 -0800 PST
+Unix format: Wed Feb 25 11:06:39 PST 2015
+Same, in UTC: Wed Feb 25 19:06:39 UTC 2015
+in Shanghai with seconds: 2015-02-26T03:06:39 +080000
+in Shanghai with colon seconds: 2015-02-26T03:06:39 +08:00:00
+
+Formats:
+
+Basic full date "Mon Jan 2 15:04:05 MST 2006" gives "Wed Feb 25 11:06:39 PST 2015"
+Basic short date "2006/01/02" gives "2015/02/25"
+AM/PM "3PM==3pm==15h" gives "11AM==11am==11h"
+No fraction "Mon Jan _2 15:04:05 MST 2006" gives "Wed Feb 25 11:06:39 PST 2015"
+0s for fraction "15:04:05.00000" gives "11:06:39.12340"
+9s for fraction "15:04:05.99999999" gives "11:06:39.1234"
+</pre> <h4 id="example_Time_Format_pad"> <span class="text">Example (Pad)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// Parse a time value from a string in the standard Unix format.
+t, err := time.Parse(time.UnixDate, "Sat Mar 7 11:06:39 PST 2015")
+if err != nil { // Always check errors even if they should not happen.
+ panic(err)
+}
+
+// Define a helper function to make the examples' output look nice.
+do := func(name, layout, want string) {
+ got := t.Format(layout)
+ if want != got {
+ fmt.Printf("error: for %q got %q; expected %q\n", layout, got, want)
+ return
+ }
+ fmt.Printf("%-16s %q gives %q\n", name, layout, got)
+}
+
+// The predefined constant Unix uses an underscore to pad the day.
+do("Unix", time.UnixDate, "Sat Mar 7 11:06:39 PST 2015")
+
+// For fixed-width printing of values, such as the date, that may be one or
+// two characters (7 vs. 07), use an _ instead of a space in the layout string.
+// Here we print just the day, which is 2 in our layout string and 7 in our
+// value.
+do("No pad", "&lt;2&gt;", "&lt;7&gt;")
+
+// An underscore represents a space pad, if the date only has one digit.
+do("Spaces", "&lt;_2&gt;", "&lt; 7&gt;")
+
+// A "0" indicates zero padding for single-digit values.
+do("Zeros", "&lt;02&gt;", "&lt;07&gt;")
+
+// If the value is already the right width, padding is not used.
+// For instance, the second (05 in the reference time) in our value is 39,
+// so it doesn't need padding, but the minutes (04, 06) does.
+do("Suppressed pad", "04:05", "06:39")
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">Unix "Mon Jan _2 15:04:05 MST 2006" gives "Sat Mar 7 11:06:39 PST 2015"
+No pad "&lt;2&gt;" gives "&lt;7&gt;"
+Spaces "&lt;_2&gt;" gives "&lt; 7&gt;"
+Zeros "&lt;02&gt;" gives "&lt;07&gt;"
+Suppressed pad "04:05" gives "06:39"
+</pre> <h3 id="Time.GoString">func (Time) <span>GoString</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (t Time) GoString() string</pre> <p>GoString implements fmt.GoStringer and formats t to be printed in Go source code. </p> <h4 id="example_Time_GoString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">t := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+fmt.Println(t.GoString())
+t = t.Add(1 * time.Minute)
+fmt.Println(t.GoString())
+t = t.AddDate(0, 1, 0)
+fmt.Println(t.GoString())
+t, _ = time.Parse("Jan 2, 2006 at 3:04pm (MST)", "Feb 3, 2013 at 7:54pm (UTC)")
+fmt.Println(t.GoString())
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+time.Date(2009, time.November, 10, 23, 1, 0, 0, time.UTC)
+time.Date(2009, time.December, 10, 23, 1, 0, 0, time.UTC)
+time.Date(2013, time.February, 3, 19, 54, 0, 0, time.UTC)
+</pre> <h3 id="Time.GobDecode">func (*Time) <span>GobDecode</span> </h3> <pre data-language="go">func (t *Time) GobDecode(data []byte) error</pre> <p>GobDecode implements the gob.GobDecoder interface. </p>
+<h3 id="Time.GobEncode">func (Time) <span>GobEncode</span> </h3> <pre data-language="go">func (t Time) GobEncode() ([]byte, error)</pre> <p>GobEncode implements the gob.GobEncoder interface. </p>
+<h3 id="Time.Hour">func (Time) <span>Hour</span> </h3> <pre data-language="go">func (t Time) Hour() int</pre> <p>Hour returns the hour within the day specified by t, in the range [0, 23]. </p>
+<h3 id="Time.ISOWeek">func (Time) <span>ISOWeek</span> </h3> <pre data-language="go">func (t Time) ISOWeek() (year, week int)</pre> <p>ISOWeek returns the ISO 8601 year and week number in which t occurs. Week ranges from 1 to 53. Jan 01 to Jan 03 of year n might belong to week 52 or 53 of year n-1, and Dec 29 to Dec 31 might belong to week 1 of year n+1. </p>
+<h3 id="Time.In">func (Time) <span>In</span> </h3> <pre data-language="go">func (t Time) In(loc *Location) Time</pre> <p>In returns a copy of t representing the same time instant, but with the copy's location information set to loc for display purposes. </p>
+<p>In panics if loc is nil. </p>
+<h3 id="Time.IsDST">func (Time) <span>IsDST</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (t Time) IsDST() bool</pre> <p>IsDST reports whether the time in the configured location is in Daylight Savings Time. </p>
+<h3 id="Time.IsZero">func (Time) <span>IsZero</span> </h3> <pre data-language="go">func (t Time) IsZero() bool</pre> <p>IsZero reports whether t represents the zero time instant, January 1, year 1, 00:00:00 UTC. </p>
+<h3 id="Time.Local">func (Time) <span>Local</span> </h3> <pre data-language="go">func (t Time) Local() Time</pre> <p>Local returns t with the location set to local time. </p>
+<h3 id="Time.Location">func (Time) <span>Location</span> </h3> <pre data-language="go">func (t Time) Location() *Location</pre> <p>Location returns the time zone information associated with t. </p>
+<h3 id="Time.MarshalBinary">func (Time) <span>MarshalBinary</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (t Time) MarshalBinary() ([]byte, error)</pre> <p>MarshalBinary implements the encoding.BinaryMarshaler interface. </p>
+<h3 id="Time.MarshalJSON">func (Time) <span>MarshalJSON</span> </h3> <pre data-language="go">func (t Time) MarshalJSON() ([]byte, error)</pre> <p>MarshalJSON implements the json.Marshaler interface. The time is a quoted string in the RFC 3339 format with sub-second precision. If the timestamp cannot be represented as valid RFC 3339 (e.g., the year is out of range), then an error is reported. </p>
+<h3 id="Time.MarshalText">func (Time) <span>MarshalText</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (t Time) MarshalText() ([]byte, error)</pre> <p>MarshalText implements the encoding.TextMarshaler interface. The time is formatted in RFC 3339 format with sub-second precision. If the timestamp cannot be represented as valid RFC 3339 (e.g., the year is out of range), then an error is reported. </p>
+<h3 id="Time.Minute">func (Time) <span>Minute</span> </h3> <pre data-language="go">func (t Time) Minute() int</pre> <p>Minute returns the minute offset within the hour specified by t, in the range [0, 59]. </p>
+<h3 id="Time.Month">func (Time) <span>Month</span> </h3> <pre data-language="go">func (t Time) Month() Month</pre> <p>Month returns the month of the year specified by t. </p>
+<h3 id="Time.Nanosecond">func (Time) <span>Nanosecond</span> </h3> <pre data-language="go">func (t Time) Nanosecond() int</pre> <p>Nanosecond returns the nanosecond offset within the second specified by t, in the range [0, 999999999]. </p>
+<h3 id="Time.Round">func (Time) <span>Round</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (t Time) Round(d Duration) Time</pre> <p>Round returns the result of rounding t to the nearest multiple of d (since the zero time). The rounding behavior for halfway values is to round up. If d &lt;= 0, Round returns t stripped of any monotonic clock reading but otherwise unchanged. </p>
+<p>Round operates on the time as an absolute duration since the zero time; it does not operate on the presentation form of the time. Thus, Round(Hour) may return a time with a non-zero minute, depending on the time's Location. </p> <h4 id="example_Time_Round"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">t := time.Date(0, 0, 0, 12, 15, 30, 918273645, time.UTC)
+round := []time.Duration{
+ time.Nanosecond,
+ time.Microsecond,
+ time.Millisecond,
+ time.Second,
+ 2 * time.Second,
+ time.Minute,
+ 10 * time.Minute,
+ time.Hour,
+}
+
+for _, d := range round {
+ fmt.Printf("t.Round(%6s) = %s\n", d, t.Round(d).Format("15:04:05.999999999"))
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">t.Round( 1ns) = 12:15:30.918273645
+t.Round( 1µs) = 12:15:30.918274
+t.Round( 1ms) = 12:15:30.918
+t.Round( 1s) = 12:15:31
+t.Round( 2s) = 12:15:30
+t.Round( 1m0s) = 12:16:00
+t.Round( 10m0s) = 12:20:00
+t.Round(1h0m0s) = 12:00:00
+</pre> <h3 id="Time.Second">func (Time) <span>Second</span> </h3> <pre data-language="go">func (t Time) Second() int</pre> <p>Second returns the second offset within the minute specified by t, in the range [0, 59]. </p>
+<h3 id="Time.String">func (Time) <span>String</span> </h3> <pre data-language="go">func (t Time) String() string</pre> <p>String returns the time formatted using the format string </p>
+<pre data-language="go">"2006-01-02 15:04:05.999999999 -0700 MST"
+</pre> <p>If the time has a monotonic clock reading, the returned string includes a final field "m=±&lt;value&gt;", where value is the monotonic clock reading formatted as a decimal number of seconds. </p>
+<p>The returned string is meant for debugging; for a stable serialized representation, use t.MarshalText, t.MarshalBinary, or t.Format with an explicit format string. </p> <h4 id="example_Time_String"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">timeWithNanoseconds := time.Date(2000, 2, 1, 12, 13, 14, 15, time.UTC)
+withNanoseconds := timeWithNanoseconds.String()
+
+timeWithoutNanoseconds := time.Date(2000, 2, 1, 12, 13, 14, 0, time.UTC)
+withoutNanoseconds := timeWithoutNanoseconds.String()
+
+fmt.Printf("withNanoseconds = %v\n", string(withNanoseconds))
+fmt.Printf("withoutNanoseconds = %v\n", string(withoutNanoseconds))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">withNanoseconds = 2000-02-01 12:13:14.000000015 +0000 UTC
+withoutNanoseconds = 2000-02-01 12:13:14 +0000 UTC
+</pre> <h3 id="Time.Sub">func (Time) <span>Sub</span> </h3> <pre data-language="go">func (t Time) Sub(u Time) Duration</pre> <p>Sub returns the duration t-u. If the result exceeds the maximum (or minimum) value that can be stored in a Duration, the maximum (or minimum) duration will be returned. To compute t-d for a duration d, use t.Add(-d). </p> <h4 id="example_Time_Sub"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">start := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)
+end := time.Date(2000, 1, 1, 12, 0, 0, 0, time.UTC)
+
+difference := end.Sub(start)
+fmt.Printf("difference = %v\n", difference)
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">difference = 12h0m0s
+</pre> <h3 id="Time.Truncate">func (Time) <span>Truncate</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (t Time) Truncate(d Duration) Time</pre> <p>Truncate returns the result of rounding t down to a multiple of d (since the zero time). If d &lt;= 0, Truncate returns t stripped of any monotonic clock reading but otherwise unchanged. </p>
+<p>Truncate operates on the time as an absolute duration since the zero time; it does not operate on the presentation form of the time. Thus, Truncate(Hour) may return a time with a non-zero minute, depending on the time's Location. </p> <h4 id="example_Time_Truncate"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">t, _ := time.Parse("2006 Jan 02 15:04:05", "2012 Dec 07 12:15:30.918273645")
+trunc := []time.Duration{
+ time.Nanosecond,
+ time.Microsecond,
+ time.Millisecond,
+ time.Second,
+ 2 * time.Second,
+ time.Minute,
+ 10 * time.Minute,
+}
+
+for _, d := range trunc {
+ fmt.Printf("t.Truncate(%5s) = %s\n", d, t.Truncate(d).Format("15:04:05.999999999"))
+}
+// To round to the last midnight in the local timezone, create a new Date.
+midnight := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.Local)
+_ = midnight
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">t.Truncate( 1ns) = 12:15:30.918273645
+t.Truncate( 1µs) = 12:15:30.918273
+t.Truncate( 1ms) = 12:15:30.918
+t.Truncate( 1s) = 12:15:30
+t.Truncate( 2s) = 12:15:30
+t.Truncate( 1m0s) = 12:15:00
+t.Truncate(10m0s) = 12:10:00
+</pre> <h3 id="Time.UTC">func (Time) <span>UTC</span> </h3> <pre data-language="go">func (t Time) UTC() Time</pre> <p>UTC returns t with the location set to UTC. </p>
+<h3 id="Time.Unix">func (Time) <span>Unix</span> </h3> <pre data-language="go">func (t Time) Unix() int64</pre> <p>Unix returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC. The result does not depend on the location associated with t. Unix-like operating systems often record time as a 32-bit count of seconds, but since the method here returns a 64-bit value it is valid for billions of years into the past or future. </p> <h4 id="example_Time_Unix"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">// 1 billion seconds of Unix, three ways.
+fmt.Println(time.Unix(1e9, 0).UTC()) // 1e9 seconds
+fmt.Println(time.Unix(0, 1e18).UTC()) // 1e18 nanoseconds
+fmt.Println(time.Unix(2e9, -1e18).UTC()) // 2e9 seconds - 1e18 nanoseconds
+
+t := time.Date(2001, time.September, 9, 1, 46, 40, 0, time.UTC)
+fmt.Println(t.Unix()) // seconds since 1970
+fmt.Println(t.UnixNano()) // nanoseconds since 1970
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">2001-09-09 01:46:40 +0000 UTC
+2001-09-09 01:46:40 +0000 UTC
+2001-09-09 01:46:40 +0000 UTC
+1000000000
+1000000000000000000
+</pre> <h3 id="Time.UnixMicro">func (Time) <span>UnixMicro</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (t Time) UnixMicro() int64</pre> <p>UnixMicro returns t as a Unix time, the number of microseconds elapsed since January 1, 1970 UTC. The result is undefined if the Unix time in microseconds cannot be represented by an int64 (a date before year -290307 or after year 294246). The result does not depend on the location associated with t. </p>
+<h3 id="Time.UnixMilli">func (Time) <span>UnixMilli</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (t Time) UnixMilli() int64</pre> <p>UnixMilli returns t as a Unix time, the number of milliseconds elapsed since January 1, 1970 UTC. The result is undefined if the Unix time in milliseconds cannot be represented by an int64 (a date more than 292 million years before or after 1970). The result does not depend on the location associated with t. </p>
+<h3 id="Time.UnixNano">func (Time) <span>UnixNano</span> </h3> <pre data-language="go">func (t Time) UnixNano() int64</pre> <p>UnixNano returns t as a Unix time, the number of nanoseconds elapsed since January 1, 1970 UTC. The result is undefined if the Unix time in nanoseconds cannot be represented by an int64 (a date before the year 1678 or after 2262). Note that this means the result of calling UnixNano on the zero Time is undefined. The result does not depend on the location associated with t. </p>
+<h3 id="Time.UnmarshalBinary">func (*Time) <span>UnmarshalBinary</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (t *Time) UnmarshalBinary(data []byte) error</pre> <p>UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. </p>
+<h3 id="Time.UnmarshalJSON">func (*Time) <span>UnmarshalJSON</span> </h3> <pre data-language="go">func (t *Time) UnmarshalJSON(data []byte) error</pre> <p>UnmarshalJSON implements the json.Unmarshaler interface. The time must be a quoted string in the RFC 3339 format. </p>
+<h3 id="Time.UnmarshalText">func (*Time) <span>UnmarshalText</span> <span title="Added in Go 1.2">1.2</span> </h3> <pre data-language="go">func (t *Time) UnmarshalText(data []byte) error</pre> <p>UnmarshalText implements the encoding.TextUnmarshaler interface. The time must be in the RFC 3339 format. </p>
+<h3 id="Time.Weekday">func (Time) <span>Weekday</span> </h3> <pre data-language="go">func (t Time) Weekday() Weekday</pre> <p>Weekday returns the day of the week specified by t. </p>
+<h3 id="Time.Year">func (Time) <span>Year</span> </h3> <pre data-language="go">func (t Time) Year() int</pre> <p>Year returns the year in which t occurs. </p>
+<h3 id="Time.YearDay">func (Time) <span>YearDay</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (t Time) YearDay() int</pre> <p>YearDay returns the day of the year specified by t, in the range [1,365] for non-leap years, and [1,366] in leap years. </p>
+<h3 id="Time.Zone">func (Time) <span>Zone</span> </h3> <pre data-language="go">func (t Time) Zone() (name string, offset int)</pre> <p>Zone computes the time zone in effect at time t, returning the abbreviated name of the zone (such as "CET") and its offset in seconds east of UTC. </p>
+<h3 id="Time.ZoneBounds">func (Time) <span>ZoneBounds</span> <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (t Time) ZoneBounds() (start, end Time)</pre> <p>ZoneBounds returns the bounds of the time zone in effect at time t. The zone begins at start and the next zone begins at end. If the zone begins at the beginning of time, start will be returned as a zero Time. If the zone goes on forever, end will be returned as a zero Time. The Location of the returned times will be the same as t. </p>
+<h2 id="Timer">type <span>Timer</span> </h2> <p>The Timer type represents a single event. When the Timer expires, the current time will be sent on C, unless the Timer was created by AfterFunc. A Timer must be created with NewTimer or AfterFunc. </p>
+<pre data-language="go">type Timer struct {
+ C &lt;-chan Time
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="AfterFunc">func <span>AfterFunc</span> </h3> <pre data-language="go">func AfterFunc(d Duration, f func()) *Timer</pre> <p>AfterFunc waits for the duration to elapse and then calls f in its own goroutine. It returns a Timer that can be used to cancel the call using its Stop method. The returned Timer's C field is not used and will be nil. </p>
+<h3 id="NewTimer">func <span>NewTimer</span> </h3> <pre data-language="go">func NewTimer(d Duration) *Timer</pre> <p>NewTimer creates a new Timer that will send the current time on its channel after at least duration d. </p>
+<h3 id="Timer.Reset">func (*Timer) <span>Reset</span> <span title="Added in Go 1.1">1.1</span> </h3> <pre data-language="go">func (t *Timer) Reset(d Duration) bool</pre> <p>Reset changes the timer to expire after duration d. It returns true if the timer had been active, false if the timer had expired or been stopped. </p>
+<p>For a Timer created with NewTimer, Reset should be invoked only on stopped or expired timers with drained channels. </p>
+<p>If a program has already received a value from t.C, the timer is known to have expired and the channel drained, so t.Reset can be used directly. If a program has not yet received a value from t.C, however, the timer must be stopped and—if Stop reports that the timer expired before being stopped—the channel explicitly drained: </p>
+<pre data-language="go">if !t.Stop() {
+ &lt;-t.C
+}
+t.Reset(d)
+</pre> <p>This should not be done concurrent to other receives from the Timer's channel. </p>
+<p>Note that it is not possible to use Reset's return value correctly, as there is a race condition between draining the channel and the new timer expiring. Reset should always be invoked on stopped or expired channels, as described above. The return value exists to preserve compatibility with existing programs. </p>
+<p>For a Timer created with AfterFunc(d, f), Reset either reschedules when f will run, in which case Reset returns true, or schedules f to run again, in which case it returns false. When Reset returns false, Reset neither waits for the prior f to complete before returning nor does it guarantee that the subsequent goroutine running f does not run concurrently with the prior one. If the caller needs to know whether the prior execution of f is completed, it must coordinate with f explicitly. </p>
+<h3 id="Timer.Stop">func (*Timer) <span>Stop</span> </h3> <pre data-language="go">func (t *Timer) Stop() bool</pre> <p>Stop prevents the Timer from firing. It returns true if the call stops the timer, false if the timer has already expired or been stopped. Stop does not close the channel, to prevent a read from the channel succeeding incorrectly. </p>
+<p>To ensure the channel is empty after a call to Stop, check the return value and drain the channel. For example, assuming the program has not received from t.C already: </p>
+<pre data-language="go">if !t.Stop() {
+ &lt;-t.C
+}
+</pre> <p>This cannot be done concurrent to other receives from the Timer's channel or other calls to the Timer's Stop method. </p>
+<p>For a timer created with AfterFunc(d, f), if t.Stop returns false, then the timer has already expired and the function f has been started in its own goroutine; Stop does not wait for f to complete before returning. If the caller needs to know whether f is completed, it must coordinate with f explicitly. </p>
+<h2 id="Weekday">type <span>Weekday</span> </h2> <p>A Weekday specifies a day of the week (Sunday = 0, ...). </p>
+<pre data-language="go">type Weekday int</pre> <pre data-language="go">const (
+ Sunday Weekday = iota
+ Monday
+ Tuesday
+ Wednesday
+ Thursday
+ Friday
+ Saturday
+)</pre> <h3 id="Weekday.String">func (Weekday) <span>String</span> </h3> <pre data-language="go">func (d Weekday) String() string</pre> <p>String returns the English name of the day ("Sunday", "Monday", ...). </p>
+<h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="tzdata/index">tzdata</a> </td> <td class="pkg-synopsis"> Package tzdata provides an embedded copy of the timezone database. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/time/" class="_attribution-link">http://golang.org/pkg/time/</a>
+ </p>
+</div>
diff --git a/devdocs/go/time%2Ftzdata%2Findex.html b/devdocs/go/time%2Ftzdata%2Findex.html
new file mode 100644
index 00000000..5335b358
--- /dev/null
+++ b/devdocs/go/time%2Ftzdata%2Findex.html
@@ -0,0 +1,13 @@
+<h1> Package tzdata </h1> <ul id="short-nav">
+<li><code>import "time/tzdata"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package tzdata provides an embedded copy of the timezone database. If this package is imported anywhere in the program, then if the time package cannot find tzdata files on the system, it will use this embedded information. </p>
+<p>Importing this package will increase the size of a program by about 450 KB. </p>
+<p>This package should normally be imported by a program's main package, not by a library. Libraries normally shouldn't decide whether to include the timezone database in a program. </p>
+<p>This package will be automatically imported if you build with -tags timetzdata. </p> <h2 id="pkg-index">Index </h2> <h3>Package files</h3> <p> <span>tzdata.go</span> <span>zzipdata.go</span> </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/time/tzdata/" class="_attribution-link">http://golang.org/pkg/time/tzdata/</a>
+ </p>
+</div>
diff --git a/devdocs/go/unicode%2Findex.html b/devdocs/go/unicode%2Findex.html
new file mode 100644
index 00000000..dd594327
--- /dev/null
+++ b/devdocs/go/unicode%2Findex.html
@@ -0,0 +1,830 @@
+<h1> Package unicode </h1> <ul id="short-nav">
+<li><code>import "unicode"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+<li><a href="#pkg-subdirectories">Subdirectories</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package unicode provides data and functions to test some properties of Unicode code points. </p> <h4 id="example__is"> <span class="text">Example (Is)</span>
+</h4> <p>Functions starting with "Is" can be used to inspect which table of range a rune belongs to. Note that runes may fit into more than one range. </p> <p>Code:</p> <pre class="code" data-language="go">// constant with mixed type runes
+const mixed = "\b5Ὂg̀9! ℃ᾭG"
+for _, c := range mixed {
+ fmt.Printf("For %q:\n", c)
+ if unicode.IsControl(c) {
+ fmt.Println("\tis control rune")
+ }
+ if unicode.IsDigit(c) {
+ fmt.Println("\tis digit rune")
+ }
+ if unicode.IsGraphic(c) {
+ fmt.Println("\tis graphic rune")
+ }
+ if unicode.IsLetter(c) {
+ fmt.Println("\tis letter rune")
+ }
+ if unicode.IsLower(c) {
+ fmt.Println("\tis lower case rune")
+ }
+ if unicode.IsMark(c) {
+ fmt.Println("\tis mark rune")
+ }
+ if unicode.IsNumber(c) {
+ fmt.Println("\tis number rune")
+ }
+ if unicode.IsPrint(c) {
+ fmt.Println("\tis printable rune")
+ }
+ if !unicode.IsPrint(c) {
+ fmt.Println("\tis not printable rune")
+ }
+ if unicode.IsPunct(c) {
+ fmt.Println("\tis punct rune")
+ }
+ if unicode.IsSpace(c) {
+ fmt.Println("\tis space rune")
+ }
+ if unicode.IsSymbol(c) {
+ fmt.Println("\tis symbol rune")
+ }
+ if unicode.IsTitle(c) {
+ fmt.Println("\tis title case rune")
+ }
+ if unicode.IsUpper(c) {
+ fmt.Println("\tis upper case rune")
+ }
+}
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">For '\b':
+ is control rune
+ is not printable rune
+For '5':
+ is digit rune
+ is graphic rune
+ is number rune
+ is printable rune
+For 'Ὂ':
+ is graphic rune
+ is letter rune
+ is printable rune
+ is upper case rune
+For 'g':
+ is graphic rune
+ is letter rune
+ is lower case rune
+ is printable rune
+For '̀':
+ is graphic rune
+ is mark rune
+ is printable rune
+For '9':
+ is digit rune
+ is graphic rune
+ is number rune
+ is printable rune
+For '!':
+ is graphic rune
+ is printable rune
+ is punct rune
+For ' ':
+ is graphic rune
+ is printable rune
+ is space rune
+For '℃':
+ is graphic rune
+ is printable rune
+ is symbol rune
+For 'ᾭ':
+ is graphic rune
+ is letter rune
+ is printable rune
+ is title case rune
+For 'G':
+ is graphic rune
+ is letter rune
+ is printable rune
+ is upper case rune
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#pkg-variables">Variables</a></li>
+<li><a href="#In">func In(r rune, ranges ...*RangeTable) bool</a></li>
+<li><a href="#Is">func Is(rangeTab *RangeTable, r rune) bool</a></li>
+<li><a href="#IsControl">func IsControl(r rune) bool</a></li>
+<li><a href="#IsDigit">func IsDigit(r rune) bool</a></li>
+<li><a href="#IsGraphic">func IsGraphic(r rune) bool</a></li>
+<li><a href="#IsLetter">func IsLetter(r rune) bool</a></li>
+<li><a href="#IsLower">func IsLower(r rune) bool</a></li>
+<li><a href="#IsMark">func IsMark(r rune) bool</a></li>
+<li><a href="#IsNumber">func IsNumber(r rune) bool</a></li>
+<li><a href="#IsOneOf">func IsOneOf(ranges []*RangeTable, r rune) bool</a></li>
+<li><a href="#IsPrint">func IsPrint(r rune) bool</a></li>
+<li><a href="#IsPunct">func IsPunct(r rune) bool</a></li>
+<li><a href="#IsSpace">func IsSpace(r rune) bool</a></li>
+<li><a href="#IsSymbol">func IsSymbol(r rune) bool</a></li>
+<li><a href="#IsTitle">func IsTitle(r rune) bool</a></li>
+<li><a href="#IsUpper">func IsUpper(r rune) bool</a></li>
+<li><a href="#SimpleFold">func SimpleFold(r rune) rune</a></li>
+<li><a href="#To">func To(_case int, r rune) rune</a></li>
+<li><a href="#ToLower">func ToLower(r rune) rune</a></li>
+<li><a href="#ToTitle">func ToTitle(r rune) rune</a></li>
+<li><a href="#ToUpper">func ToUpper(r rune) rune</a></li>
+<li><a href="#CaseRange">type CaseRange</a></li>
+<li><a href="#Range16">type Range16</a></li>
+<li><a href="#Range32">type Range32</a></li>
+<li><a href="#RangeTable">type RangeTable</a></li>
+<li><a href="#SpecialCase">type SpecialCase</a></li>
+<li> <a href="#SpecialCase.ToLower">func (special SpecialCase) ToLower(r rune) rune</a>
+</li>
+<li> <a href="#SpecialCase.ToTitle">func (special SpecialCase) ToTitle(r rune) rune</a>
+</li>
+<li> <a href="#SpecialCase.ToUpper">func (special SpecialCase) ToUpper(r rune) rune</a>
+</li>
+<li><a href="#pkg-note-BUG">Bugs</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_IsDigit">IsDigit</a></dd> <dd><a class="exampleLink" href="#example_IsLetter">IsLetter</a></dd> <dd><a class="exampleLink" href="#example_IsLower">IsLower</a></dd> <dd><a class="exampleLink" href="#example_IsNumber">IsNumber</a></dd> <dd><a class="exampleLink" href="#example_IsSpace">IsSpace</a></dd> <dd><a class="exampleLink" href="#example_IsTitle">IsTitle</a></dd> <dd><a class="exampleLink" href="#example_IsUpper">IsUpper</a></dd> <dd><a class="exampleLink" href="#example_SimpleFold">SimpleFold</a></dd> <dd><a class="exampleLink" href="#example_SpecialCase">SpecialCase</a></dd> <dd><a class="exampleLink" href="#example_To">To</a></dd> <dd><a class="exampleLink" href="#example_ToLower">ToLower</a></dd> <dd><a class="exampleLink" href="#example_ToTitle">ToTitle</a></dd> <dd><a class="exampleLink" href="#example_ToUpper">ToUpper</a></dd> <dd><a class="exampleLink" href="#example__is">Package (Is)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>casetables.go</span> <span>digit.go</span> <span>graphic.go</span> <span>letter.go</span> <span>tables.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
+ MaxRune = '\U0010FFFF' // Maximum valid Unicode code point.
+ ReplacementChar = '\uFFFD' // Represents invalid code points.
+ MaxASCII = '\u007F' // maximum ASCII value.
+ MaxLatin1 = '\u00FF' // maximum Latin-1 value.
+)</pre> <p>Indices into the Delta arrays inside CaseRanges for case mapping. </p>
+<pre data-language="go">const (
+ UpperCase = iota
+ LowerCase
+ TitleCase
+ MaxCase
+)</pre> <p>If the Delta field of a <a href="#CaseRange">CaseRange</a> is UpperLower, it means this CaseRange represents a sequence of the form (say) <a href="#Upper">Upper</a> <a href="#Lower">Lower</a> <a href="#Upper">Upper</a> <a href="#Lower">Lower</a>. </p>
+<pre data-language="go">const (
+ UpperLower = MaxRune + 1 // (Cannot be a valid delta.)
+)</pre> <p>Version is the Unicode edition from which the tables are derived. </p>
+<pre data-language="go">const Version = "15.0.0"</pre> <h2 id="pkg-variables">Variables</h2> <p>These variables have type *RangeTable. </p>
+<pre data-language="go">var (
+ Cc = _Cc // Cc is the set of Unicode characters in category Cc (Other, control).
+ Cf = _Cf // Cf is the set of Unicode characters in category Cf (Other, format).
+ Co = _Co // Co is the set of Unicode characters in category Co (Other, private use).
+ Cs = _Cs // Cs is the set of Unicode characters in category Cs (Other, surrogate).
+ Digit = _Nd // Digit is the set of Unicode characters with the "decimal digit" property.
+ Nd = _Nd // Nd is the set of Unicode characters in category Nd (Number, decimal digit).
+ Letter = _L // Letter/L is the set of Unicode letters, category L.
+ L = _L
+ Lm = _Lm // Lm is the set of Unicode characters in category Lm (Letter, modifier).
+ Lo = _Lo // Lo is the set of Unicode characters in category Lo (Letter, other).
+ Lower = _Ll // Lower is the set of Unicode lower case letters.
+ Ll = _Ll // Ll is the set of Unicode characters in category Ll (Letter, lowercase).
+ Mark = _M // Mark/M is the set of Unicode mark characters, category M.
+ M = _M
+ Mc = _Mc // Mc is the set of Unicode characters in category Mc (Mark, spacing combining).
+ Me = _Me // Me is the set of Unicode characters in category Me (Mark, enclosing).
+ Mn = _Mn // Mn is the set of Unicode characters in category Mn (Mark, nonspacing).
+ Nl = _Nl // Nl is the set of Unicode characters in category Nl (Number, letter).
+ No = _No // No is the set of Unicode characters in category No (Number, other).
+ Number = _N // Number/N is the set of Unicode number characters, category N.
+ N = _N
+ Other = _C // Other/C is the set of Unicode control and special characters, category C.
+ C = _C
+ Pc = _Pc // Pc is the set of Unicode characters in category Pc (Punctuation, connector).
+ Pd = _Pd // Pd is the set of Unicode characters in category Pd (Punctuation, dash).
+ Pe = _Pe // Pe is the set of Unicode characters in category Pe (Punctuation, close).
+ Pf = _Pf // Pf is the set of Unicode characters in category Pf (Punctuation, final quote).
+ Pi = _Pi // Pi is the set of Unicode characters in category Pi (Punctuation, initial quote).
+ Po = _Po // Po is the set of Unicode characters in category Po (Punctuation, other).
+ Ps = _Ps // Ps is the set of Unicode characters in category Ps (Punctuation, open).
+ Punct = _P // Punct/P is the set of Unicode punctuation characters, category P.
+ P = _P
+ Sc = _Sc // Sc is the set of Unicode characters in category Sc (Symbol, currency).
+ Sk = _Sk // Sk is the set of Unicode characters in category Sk (Symbol, modifier).
+ Sm = _Sm // Sm is the set of Unicode characters in category Sm (Symbol, math).
+ So = _So // So is the set of Unicode characters in category So (Symbol, other).
+ Space = _Z // Space/Z is the set of Unicode space characters, category Z.
+ Z = _Z
+ Symbol = _S // Symbol/S is the set of Unicode symbol characters, category S.
+ S = _S
+ Title = _Lt // Title is the set of Unicode title case letters.
+ Lt = _Lt // Lt is the set of Unicode characters in category Lt (Letter, titlecase).
+ Upper = _Lu // Upper is the set of Unicode upper case letters.
+ Lu = _Lu // Lu is the set of Unicode characters in category Lu (Letter, uppercase).
+ Zl = _Zl // Zl is the set of Unicode characters in category Zl (Separator, line).
+ Zp = _Zp // Zp is the set of Unicode characters in category Zp (Separator, paragraph).
+ Zs = _Zs // Zs is the set of Unicode characters in category Zs (Separator, space).
+)</pre> <p>These variables have type *RangeTable. </p>
+<pre data-language="go">var (
+ Adlam = _Adlam // Adlam is the set of Unicode characters in script Adlam.
+ Ahom = _Ahom // Ahom is the set of Unicode characters in script Ahom.
+ Anatolian_Hieroglyphs = _Anatolian_Hieroglyphs // Anatolian_Hieroglyphs is the set of Unicode characters in script Anatolian_Hieroglyphs.
+ Arabic = _Arabic // Arabic is the set of Unicode characters in script Arabic.
+ Armenian = _Armenian // Armenian is the set of Unicode characters in script Armenian.
+ Avestan = _Avestan // Avestan is the set of Unicode characters in script Avestan.
+ Balinese = _Balinese // Balinese is the set of Unicode characters in script Balinese.
+ Bamum = _Bamum // Bamum is the set of Unicode characters in script Bamum.
+ Bassa_Vah = _Bassa_Vah // Bassa_Vah is the set of Unicode characters in script Bassa_Vah.
+ Batak = _Batak // Batak is the set of Unicode characters in script Batak.
+ Bengali = _Bengali // Bengali is the set of Unicode characters in script Bengali.
+ Bhaiksuki = _Bhaiksuki // Bhaiksuki is the set of Unicode characters in script Bhaiksuki.
+ Bopomofo = _Bopomofo // Bopomofo is the set of Unicode characters in script Bopomofo.
+ Brahmi = _Brahmi // Brahmi is the set of Unicode characters in script Brahmi.
+ Braille = _Braille // Braille is the set of Unicode characters in script Braille.
+ Buginese = _Buginese // Buginese is the set of Unicode characters in script Buginese.
+ Buhid = _Buhid // Buhid is the set of Unicode characters in script Buhid.
+ Canadian_Aboriginal = _Canadian_Aboriginal // Canadian_Aboriginal is the set of Unicode characters in script Canadian_Aboriginal.
+ Carian = _Carian // Carian is the set of Unicode characters in script Carian.
+ Caucasian_Albanian = _Caucasian_Albanian // Caucasian_Albanian is the set of Unicode characters in script Caucasian_Albanian.
+ Chakma = _Chakma // Chakma is the set of Unicode characters in script Chakma.
+ Cham = _Cham // Cham is the set of Unicode characters in script Cham.
+ Cherokee = _Cherokee // Cherokee is the set of Unicode characters in script Cherokee.
+ Chorasmian = _Chorasmian // Chorasmian is the set of Unicode characters in script Chorasmian.
+ Common = _Common // Common is the set of Unicode characters in script Common.
+ Coptic = _Coptic // Coptic is the set of Unicode characters in script Coptic.
+ Cuneiform = _Cuneiform // Cuneiform is the set of Unicode characters in script Cuneiform.
+ Cypriot = _Cypriot // Cypriot is the set of Unicode characters in script Cypriot.
+ Cypro_Minoan = _Cypro_Minoan // Cypro_Minoan is the set of Unicode characters in script Cypro_Minoan.
+ Cyrillic = _Cyrillic // Cyrillic is the set of Unicode characters in script Cyrillic.
+ Deseret = _Deseret // Deseret is the set of Unicode characters in script Deseret.
+ Devanagari = _Devanagari // Devanagari is the set of Unicode characters in script Devanagari.
+ Dives_Akuru = _Dives_Akuru // Dives_Akuru is the set of Unicode characters in script Dives_Akuru.
+ Dogra = _Dogra // Dogra is the set of Unicode characters in script Dogra.
+ Duployan = _Duployan // Duployan is the set of Unicode characters in script Duployan.
+ Egyptian_Hieroglyphs = _Egyptian_Hieroglyphs // Egyptian_Hieroglyphs is the set of Unicode characters in script Egyptian_Hieroglyphs.
+ Elbasan = _Elbasan // Elbasan is the set of Unicode characters in script Elbasan.
+ Elymaic = _Elymaic // Elymaic is the set of Unicode characters in script Elymaic.
+ Ethiopic = _Ethiopic // Ethiopic is the set of Unicode characters in script Ethiopic.
+ Georgian = _Georgian // Georgian is the set of Unicode characters in script Georgian.
+ Glagolitic = _Glagolitic // Glagolitic is the set of Unicode characters in script Glagolitic.
+ Gothic = _Gothic // Gothic is the set of Unicode characters in script Gothic.
+ Grantha = _Grantha // Grantha is the set of Unicode characters in script Grantha.
+ Greek = _Greek // Greek is the set of Unicode characters in script Greek.
+ Gujarati = _Gujarati // Gujarati is the set of Unicode characters in script Gujarati.
+ Gunjala_Gondi = _Gunjala_Gondi // Gunjala_Gondi is the set of Unicode characters in script Gunjala_Gondi.
+ Gurmukhi = _Gurmukhi // Gurmukhi is the set of Unicode characters in script Gurmukhi.
+ Han = _Han // Han is the set of Unicode characters in script Han.
+ Hangul = _Hangul // Hangul is the set of Unicode characters in script Hangul.
+ Hanifi_Rohingya = _Hanifi_Rohingya // Hanifi_Rohingya is the set of Unicode characters in script Hanifi_Rohingya.
+ Hanunoo = _Hanunoo // Hanunoo is the set of Unicode characters in script Hanunoo.
+ Hatran = _Hatran // Hatran is the set of Unicode characters in script Hatran.
+ Hebrew = _Hebrew // Hebrew is the set of Unicode characters in script Hebrew.
+ Hiragana = _Hiragana // Hiragana is the set of Unicode characters in script Hiragana.
+ Imperial_Aramaic = _Imperial_Aramaic // Imperial_Aramaic is the set of Unicode characters in script Imperial_Aramaic.
+ Inherited = _Inherited // Inherited is the set of Unicode characters in script Inherited.
+ Inscriptional_Pahlavi = _Inscriptional_Pahlavi // Inscriptional_Pahlavi is the set of Unicode characters in script Inscriptional_Pahlavi.
+ Inscriptional_Parthian = _Inscriptional_Parthian // Inscriptional_Parthian is the set of Unicode characters in script Inscriptional_Parthian.
+ Javanese = _Javanese // Javanese is the set of Unicode characters in script Javanese.
+ Kaithi = _Kaithi // Kaithi is the set of Unicode characters in script Kaithi.
+ Kannada = _Kannada // Kannada is the set of Unicode characters in script Kannada.
+ Katakana = _Katakana // Katakana is the set of Unicode characters in script Katakana.
+ Kawi = _Kawi // Kawi is the set of Unicode characters in script Kawi.
+ Kayah_Li = _Kayah_Li // Kayah_Li is the set of Unicode characters in script Kayah_Li.
+ Kharoshthi = _Kharoshthi // Kharoshthi is the set of Unicode characters in script Kharoshthi.
+ Khitan_Small_Script = _Khitan_Small_Script // Khitan_Small_Script is the set of Unicode characters in script Khitan_Small_Script.
+ Khmer = _Khmer // Khmer is the set of Unicode characters in script Khmer.
+ Khojki = _Khojki // Khojki is the set of Unicode characters in script Khojki.
+ Khudawadi = _Khudawadi // Khudawadi is the set of Unicode characters in script Khudawadi.
+ Lao = _Lao // Lao is the set of Unicode characters in script Lao.
+ Latin = _Latin // Latin is the set of Unicode characters in script Latin.
+ Lepcha = _Lepcha // Lepcha is the set of Unicode characters in script Lepcha.
+ Limbu = _Limbu // Limbu is the set of Unicode characters in script Limbu.
+ Linear_A = _Linear_A // Linear_A is the set of Unicode characters in script Linear_A.
+ Linear_B = _Linear_B // Linear_B is the set of Unicode characters in script Linear_B.
+ Lisu = _Lisu // Lisu is the set of Unicode characters in script Lisu.
+ Lycian = _Lycian // Lycian is the set of Unicode characters in script Lycian.
+ Lydian = _Lydian // Lydian is the set of Unicode characters in script Lydian.
+ Mahajani = _Mahajani // Mahajani is the set of Unicode characters in script Mahajani.
+ Makasar = _Makasar // Makasar is the set of Unicode characters in script Makasar.
+ Malayalam = _Malayalam // Malayalam is the set of Unicode characters in script Malayalam.
+ Mandaic = _Mandaic // Mandaic is the set of Unicode characters in script Mandaic.
+ Manichaean = _Manichaean // Manichaean is the set of Unicode characters in script Manichaean.
+ Marchen = _Marchen // Marchen is the set of Unicode characters in script Marchen.
+ Masaram_Gondi = _Masaram_Gondi // Masaram_Gondi is the set of Unicode characters in script Masaram_Gondi.
+ Medefaidrin = _Medefaidrin // Medefaidrin is the set of Unicode characters in script Medefaidrin.
+ Meetei_Mayek = _Meetei_Mayek // Meetei_Mayek is the set of Unicode characters in script Meetei_Mayek.
+ Mende_Kikakui = _Mende_Kikakui // Mende_Kikakui is the set of Unicode characters in script Mende_Kikakui.
+ Meroitic_Cursive = _Meroitic_Cursive // Meroitic_Cursive is the set of Unicode characters in script Meroitic_Cursive.
+ Meroitic_Hieroglyphs = _Meroitic_Hieroglyphs // Meroitic_Hieroglyphs is the set of Unicode characters in script Meroitic_Hieroglyphs.
+ Miao = _Miao // Miao is the set of Unicode characters in script Miao.
+ Modi = _Modi // Modi is the set of Unicode characters in script Modi.
+ Mongolian = _Mongolian // Mongolian is the set of Unicode characters in script Mongolian.
+ Mro = _Mro // Mro is the set of Unicode characters in script Mro.
+ Multani = _Multani // Multani is the set of Unicode characters in script Multani.
+ Myanmar = _Myanmar // Myanmar is the set of Unicode characters in script Myanmar.
+ Nabataean = _Nabataean // Nabataean is the set of Unicode characters in script Nabataean.
+ Nag_Mundari = _Nag_Mundari // Nag_Mundari is the set of Unicode characters in script Nag_Mundari.
+ Nandinagari = _Nandinagari // Nandinagari is the set of Unicode characters in script Nandinagari.
+ New_Tai_Lue = _New_Tai_Lue // New_Tai_Lue is the set of Unicode characters in script New_Tai_Lue.
+ Newa = _Newa // Newa is the set of Unicode characters in script Newa.
+ Nko = _Nko // Nko is the set of Unicode characters in script Nko.
+ Nushu = _Nushu // Nushu is the set of Unicode characters in script Nushu.
+ Nyiakeng_Puachue_Hmong = _Nyiakeng_Puachue_Hmong // Nyiakeng_Puachue_Hmong is the set of Unicode characters in script Nyiakeng_Puachue_Hmong.
+ Ogham = _Ogham // Ogham is the set of Unicode characters in script Ogham.
+ Ol_Chiki = _Ol_Chiki // Ol_Chiki is the set of Unicode characters in script Ol_Chiki.
+ Old_Hungarian = _Old_Hungarian // Old_Hungarian is the set of Unicode characters in script Old_Hungarian.
+ Old_Italic = _Old_Italic // Old_Italic is the set of Unicode characters in script Old_Italic.
+ Old_North_Arabian = _Old_North_Arabian // Old_North_Arabian is the set of Unicode characters in script Old_North_Arabian.
+ Old_Permic = _Old_Permic // Old_Permic is the set of Unicode characters in script Old_Permic.
+ Old_Persian = _Old_Persian // Old_Persian is the set of Unicode characters in script Old_Persian.
+ Old_Sogdian = _Old_Sogdian // Old_Sogdian is the set of Unicode characters in script Old_Sogdian.
+ Old_South_Arabian = _Old_South_Arabian // Old_South_Arabian is the set of Unicode characters in script Old_South_Arabian.
+ Old_Turkic = _Old_Turkic // Old_Turkic is the set of Unicode characters in script Old_Turkic.
+ Old_Uyghur = _Old_Uyghur // Old_Uyghur is the set of Unicode characters in script Old_Uyghur.
+ Oriya = _Oriya // Oriya is the set of Unicode characters in script Oriya.
+ Osage = _Osage // Osage is the set of Unicode characters in script Osage.
+ Osmanya = _Osmanya // Osmanya is the set of Unicode characters in script Osmanya.
+ Pahawh_Hmong = _Pahawh_Hmong // Pahawh_Hmong is the set of Unicode characters in script Pahawh_Hmong.
+ Palmyrene = _Palmyrene // Palmyrene is the set of Unicode characters in script Palmyrene.
+ Pau_Cin_Hau = _Pau_Cin_Hau // Pau_Cin_Hau is the set of Unicode characters in script Pau_Cin_Hau.
+ Phags_Pa = _Phags_Pa // Phags_Pa is the set of Unicode characters in script Phags_Pa.
+ Phoenician = _Phoenician // Phoenician is the set of Unicode characters in script Phoenician.
+ Psalter_Pahlavi = _Psalter_Pahlavi // Psalter_Pahlavi is the set of Unicode characters in script Psalter_Pahlavi.
+ Rejang = _Rejang // Rejang is the set of Unicode characters in script Rejang.
+ Runic = _Runic // Runic is the set of Unicode characters in script Runic.
+ Samaritan = _Samaritan // Samaritan is the set of Unicode characters in script Samaritan.
+ Saurashtra = _Saurashtra // Saurashtra is the set of Unicode characters in script Saurashtra.
+ Sharada = _Sharada // Sharada is the set of Unicode characters in script Sharada.
+ Shavian = _Shavian // Shavian is the set of Unicode characters in script Shavian.
+ Siddham = _Siddham // Siddham is the set of Unicode characters in script Siddham.
+ SignWriting = _SignWriting // SignWriting is the set of Unicode characters in script SignWriting.
+ Sinhala = _Sinhala // Sinhala is the set of Unicode characters in script Sinhala.
+ Sogdian = _Sogdian // Sogdian is the set of Unicode characters in script Sogdian.
+ Sora_Sompeng = _Sora_Sompeng // Sora_Sompeng is the set of Unicode characters in script Sora_Sompeng.
+ Soyombo = _Soyombo // Soyombo is the set of Unicode characters in script Soyombo.
+ Sundanese = _Sundanese // Sundanese is the set of Unicode characters in script Sundanese.
+ Syloti_Nagri = _Syloti_Nagri // Syloti_Nagri is the set of Unicode characters in script Syloti_Nagri.
+ Syriac = _Syriac // Syriac is the set of Unicode characters in script Syriac.
+ Tagalog = _Tagalog // Tagalog is the set of Unicode characters in script Tagalog.
+ Tagbanwa = _Tagbanwa // Tagbanwa is the set of Unicode characters in script Tagbanwa.
+ Tai_Le = _Tai_Le // Tai_Le is the set of Unicode characters in script Tai_Le.
+ Tai_Tham = _Tai_Tham // Tai_Tham is the set of Unicode characters in script Tai_Tham.
+ Tai_Viet = _Tai_Viet // Tai_Viet is the set of Unicode characters in script Tai_Viet.
+ Takri = _Takri // Takri is the set of Unicode characters in script Takri.
+ Tamil = _Tamil // Tamil is the set of Unicode characters in script Tamil.
+ Tangsa = _Tangsa // Tangsa is the set of Unicode characters in script Tangsa.
+ Tangut = _Tangut // Tangut is the set of Unicode characters in script Tangut.
+ Telugu = _Telugu // Telugu is the set of Unicode characters in script Telugu.
+ Thaana = _Thaana // Thaana is the set of Unicode characters in script Thaana.
+ Thai = _Thai // Thai is the set of Unicode characters in script Thai.
+ Tibetan = _Tibetan // Tibetan is the set of Unicode characters in script Tibetan.
+ Tifinagh = _Tifinagh // Tifinagh is the set of Unicode characters in script Tifinagh.
+ Tirhuta = _Tirhuta // Tirhuta is the set of Unicode characters in script Tirhuta.
+ Toto = _Toto // Toto is the set of Unicode characters in script Toto.
+ Ugaritic = _Ugaritic // Ugaritic is the set of Unicode characters in script Ugaritic.
+ Vai = _Vai // Vai is the set of Unicode characters in script Vai.
+ Vithkuqi = _Vithkuqi // Vithkuqi is the set of Unicode characters in script Vithkuqi.
+ Wancho = _Wancho // Wancho is the set of Unicode characters in script Wancho.
+ Warang_Citi = _Warang_Citi // Warang_Citi is the set of Unicode characters in script Warang_Citi.
+ Yezidi = _Yezidi // Yezidi is the set of Unicode characters in script Yezidi.
+ Yi = _Yi // Yi is the set of Unicode characters in script Yi.
+ Zanabazar_Square = _Zanabazar_Square // Zanabazar_Square is the set of Unicode characters in script Zanabazar_Square.
+)</pre> <p>These variables have type *RangeTable. </p>
+<pre data-language="go">var (
+ ASCII_Hex_Digit = _ASCII_Hex_Digit // ASCII_Hex_Digit is the set of Unicode characters with property ASCII_Hex_Digit.
+ Bidi_Control = _Bidi_Control // Bidi_Control is the set of Unicode characters with property Bidi_Control.
+ Dash = _Dash // Dash is the set of Unicode characters with property Dash.
+ Deprecated = _Deprecated // Deprecated is the set of Unicode characters with property Deprecated.
+ Diacritic = _Diacritic // Diacritic is the set of Unicode characters with property Diacritic.
+ Extender = _Extender // Extender is the set of Unicode characters with property Extender.
+ Hex_Digit = _Hex_Digit // Hex_Digit is the set of Unicode characters with property Hex_Digit.
+ Hyphen = _Hyphen // Hyphen is the set of Unicode characters with property Hyphen.
+ IDS_Binary_Operator = _IDS_Binary_Operator // IDS_Binary_Operator is the set of Unicode characters with property IDS_Binary_Operator.
+ IDS_Trinary_Operator = _IDS_Trinary_Operator // IDS_Trinary_Operator is the set of Unicode characters with property IDS_Trinary_Operator.
+ Ideographic = _Ideographic // Ideographic is the set of Unicode characters with property Ideographic.
+ Join_Control = _Join_Control // Join_Control is the set of Unicode characters with property Join_Control.
+ Logical_Order_Exception = _Logical_Order_Exception // Logical_Order_Exception is the set of Unicode characters with property Logical_Order_Exception.
+ Noncharacter_Code_Point = _Noncharacter_Code_Point // Noncharacter_Code_Point is the set of Unicode characters with property Noncharacter_Code_Point.
+ Other_Alphabetic = _Other_Alphabetic // Other_Alphabetic is the set of Unicode characters with property Other_Alphabetic.
+ Other_Default_Ignorable_Code_Point = _Other_Default_Ignorable_Code_Point // Other_Default_Ignorable_Code_Point is the set of Unicode characters with property Other_Default_Ignorable_Code_Point.
+ Other_Grapheme_Extend = _Other_Grapheme_Extend // Other_Grapheme_Extend is the set of Unicode characters with property Other_Grapheme_Extend.
+ Other_ID_Continue = _Other_ID_Continue // Other_ID_Continue is the set of Unicode characters with property Other_ID_Continue.
+ Other_ID_Start = _Other_ID_Start // Other_ID_Start is the set of Unicode characters with property Other_ID_Start.
+ Other_Lowercase = _Other_Lowercase // Other_Lowercase is the set of Unicode characters with property Other_Lowercase.
+ Other_Math = _Other_Math // Other_Math is the set of Unicode characters with property Other_Math.
+ Other_Uppercase = _Other_Uppercase // Other_Uppercase is the set of Unicode characters with property Other_Uppercase.
+ Pattern_Syntax = _Pattern_Syntax // Pattern_Syntax is the set of Unicode characters with property Pattern_Syntax.
+ Pattern_White_Space = _Pattern_White_Space // Pattern_White_Space is the set of Unicode characters with property Pattern_White_Space.
+ Prepended_Concatenation_Mark = _Prepended_Concatenation_Mark // Prepended_Concatenation_Mark is the set of Unicode characters with property Prepended_Concatenation_Mark.
+ Quotation_Mark = _Quotation_Mark // Quotation_Mark is the set of Unicode characters with property Quotation_Mark.
+ Radical = _Radical // Radical is the set of Unicode characters with property Radical.
+ Regional_Indicator = _Regional_Indicator // Regional_Indicator is the set of Unicode characters with property Regional_Indicator.
+ STerm = _Sentence_Terminal // STerm is an alias for Sentence_Terminal.
+ Sentence_Terminal = _Sentence_Terminal // Sentence_Terminal is the set of Unicode characters with property Sentence_Terminal.
+ Soft_Dotted = _Soft_Dotted // Soft_Dotted is the set of Unicode characters with property Soft_Dotted.
+ Terminal_Punctuation = _Terminal_Punctuation // Terminal_Punctuation is the set of Unicode characters with property Terminal_Punctuation.
+ Unified_Ideograph = _Unified_Ideograph // Unified_Ideograph is the set of Unicode characters with property Unified_Ideograph.
+ Variation_Selector = _Variation_Selector // Variation_Selector is the set of Unicode characters with property Variation_Selector.
+ White_Space = _White_Space // White_Space is the set of Unicode characters with property White_Space.
+)</pre> <p>CaseRanges is the table describing case mappings for all letters with non-self mappings. </p>
+<pre data-language="go">var CaseRanges = _CaseRanges</pre> <p>Categories is the set of Unicode category tables. </p>
+<pre data-language="go">var Categories = map[string]*RangeTable{
+ "C": C,
+ "Cc": Cc,
+ "Cf": Cf,
+ "Co": Co,
+ "Cs": Cs,
+ "L": L,
+ "Ll": Ll,
+ "Lm": Lm,
+ "Lo": Lo,
+ "Lt": Lt,
+ "Lu": Lu,
+ "M": M,
+ "Mc": Mc,
+ "Me": Me,
+ "Mn": Mn,
+ "N": N,
+ "Nd": Nd,
+ "Nl": Nl,
+ "No": No,
+ "P": P,
+ "Pc": Pc,
+ "Pd": Pd,
+ "Pe": Pe,
+ "Pf": Pf,
+ "Pi": Pi,
+ "Po": Po,
+ "Ps": Ps,
+ "S": S,
+ "Sc": Sc,
+ "Sk": Sk,
+ "Sm": Sm,
+ "So": So,
+ "Z": Z,
+ "Zl": Zl,
+ "Zp": Zp,
+ "Zs": Zs,
+}</pre> <p>FoldCategory maps a category name to a table of code points outside the category that are equivalent under simple case folding to code points inside the category. If there is no entry for a category name, there are no such points. </p>
+<pre data-language="go">var FoldCategory = map[string]*RangeTable{
+ "L": foldL,
+ "Ll": foldLl,
+ "Lt": foldLt,
+ "Lu": foldLu,
+ "M": foldM,
+ "Mn": foldMn,
+}</pre> <p>FoldScript maps a script name to a table of code points outside the script that are equivalent under simple case folding to code points inside the script. If there is no entry for a script name, there are no such points. </p>
+<pre data-language="go">var FoldScript = map[string]*RangeTable{
+ "Common": foldCommon,
+ "Greek": foldGreek,
+ "Inherited": foldInherited,
+}</pre> <p>GraphicRanges defines the set of graphic characters according to Unicode. </p>
+<pre data-language="go">var GraphicRanges = []*RangeTable{
+ L, M, N, P, S, Zs,
+}</pre> <p>PrintRanges defines the set of printable characters according to Go. ASCII space, U+0020, is handled separately. </p>
+<pre data-language="go">var PrintRanges = []*RangeTable{
+ L, M, N, P, S,
+}</pre> <p>Properties is the set of Unicode property tables. </p>
+<pre data-language="go">var Properties = map[string]*RangeTable{
+ "ASCII_Hex_Digit": ASCII_Hex_Digit,
+ "Bidi_Control": Bidi_Control,
+ "Dash": Dash,
+ "Deprecated": Deprecated,
+ "Diacritic": Diacritic,
+ "Extender": Extender,
+ "Hex_Digit": Hex_Digit,
+ "Hyphen": Hyphen,
+ "IDS_Binary_Operator": IDS_Binary_Operator,
+ "IDS_Trinary_Operator": IDS_Trinary_Operator,
+ "Ideographic": Ideographic,
+ "Join_Control": Join_Control,
+ "Logical_Order_Exception": Logical_Order_Exception,
+ "Noncharacter_Code_Point": Noncharacter_Code_Point,
+ "Other_Alphabetic": Other_Alphabetic,
+ "Other_Default_Ignorable_Code_Point": Other_Default_Ignorable_Code_Point,
+ "Other_Grapheme_Extend": Other_Grapheme_Extend,
+ "Other_ID_Continue": Other_ID_Continue,
+ "Other_ID_Start": Other_ID_Start,
+ "Other_Lowercase": Other_Lowercase,
+ "Other_Math": Other_Math,
+ "Other_Uppercase": Other_Uppercase,
+ "Pattern_Syntax": Pattern_Syntax,
+ "Pattern_White_Space": Pattern_White_Space,
+ "Prepended_Concatenation_Mark": Prepended_Concatenation_Mark,
+ "Quotation_Mark": Quotation_Mark,
+ "Radical": Radical,
+ "Regional_Indicator": Regional_Indicator,
+ "Sentence_Terminal": Sentence_Terminal,
+ "STerm": Sentence_Terminal,
+ "Soft_Dotted": Soft_Dotted,
+ "Terminal_Punctuation": Terminal_Punctuation,
+ "Unified_Ideograph": Unified_Ideograph,
+ "Variation_Selector": Variation_Selector,
+ "White_Space": White_Space,
+}</pre> <p>Scripts is the set of Unicode script tables. </p>
+<pre data-language="go">var Scripts = map[string]*RangeTable{
+ "Adlam": Adlam,
+ "Ahom": Ahom,
+ "Anatolian_Hieroglyphs": Anatolian_Hieroglyphs,
+ "Arabic": Arabic,
+ "Armenian": Armenian,
+ "Avestan": Avestan,
+ "Balinese": Balinese,
+ "Bamum": Bamum,
+ "Bassa_Vah": Bassa_Vah,
+ "Batak": Batak,
+ "Bengali": Bengali,
+ "Bhaiksuki": Bhaiksuki,
+ "Bopomofo": Bopomofo,
+ "Brahmi": Brahmi,
+ "Braille": Braille,
+ "Buginese": Buginese,
+ "Buhid": Buhid,
+ "Canadian_Aboriginal": Canadian_Aboriginal,
+ "Carian": Carian,
+ "Caucasian_Albanian": Caucasian_Albanian,
+ "Chakma": Chakma,
+ "Cham": Cham,
+ "Cherokee": Cherokee,
+ "Chorasmian": Chorasmian,
+ "Common": Common,
+ "Coptic": Coptic,
+ "Cuneiform": Cuneiform,
+ "Cypriot": Cypriot,
+ "Cypro_Minoan": Cypro_Minoan,
+ "Cyrillic": Cyrillic,
+ "Deseret": Deseret,
+ "Devanagari": Devanagari,
+ "Dives_Akuru": Dives_Akuru,
+ "Dogra": Dogra,
+ "Duployan": Duployan,
+ "Egyptian_Hieroglyphs": Egyptian_Hieroglyphs,
+ "Elbasan": Elbasan,
+ "Elymaic": Elymaic,
+ "Ethiopic": Ethiopic,
+ "Georgian": Georgian,
+ "Glagolitic": Glagolitic,
+ "Gothic": Gothic,
+ "Grantha": Grantha,
+ "Greek": Greek,
+ "Gujarati": Gujarati,
+ "Gunjala_Gondi": Gunjala_Gondi,
+ "Gurmukhi": Gurmukhi,
+ "Han": Han,
+ "Hangul": Hangul,
+ "Hanifi_Rohingya": Hanifi_Rohingya,
+ "Hanunoo": Hanunoo,
+ "Hatran": Hatran,
+ "Hebrew": Hebrew,
+ "Hiragana": Hiragana,
+ "Imperial_Aramaic": Imperial_Aramaic,
+ "Inherited": Inherited,
+ "Inscriptional_Pahlavi": Inscriptional_Pahlavi,
+ "Inscriptional_Parthian": Inscriptional_Parthian,
+ "Javanese": Javanese,
+ "Kaithi": Kaithi,
+ "Kannada": Kannada,
+ "Katakana": Katakana,
+ "Kawi": Kawi,
+ "Kayah_Li": Kayah_Li,
+ "Kharoshthi": Kharoshthi,
+ "Khitan_Small_Script": Khitan_Small_Script,
+ "Khmer": Khmer,
+ "Khojki": Khojki,
+ "Khudawadi": Khudawadi,
+ "Lao": Lao,
+ "Latin": Latin,
+ "Lepcha": Lepcha,
+ "Limbu": Limbu,
+ "Linear_A": Linear_A,
+ "Linear_B": Linear_B,
+ "Lisu": Lisu,
+ "Lycian": Lycian,
+ "Lydian": Lydian,
+ "Mahajani": Mahajani,
+ "Makasar": Makasar,
+ "Malayalam": Malayalam,
+ "Mandaic": Mandaic,
+ "Manichaean": Manichaean,
+ "Marchen": Marchen,
+ "Masaram_Gondi": Masaram_Gondi,
+ "Medefaidrin": Medefaidrin,
+ "Meetei_Mayek": Meetei_Mayek,
+ "Mende_Kikakui": Mende_Kikakui,
+ "Meroitic_Cursive": Meroitic_Cursive,
+ "Meroitic_Hieroglyphs": Meroitic_Hieroglyphs,
+ "Miao": Miao,
+ "Modi": Modi,
+ "Mongolian": Mongolian,
+ "Mro": Mro,
+ "Multani": Multani,
+ "Myanmar": Myanmar,
+ "Nabataean": Nabataean,
+ "Nag_Mundari": Nag_Mundari,
+ "Nandinagari": Nandinagari,
+ "New_Tai_Lue": New_Tai_Lue,
+ "Newa": Newa,
+ "Nko": Nko,
+ "Nushu": Nushu,
+ "Nyiakeng_Puachue_Hmong": Nyiakeng_Puachue_Hmong,
+ "Ogham": Ogham,
+ "Ol_Chiki": Ol_Chiki,
+ "Old_Hungarian": Old_Hungarian,
+ "Old_Italic": Old_Italic,
+ "Old_North_Arabian": Old_North_Arabian,
+ "Old_Permic": Old_Permic,
+ "Old_Persian": Old_Persian,
+ "Old_Sogdian": Old_Sogdian,
+ "Old_South_Arabian": Old_South_Arabian,
+ "Old_Turkic": Old_Turkic,
+ "Old_Uyghur": Old_Uyghur,
+ "Oriya": Oriya,
+ "Osage": Osage,
+ "Osmanya": Osmanya,
+ "Pahawh_Hmong": Pahawh_Hmong,
+ "Palmyrene": Palmyrene,
+ "Pau_Cin_Hau": Pau_Cin_Hau,
+ "Phags_Pa": Phags_Pa,
+ "Phoenician": Phoenician,
+ "Psalter_Pahlavi": Psalter_Pahlavi,
+ "Rejang": Rejang,
+ "Runic": Runic,
+ "Samaritan": Samaritan,
+ "Saurashtra": Saurashtra,
+ "Sharada": Sharada,
+ "Shavian": Shavian,
+ "Siddham": Siddham,
+ "SignWriting": SignWriting,
+ "Sinhala": Sinhala,
+ "Sogdian": Sogdian,
+ "Sora_Sompeng": Sora_Sompeng,
+ "Soyombo": Soyombo,
+ "Sundanese": Sundanese,
+ "Syloti_Nagri": Syloti_Nagri,
+ "Syriac": Syriac,
+ "Tagalog": Tagalog,
+ "Tagbanwa": Tagbanwa,
+ "Tai_Le": Tai_Le,
+ "Tai_Tham": Tai_Tham,
+ "Tai_Viet": Tai_Viet,
+ "Takri": Takri,
+ "Tamil": Tamil,
+ "Tangsa": Tangsa,
+ "Tangut": Tangut,
+ "Telugu": Telugu,
+ "Thaana": Thaana,
+ "Thai": Thai,
+ "Tibetan": Tibetan,
+ "Tifinagh": Tifinagh,
+ "Tirhuta": Tirhuta,
+ "Toto": Toto,
+ "Ugaritic": Ugaritic,
+ "Vai": Vai,
+ "Vithkuqi": Vithkuqi,
+ "Wancho": Wancho,
+ "Warang_Citi": Warang_Citi,
+ "Yezidi": Yezidi,
+ "Yi": Yi,
+ "Zanabazar_Square": Zanabazar_Square,
+}</pre> <h2 id="In">func <span>In</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func In(r rune, ranges ...*RangeTable) bool</pre> <p>In reports whether the rune is a member of one of the ranges. </p>
+<h2 id="Is">func <span>Is</span> </h2> <pre data-language="go">func Is(rangeTab *RangeTable, r rune) bool</pre> <p>Is reports whether the rune is in the specified table of ranges. </p>
+<h2 id="IsControl">func <span>IsControl</span> </h2> <pre data-language="go">func IsControl(r rune) bool</pre> <p>IsControl reports whether the rune is a control character. The <a href="#C">C</a> (<a href="#Other">Other</a>) Unicode category includes more code points such as surrogates; use <a href="#Is">Is</a>(C, r) to test for them. </p>
+<h2 id="IsDigit">func <span>IsDigit</span> </h2> <pre data-language="go">func IsDigit(r rune) bool</pre> <p>IsDigit reports whether the rune is a decimal digit. </p> <h4 id="example_IsDigit"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsDigit('৩'))
+fmt.Printf("%t\n", unicode.IsDigit('A'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="IsGraphic">func <span>IsGraphic</span> </h2> <pre data-language="go">func IsGraphic(r rune) bool</pre> <p>IsGraphic reports whether the rune is defined as a Graphic by Unicode. Such characters include letters, marks, numbers, punctuation, symbols, and spaces, from categories <a href="#L">L</a>, <a href="#M">M</a>, <a href="#N">N</a>, <a href="#P">P</a>, <a href="#S">S</a>, <a href="#Zs">Zs</a>. </p>
+<h2 id="IsLetter">func <span>IsLetter</span> </h2> <pre data-language="go">func IsLetter(r rune) bool</pre> <p>IsLetter reports whether the rune is a letter (category <a href="#L">L</a>). </p> <h4 id="example_IsLetter"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsLetter('A'))
+fmt.Printf("%t\n", unicode.IsLetter('7'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="IsLower">func <span>IsLower</span> </h2> <pre data-language="go">func IsLower(r rune) bool</pre> <p>IsLower reports whether the rune is a lower case letter. </p> <h4 id="example_IsLower"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsLower('a'))
+fmt.Printf("%t\n", unicode.IsLower('A'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="IsMark">func <span>IsMark</span> </h2> <pre data-language="go">func IsMark(r rune) bool</pre> <p>IsMark reports whether the rune is a mark character (category <a href="#M">M</a>). </p>
+<h2 id="IsNumber">func <span>IsNumber</span> </h2> <pre data-language="go">func IsNumber(r rune) bool</pre> <p>IsNumber reports whether the rune is a number (category <a href="#N">N</a>). </p> <h4 id="example_IsNumber"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsNumber('Ⅷ'))
+fmt.Printf("%t\n", unicode.IsNumber('A'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="IsOneOf">func <span>IsOneOf</span> </h2> <pre data-language="go">func IsOneOf(ranges []*RangeTable, r rune) bool</pre> <p>IsOneOf reports whether the rune is a member of one of the ranges. The function "In" provides a nicer signature and should be used in preference to IsOneOf. </p>
+<h2 id="IsPrint">func <span>IsPrint</span> </h2> <pre data-language="go">func IsPrint(r rune) bool</pre> <p>IsPrint reports whether the rune is defined as printable by Go. Such characters include letters, marks, numbers, punctuation, symbols, and the ASCII space character, from categories <a href="#L">L</a>, <a href="#M">M</a>, <a href="#N">N</a>, <a href="#P">P</a>, <a href="#S">S</a> and the ASCII space character. This categorization is the same as <a href="#IsGraphic">IsGraphic</a> except that the only spacing character is ASCII space, U+0020. </p>
+<h2 id="IsPunct">func <span>IsPunct</span> </h2> <pre data-language="go">func IsPunct(r rune) bool</pre> <p>IsPunct reports whether the rune is a Unicode punctuation character (category <a href="#P">P</a>). </p>
+<h2 id="IsSpace">func <span>IsSpace</span> </h2> <pre data-language="go">func IsSpace(r rune) bool</pre> <p>IsSpace reports whether the rune is a space character as defined by Unicode's White Space property; in the Latin-1 space this is </p>
+<pre data-language="go">'\t', '\n', '\v', '\f', '\r', ' ', U+0085 (NEL), U+00A0 (NBSP).
+</pre> <p>Other definitions of spacing characters are set by category Z and property <a href="#Pattern_White_Space">Pattern_White_Space</a>. </p> <h4 id="example_IsSpace"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsSpace(' '))
+fmt.Printf("%t\n", unicode.IsSpace('\n'))
+fmt.Printf("%t\n", unicode.IsSpace('\t'))
+fmt.Printf("%t\n", unicode.IsSpace('a'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+true
+true
+false
+</pre> <h2 id="IsSymbol">func <span>IsSymbol</span> </h2> <pre data-language="go">func IsSymbol(r rune) bool</pre> <p>IsSymbol reports whether the rune is a symbolic character. </p>
+<h2 id="IsTitle">func <span>IsTitle</span> </h2> <pre data-language="go">func IsTitle(r rune) bool</pre> <p>IsTitle reports whether the rune is a title case letter. </p> <h4 id="example_IsTitle"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsTitle('Dž'))
+fmt.Printf("%t\n", unicode.IsTitle('a'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="IsUpper">func <span>IsUpper</span> </h2> <pre data-language="go">func IsUpper(r rune) bool</pre> <p>IsUpper reports whether the rune is an upper case letter. </p> <h4 id="example_IsUpper"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsUpper('A'))
+fmt.Printf("%t\n", unicode.IsUpper('a'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="SimpleFold">func <span>SimpleFold</span> </h2> <pre data-language="go">func SimpleFold(r rune) rune</pre> <p>SimpleFold iterates over Unicode code points equivalent under the Unicode-defined simple case folding. Among the code points equivalent to rune (including rune itself), SimpleFold returns the smallest rune &gt; r if one exists, or else the smallest rune &gt;= 0. If r is not a valid Unicode code point, SimpleFold(r) returns r. </p>
+<p>For example: </p>
+<pre data-language="go">SimpleFold('A') = 'a'
+SimpleFold('a') = 'A'
+
+SimpleFold('K') = 'k'
+SimpleFold('k') = '\u212A' (Kelvin symbol, K)
+SimpleFold('\u212A') = 'K'
+
+SimpleFold('1') = '1'
+
+SimpleFold(-2) = -2
+</pre> <h4 id="example_SimpleFold"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%#U\n", unicode.SimpleFold('A')) // 'a'
+fmt.Printf("%#U\n", unicode.SimpleFold('a')) // 'A'
+fmt.Printf("%#U\n", unicode.SimpleFold('K')) // 'k'
+fmt.Printf("%#U\n", unicode.SimpleFold('k')) // '\u212A' (Kelvin symbol, K)
+fmt.Printf("%#U\n", unicode.SimpleFold('\u212A')) // 'K'
+fmt.Printf("%#U\n", unicode.SimpleFold('1')) // '1'
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">U+0061 'a'
+U+0041 'A'
+U+006B 'k'
+U+212A 'K'
+U+004B 'K'
+U+0031 '1'
+</pre> <h2 id="To">func <span>To</span> </h2> <pre data-language="go">func To(_case int, r rune) rune</pre> <p>To maps the rune to the specified case: <a href="#UpperCase">UpperCase</a>, <a href="#LowerCase">LowerCase</a>, or <a href="#TitleCase">TitleCase</a>. </p> <h4 id="example_To"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const lcG = 'g'
+fmt.Printf("%#U\n", unicode.To(unicode.UpperCase, lcG))
+fmt.Printf("%#U\n", unicode.To(unicode.LowerCase, lcG))
+fmt.Printf("%#U\n", unicode.To(unicode.TitleCase, lcG))
+
+const ucG = 'G'
+fmt.Printf("%#U\n", unicode.To(unicode.UpperCase, ucG))
+fmt.Printf("%#U\n", unicode.To(unicode.LowerCase, ucG))
+fmt.Printf("%#U\n", unicode.To(unicode.TitleCase, ucG))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">U+0047 'G'
+U+0067 'g'
+U+0047 'G'
+U+0047 'G'
+U+0067 'g'
+U+0047 'G'
+</pre> <h2 id="ToLower">func <span>ToLower</span> </h2> <pre data-language="go">func ToLower(r rune) rune</pre> <p>ToLower maps the rune to lower case. </p> <h4 id="example_ToLower"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const ucG = 'G'
+fmt.Printf("%#U\n", unicode.ToLower(ucG))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">U+0067 'g'
+</pre> <h2 id="ToTitle">func <span>ToTitle</span> </h2> <pre data-language="go">func ToTitle(r rune) rune</pre> <p>ToTitle maps the rune to title case. </p> <h4 id="example_ToTitle"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const ucG = 'g'
+fmt.Printf("%#U\n", unicode.ToTitle(ucG))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">U+0047 'G'
+</pre> <h2 id="ToUpper">func <span>ToUpper</span> </h2> <pre data-language="go">func ToUpper(r rune) rune</pre> <p>ToUpper maps the rune to upper case. </p> <h4 id="example_ToUpper"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">const ucG = 'g'
+fmt.Printf("%#U\n", unicode.ToUpper(ucG))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">U+0047 'G'
+</pre> <h2 id="CaseRange">type <span>CaseRange</span> </h2> <p>CaseRange represents a range of Unicode code points for simple (one code point to one code point) case conversion. The range runs from Lo to Hi inclusive, with a fixed stride of 1. Deltas are the number to add to the code point to reach the code point for a different case for that character. They may be negative. If zero, it means the character is in the corresponding case. There is a special case representing sequences of alternating corresponding Upper and Lower pairs. It appears with a fixed Delta of </p>
+<pre data-language="go">{UpperLower, UpperLower, UpperLower}
+</pre> <p>The constant UpperLower has an otherwise impossible delta value. </p>
+<pre data-language="go">type CaseRange struct {
+ Lo uint32
+ Hi uint32
+ Delta d
+}
+</pre> <h2 id="Range16">type <span>Range16</span> </h2> <p>Range16 represents of a range of 16-bit Unicode code points. The range runs from Lo to Hi inclusive and has the specified stride. </p>
+<pre data-language="go">type Range16 struct {
+ Lo uint16
+ Hi uint16
+ Stride uint16
+}
+</pre> <h2 id="Range32">type <span>Range32</span> </h2> <p>Range32 represents of a range of Unicode code points and is used when one or more of the values will not fit in 16 bits. The range runs from Lo to Hi inclusive and has the specified stride. Lo and Hi must always be &gt;= 1&lt;&lt;16. </p>
+<pre data-language="go">type Range32 struct {
+ Lo uint32
+ Hi uint32
+ Stride uint32
+}
+</pre> <h2 id="RangeTable">type <span>RangeTable</span> </h2> <p>RangeTable defines a set of Unicode code points by listing the ranges of code points within the set. The ranges are listed in two slices to save space: a slice of 16-bit ranges and a slice of 32-bit ranges. The two slices must be in sorted order and non-overlapping. Also, R32 should contain only values &gt;= 0x10000 (1&lt;&lt;16). </p>
+<pre data-language="go">type RangeTable struct {
+ R16 []Range16
+ R32 []Range32
+ LatinOffset int // number of entries in R16 with Hi &lt;= MaxLatin1; added in Go 1.1
+}
+</pre> <h2 id="SpecialCase">type <span>SpecialCase</span> </h2> <p>SpecialCase represents language-specific case mappings such as Turkish. Methods of SpecialCase customize (by overriding) the standard mappings. </p>
+<pre data-language="go">type SpecialCase []CaseRange</pre> <pre data-language="go">var AzeriCase SpecialCase = _TurkishCase</pre> <pre data-language="go">var TurkishCase SpecialCase = _TurkishCase</pre> <h4 id="example_SpecialCase"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">t := unicode.TurkishCase
+
+const lci = 'i'
+fmt.Printf("%#U\n", t.ToLower(lci))
+fmt.Printf("%#U\n", t.ToTitle(lci))
+fmt.Printf("%#U\n", t.ToUpper(lci))
+
+const uci = 'İ'
+fmt.Printf("%#U\n", t.ToLower(uci))
+fmt.Printf("%#U\n", t.ToTitle(uci))
+fmt.Printf("%#U\n", t.ToUpper(uci))
+
+</pre> <p>Output:</p> <pre class="output" data-language="go">U+0069 'i'
+U+0130 'İ'
+U+0130 'İ'
+U+0069 'i'
+U+0130 'İ'
+U+0130 'İ'
+</pre> <h3 id="SpecialCase.ToLower">func (SpecialCase) <span>ToLower</span> </h3> <pre data-language="go">func (special SpecialCase) ToLower(r rune) rune</pre> <p>ToLower maps the rune to lower case giving priority to the special mapping. </p>
+<h3 id="SpecialCase.ToTitle">func (SpecialCase) <span>ToTitle</span> </h3> <pre data-language="go">func (special SpecialCase) ToTitle(r rune) rune</pre> <p>ToTitle maps the rune to title case giving priority to the special mapping. </p>
+<h3 id="SpecialCase.ToUpper">func (SpecialCase) <span>ToUpper</span> </h3> <pre data-language="go">func (special SpecialCase) ToUpper(r rune) rune</pre> <p>ToUpper maps the rune to upper case giving priority to the special mapping. </p>
+<h2 id="pkg-note-BUG">Bugs</h2> <ul> <li>☞ <p>There is no mechanism for full case folding, that is, for characters that involve multiple runes in the input or output. </p>
+</li> </ul> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="utf16/index">utf16</a> </td> <td class="pkg-synopsis"> Package utf16 implements encoding and decoding of UTF-16 sequences. </td> </tr> <tr> <td class="pkg-name"> <a href="utf8/index">utf8</a> </td> <td class="pkg-synopsis"> Package utf8 implements functions and constants to support text encoded in UTF-8. </td> </tr> </table> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/unicode/" class="_attribution-link">http://golang.org/pkg/unicode/</a>
+ </p>
+</div>
diff --git a/devdocs/go/unicode%2Futf16%2Findex.html b/devdocs/go/unicode%2Futf16%2Findex.html
new file mode 100644
index 00000000..e846c303
--- /dev/null
+++ b/devdocs/go/unicode%2Futf16%2Findex.html
@@ -0,0 +1,22 @@
+<h1> Package utf16 </h1> <ul id="short-nav">
+<li><code>import "unicode/utf16"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package utf16 implements encoding and decoding of UTF-16 sequences. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#AppendRune">func AppendRune(a []uint16, r rune) []uint16</a></li>
+<li><a href="#Decode">func Decode(s []uint16) []rune</a></li>
+<li><a href="#DecodeRune">func DecodeRune(r1, r2 rune) rune</a></li>
+<li><a href="#Encode">func Encode(s []rune) []uint16</a></li>
+<li><a href="#EncodeRune">func EncodeRune(r rune) (r1, r2 rune)</a></li>
+<li><a href="#IsSurrogate">func IsSurrogate(r rune) bool</a></li>
+</ul> <h3>Package files</h3> <p> <span>utf16.go</span> </p> <h2 id="AppendRune">func <span>AppendRune</span> <span title="Added in Go 1.20">1.20</span> </h2> <pre data-language="go">func AppendRune(a []uint16, r rune) []uint16</pre> <p>AppendRune appends the UTF-16 encoding of the Unicode code point r to the end of p and returns the extended buffer. If the rune is not a valid Unicode code point, it appends the encoding of U+FFFD. </p>
+<h2 id="Decode">func <span>Decode</span> </h2> <pre data-language="go">func Decode(s []uint16) []rune</pre> <p>Decode returns the Unicode code point sequence represented by the UTF-16 encoding s. </p>
+<h2 id="DecodeRune">func <span>DecodeRune</span> </h2> <pre data-language="go">func DecodeRune(r1, r2 rune) rune</pre> <p>DecodeRune returns the UTF-16 decoding of a surrogate pair. If the pair is not a valid UTF-16 surrogate pair, DecodeRune returns the Unicode replacement code point U+FFFD. </p>
+<h2 id="Encode">func <span>Encode</span> </h2> <pre data-language="go">func Encode(s []rune) []uint16</pre> <p>Encode returns the UTF-16 encoding of the Unicode code point sequence s. </p>
+<h2 id="EncodeRune">func <span>EncodeRune</span> </h2> <pre data-language="go">func EncodeRune(r rune) (r1, r2 rune)</pre> <p>EncodeRune returns the UTF-16 surrogate pair r1, r2 for the given rune. If the rune is not a valid Unicode code point or does not need encoding, EncodeRune returns U+FFFD, U+FFFD. </p>
+<h2 id="IsSurrogate">func <span>IsSurrogate</span> </h2> <pre data-language="go">func IsSurrogate(r rune) bool</pre> <p>IsSurrogate reports whether the specified Unicode code point can appear in a surrogate pair. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/unicode/utf16/" class="_attribution-link">http://golang.org/pkg/unicode/utf16/</a>
+ </p>
+</div>
diff --git a/devdocs/go/unicode%2Futf8%2Findex.html b/devdocs/go/unicode%2Futf8%2Findex.html
new file mode 100644
index 00000000..b27d81f9
--- /dev/null
+++ b/devdocs/go/unicode%2Futf8%2Findex.html
@@ -0,0 +1,205 @@
+<h1> Package utf8 </h1> <ul id="short-nav">
+<li><code>import "unicode/utf8"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package utf8 implements functions and constants to support text encoded in UTF-8. It includes functions to translate between runes and UTF-8 byte sequences. See <a href="https://en.wikipedia.org/wiki/UTF-8">https://en.wikipedia.org/wiki/UTF-8</a> </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#pkg-constants">Constants</a></li>
+<li><a href="#AppendRune">func AppendRune(p []byte, r rune) []byte</a></li>
+<li><a href="#DecodeLastRune">func DecodeLastRune(p []byte) (r rune, size int)</a></li>
+<li><a href="#DecodeLastRuneInString">func DecodeLastRuneInString(s string) (r rune, size int)</a></li>
+<li><a href="#DecodeRune">func DecodeRune(p []byte) (r rune, size int)</a></li>
+<li><a href="#DecodeRuneInString">func DecodeRuneInString(s string) (r rune, size int)</a></li>
+<li><a href="#EncodeRune">func EncodeRune(p []byte, r rune) int</a></li>
+<li><a href="#FullRune">func FullRune(p []byte) bool</a></li>
+<li><a href="#FullRuneInString">func FullRuneInString(s string) bool</a></li>
+<li><a href="#RuneCount">func RuneCount(p []byte) int</a></li>
+<li><a href="#RuneCountInString">func RuneCountInString(s string) (n int)</a></li>
+<li><a href="#RuneLen">func RuneLen(r rune) int</a></li>
+<li><a href="#RuneStart">func RuneStart(b byte) bool</a></li>
+<li><a href="#Valid">func Valid(p []byte) bool</a></li>
+<li><a href="#ValidRune">func ValidRune(r rune) bool</a></li>
+<li><a href="#ValidString">func ValidString(s string) bool</a></li>
+</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_AppendRune">AppendRune</a></dd> <dd><a class="exampleLink" href="#example_DecodeLastRune">DecodeLastRune</a></dd> <dd><a class="exampleLink" href="#example_DecodeLastRuneInString">DecodeLastRuneInString</a></dd> <dd><a class="exampleLink" href="#example_DecodeRune">DecodeRune</a></dd> <dd><a class="exampleLink" href="#example_DecodeRuneInString">DecodeRuneInString</a></dd> <dd><a class="exampleLink" href="#example_EncodeRune">EncodeRune</a></dd> <dd><a class="exampleLink" href="#example_EncodeRune_outOfRange">EncodeRune (OutOfRange)</a></dd> <dd><a class="exampleLink" href="#example_FullRune">FullRune</a></dd> <dd><a class="exampleLink" href="#example_FullRuneInString">FullRuneInString</a></dd> <dd><a class="exampleLink" href="#example_RuneCount">RuneCount</a></dd> <dd><a class="exampleLink" href="#example_RuneCountInString">RuneCountInString</a></dd> <dd><a class="exampleLink" href="#example_RuneLen">RuneLen</a></dd> <dd><a class="exampleLink" href="#example_RuneStart">RuneStart</a></dd> <dd><a class="exampleLink" href="#example_Valid">Valid</a></dd> <dd><a class="exampleLink" href="#example_ValidRune">ValidRune</a></dd> <dd><a class="exampleLink" href="#example_ValidString">ValidString</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>utf8.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>Numbers fundamental to the encoding. </p>
+<pre data-language="go">const (
+ RuneError = '\uFFFD' // the "error" Rune or "Unicode replacement character"
+ RuneSelf = 0x80 // characters below RuneSelf are represented as themselves in a single byte.
+ MaxRune = '\U0010FFFF' // Maximum valid Unicode code point.
+ UTFMax = 4 // maximum number of bytes of a UTF-8 encoded Unicode character.
+)</pre> <h2 id="AppendRune">func <span>AppendRune</span> <span title="Added in Go 1.18">1.18</span> </h2> <pre data-language="go">func AppendRune(p []byte, r rune) []byte</pre> <p>AppendRune appends the UTF-8 encoding of r to the end of p and returns the extended buffer. If the rune is out of range, it appends the encoding of <a href="#RuneError">RuneError</a>. </p> <h4 id="example_AppendRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf1 := utf8.AppendRune(nil, 0x10000)
+buf2 := utf8.AppendRune([]byte("init"), 0x10000)
+fmt.Println(string(buf1))
+fmt.Println(string(buf2))
+</pre> <p>Output:</p> <pre class="output" data-language="go">𐀀
+init𐀀
+</pre> <h2 id="DecodeLastRune">func <span>DecodeLastRune</span> </h2> <pre data-language="go">func DecodeLastRune(p []byte) (r rune, size int)</pre> <p>DecodeLastRune unpacks the last UTF-8 encoding in p and returns the rune and its width in bytes. If p is empty it returns (<a href="#RuneError">RuneError</a>, 0). Otherwise, if the encoding is invalid, it returns (RuneError, 1). Both are impossible results for correct, non-empty UTF-8. </p>
+<p>An encoding is invalid if it is incorrect UTF-8, encodes a rune that is out of range, or is not the shortest possible UTF-8 encoding for the value. No other validation is performed. </p> <h4 id="example_DecodeLastRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte("Hello, 世界")
+
+for len(b) &gt; 0 {
+ r, size := utf8.DecodeLastRune(b)
+ fmt.Printf("%c %v\n", r, size)
+
+ b = b[:len(b)-size]
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">界 3
+世 3
+ 1
+, 1
+o 1
+l 1
+l 1
+e 1
+H 1
+</pre> <h2 id="DecodeLastRuneInString">func <span>DecodeLastRuneInString</span> </h2> <pre data-language="go">func DecodeLastRuneInString(s string) (r rune, size int)</pre> <p>DecodeLastRuneInString is like <a href="#DecodeLastRune">DecodeLastRune</a> but its input is a string. If s is empty it returns (<a href="#RuneError">RuneError</a>, 0). Otherwise, if the encoding is invalid, it returns (RuneError, 1). Both are impossible results for correct, non-empty UTF-8. </p>
+<p>An encoding is invalid if it is incorrect UTF-8, encodes a rune that is out of range, or is not the shortest possible UTF-8 encoding for the value. No other validation is performed. </p> <h4 id="example_DecodeLastRuneInString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := "Hello, 世界"
+
+for len(str) &gt; 0 {
+ r, size := utf8.DecodeLastRuneInString(str)
+ fmt.Printf("%c %v\n", r, size)
+
+ str = str[:len(str)-size]
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">界 3
+世 3
+ 1
+, 1
+o 1
+l 1
+l 1
+e 1
+H 1
+</pre> <h2 id="DecodeRune">func <span>DecodeRune</span> </h2> <pre data-language="go">func DecodeRune(p []byte) (r rune, size int)</pre> <p>DecodeRune unpacks the first UTF-8 encoding in p and returns the rune and its width in bytes. If p is empty it returns (<a href="#RuneError">RuneError</a>, 0). Otherwise, if the encoding is invalid, it returns (RuneError, 1). Both are impossible results for correct, non-empty UTF-8. </p>
+<p>An encoding is invalid if it is incorrect UTF-8, encodes a rune that is out of range, or is not the shortest possible UTF-8 encoding for the value. No other validation is performed. </p> <h4 id="example_DecodeRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">b := []byte("Hello, 世界")
+
+for len(b) &gt; 0 {
+ r, size := utf8.DecodeRune(b)
+ fmt.Printf("%c %v\n", r, size)
+
+ b = b[size:]
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">H 1
+e 1
+l 1
+l 1
+o 1
+, 1
+ 1
+世 3
+界 3
+</pre> <h2 id="DecodeRuneInString">func <span>DecodeRuneInString</span> </h2> <pre data-language="go">func DecodeRuneInString(s string) (r rune, size int)</pre> <p>DecodeRuneInString is like <a href="#DecodeRune">DecodeRune</a> but its input is a string. If s is empty it returns (<a href="#RuneError">RuneError</a>, 0). Otherwise, if the encoding is invalid, it returns (RuneError, 1). Both are impossible results for correct, non-empty UTF-8. </p>
+<p>An encoding is invalid if it is incorrect UTF-8, encodes a rune that is out of range, or is not the shortest possible UTF-8 encoding for the value. No other validation is performed. </p> <h4 id="example_DecodeRuneInString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := "Hello, 世界"
+
+for len(str) &gt; 0 {
+ r, size := utf8.DecodeRuneInString(str)
+ fmt.Printf("%c %v\n", r, size)
+
+ str = str[size:]
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">H 1
+e 1
+l 1
+l 1
+o 1
+, 1
+ 1
+世 3
+界 3
+</pre> <h2 id="EncodeRune">func <span>EncodeRune</span> </h2> <pre data-language="go">func EncodeRune(p []byte, r rune) int</pre> <p>EncodeRune writes into p (which must be large enough) the UTF-8 encoding of the rune. If the rune is out of range, it writes the encoding of <a href="#RuneError">RuneError</a>. It returns the number of bytes written. </p> <h4 id="example_EncodeRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">r := '世'
+buf := make([]byte, 3)
+
+n := utf8.EncodeRune(buf, r)
+
+fmt.Println(buf)
+fmt.Println(n)
+</pre> <p>Output:</p> <pre class="output" data-language="go">[228 184 150]
+3
+</pre> <h4 id="example_EncodeRune_outOfRange"> <span class="text">Example (OutOfRange)</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">runes := []rune{
+ // Less than 0, out of range.
+ -1,
+ // Greater than 0x10FFFF, out of range.
+ 0x110000,
+ // The Unicode replacement character.
+ utf8.RuneError,
+}
+for i, c := range runes {
+ buf := make([]byte, 3)
+ size := utf8.EncodeRune(buf, c)
+ fmt.Printf("%d: %d %[2]s %d\n", i, buf, size)
+}
+</pre> <p>Output:</p> <pre class="output" data-language="go">0: [239 191 189] � 3
+1: [239 191 189] � 3
+2: [239 191 189] � 3
+</pre> <h2 id="FullRune">func <span>FullRune</span> </h2> <pre data-language="go">func FullRune(p []byte) bool</pre> <p>FullRune reports whether the bytes in p begin with a full UTF-8 encoding of a rune. An invalid encoding is considered a full Rune since it will convert as a width-1 error rune. </p> <h4 id="example_FullRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf := []byte{228, 184, 150} // 世
+fmt.Println(utf8.FullRune(buf))
+fmt.Println(utf8.FullRune(buf[:2]))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="FullRuneInString">func <span>FullRuneInString</span> </h2> <pre data-language="go">func FullRuneInString(s string) bool</pre> <p>FullRuneInString is like FullRune but its input is a string. </p> <h4 id="example_FullRuneInString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := "世"
+fmt.Println(utf8.FullRuneInString(str))
+fmt.Println(utf8.FullRuneInString(str[:2]))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="RuneCount">func <span>RuneCount</span> </h2> <pre data-language="go">func RuneCount(p []byte) int</pre> <p>RuneCount returns the number of runes in p. Erroneous and short encodings are treated as single runes of width 1 byte. </p> <h4 id="example_RuneCount"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf := []byte("Hello, 世界")
+fmt.Println("bytes =", len(buf))
+fmt.Println("runes =", utf8.RuneCount(buf))
+</pre> <p>Output:</p> <pre class="output" data-language="go">bytes = 13
+runes = 9
+</pre> <h2 id="RuneCountInString">func <span>RuneCountInString</span> </h2> <pre data-language="go">func RuneCountInString(s string) (n int)</pre> <p>RuneCountInString is like <a href="#RuneCount">RuneCount</a> but its input is a string. </p> <h4 id="example_RuneCountInString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">str := "Hello, 世界"
+fmt.Println("bytes =", len(str))
+fmt.Println("runes =", utf8.RuneCountInString(str))
+</pre> <p>Output:</p> <pre class="output" data-language="go">bytes = 13
+runes = 9
+</pre> <h2 id="RuneLen">func <span>RuneLen</span> </h2> <pre data-language="go">func RuneLen(r rune) int</pre> <p>RuneLen returns the number of bytes required to encode the rune. It returns -1 if the rune is not a valid value to encode in UTF-8. </p> <h4 id="example_RuneLen"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Println(utf8.RuneLen('a'))
+fmt.Println(utf8.RuneLen('界'))
+</pre> <p>Output:</p> <pre class="output" data-language="go">1
+3
+</pre> <h2 id="RuneStart">func <span>RuneStart</span> </h2> <pre data-language="go">func RuneStart(b byte) bool</pre> <p>RuneStart reports whether the byte could be the first byte of an encoded, possibly invalid rune. Second and subsequent bytes always have the top two bits set to 10. </p> <h4 id="example_RuneStart"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">buf := []byte("a界")
+fmt.Println(utf8.RuneStart(buf[0]))
+fmt.Println(utf8.RuneStart(buf[1]))
+fmt.Println(utf8.RuneStart(buf[2]))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+true
+false
+</pre> <h2 id="Valid">func <span>Valid</span> </h2> <pre data-language="go">func Valid(p []byte) bool</pre> <p>Valid reports whether p consists entirely of valid UTF-8-encoded runes. </p> <h4 id="example_Valid"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">valid := []byte("Hello, 世界")
+invalid := []byte{0xff, 0xfe, 0xfd}
+
+fmt.Println(utf8.Valid(valid))
+fmt.Println(utf8.Valid(invalid))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="ValidRune">func <span>ValidRune</span> <span title="Added in Go 1.1">1.1</span> </h2> <pre data-language="go">func ValidRune(r rune) bool</pre> <p>ValidRune reports whether r can be legally encoded as UTF-8. Code points that are out of range or a surrogate half are illegal. </p> <h4 id="example_ValidRune"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">valid := 'a'
+invalid := rune(0xfffffff)
+
+fmt.Println(utf8.ValidRune(valid))
+fmt.Println(utf8.ValidRune(invalid))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre> <h2 id="ValidString">func <span>ValidString</span> </h2> <pre data-language="go">func ValidString(s string) bool</pre> <p>ValidString reports whether s consists entirely of valid UTF-8-encoded runes. </p> <h4 id="example_ValidString"> <span class="text">Example</span>
+</h4> <p>Code:</p> <pre class="code" data-language="go">valid := "Hello, 世界"
+invalid := string([]byte{0xff, 0xfe, 0xfd})
+
+fmt.Println(utf8.ValidString(valid))
+fmt.Println(utf8.ValidString(invalid))
+</pre> <p>Output:</p> <pre class="output" data-language="go">true
+false
+</pre><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/unicode/utf8/" class="_attribution-link">http://golang.org/pkg/unicode/utf8/</a>
+ </p>
+</div>
diff --git a/devdocs/go/unsafe%2Findex.html b/devdocs/go/unsafe%2Findex.html
new file mode 100644
index 00000000..5e8827ad
--- /dev/null
+++ b/devdocs/go/unsafe%2Findex.html
@@ -0,0 +1,120 @@
+<h1> Package unsafe </h1> <ul id="short-nav">
+<li><code>import "unsafe"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package unsafe contains operations that step around the type safety of Go programs. </p>
+<p>Packages that import unsafe may be non-portable and are not protected by the Go 1 compatibility guidelines. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Alignof">func Alignof(x ArbitraryType) uintptr</a></li>
+<li><a href="#Offsetof">func Offsetof(x ArbitraryType) uintptr</a></li>
+<li><a href="#Sizeof">func Sizeof(x ArbitraryType) uintptr</a></li>
+<li><a href="#String">func String(ptr *byte, len IntegerType) string</a></li>
+<li><a href="#StringData">func StringData(str string) *byte</a></li>
+<li><a href="#ArbitraryType">type ArbitraryType</a></li>
+<li> <a href="#Slice">func Slice(ptr *ArbitraryType, len IntegerType) []ArbitraryType</a>
+</li>
+<li> <a href="#SliceData">func SliceData(slice []ArbitraryType) *ArbitraryType</a>
+</li>
+<li><a href="#IntegerType">type IntegerType</a></li>
+<li><a href="#Pointer">type Pointer</a></li>
+<li> <a href="#Add">func Add(ptr Pointer, len IntegerType) Pointer</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>unsafe.go</span> </p> <h2 id="Alignof">func <span>Alignof</span> </h2> <pre data-language="go">func Alignof(x ArbitraryType) uintptr</pre> <p>Alignof takes an expression x of any type and returns the required alignment of a hypothetical variable v as if v was declared via var v = x. It is the largest value m such that the address of v is always zero mod m. It is the same as the value returned by reflect.TypeOf(x).Align(). As a special case, if a variable s is of struct type and f is a field within that struct, then Alignof(s.f) will return the required alignment of a field of that type within a struct. This case is the same as the value returned by reflect.TypeOf(s.f).FieldAlign(). The return value of Alignof is a Go constant if the type of the argument does not have variable size. (See the description of <a href="#Sizeof">Sizeof</a> for a definition of variable sized types.) </p>
+<h2 id="Offsetof">func <span>Offsetof</span> </h2> <pre data-language="go">func Offsetof(x ArbitraryType) uintptr</pre> <p>Offsetof returns the offset within the struct of the field represented by x, which must be of the form structValue.field. In other words, it returns the number of bytes between the start of the struct and the start of the field. The return value of Offsetof is a Go constant if the type of the argument x does not have variable size. (See the description of <a href="#Sizeof">Sizeof</a> for a definition of variable sized types.) </p>
+<h2 id="Sizeof">func <span>Sizeof</span> </h2> <pre data-language="go">func Sizeof(x ArbitraryType) uintptr</pre> <p>Sizeof takes an expression x of any type and returns the size in bytes of a hypothetical variable v as if v was declared via var v = x. The size does not include any memory possibly referenced by x. For instance, if x is a slice, Sizeof returns the size of the slice descriptor, not the size of the memory referenced by the slice. For a struct, the size includes any padding introduced by field alignment. The return value of Sizeof is a Go constant if the type of the argument x does not have variable size. (A type has variable size if it is a type parameter or if it is an array or struct type with elements of variable size). </p>
+<h2 id="String">func <span>String</span> </h2> <pre data-language="go">func String(ptr *byte, len IntegerType) string</pre> <p>String returns a string value whose underlying bytes start at ptr and whose length is len. </p>
+<p>The len argument must be of integer type or an untyped constant. A constant len argument must be non-negative and representable by a value of type int; if it is an untyped constant it is given type int. At run time, if len is negative, or if ptr is nil and len is not zero, a run-time panic occurs. </p>
+<p>Since Go strings are immutable, the bytes passed to String must not be modified afterwards. </p>
+<h2 id="StringData">func <span>StringData</span> </h2> <pre data-language="go">func StringData(str string) *byte</pre> <p>StringData returns a pointer to the underlying bytes of str. For an empty string the return value is unspecified, and may be nil. </p>
+<p>Since Go strings are immutable, the bytes returned by StringData must not be modified. </p>
+<h2 id="ArbitraryType">type <span>ArbitraryType</span> </h2> <p>ArbitraryType is here for the purposes of documentation only and is not actually part of the unsafe package. It represents the type of an arbitrary Go expression. </p>
+<pre data-language="go">type ArbitraryType int</pre> <h3 id="Slice">func <span>Slice</span> </h3> <pre data-language="go">func Slice(ptr *ArbitraryType, len IntegerType) []ArbitraryType</pre> <p>The function Slice returns a slice whose underlying array starts at ptr and whose length and capacity are len. Slice(ptr, len) is equivalent to </p>
+<pre data-language="go">(*[len]ArbitraryType)(unsafe.Pointer(ptr))[:]
+</pre> <p>except that, as a special case, if ptr is nil and len is zero, Slice returns nil. </p>
+<p>The len argument must be of integer type or an untyped constant. A constant len argument must be non-negative and representable by a value of type int; if it is an untyped constant it is given type int. At run time, if len is negative, or if ptr is nil and len is not zero, a run-time panic occurs. </p>
+<h3 id="SliceData">func <span>SliceData</span> </h3> <pre data-language="go">func SliceData(slice []ArbitraryType) *ArbitraryType</pre> <p>SliceData returns a pointer to the underlying array of the argument slice. </p>
+<ul> <li>If cap(slice) &gt; 0, SliceData returns &amp;slice[:1][0]. </li>
+<li>If slice == nil, SliceData returns nil. </li>
+<li>Otherwise, SliceData returns a non-nil pointer to an unspecified memory address. </li>
+</ul> <h2 id="IntegerType">type <span>IntegerType</span> </h2> <p>IntegerType is here for the purposes of documentation only and is not actually part of the unsafe package. It represents any arbitrary integer type. </p>
+<pre data-language="go">type IntegerType int</pre> <h2 id="Pointer">type <span>Pointer</span> </h2> <p>Pointer represents a pointer to an arbitrary type. There are four special operations available for type Pointer that are not available for other types: </p>
+<ul> <li>A pointer value of any type can be converted to a Pointer. </li>
+<li>A Pointer can be converted to a pointer value of any type. </li>
+<li>A uintptr can be converted to a Pointer. </li>
+<li>A Pointer can be converted to a uintptr. </li>
+</ul> <p>Pointer therefore allows a program to defeat the type system and read and write arbitrary memory. It should be used with extreme care. </p>
+<p>The following patterns involving Pointer are valid. Code not using these patterns is likely to be invalid today or to become invalid in the future. Even the valid patterns below come with important caveats. </p>
+<p>Running "go vet" can help find uses of Pointer that do not conform to these patterns, but silence from "go vet" is not a guarantee that the code is valid. </p>
+<p>(1) Conversion of a *T1 to Pointer to *T2. </p>
+<p>Provided that T2 is no larger than T1 and that the two share an equivalent memory layout, this conversion allows reinterpreting data of one type as data of another type. An example is the implementation of math.Float64bits: </p>
+<pre data-language="go">func Float64bits(f float64) uint64 {
+ return *(*uint64)(unsafe.Pointer(&amp;f))
+}
+</pre> <p>(2) Conversion of a Pointer to a uintptr (but not back to Pointer). </p>
+<p>Converting a Pointer to a uintptr produces the memory address of the value pointed at, as an integer. The usual use for such a uintptr is to print it. </p>
+<p>Conversion of a uintptr back to Pointer is not valid in general. </p>
+<p>A uintptr is an integer, not a reference. Converting a Pointer to a uintptr creates an integer value with no pointer semantics. Even if a uintptr holds the address of some object, the garbage collector will not update that uintptr's value if the object moves, nor will that uintptr keep the object from being reclaimed. </p>
+<p>The remaining patterns enumerate the only valid conversions from uintptr to Pointer. </p>
+<p>(3) Conversion of a Pointer to a uintptr and back, with arithmetic. </p>
+<p>If p points into an allocated object, it can be advanced through the object by conversion to uintptr, addition of an offset, and conversion back to Pointer. </p>
+<pre data-language="go">p = unsafe.Pointer(uintptr(p) + offset)
+</pre> <p>The most common use of this pattern is to access fields in a struct or elements of an array: </p>
+<pre data-language="go">// equivalent to f := unsafe.Pointer(&amp;s.f)
+f := unsafe.Pointer(uintptr(unsafe.Pointer(&amp;s)) + unsafe.Offsetof(s.f))
+
+// equivalent to e := unsafe.Pointer(&amp;x[i])
+e := unsafe.Pointer(uintptr(unsafe.Pointer(&amp;x[0])) + i*unsafe.Sizeof(x[0]))
+</pre> <p>It is valid both to add and to subtract offsets from a pointer in this way. It is also valid to use &amp;^ to round pointers, usually for alignment. In all cases, the result must continue to point into the original allocated object. </p>
+<p>Unlike in C, it is not valid to advance a pointer just beyond the end of its original allocation: </p>
+<pre data-language="go">// INVALID: end points outside allocated space.
+var s thing
+end = unsafe.Pointer(uintptr(unsafe.Pointer(&amp;s)) + unsafe.Sizeof(s))
+
+// INVALID: end points outside allocated space.
+b := make([]byte, n)
+end = unsafe.Pointer(uintptr(unsafe.Pointer(&amp;b[0])) + uintptr(n))
+</pre> <p>Note that both conversions must appear in the same expression, with only the intervening arithmetic between them: </p>
+<pre data-language="go">// INVALID: uintptr cannot be stored in variable
+// before conversion back to Pointer.
+u := uintptr(p)
+p = unsafe.Pointer(u + offset)
+</pre> <p>Note that the pointer must point into an allocated object, so it may not be nil. </p>
+<pre data-language="go">// INVALID: conversion of nil pointer
+u := unsafe.Pointer(nil)
+p := unsafe.Pointer(uintptr(u) + offset)
+</pre> <p>(4) Conversion of a Pointer to a uintptr when calling syscall.Syscall. </p>
+<p>The Syscall functions in package syscall pass their uintptr arguments directly to the operating system, which then may, depending on the details of the call, reinterpret some of them as pointers. That is, the system call implementation is implicitly converting certain arguments back from uintptr to pointer. </p>
+<p>If a pointer argument must be converted to uintptr for use as an argument, that conversion must appear in the call expression itself: </p>
+<pre data-language="go">syscall.Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(n))
+</pre> <p>The compiler handles a Pointer converted to a uintptr in the argument list of a call to a function implemented in assembly by arranging that the referenced allocated object, if any, is retained and not moved until the call completes, even though from the types alone it would appear that the object is no longer needed during the call. </p>
+<p>For the compiler to recognize this pattern, the conversion must appear in the argument list: </p>
+<pre data-language="go">// INVALID: uintptr cannot be stored in variable
+// before implicit conversion back to Pointer during system call.
+u := uintptr(unsafe.Pointer(p))
+syscall.Syscall(SYS_READ, uintptr(fd), u, uintptr(n))
+</pre> <p>(5) Conversion of the result of reflect.Value.Pointer or reflect.Value.UnsafeAddr from uintptr to Pointer. </p>
+<p>Package reflect's Value methods named Pointer and UnsafeAddr return type uintptr instead of unsafe.Pointer to keep callers from changing the result to an arbitrary type without first importing "unsafe". However, this means that the result is fragile and must be converted to Pointer immediately after making the call, in the same expression: </p>
+<pre data-language="go">p := (*int)(unsafe.Pointer(reflect.ValueOf(new(int)).Pointer()))
+</pre> <p>As in the cases above, it is invalid to store the result before the conversion: </p>
+<pre data-language="go">// INVALID: uintptr cannot be stored in variable
+// before conversion back to Pointer.
+u := reflect.ValueOf(new(int)).Pointer()
+p := (*int)(unsafe.Pointer(u))
+</pre> <p>(6) Conversion of a reflect.SliceHeader or reflect.StringHeader Data field to or from Pointer. </p>
+<p>As in the previous case, the reflect data structures SliceHeader and StringHeader declare the field Data as a uintptr to keep callers from changing the result to an arbitrary type without first importing "unsafe". However, this means that SliceHeader and StringHeader are only valid when interpreting the content of an actual slice or string value. </p>
+<pre data-language="go">var s string
+hdr := (*reflect.StringHeader)(unsafe.Pointer(&amp;s)) // case 1
+hdr.Data = uintptr(unsafe.Pointer(p)) // case 6 (this case)
+hdr.Len = n
+</pre> <p>In this usage hdr.Data is really an alternate way to refer to the underlying pointer in the string header, not a uintptr variable itself. </p>
+<p>In general, reflect.SliceHeader and reflect.StringHeader should be used only as *reflect.SliceHeader and *reflect.StringHeader pointing at actual slices or strings, never as plain structs. A program should not declare or allocate variables of these struct types. </p>
+<pre data-language="go">// INVALID: a directly-declared header will not hold Data as a reference.
+var hdr reflect.StringHeader
+hdr.Data = uintptr(unsafe.Pointer(p))
+hdr.Len = n
+s := *(*string)(unsafe.Pointer(&amp;hdr)) // p possibly already lost
+</pre> <pre data-language="go">type Pointer *ArbitraryType</pre> <h3 id="Add">func <span>Add</span> </h3> <pre data-language="go">func Add(ptr Pointer, len IntegerType) Pointer</pre> <p>The function Add adds len to ptr and returns the updated pointer Pointer(uintptr(ptr) + uintptr(len)). The len argument must be of integer type or an untyped constant. A constant len argument must be representable by a value of type int; if it is an untyped constant it is given type int. The rules for valid uses of Pointer still apply. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/unsafe/" class="_attribution-link">http://golang.org/pkg/unsafe/</a>
+ </p>
+</div>