# Technical Documentation: golang/go

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/golang/go)

### Overview (README.md)

# The Go Programming Language

Go is an open source programming language that makes it easy to build simple,
reliable, and efficient software.


*Gopher image by [Renee French][rf], licensed under [Creative Commons 4.0 Attribution license][cc4-by].*

Our canonical Git repository is located at https://go.googlesource.com/go.
There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the
BSD-style license found in the LICENSE file.

### Download and Install

#### Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install
for installation instructions.

#### Install From Source

If a binary distribution is not available for your combination of
operating system and architecture, visit
https://go.dev/doc/install/source
for source installation instructions.

### Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and
proposals only. See https://go.dev/wiki/Questions for a list of
places to ask questions about the Go language.

[rf]: https://reneefrench.blogspot.com/
[cc4-by]: https://creativecommons.org/licenses/by/4.0/

---

### Doc README (`doc/README.md`)

# Release Notes

The `initial` and `next` subdirectories of this directory are for release notes.

## For developers

Release notes should be added to `next` by editing existing files or creating
new files. **Do not add RELNOTE=yes comments in CLs.** Instead, add a file to
the CL (or ask the author to do so).

At the end of the development cycle, the files will be merged by being
concatenated in sorted order by pathname. Files in the directory matching the
glob "*stdlib/*minor" are treated specially. They should be in subdirectories
corresponding to standard library package paths, and headings for those package
paths will be generated automatically.

Files in this repo's `api/next` directory must have corresponding files in
`doc/next/*stdlib/*minor`.
The files should be in the subdirectory for the package with the new
API, and should be named after the issue number of the API proposal.
For example, if the directory `6-stdlib/99-minor` is present,
then an `api/next` file with the line

    pkg net/http, function F #12345

should have a corresponding file named `doc/next/6-stdlib/99-minor/net/http/12345.md`.
At a minimum, that file should contain either a full sentence or a TODO,
ideally referring to a person with the responsibility to complete the note.

If your CL addresses an accepted proposal, mention the proposal issue number in
your release note in the form `/issue/NUMBER`. A link to the issue in the text
will have this form (see below). If you don't want to mention the issue in the
text, add it as a comment:
```

```
If an accepted proposal is mentioned in a CL but not in the release notes, it will be
flagged as a TODO by the automated tooling. That is true even for proposals that add API.

Use the following forms in your markdown:

	[http.Request]                     # symbol documentation; auto-linked as in Go doc strings
	[Request]                          # short form, for symbols in the package being documented
	[net/http]                         # package link
	[#12345](/issue/12345)             # GitHub issues
	[CL 6789](/cl/6789)                # Gerrit changelists

To preview `next` content in merged form using a local instance of the website, run:

```
go run golang.org/x/website/cmd/golangorg@latest -goroot=..
```

Then open http://localhost:6060/doc/next. Refresh the page to see your latest edits.

## For the release team

The `relnote` tool, at `golang.org/x/build/cmd/relnote`, operates on the files
in `doc/next`.

As a release cycle nears completion, run `relnote todo` to get a list of
unfinished release note work.

To prepare the release notes for a release, run `relnote generate`.
That will merge the `.md` files in `next` into a single file.
Atomically (as close to it as possible) add that file to `_content/doc` directory
of the website repository and remove the `doc/next` directory in this repository.

To begin the next release development cycle, populate the contents of `next`
with those of `initial`. From the repo root:

    > cd doc
    > cp -R initial/ next

Then edit `next/1-intro.md` to refer to the next version.

---

### Doc Initial 1 Intro (`doc/initial/1-intro.md`)

<style>
  main ul li { margin: 0.5em 0; }
</style>

## DRAFT RELEASE NOTES — Introduction to Go 1.N {#introduction}

**Go 1.N is not yet released. These are work-in-progress release notes.
Go 1.N is expected to be released in {Month} {Year}.**

---

### Doc Next 1 Intro (`doc/next/1-intro.md`)

<style>
  main ul li { margin: 0.5em 0; }
</style>

## DRAFT RELEASE NOTES — Introduction to Go 1.28 {#introduction}

**Go 1.28 is not yet released. These are work-in-progress release notes.
Go 1.28 is expected to be released in February 2027.**

---

### Src Go Doc Comment Testdata README (`src/go/doc/comment/testdata/README.md`)

This directory contains test files (*.txt) for the comment parser.

The files are in [txtar format](https://pkg.go.dev/golang.org/x/tools/txtar).
Consider this example:

	-- input --
	Hello.
	-- gofmt --
	Hello.
	-- html --
	<p>Hello.
	-- markdown --
	Hello.
	-- text --
	Hello.

Each `-- name --` line introduces a new file with the given name.
The file named “input” must be first and contains the input to
[comment.Parser](https://pkg.go.dev/go/doc/comment/#Parser).

The remaining files contain the expected output for the named format generated by
[comment.Printer](https://pkg.go.dev/go/doc/comment/#Printer):
“gofmt” for Printer.Comment (Go comment format, as used by gofmt),
“html” for Printer.HTML, “markdown” for Printer.Markdown, and “text” for Printer.Text.
The format can also be “dump” for a textual dump of the raw data structures.

The text before the `-- input --` line, if present, is JSON to be unmarshaled
to initialize a comment.Printer. For example, this test case sets the Printer's
TextWidth field to 20:

	{"TextWidth": 20}
	-- input --
	Package gob manages streams of gobs - binary values exchanged between an
	Encoder (transmitter) and a Decoder (receiver).
	-- text --
	Package gob
	manages streams
	of gobs - binary
	values exchanged
	between an Encoder
	(transmitter) and a
	Decoder (receiver).

---

### Src Go Doc Testdata Examples README (`src/go/doc/testdata/examples/README.md`)

These files are processed by example_test.go:TestExamples.

A .golden file is a txtar file with two sections for each example that should be
created by doc.Examples from the corresponding .go file.

One section, named EXAMPLE_NAME.Output, contains the example's output,
the value of the field Example.Output.

The other, named EXAMPLE_NAME.Play, contains the formatted code for a playable
version of the example, the value of the field Example.Play.

If a section is missing, it is treated as being empty.

---

### Doc Godebug (`doc/godebug.md`)

---
title: "Go, Backwards Compatibility, and GODEBUG"
layout: article
---



## Introduction {#intro}

Go's emphasis on backwards compatibility is one of its key strengths.
There are, however, times when we cannot maintain complete compatibility.
If code depends on buggy (including insecure) behavior,
then fixing the bug will break that code.
New features can also have similar impacts:
enabling the HTTP/2 use by the HTTP client broke programs
connecting to servers with buggy HTTP/2 implementations.
These kinds of changes are unavoidable and
[permitted by the Go 1 compatibility rules](/doc/go1compat).
Even so, Go provides a mechanism called GODEBUG to
reduce the impact such changes have on Go developers
using newer toolchains to compile old code.

A GODEBUG setting is a `key=value` pair
that controls the execution of certain parts of a Go program.
The environment variable `GODEBUG`
can hold a comma-separated list of these settings.
For example, if a Go program is running in an environment that contains

	GODEBUG=http2client=0,http2server=0

then that Go program will disable the use of HTTP/2 by default in both
the HTTP client and the HTTP server.
Unrecognized settings in the `GODEBUG` environment variable are ignored.
It is also possible to set the default `GODEBUG` for a given program
(discussed below).

When preparing any change that is permitted by Go 1 compatibility
but may nonetheless break some existing programs,
we first engineer the change to keep as many existing programs working as possible.
For the remaining programs,
we define a new GODEBUG setting that
allows individual programs to opt back in to the old behavior.
A GODEBUG setting may not be added if doing so is infeasible,
but that should be extremely rare.

GODEBUG settings added for compatibility will be maintained
for a minimum of two years (four Go releases).
Some, such as `http2client` and `http2server`,
will be maintained much longer, even indefinitely.

When possible, each GODEBUG setting has an associated
[runtime/metrics](/pkg/runtime/metrics/) counter
named `/godebug/non-default-behavior/<name>:events`
that counts the number of times a particular program's
behavior has changed based on a non-default value
for that setting.
For example, when `GODEBUG=http2client=0` is set,
`/godebug/non-default-behavior/http2client:events`
counts the number of HTTP transports that the program
has configured without HTTP/2 support.

## Default GODEBUG Values {#default}

When a GODEBUG setting is not listed in the environment variable,
its value is derived from three sources:
the defaults for the Go toolchain used to build the program,
amended to match the Go version listed in `go.mod`,
and then overridden by explicit `//go:debug` lines in the program.

The [GODEBUG History](#history) gives the exact defaults for each Go toolchain version.
For example, Go 1.21 introduces the `panicnil` setting,
controlling whether `panic(nil)` is allowed;
it defaults to `panicnil=0`, making `panic(nil)` a run-time error.
Using `panicnil=1` restores the behavior of Go 1.20 and earlier.

When compiling a work module or workspace that declares
an older Go version, the Go toolchain amends its defaults
to match that older Go version as closely as possible.
For example, when a Go 1.21 toolchain compiles a program,
if the work module's `go.mod` or the workspace's `go.work`
says `go` `1.20`, then the program defaults to `panicnil=1`,
matching Go 1.20 instead of Go 1.21.

As an exception, GODEBUGs introduced for security releases
will have the new behavior apply to all versions.

Because this method of setting GODEBUG defaults was introduced only in Go 1.21,
programs listing versions of Go earlier than Go 1.20 are configured to match Go 1.20,
not the older version.

To override these defaults, starting in Go 1.23, the work module's `go.mod`
or the workspace's `go.work` can list one or more `godebug` lines:

	godebug (
		default=go1.21
		panicnil=1
		asynctimerchan=0
	)

The special key `default` indicates a Go version to take unspecified
settings from. This allows setting the GODEBUG defaults separately
from the Go language version in the module.
In this example, the program is asking for Go 1.21 semantics and
then asking for the old pre-Go 1.21 `panic(nil)` behavior and the
new Go 1.23 `asynctimerchan=0` behavior.

Only the work module's `go.mod` is consulted for `godebug` directives.
Any directives in required dependency modules are ignored.
It is an error to list a `godebug` with an unrecognized setting.
(Toolchains older than Go 1.23 reject all `godebug` lines, since they do not
understand `godebug` at all.) When a workspace is in use, `godebug`
directives in `go.mod` files are ignored, and `go.work` will be consulted
for `godebug` directives instead.

The defaults from the `go` and `godebug` lines apply to all main
packages that are built. For more fine-grained control,
starting in Go 1.21, a main package's source files
can include one or more `//go:debug` directives at the top of the file
(preceding the `package` statement).
The `godebug` lines in the previous example would be written:

	//go:debug default=go1.21
	//go:debug panicnil=1
	//go:debug asynctimerchan=0

Starting in Go 1.21, the Go toolchain treats a `//go:debug` directive
with an unrecognized GODEBUG setting as an invalid program.
Programs with more than one `//go:debug` line for a given setting
are also treated as invalid.
(Older toolchains ignore `//go:debug` directives entirely.)

The defaults that will be compiled into a main package
are reported by the command:

	go list -f '{{.DefaultGODEBUG}}' my/main/package

Only differences from the base Go toolchain defaults are reported.

When testing a package, `//go:debug` lines in the `*_test.go`
files are treated as directives for the test's main package.
In any other context, `//go:debug` lines are ignored by the toolchain;
`go` `vet` reports such lines as misplaced.

## GODEBUG History {#history}

This section documents the GODEBUG settings introduced and removed in each major Go release
for compatibility reasons.
Packages or programs may define additional settings for internal debugging purposes;
for example,
see the [runtime documentation](/pkg/runtime#hdr-Environment_Variables)
and the [go command documentation](/cmd/go#hdr-Build_and_test_caching).

### Go 1.28

Go 1.28 changed
[`net/http.FileServer`](/pkg/net/http#FileServer),
[`net/http.FileServerFS`](/pkg/net/http#FileServerFS),
[`net/http.ServeContent`](/pkg/net/http#ServeContent),
[`net/http.ServeFile`](/pkg/net/http#ServeFile), and
[`net/http.ServeFileFS`](/pkg/net/http#ServeFileFS) to
limit the maximum number of ranges in a Range header.
When the number of ranges in a header exceeds the new
`httpservecontentmaxranges` setting, the header is ignored.
The default value is `httpservecontentmaxranges=200`.
Setting `httpservecontentmaxranges=0` disables the limit.
To avoid denial of service attacks, this setting and default
was backported to Go 1.27.2 and Go 1.26.9.

Go 1.28 added a new `netmarshal` setting that controls whether
the text marshaling of the types `net.IPMask`, `net.IPNet`, and
`net.HardwareAddr` is readable. The value `netmarshal=0` will
JSON encode those types using an unreadable base64 encoding.
The value `netmarshal=1` will use a readable version such as the IP address.
For Go 1.28 and 1.29 the default value remains `netmarshal=0`.
This ensures that JSON or other marshaled data generated by those
versions will be readable by older versions of Go.
The expectation is that Go 1.30 will change the default to be netmarshal=1.
Go 1.28 and all future releases will support both the old and new
encodings when reading data. This setting may be removed in a future Go release,
Go 1.34 at the earliest.

### Go 1.27

Go 1.27 removed the `gotypesalias` setting, as noted in the [Go 1.22](#go-122) section.

Go 1.27 removed the `tlsunsafeekm` setting, as noted in the [Go 1.22](#go-122) section.

Go 1.27 removed the `tlsrsakex` setting, as noted in the [Go 1.22](#go-122) section.

Go 1.27 removed the `tls3des` setting, as noted in the [Go 1.23](#go-123) section.

Go 1.27 removed the `tls10server` setting, as noted in the [Go 1.22](#go-122) section.

Go 1.27 removed the `x509keypairleaf` setting, as noted in the [Go 1.23](#go-123) section.

Go 1.27 removed the `asynctimerchan` setting, as noted in the [Go 1.23](#go-123) section.

Go 1.27 added a new `htmlmetacontenturlescape` setting that controls whether
html/template will escape URLs in the `url=` portion of the content attribute of
HTML meta tags. The default `htmlmetacontentescape=1` will cause URLs to be
escaped. Setting `htmlmetacontentescape=0` disables this behavior. To avoid
content injection attacks, this setting and default was backported to Go 1.25.8
and Go 1.26.1.

Go 1.27 changes the default for `tracebacklabels` (added in [Go 1.26](#go-126))
to `1`. This opt-out is expected to be kept indefinitely in case goroutine
labels acquire sensitive information that shouldn't be made available in
tracebacks.

Go 1.27 added a new `x509sslcertoverrideplatform` setting that controls whether
crypto/x509 will load roots from disk on Windows and Darwin when `SSL_CERT_FILE`
or `SSL_CERT_DIR` are set. The default value `x509sslcertoverrideplatform=1` will
cause roots to be loaded from disk when these environment variables are set.
Setting `x509sslcertoverrideplatform=0` disables this behavior in favor of using
the platform certificate store instead of honoring the environment variables. We
plan to remove this setting in Go 1.31.

Go 1.27 added a `fips140ems` setting that when set to `0` disables the
enforcement of Extended Master Secret in FIPS 140-3 mode. There is no change in
default behavior. This setting was backported to Go 1.26.6 and Go 1.25.13.
We plan to remove this setting in Go 1.31.

### Go 1.26

Go 1.26 added a new `httpcookiemaxnum` setting that controls the maximum number
of cookies that net/http will accept when parsing HTTP headers. If the number of
cookies in a header exceeds the number set in `httpcookiemaxnum`, cookie parsing
will fail early. The default value is `httpcookiemaxnum=3000`. Setting
`httpcookiemaxnum=0` will allow the cookie parsing to accept an indefinite
number of cookies. To avoid denial of service attacks, this setting and default
was backported to Go 1.25.2 and Go 1.24.8.

Go 1.26 added a new `urlmaxqueryparams` setting that controls the maximum number
of query parameters that net/url will accept when parsing a URL-encoded query string.
If the number of parameters exceeds the number set in `urlmaxqueryparams`,
parsing will fail early. The default value is `urlmaxqueryparams=10000`.
Setting `urlmaxqueryparams=0` disables the limit. To avoid denial of service
attacks, this setting and default was backported to Go 1.25.6 and Go 1.24.12.

Go 1.26 added a new `urlstrictcolons` setting that controls whether `net/url.Parse`
allows malformed hostnames containing colons outside of a bracketed IPv6 address.
The default `urlstrictcolons=1` rejects URLs such as `http://localhost:1:2` or `http://::1/`.
Colons are permitted as part of a bracketed IPv6 address, such as `http://[::1]/`.
Go 1.27 limited this validation to `http` and `https` URLs, so the setting has no
effect on URLs with other schemes.

Go 1.26 enabled two additional post-quantum key exchange mechanisms:
SecP256r1MLKEM768 and SecP384r1MLKEM1024. The default can be reverted using the
[`tlssecpmlkem` setting](/pkg/crypto/tls/#Config.CurvePreferences).

Go 1.26 added a new `tracebacklabels` setting that controls the inclusion of
goroutine labels set through the `runtime/pprof` package. Setting `tracebacklabels=1`
includes these key/value pairs in the goroutine status header of runtime
tracebacks and debug=2 runtime/pprof stack dumps. This format may change in the future.
(see go.dev/issue/76349)

Go 1.26 added a new `cryptocustomrand` setting that controls whether most crypto/...
APIs ignore the random `io.Reader` parameter. For Go 1.26, it defaults
to `cryptocustomrand=0`, ignoring the random parameters. Using `cryptocustomrand=1`
reverts to the pre-Go 1.26 behavior.

### Go 1.25

Go 1.25 added a new `decoratemappings` setting that controls whether the Go
runtime annotates OS anonymous memory mappings with context about their
purpose. These annotations appear in /proc/self/maps and /proc/self/smaps as
"[anon: Go: ...]". This setting is only used on Linux. For Go 1.25, it defaults
to `decoratemappings=1`, enabling annotations. Using `decoratemappings=0`
reverts to the pre-Go 1.25 behavior. This setting is fixed at program startup
time, and can't be modified by changing the `GODEBUG` environment variable
after the program starts.

Go 1.25 added a new `embedfollowsymlinks` setting that controls whether the
Go command will follow symlinks to regular files embedding files.
The default value `embedfollowsymlinks=0` does not allow following
symlinks. `embedfollowsymlinks=1` will allow following symlinks.

Go 1.25 added a new `containermaxprocs` setting that controls whether the Go
runtime will consider cgroup CPU limits when setting the default GOMAXPROCS.
The default value `containermaxprocs=1` will use cgroup limits in addition to
the total logical CPU count and CPU affinity. `containermaxprocs=0` will
disable consideration of cgroup limits. This setting only affects Linux.

Go 1.25 added a new `updatemaxprocs` setting that controls whether the Go
runtime will periodically update GOMAXPROCS for new CPU affinity or cgroup
limits. The default value `updatemaxprocs=1` will enable periodic updates.
`updatemaxprocs=0` will disable periodic updates.

Go 1.25 disabled SHA-1 signature algorithms in TLS 1.2 according to RFC 9155.
The default can be reverted using the `tlssha1=1` setting.

Go 1.25 switched to SHA-256 to fill in missing SubjectKeyId in
crypto/x509.CreateCertificate. The setting `x509sha256skid=0` reverts to SHA-1.

Go 1.25 corrected the semantics of contention reports for runtime-internal locks,
and so removed the [`runtimecontentionstacks` setting](/pkg/runtime#hdr-Environment_Variables).

Go 1.25 (starting with Go 1.25 RC 2) disabled build information stamping when
multiple VCS are detected due to concerns around VCS injection attacks. This
behavior and setting was backported to Go 1.24.5 and Go 1.23.11. This behavior
can be renabled with the setting `allowmultiplevcs=1`.

### Go 1.24

Go 1.24 added a new `fips140` setting that controls whether the Go
Cryptographic Module operates in FIPS 140-3 mode.
The possible values are:
- "off": no special support for FIPS 140-3 mode. This is the default.
- "on": the Go Cryptographic Module operates in FIPS 140-3 mode.
- "only": like "on", but cryptographic algorithms not approved by
  FIPS 140-3 return an error or panic.
For more information, see [FIPS 140-3 Compliance](/doc/security/fips140).
This setting is fixed at program startup time, and can't be modified
by changing the `GODEBUG` environment variable after the program starts.

Go 1.24 changed the global [`math/rand.Seed`](/pkg/math/rand/#Seed) to be a
no-op. This behavior is controlled by the `randseednop` setting.
For Go 1.24 it defaults to `randseednop=1`.
Using `randseednop=0` reverts to the pre-Go 1.24 behavior.

Go 1.24 added new values for the `multipathtcp` setting.
The possible values for `multipathtcp` are now:
- "0": disable MPTCP on dialers and listeners by default
- "1": enable MPTCP on dialers and listeners by default
- "2": enable MPTCP on listeners only by default
- "3": enable MPTCP on dialers only by default

For Go 1.24, it now defaults to multipathtcp="2", thus
enabled by default on listeners. Using multipathtcp="0" reverts to the
pre-Go 1.24 behavior.

Go 1.24 changed the behavior of `go test -json` to emit build errors as JSON
instead of text.
These new JSON events are distinguished by new `Action` values,
but can still cause problems with CI systems that aren't robust to these events.
This behavior can be controlled with the `gotestjsonbuildtext` setting.
Using `gotestjsonbuildtext=1` restores the 1.23 behavior.
This setting will be removed in a future release, Go 1.28 at the earliest.

Go 1.24 changed [`crypto/rsa`](/pkg/crypto/rsa) to require RSA keys to be at
least 1024 bits. This behavior can be controlled with the `rsa1024min` setting.
Using `rsa1024min=0` restores the Go 1.23 behavior.

Go 1.24 introduced a mechanism for enabling platform specific Data Independent
Timing (DIT) modes in the [`crypto/subtle`](/pkg/crypto/subtle) package. This
mode can be enabled for an entire program with the `dataindependenttiming` setting.
For Go 1.24 it defaults to `dataindependenttiming=0`. There is no change in default
behavior from Go 1.23 when `dataindependenttiming` is unset.
Using `dataindependenttiming=1` enables the DIT mode for the entire Go program.
When enabled, DIT will be enabled when calling into C from Go. When enabled,
calling into Go code from C will enable DIT, and disable it before returning to
C if it was not enabled when Go code was entered.
This currently only affects arm64 programs. For all other platforms it is a no-op.

Go 1.24 removed the `x509sha1` setting.  `crypto/x509` no longer supports verifying
signatures on certificates that use SHA-1 based signature algorithms.

Go 1.24 changes the default value of the [`x509usepolicies`
setting.](/pkg/crypto/x509/#CreateCertificate) from `0` to `1`. When marshalling
certificates, policies are now taken from the
[`Certificate.Policies`](/pkg/crypto/x509/#Certificate.Policies) field rather
than the
[`Certificate.PolicyIdentifiers`](/pkg/crypto/x509/#Certificate.PolicyIdentifiers)
field by default.

Go 1.24 enabled the post-quantum key exchange mechanism
X25519MLKEM768 by default. The default can be reverted using the
[`tlsmlkem` setting](/pkg/crypto/tls/#Config.CurvePreferences).
This can be useful when dealing with buggy TLS servers that do not handle large records correctly,
causing a timeout during the handshake (see [TLS post-quantum TL;DR fail](https://tldr.fail/)).
Go 1.24 also removed X25519Kyber768Draft00 and the Go 1.23 `tlskyber` setting.

Go 1.24 made [`ParsePKCS1PrivateKey`](/pkg/crypto/x509/#ParsePKCS1PrivateKey)
use and validate the CRT parameters in the encoded private key. This behavior
can be controlled with the `x509rsacrt` setting. Using `x509rsacrt=0` restores
the Go 1.23 behavior.

### Go 1.23

Go 1.23 changed the channels created by package time to be unbuffered
(synchronous), which makes correct use of the [`Timer.Stop`](/pkg/time/#Timer.Stop)
and [`Timer.Reset`](/pkg/time/#Timer.Reset) method results much easier.
The [`asynctimerchan` setting](/pkg/time/#NewTimer) disables this change.
There are no runtime metrics for this change.
This setting will be removed in Go 1.27.

Go 1.23 changed the mode bits reported by [`os.Lstat`](/pkg/os#Lstat) and [`os.Stat`](/pkg/os#Stat)
for reparse points, which can be controlled with the `winsymlink` setting.
As of Go 1.23 (`winsymlink=1`), mount points no longer have [`os.ModeSymlink`](/pkg/os#ModeSymlink)
set, and reparse points that are not symlinks, Unix sockets, or dedup files now
always have [`os.ModeIrregular`](/pkg/os#ModeIrregular) set. As a result of these changes,
[`filepath.EvalSymlinks`](/pkg/path/filepath#EvalSymlinks) no longer evaluates
mount points, which was a source of many inconsistencies and bugs.
At previous versions (`winsymlink=0`), mount points are treated as symlinks,
and other reparse points with non-default [`os.ModeType`](/pkg/os#ModeType) bits
(such as [`os.ModeDir`](/pkg/os#ModeDir)) do not have the `ModeIrregular` bit set.

Go 1.23 changed [`os.Readlink`](/pkg/os#Readlink) and [`filepath.EvalSymlinks`](/pkg/path/filepath#EvalSymlinks)
to avoid trying to normalize volumes to drive letters, which was not always even possible.
This behavior is controlled by the `winreadlinkvolume` setting.
For Go 1.23, it defaults to `winreadlinkvolume=1`.
Previous versions default to `winreadlinkvolume=0`.

Go 1.23 enabled the experimental post-quantum key exchange mechanism
X25519Kyber768Draft00 by default. The default can be reverted using the
[`tlskyber` setting](/pkg/crypto/tls/#Config.CurvePreferences).
This can be useful when dealing with buggy TLS servers that do not handle large records correctly,
causing a timeout during the handshake (see [TLS post-quantum TL;DR fail](https://tldr.fail/)).

Go 1.23 changed the behavior of
[crypto/x509.ParseCertificate](/pkg/crypto/x509/#ParseCertificate) to reject
serial numbers that are negative. This change can be reverted with
the [`x509negativeserial` setting](/pkg/crypto/x509/#ParseCertificate).

Go 1.23 re-enabled support in html/template for ECMAScript 6 template literals by default.
The [`jstmpllitinterp` setting](/pkg/html/template#hdr-Security_Model) no longer has
any effect.

Go 1.23 changed the default TLS cipher suites used by clients and servers when
not explicitly configured, removing 3DES cipher suites. The default can be reverted
using the [`tls3des` setting](/pkg/crypto/tls/#Config.CipherSuites).
This setting will be removed in Go 1.27.

Go 1.23 changed the behavior of [`tls.X509KeyPair`](/pkg/crypto/tls#X509KeyPair)
and [`tls.LoadX509KeyPair`](/pkg/crypto/tls#LoadX509KeyPair) to populate the
Leaf field of the returned [`tls.Certificate`](/pkg/crypto/tls#Certificate).
This behavior is controlled by the `x509keypairleaf` setting. For Go 1.23, it
defaults to `x509keypairleaf=1`. Previous versions default to
`x509keypairleaf=0`.
This setting will be removed in Go 1.27.

Go 1.23 changed
[`net/http.ServeContent`](/pkg/net/http#ServeContent),
[`net/http.ServeFile`](/pkg/net/http#ServeFile), and
[`net/http.ServeFS`](/pkg/net/http#ServeFS) to
remove Cache-Control, Content-Encoding, Etag, and Last-Modified headers
when serving an error. This behavior is controlled by
the [`httpservecontentkeepheaders` setting](/pkg/net/http#ServeContent).
Using `httpservecontentkeepheaders=1` restores the pre-Go 1.23 behavior.

### Go 1.22

Go 1.22 adds a configurable limit to control the maximum acceptable RSA key size
that can be used in TLS handshakes, controlled by the [`tlsmaxrsasize` setting](/pkg/crypto/tls#Conn.Handshake).
The default is tlsmaxrsasize=8192, limiting RSA to 8192-bit keys. To avoid
denial of service attacks, this setting and default was backported to Go
1.19.13, Go 1.20.8, and Go 1.21.1.

Go 1.22 made it an error for a request or response read by a net/http
client or server to have an empty Content-Length header.
This behavior is controlled by the `httplaxcontentlength` setting.

Go 1.22 changed the behavior of ServeMux to accept extended
patterns and unescape both patterns and request paths by segment.
This behavior can be controlled by the
[`httpmuxgo121` setting](/pkg/net/http/#ServeMux).

Go 1.22 added the [Alias type](/pkg/go/types#Alias) to [go/types](/pkg/go/types)
for the explicit representation of [type aliases](/ref/spec#Type_declarations).
Whether the type checker produces `Alias` types or not is controlled by the
[`gotypesalias` setting](/pkg/go/types#Alias).
For Go 1.22 it defaults to `gotypesalias=0`.
For Go 1.23, `gotypesalias=1` will become the default.
This setting will be removed in Go 1.27.

Go 1.22 changed the default minimum TLS version supported by both servers
and clients to TLS 1.2. The default can be reverted to TLS 1.0 using the
[`tls10server` setting](/pkg/crypto/tls/#Config).
This setting will be removed in Go 1.27.

Go 1.22 changed the default TLS cipher suites used by clients and servers when
not explicitly configured, removing the cipher suites which used RSA based key
exchange. The default can be reverted using the [`tlsrsakex` setting](/pkg/crypto/tls/#Config).
This setting will be removed in Go 1.27.

Go 1.22 disabled
[`ConnectionState.ExportKeyingMaterial`](/pkg/crypto/tls/#ConnectionState.ExportKeyingMaterial)
when the connection supports neither TLS 1.3 nor Extended Master Secret
(implemented in Go 1.21). It can be reenabled with the [`tlsunsafeekm`
setting](/pkg/crypto/tls/#ConnectionState.ExportKeyingMaterial).
This setting will be removed in Go 1.27.

Go 1.22 changed how the runtime interacts with transparent huge pages on Linux.
In particular, a common default Linux kernel configuration can result in
significant memory overheads, and Go 1.22 no longer works around this default.
To work around this issue without adjusting kernel settings, transparent huge
pages can be disabled for Go memory with the
[`disablethp` setting](/pkg/runtime#hdr-Environment_Variables).
This behavior was backported to Go 1.21.1, but the setting is only available
starting with Go 1.21.6.
This setting may be removed in a future release, and users impacted by this issue
should adjust their Linux configuration according to the recommendations in the
[GC guide](/doc/gc-guide#Linux_transparent_huge_pages), or switch to a Linux
distribution that disables transparent huge pages altogether.

Go 1.22 added contention on runtime-internal locks to the [`mutex`
profile](/pkg/runtime/pprof#Profile). Contention on these locks is always
reported at `runtime._LostContendedRuntimeLock`. Complete stack traces of
runtime locks can be enabled with the [`runtimecontentionstacks`
setting](/pkg/runtime#hdr-Environment_Variables). These stack traces have
non-standard semantics, see setting documentation for details.

Go 1.22 added a new [`crypto/x509.Certificate`](/pkg/crypto/x509/#Certificate)
field, [`Policies`](/pkg/crypto/x509/#Certificate.Policies), which supports
certificate policy OIDs with components larger than 31 bits. By default this
field is only used during parsing, when it is populated with policy OIDs, but
not used during marshaling. It can be used to marshal these larger OIDs, instead
of the existing PolicyIdentifiers field, by using the
[`x509usepolicies` setting](/pkg/crypto/x509/#CreateCertificate).


### Go 1.21

Go 1.21 made it a run-time error to call `panic` with a nil interface value,
controlled by the [`panicnil` setting](/pkg/builtin/#panic).

Go 1.21 made it an error for html/template actions to appear inside of an ECMAScript 6
template literal, controlled by the
[`jstmpllitinterp` setting](/pkg/html/template#hdr-Security_Model).
This behavior was backported to Go 1.19.8+ and Go 1.20.3+.

Go 1.21 introduced a limit on the maximum number of MIME headers and multipart
forms, controlled by the
[`multipartmaxheaders` and `multipartmaxparts` settings](/pkg/mime/multipart#hdr-Limits)
respectively.
This behavior was backported to Go 1.19.8+ and Go 1.20.3+.

Go 1.21 adds the support of Multipath TCP but it is only used if the application
explicitly asked for it. This behavior can be controlled by the
[`multipathtcp` setting](/pkg/net#Dialer.SetMultipathTCP).

There is no plan to remove any of these settings.

### Go 1.20

Go 1.20 introduced support for rejecting insecure paths in tar and zip archives,
controlled by the [`tarinsecurepath` setting](/pkg/archive/tar/#Reader.Next)
and the [`zipinsecurepath` setting](/pkg/archive/zip/#NewReader).
These default to `tarinsecurepath=1` and `zipinsecurepath=1`,
preserving the behavior of earlier versions of Go.
A future version of Go may change the defaults to
`tarinsecurepath=0` and `zipinsecurepath=0`.

Go 1.20 introduced automatic seeding of the
[`math/rand`](/pkg/math/rand) global random number generator,
controlled by the [`randautoseed` setting](/pkg/math/rand/#Seed).

Go 1.20 introduced the concept of fallback roots for use during certificate verification,
controlled by the [`x509usefallbackroots` setting](/pkg/crypto/x509/#SetFallbackRoots).

Go 1.20 removed the preinstalled `.a` files for the standard library
from the Go distribution.
Installations now build and cache the standard library like
packages in other modules.
The [`installgoroot` setting](/cmd/go#hdr-Compile_and_install_packages_and_dependencies)
restores the installation and use of preinstalled `.a` files.

There is no plan to remove any of these settings.

### Go 1.19

Go 1.19 made it an error for path lookups to resolve to binaries in the current directory,
controlled by the [`execerrdot` setting](/pkg/os/exec#hdr-Executables_in_the_current_directory).
There is no plan to remove this setting.

Go 1.19 started sending EDNS0 additional headers on DNS requests.
This can reportedly break the DNS server provided on some routers,
such as CenturyLink Zyxel C3000Z.
This can be changed by the [`netedns0` setting](/pkg/net#hdr-Name_Resolution).
This setting is available in Go 1.21.12, Go 1.22.5, Go 1.23, and later.
There is no plan to remove this setting.

### Go 1.18

Go 1.18 removed support for SHA1 in most X.509 certificates,
controlled by the [`x509sha1` setting](/pkg/crypto/x509#InsecureAlgorithmError).
This setting was removed in Go 1.24.

### Go 1.10

Go 1.10 changed how build caching worked and added test caching, along
with the [`gocacheverify`, `gocachehash`, and `gocachetest` settings](/cmd/go/#hdr-Build_and_test_caching).
There is no plan to remove these settings.

### Go 1.6

Go 1.6 introduced transparent support for HTTP/2,
controlled by the [`http2client`, `http2server`, and `http2debug` settings](/pkg/net/http/#hdr-HTTP_2).
There is no plan to remove these settings.

### Go 1.5

Go 1.5 introduced a pure Go DNS resolver,
controlled by the [`netdns` setting](/pkg/net/#hdr-Name_Resolution).
There is no plan to remove this setting.

---

### Doc Next 3 Tools (`doc/next/3-tools.md`)

## Tools {#tools}

### Go command {#go-command}

### Cgo {#cgo}

### Vet {#vet}

The new [`scannererr`](https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/scannererr)
analyzer checks for failure to handle scanner errors after a loop
around [bufio.Scanner.Scan], which may cause scanning or I/O errors to
go unreported. 

The [`sqlrowserr`](https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/sqlrowserr)
analyzer performs a similar check for loops around [sql.Rows.Next],
so that iteration errors are correctly distinguished from a smaller result.

---

### Doc Next 5 Toolchain (`doc/next/5-toolchain.md`)

## Compiler {#compiler}

## Assembler {#assembler}

## Linker {#linker}

## Bootstrap {#boostrap}


As mentioned in the [Go 1.26 release notes](/doc/go1.26#bootstrap), Go 1.28 now requires
Go 1.26.0 or later for bootstrap.
We expect that Go 1.30 will require a minor release of Go 1.28.0 or later for bootstrap.

---

### Src Go Doc Testdata Template (`src/go/doc/testdata/template.txt`)

{{synopsis .Doc}}
PACKAGE {{.Name}}

IMPORTPATH
	{{.ImportPath}}

{{with .Imports}}IMPORTS
{{range .}}	{{.}}
{{end}}
{{end}}{{/*

*/}}FILENAMES
{{range .Filenames}}	{{.}}
{{end}}{{/*

*/}}{{with .Consts}}
CONSTANTS
{{range .}}	{{synopsis .Doc}}
	{{node .Decl $.FSet}}

{{end}}{{end}}{{/*

*/}}{{with .Vars}}
VARIABLES
{{range .}}	{{synopsis .Doc}}
	{{node .Decl $.FSet}}

{{end}}{{end}}{{/*

*/}}{{with .Funcs}}
FUNCTIONS
{{range .}}	{{synopsis .Doc}}
	{{node .Decl $.FSet}}

{{end}}{{end}}{{/*

*/}}{{with .Types}}
TYPES
{{range .}}	{{synopsis .Doc}}
	{{node .Decl $.FSet}}

{{range .Consts}}	{{synopsis .Doc}}
	{{node .Decl $.FSet}}

{{end}}{{/*

*/}}{{range .Vars}}	{{synopsis .Doc}}
	{{node .Decl $.FSet}}

{{end}}{{/*

*/}}{{range .Funcs}}	{{synopsis .Doc}}
	{{node .Decl $.FSet}}

{{end}}{{/*

*/}}{{range .Methods}}	{{synopsis .Doc}}
	{{node .Decl $.FSet}}

{{end}}{{end}}{{end}}{{/*

*/}}{{with .Bugs}}
BUGS .Bugs is now deprecated, please use .Notes instead
{{range .}}{{indent "\t" .}}
{{end}}{{end}}{{with .Notes}}{{range $marker, $content := .}}
{{$marker}}S
{{range $content}}{{$marker}}({{.UID}}){{indent "\t" .Body}}
{{end}}{{end}}{{end}}

---

### Doc Next 6 Stdlib 99 Minor Embed 80822 (`doc/next/6-stdlib/99-minor/embed/80822.md`)

The `ReadAt` methods of files returned by [embed.FS] now return
[io.EOF] when called with an offset at or beyond the end of the
file, as required by [io.ReaderAt].

---

### Doc Next 6 Stdlib 99 Minor Flag 65675 (`doc/next/6-stdlib/99-minor/flag/65675.md`)

The new [FlagSet.All] method returns an iterator over all the flags in the FlagSet;
the function [All] does the same for the global [CommandLine] flag set.
The new [Flag.IsSet] field indicates whether the flag has been set.

---

### Doc Next 6 Stdlib 99 Minor Net 29678 (`doc/next/6-stdlib/99-minor/net/29678.md`)

The [IPMask], [IPNet], and [HardwareAddr] types each now implement
a [encoding.TextUnmarshaler] method. This method will recognize
the current marshaling of those types, as well as a planned future
marshaling format. The future marshaling format will be readable
in JSON format, unlike the current format which is a base64 encoding.
The future marshaling format will become the default in a later Go release.
This is being done as a two-step process so that JSON generated
by this release of Go can still be read by earlier releases of Go.

---

### Doc Next 6 Stdlib 99 Minor Regexp 61902 (`doc/next/6-stdlib/99-minor/regexp/61902.md`)

New [Regexp.All], [Regexp.AllIndex], [Regexp.AllString], [Regexp.AllStringIndex],
[Regexp.AllStringIndex], [Regexp.AllStringSubmatchIndex], [Regexp.AllSubmatch], and
[Regexp.AllSubmatchIndex] iterator methods on [Regexp] allow incremental matching of the input.

The new [Regexp.SplitSeq] method iterates over the results of splitting the input with the
regular expression.

---

### Doc Next 6 Stdlib 99 Minor Syscall 68595 (`doc/next/6-stdlib/99-minor/syscall/68595.md`)

On Linux, [SysProcAttr] now supports enforcement of Landlock policies
and the `PR_SET_NO_NEW_PRIVS` flag for newly spawned subprocesses.

---

### Doc Next 6 Stdlib 99 Minor Time 67066 (`doc/next/6-stdlib/99-minor/time/67066.md`)

On Windows, the monotonic clock used by [Now] now has a resolution of
100 nanoseconds. Previously, its resolution was on the order of milliseconds.
This improves the precision of elapsed-time measurements, such as those
made with [Since].

---

### Src Go Doc Comment Testdata Blank (`src/go/doc/comment/testdata/blank.txt`)

-- input --
	$
	Blank line at start and end.
	$
-- gofmt --
Blank line at start and end.
-- text --
Blank line at start and end.
-- markdown --
Blank line at start and end.
-- html --
<p>Blank line at start and end.

---

### Src Go Doc Comment Testdata Code (`src/go/doc/comment/testdata/code.txt`)

-- input --
Text.
	A tab-indented
	(no, not eight-space indented)
	code block and haiku.
More text.
 One space
  is
   enough
    to
     start
      a
       block.
More text.

      Blocks
    can

  have
    blank
      lines.
-- gofmt --
Text.

	A tab-indented
	(no, not eight-space indented)
	code block and haiku.

More text.

	One space
	 is
	  enough
	   to
	    start
	     a
	      block.

More text.

	    Blocks
	  can

	have
	  blank
	    lines.
-- markdown --
Text.

	A tab-indented
	(no, not eight-space indented)
	code block and haiku.

More text.

	One space
	 is
	  enough
	   to
	    start
	     a
	      block.

More text.

	    Blocks
	  can

	have
	  blank
	    lines.
-- html --
<p>Text.
<pre>A tab-indented
(no, not eight-space indented)
code block and haiku.
</pre>
<p>More text.
<pre>One space
 is
  enough
   to
    start
     a
      block.
</pre>
<p>More text.
<pre>    Blocks
  can

have
  blank
    lines.
</pre>

---

### Src Go Doc Comment Testdata Code2 (`src/go/doc/comment/testdata/code2.txt`)

-- input --
Text.

	A tab-indented
	(no, not eight-space indented)
	code block and haiku.

More text.
-- gofmt --
Text.

	A tab-indented
	(no, not eight-space indented)
	code block and haiku.

More text.
-- markdown --
Text.

	A tab-indented
	(no, not eight-space indented)
	code block and haiku.

More text.
-- html --
<p>Text.
<pre>A tab-indented
(no, not eight-space indented)
code block and haiku.
</pre>
<p>More text.

---

### Src Go Doc Comment Testdata Code3 (`src/go/doc/comment/testdata/code3.txt`)

-- input --
Text.

	$
	A tab-indented
	(surrounded by more blank lines)
	code block and haiku.
	$

More text.
-- gofmt --
Text.

	A tab-indented
	(surrounded by more blank lines)
	code block and haiku.

More text.
-- markdown --
Text.

	A tab-indented
	(surrounded by more blank lines)
	code block and haiku.

More text.
-- html --
<p>Text.
<pre>A tab-indented
(surrounded by more blank lines)
code block and haiku.
</pre>
<p>More text.

---

### Src Go Doc Comment Testdata Code4 (`src/go/doc/comment/testdata/code4.txt`)

-- input --
To test, run this command:
  go test -more

Or, to test specific things, run this command:

go test -more \
  -pkg first/package \
  -pkg second/package \
  -pkg third/package

Happy testing!
-- gofmt --
To test, run this command:

	go test -more

Or, to test specific things, run this command:

	go test -more \
	  -pkg first/package \
	  -pkg second/package \
	  -pkg third/package

Happy testing!
-- markdown --
To test, run this command:

	go test -more

Or, to test specific things, run this command:

	go test -more \
	  -pkg first/package \
	  -pkg second/package \
	  -pkg third/package

Happy testing!

---

### Src Go Doc Comment Testdata Code5 (`src/go/doc/comment/testdata/code5.txt`)

-- input --
L1
L2
L3
L4
L5
- L6 {
	L7
}
L8
-- gofmt --
L1
L2
L3
L4
L5
  - L6 {
    L7
    }

L8

---

### Src Go Doc Comment Testdata Code6 (`src/go/doc/comment/testdata/code6.txt`)

-- input --
Run this program:

func main() {
	fmt.Println("hello, world")
}

Or this:

go func() {
	fmt.Println("hello, world")
}()
-- gofmt --
Run this program:

	func main() {
		fmt.Println("hello, world")
	}

Or this:

	go func() {
		fmt.Println("hello, world")
	}()

---

### Src Go Doc Comment Testdata Crash1 (`src/go/doc/comment/testdata/crash1.txt`)

-- input --
[]

[]: http://
-- gofmt --
[]

[]: http://
-- html --
<p><a href="http://"></a>
-- markdown --
[](http://)
-- text --


[]: http://

---

### Src Go Doc Comment Testdata Doclink (`src/go/doc/comment/testdata/doclink.txt`)

-- input --
In this package, see [Doc] and [Parser.Parse].
There is no [Undef] or [Undef.Method].
See also the [comment] package,
especially [comment.Doc] and [comment.Parser.Parse].
-- gofmt --
In this package, see [Doc] and [Parser.Parse].
There is no [Undef] or [Undef.Method].
See also the [comment] package,
especially [comment.Doc] and [comment.Parser.Parse].
-- text --
In this package, see Doc and Parser.Parse. There is no [Undef] or
[Undef.Method]. See also the comment package, especially comment.Doc and
comment.Parser.Parse.
-- markdown --
In this package, see [Doc](#Doc) and [Parser.Parse](#Parser.Parse). There is no \[Undef] or \[Undef.Method]. See also the [comment](/go/doc/comment) package, especially [comment.Doc](/go/doc/comment#Doc) and [comment.Parser.Parse](/go/doc/comment#Parser.Parse).
-- html --
<p>In this package, see <a href="#Doc">Doc</a> and <a href="#Parser.Parse">Parser.Parse</a>.
There is no [Undef] or [Undef.Method].
See also the <a href="/go/doc/comment">comment</a> package,
especially <a href="/go/doc/comment#Doc">comment.Doc</a> and <a href="/go/doc/comment#Parser.Parse">comment.Parser.Parse</a>.

---

### Src Go Doc Comment Testdata Doclink2 (`src/go/doc/comment/testdata/doclink2.txt`)

-- input --
We use [io.Reader] a lot, and also a few map[io.Reader]string.

Never [io.Reader]int or Slice[io.Reader] though.
-- markdown --
We use [io.Reader](/io#Reader) a lot, and also a few map\[io.Reader]string.

Never \[io.Reader]int or Slice\[io.Reader] though.

---

### Src Go Doc Comment Testdata Doclink3 (`src/go/doc/comment/testdata/doclink3.txt`)

-- input --
[encoding/json.Marshal] is a doc link.

[rot13.Marshal] is not.
-- markdown --
[encoding/json.Marshal](/encoding/json#Marshal) is a doc link.

\[rot13.Marshal] is not.

---

### Src Go Doc Comment Testdata Doclink4 (`src/go/doc/comment/testdata/doclink4.txt`)

-- input --
[io] at start of comment.
[io] at start of line.
At end of line: [io]
At end of comment: [io]
-- markdown --
[io](/io) at start of comment. [io](/io) at start of line. At end of line: [io](/io) At end of comment: [io](/io)

---

### Src Go Doc Comment Testdata Doclink5 (`src/go/doc/comment/testdata/doclink5.txt`)

{"DocLinkBaseURL": "https://pkg.go.dev"}
-- input --
[encoding/json.Marshal] is a doc link.
-- markdown --
[encoding/json.Marshal](https://pkg.go.dev/encoding/json#Marshal) is a doc link.

---

### Src Go Doc Comment Testdata Doclink6 (`src/go/doc/comment/testdata/doclink6.txt`)

{"DocLinkBaseURL": "https://go.dev/pkg/"}
-- input --
[encoding/json.Marshal] is a doc link, and so is [rsc.io/quote.NonExist].
-- markdown --
[encoding/json.Marshal](https://go.dev/pkg/encoding/json/#Marshal) is a doc link, and so is [rsc.io/quote.NonExist](https://go.dev/pkg/rsc.io/quote/#NonExist).

---

### Src Go Doc Comment Testdata Doclink7 (`src/go/doc/comment/testdata/doclink7.txt`)

-- input --
You see more [*bytes.Buffer] than [bytes.Buffer].
-- markdown --
You see more [\*bytes.Buffer](/bytes#Buffer) than [bytes.Buffer](/bytes#Buffer).

---

### Src Go Doc Comment Testdata Escape (`src/go/doc/comment/testdata/escape.txt`)

-- input --
What the ~!@#$%^&*()_+-=`{}|[]\:";',./<>?

+ Line

- Line

* Line

999. Line

## Line
-- gofmt --
What the ~!@#$%^&*()_+-=`{}|[]\:";',./<>?

+ Line

- Line

* Line

999. Line

## Line
-- text --
What the ~!@#$%^&*()_+-=`{}|[]\:";',./<>?

+ Line

- Line

* Line

999. Line

## Line
-- markdown --
What the ~!@#$%^&\*()\_+-=\`{}|\[]\\:";',./\<>?

\+ Line

\- Line

\* Line

999\. Line

\## Line
-- html --
<p>What the ~!@#$%^&amp;*()_+-=`{}|[]\:&quot;;&apos;,./&lt;&gt;?
<p>+ Line
<p>- Line
<p>* Line
<p>999. Line
<p>## Line

---

### Src Go Doc Comment Testdata Head (`src/go/doc/comment/testdata/head.txt`)

-- input --
Some text.

An Old Heading

Not An Old Heading.

And some text.

# A New Heading.

And some more text.

# Not a heading,
because text follows it.

Because text precedes it,
# not a heading.

## Not a heading either.

-- gofmt --
Some text.

# An Old Heading

Not An Old Heading.

And some text.

# A New Heading.

And some more text.

# Not a heading,
because text follows it.

Because text precedes it,
# not a heading.

## Not a heading either.

-- text --
Some text.

# An Old Heading

Not An Old Heading.

And some text.

# A New Heading.

And some more text.

# Not a heading, because text follows it.

Because text precedes it, # not a heading.

## Not a heading either.

-- markdown --
Some text.

### An Old Heading {#hdr-An_Old_Heading}

Not An Old Heading.

And some text.

### A New Heading. {#hdr-A_New_Heading_}

And some more text.

\# Not a heading, because text follows it.

Because text precedes it, # not a heading.

\## Not a heading either.

-- html --
<p>Some text.
<h3 id="hdr-An_Old_Heading">An Old Heading</h3>
<p>Not An Old Heading.
<p>And some text.
<h3 id="hdr-A_New_Heading_">A New Heading.</h3>
<p>And some more text.
<p># Not a heading,
because text follows it.
<p>Because text precedes it,
# not a heading.
<p>## Not a heading either.

---

### Src Go Doc Comment Testdata Head2 (`src/go/doc/comment/testdata/head2.txt`)

-- input --
✦

Almost a+heading

✦

Don't be a heading

✦

A.b is a heading

✦

A. b is not a heading

✦
-- gofmt --
✦

Almost a+heading

✦

Don't be a heading

✦

# A.b is a heading

✦

A. b is not a heading

✦

---

### Src Go Doc Comment Testdata Head3 (`src/go/doc/comment/testdata/head3.txt`)

{"HeadingLevel": 5}
-- input --
# Heading
-- markdown --
##### Heading {#hdr-Heading}
-- html --
<h5 id="hdr-Heading">Heading</h5>

---

### Src Go Doc Comment Testdata Hello (`src/go/doc/comment/testdata/hello.txt`)

-- input --
	Hello,
	world

	This is
	a test.
-- dump --
Doc
	Paragraph
		Plain
			"Hello,\n"
			"world"
	Paragraph
		Plain
			"This is\n"
			"a test."
-- gofmt --
Hello,
world

This is
a test.
-- html --
<p>Hello,
world
<p>This is
a test.
-- markdown --
Hello, world

This is a test.
-- text --
Hello, world

This is a test.

---

### Src Go Doc Comment Testdata Link (`src/go/doc/comment/testdata/link.txt`)

-- input --
The Go home page is https://go.dev/.
It used to be https://golang.org.

-- gofmt --
The Go home page is https://go.dev/.
It used to be https://golang.org.

-- text --
The Go home page is https://go.dev/. It used to be https://golang.org.

-- markdown --
The Go home page is [https://go.dev/](https://go.dev/). It used to be [https://golang.org](https://golang.org).

-- html --
<p>The Go home page is <a href="https://go.dev/">https://go.dev/</a>.
It used to be <a href="https://golang.org">https://golang.org</a>.

---

### Src Go Doc Comment Testdata Link2 (`src/go/doc/comment/testdata/link2.txt`)

-- input --
The Go home page is https://go.dev/.
It used to be https://golang.org.
https:// is not a link.
Nor is https://
https://☺ is not a link.
https://:80 is not a link.

-- gofmt --
The Go home page is https://go.dev/.
It used to be https://golang.org.
https:// is not a link.
Nor is https://
https://☺ is not a link.
https://:80 is not a link.

-- text --
The Go home page is https://go.dev/. It used to be https://golang.org. https://
is not a link. Nor is https:// https://☺ is not a link. https://:80 is not a
link.

-- markdown --
The Go home page is [https://go.dev/](https://go.dev/). It used to be [https://golang.org](https://golang.org). https:// is not a link. Nor is https:// https://☺ is not a link. https://:80 is not a link.

-- html --
<p>The Go home page is <a href="https://go.dev/">https://go.dev/</a>.
It used to be <a href="https://golang.org">https://golang.org</a>.
https:// is not a link.
Nor is https://
https://☺ is not a link.
https://:80 is not a link.

---

### Src Go Doc Comment Testdata Link3 (`src/go/doc/comment/testdata/link3.txt`)

-- input --
Doc text.

[Go home page]: https://go.dev
-- gofmt --
Doc text.

[Go home page]: https://go.dev
-- text --
Doc text.
-- markdown --
Doc text.
-- html --
<p>Doc text.

---

### Src Go Doc Comment Testdata Link4 (`src/go/doc/comment/testdata/link4.txt`)

-- input --
These are not links.

[x

[x]:

[x]:https://go.dev

[x]https://go.dev

[x]: surprise://go.dev

[x]: surprise!

But this is, with a tab (although it's unused).

[z]:	https://go.dev
-- gofmt --
These are not links.

[x

[x]:

[x]:https://go.dev

[x]https://go.dev

[x]: surprise://go.dev

[x]: surprise!

But this is, with a tab (although it's unused).

[z]: https://go.dev
-- text --
These are not links.

[x

[x]:

[x]:https://go.dev

[x]https://go.dev

[x]: surprise://go.dev

[x]: surprise!

But this is, with a tab (although it's unused).
-- markdown --
These are not links.

\[x

\[x]:

\[x]:[https://go.dev](https://go.dev)

\[x][https://go.dev](https://go.dev)

\[x]: surprise://go.dev

\[x]: surprise!

But this is, with a tab (although it's unused).
-- html --
<p>These are not links.
<p>[x
<p>[x]:
<p>[x]:<a href="https://go.dev">https://go.dev</a>
<p>[x]<a href="https://go.dev">https://go.dev</a>
<p>[x]: surprise://go.dev
<p>[x]: surprise!
<p>But this is, with a tab (although it&apos;s unused).

---

### Src Go Doc Comment Testdata Link5 (`src/go/doc/comment/testdata/link5.txt`)

-- input --
See the [Go home page] and the [pkg
site].

[Go home page]: https://go.dev/
[pkg site]: https://pkg.go.dev
[Go home page]: https://duplicate.ignored

They're really great!

-- gofmt --
See the [Go home page] and the [pkg
site].

They're really great!

[Go home page]: https://go.dev/
[pkg site]: https://pkg.go.dev

[Go home page]: https://duplicate.ignored

-- text --
See the Go home page and the pkg site.

They're really great!

[Go home page]: https://go.dev/
[pkg site]: https://pkg.go.dev
-- markdown --
See the [Go home page](https://go.dev/) and the [pkg site](https://pkg.go.dev).

They're really great!
-- html --
<p>See the <a href="https://go.dev/">Go home page</a> and the <a href="https://pkg.go.dev">pkg
site</a>.
<p>They&apos;re really great!

---

### Src Go Doc Comment Testdata Link6 (`src/go/doc/comment/testdata/link6.txt`)

-- input --
URLs with punctuation are hard.
We don't want to consume the end-of-sentence punctuation.

For example, https://en.wikipedia.org/wiki/John_Adams_(miniseries).
And https://example.com/[foo]/bar{.
And https://example.com/(foo)/bar!
And https://example.com/{foo}/bar{.
And https://example.com/)baz{foo}.

[And https://example.com/].

-- gofmt --
URLs with punctuation are hard.
We don't want to consume the end-of-sentence punctuation.

For example, https://en.wikipedia.org/wiki/John_Adams_(miniseries).
And https://example.com/[foo]/bar{.
And https://example.com/(foo)/bar!
And https://example.com/{foo}/bar{.
And https://example.com/)baz{foo}.

[And https://example.com/].

-- text --
URLs with punctuation are hard. We don't want to consume the end-of-sentence
punctuation.

For example, https://en.wikipedia.org/wiki/John_Adams_(miniseries).
And https://example.com/[foo]/bar{. And https://example.com/(foo)/bar! And
https://example.com/{foo}/bar{. And https://example.com/)baz{foo}.

[And https://example.com/].

-- markdown --
URLs with punctuation are hard. We don't want to consume the end-of-sentence punctuation.

For example, [https://en.wikipedia.org/wiki/John\_Adams\_(miniseries)](https://en.wikipedia.org/wiki/John_Adams_(miniseries)). And [https://example.com/\[foo]/bar](https://example.com/[foo]/bar){. And [https://example.com/(foo)/bar](https://example.com/(foo)/bar)! And [https://example.com/{foo}/bar](https://example.com/{foo}/bar){. And [https://example.com/](https://example.com/))baz{foo}.

\[And [https://example.com/](https://example.com/)].

-- html --
<p>URLs with punctuation are hard.
We don&apos;t want to consume the end-of-sentence punctuation.
<p>For example, <a href="https://en.wikipedia.org/wiki/John_Adams_(miniseries)">https://en.wikipedia.org/wiki/John_Adams_(miniseries)</a>.
And <a href="https://example.com/[foo]/bar">https://example.com/[foo]/bar</a>{.
And <a href="https://example.com/(foo)/bar">https://example.com/(foo)/bar</a>!
And <a href="https://example.com/{foo}/bar">https://example.com/{foo}/bar</a>{.
And <a href="https://example.com/">https://example.com/</a>)baz{foo}.
<p>[And <a href="https://example.com/">https://example.com/</a>].

---

### Src Go Doc Comment Testdata Link7 (`src/go/doc/comment/testdata/link7.txt`)

-- input --
[math] is a package but this is not a doc link.

[io] is a doc link.

[math]: https://example.com
-- gofmt --
[math] is a package but this is not a doc link.

[io] is a doc link.

[math]: https://example.com
-- text --
math is a package but this is not a doc link.

io is a doc link.

[math]: https://example.com
-- markdown --
[math](https://example.com) is a package but this is not a doc link.

[io](/io) is a doc link.
-- html --
<p><a href="https://example.com">math</a> is a package but this is not a doc link.
<p><a href="/io">io</a> is a doc link.

---

### Src Go Doc Comment Testdata Linklist (`src/go/doc/comment/testdata/linklist.txt`)

{"DocLinkBaseURL": "https://pkg.go.dev"}
-- input --
Did you know?

  - [encoding/json.Marshal] is a doc link. So is [encoding/json.Unmarshal].
-- text --
Did you know?

  - encoding/json.Marshal is a doc link. So is encoding/json.Unmarshal.
-- markdown --
Did you know?

  - [encoding/json.Marshal](https://pkg.go.dev/encoding/json#Marshal) is a doc link. So is [encoding/json.Unmarshal](https://pkg.go.dev/encoding/json#Unmarshal).
-- html --
<p>Did you know?
<ul>
<li><a href="https://pkg.go.dev/encoding/json#Marshal">encoding/json.Marshal</a> is a doc link. So is <a href="https://pkg.go.dev/encoding/json#Unmarshal">encoding/json.Unmarshal</a>.
</ul>

---

### Src Go Doc Comment Testdata Linklist2 (`src/go/doc/comment/testdata/linklist2.txt`)

{"DocLinkBaseURL": "https://pkg.go.dev"}
-- input --
Did you know?

  - [testing.T] is one doc link.
  - So is [testing.M].
  - So is [testing.B].
    This is the same list paragraph.

    There is [testing.PB] in this list item, too!
-- text --
Did you know?

  - testing.T is one doc link.

  - So is testing.M.

  - So is testing.B. This is the same list paragraph.

    There is testing.PB in this list item, too!
-- markdown --
Did you know?

  - [testing.T](https://pkg.go.dev/testing#T) is one doc link.

  - So is [testing.M](https://pkg.go.dev/testing#M).

  - So is [testing.B](https://pkg.go.dev/testing#B). This is the same list paragraph.

    There is [testing.PB](https://pkg.go.dev/testing#PB) in this list item, too!
-- html --
<p>Did you know?
<ul>
<li><p><a href="https://pkg.go.dev/testing#T">testing.T</a> is one doc link.
<li><p>So is <a href="https://pkg.go.dev/testing#M">testing.M</a>.
<li><p>So is <a href="https://pkg.go.dev/testing#B">testing.B</a>.
This is the same list paragraph.
<p>There is <a href="https://pkg.go.dev/testing#PB">testing.PB</a> in this list item, too!
</ul>

---

### Src Go Doc Comment Testdata Linklist3 (`src/go/doc/comment/testdata/linklist3.txt`)

{"DocLinkBaseURL": "https://pkg.go.dev"}
-- input --
Cool things:

  - Foo
  - [Go]
  - Bar

[Go]: https://go.dev/
-- text --
Cool things:

  - Foo
  - Go
  - Bar

[Go]: https://go.dev/
-- markdown --
Cool things:

  - Foo
  - [Go](https://go.dev/)
  - Bar

-- html --
<p>Cool things:
<ul>
<li>Foo
<li><a href="https://go.dev/">Go</a>
<li>Bar
</ul>

---

### Src Go Doc Comment Testdata Linklist4 (`src/go/doc/comment/testdata/linklist4.txt`)

{"DocLinkBaseURL": "https://pkg.go.dev"}
-- input --
Cool things:

  - Foo
  - [Go] is great
    
    [Go]: https://go.dev/
  - Bar

-- text --
Cool things:

  - Foo

  - Go is great

  - Bar

[Go]: https://go.dev/
-- markdown --
Cool things:

  - Foo

  - [Go](https://go.dev/) is great

  - Bar

-- html --
<p>Cool things:
<ul>
<li><p>Foo
<li><p><a href="https://go.dev/">Go</a> is great
<li><p>Bar
</ul>

---

### Src Go Doc Comment Testdata List (`src/go/doc/comment/testdata/list.txt`)

-- input --
Text.
- Not a list.
 - Here is the list.
     • Using multiple bullets.
          * Indentation does not matter.
     + Lots of bullets.
More text.

-- gofmt --
Text.
- Not a list.
  - Here is the list.
  - Using multiple bullets.
  - Indentation does not matter.
  - Lots of bullets.

More text.

-- text --
Text. - Not a list.
  - Here is the list.
  - Using multiple bullets.
  - Indentation does not matter.
  - Lots of bullets.

More text.

-- markdown --
Text. - Not a list.

  - Here is the list.
  - Using multiple bullets.
  - Indentation does not matter.
  - Lots of bullets.

More text.

-- html --
<p>Text.
- Not a list.
<ul>
<li>Here is the list.
<li>Using multiple bullets.
<li>Indentation does not matter.
<li>Lots of bullets.
</ul>
<p>More text.

---

### Src Go Doc Comment Testdata List10 (`src/go/doc/comment/testdata/list10.txt`)

-- input --

	1. This list
	2. Starts the comment
	3. And also has a blank line before it.

All of which is a little weird.
-- gofmt --
 1. This list
 2. Starts the comment
 3. And also has a blank line before it.

All of which is a little weird.

---

### Src Go Doc Comment Testdata List2 (`src/go/doc/comment/testdata/list2.txt`)

-- input --
Text.
 1. Uno
   2) Dos
 3. Tres
   5. Cinco
 7. Siete
   11. Once
 12. Doce
 13. Trece.

-- gofmt --
Text.
 1. Uno
 2. Dos
 3. Tres
 5. Cinco
 7. Siete
 11. Once
 12. Doce
 13. Trece.

-- text --
Text.
 1. Uno
 2. Dos
 3. Tres
 5. Cinco
 7. Siete
 11. Once
 12. Doce
 13. Trece.

-- markdown --
Text.

 1. Uno
 2. Dos
 3. Tres
 5. Cinco
 7. Siete
 11. Once
 12. Doce
 13. Trece.

-- html --
<p>Text.
<ol>
<li>Uno
<li>Dos
<li>Tres
<li value="5">Cinco
<li value="7">Siete
<li value="11">Once
<li>Doce
<li>Trece.
</ol>

---

### Src Go Doc Comment Testdata List3 (`src/go/doc/comment/testdata/list3.txt`)

-- input --
Text.

 1. Uno
 1. Dos
 1. Tres
 1. Quatro

-- gofmt --
Text.

 1. Uno
 1. Dos
 1. Tres
 1. Quatro

-- markdown --
Text.

 1. Uno
 1. Dos
 1. Tres
 1. Quatro

-- html --
<p>Text.
<ol>
<li>Uno
<li value="1">Dos
<li value="1">Tres
<li value="1">Quatro
</ol>

---

### Src Go Doc Comment Testdata List4 (`src/go/doc/comment/testdata/list4.txt`)

-- input --
Text.
  1. List
2. Not indented, not a list.
  3. Another list.

-- gofmt --
Text.
 1. List

2. Not indented, not a list.
 3. Another list.

-- text --
Text.
 1. List

2. Not indented, not a list.
 3. Another list.

-- markdown --
Text.

 1. List

2\. Not indented, not a list.

 3. Another list.

-- html --
<p>Text.
<ol>
<li>List
</ol>
<p>2. Not indented, not a list.
<ol>
<li value="3">Another list.
</ol>

---

### Src Go Doc Comment Testdata List5 (`src/go/doc/comment/testdata/list5.txt`)

-- input --
Text.

  1. One
  999999999999999999999. Big
  1000000000000000000000. Bigger
  1000000000000000000001. Biggest

-- gofmt --
Text.

 1. One
 999999999999999999999. Big
 1000000000000000000000. Bigger
 1000000000000000000001. Biggest

-- text --
Text.

 1. One
 999999999999999999999. Big
 1000000000000000000000. Bigger
 1000000000000000000001. Biggest

-- markdown --
Text.

 1. One
 999999999999999999999. Big
 1000000000000000000000. Bigger
 1000000000000000000001. Biggest

-- html --
<p>Text.
<ol>
<li>One
<li value="999999999999999999999">Big
<li>Bigger
<li>Biggest
</ol>

---

### Src Go Doc Comment Testdata List6 (`src/go/doc/comment/testdata/list6.txt`)

-- input --
Text.
 - List immediately after.
 - Another.

More text.

 - List after blank line.
 - Another.

Even more text.
 - List immediately after.

 - Blank line between items.

Yet more text.

 - Another list after blank line.

 - Blank line between items.

Still more text.
 - One list item.

   Multiple paragraphs.
-- dump --
Doc
	Paragraph
		Plain "Text."
	List ForceBlankBefore=false ForceBlankBetween=false
		Item Number=""
			Paragraph
				Plain "List immediately after."
		Item Number=""
			Paragraph
				Plain "Another."
	Paragraph
		Plain "More text."
	List ForceBlankBefore=true ForceBlankBetween=false
		Item Number=""
			Paragraph
				Plain "List after blank line."
		Item Number=""
			Paragraph
				Plain "Another."
	Paragraph
		Plain "Even more text."
	List ForceBlankBefore=false ForceBlankBetween=true
		Item Number=""
			Paragraph
				Plain "List immediately after."
		Item Number=""
			Paragraph
				Plain "Blank line between items."
	Paragraph
		Plain "Yet more text."
	List ForceBlankBefore=true ForceBlankBetween=true
		Item Number=""
			Paragraph
				Plain "Another list after blank line."
		Item Number=""
			Paragraph
				Plain "Blank line between items."
	Paragraph
		Plain "Still more text."
	List ForceBlankBefore=false ForceBlankBetween=true
		Item Number=""
			Paragraph
				Plain "One list item."
			Paragraph
				Plain "Multiple paragraphs."

-- gofmt --
Text.
  - List immediately after.
  - Another.

More text.

  - List after blank line.
  - Another.

Even more text.

  - List immediately after.

  - Blank line between items.

Yet more text.

  - Another list after blank line.

  - Blank line between items.

Still more text.

  - One list item.

    Multiple paragraphs.

-- markdown --
Text.

  - List immediately after.
  - Another.

More text.

  - List after blank line.
  - Another.

Even more text.

  - List immediately after.

  - Blank line between items.

Yet more text.

  - Another list after blank line.

  - Blank line between items.

Still more text.

  - One list item.

    Multiple paragraphs.

---

### Src Go Doc Comment Testdata List7 (`src/go/doc/comment/testdata/list7.txt`)

-- input --
Almost list markers (but not quite):

 -

❦

 - $

❦

 - $

❦

  $
   $

❦

 1! List.

❦
-- gofmt --
Almost list markers (but not quite):

	-

❦

	- $

❦

	- $

❦

❦

	1! List.

❦
-- text --
Almost list markers (but not quite):

	-

❦

	-

❦

	-

❦

❦

	1! List.

❦
-- markdown --
Almost list markers (but not quite):

	-

❦

	- $

❦

	- $

❦

❦

	1! List.

❦
-- html --
<p>Almost list markers (but not quite):
<pre>-
</pre>
<p>❦
<pre>- $
</pre>
<p>❦
<pre>- $
</pre>
<p>❦
<p>❦
<pre>1! List.
</pre>
<p>❦

---

### Src Go Doc Comment Testdata List8 (`src/go/doc/comment/testdata/list8.txt`)

-- input --
Loose lists.
  - A

    B
  - C
    D
  - E
  - F
-- gofmt --
Loose lists.

  - A

    B

  - C
    D

  - E

  - F
-- text --
Loose lists.

  - A

    B

  - C D

  - E

  - F
-- markdown --
Loose lists.

  - A

    B

  - C D

  - E

  - F
-- html --
<p>Loose lists.
<ul>
<li><p>A
<p>B
<li><p>C
D
<li><p>E
<li><p>F
</ul>

---

### Src Go Doc Comment Testdata List9 (`src/go/doc/comment/testdata/list9.txt`)

-- input --
Text.

1. Not a list
2. because it is
3. unindented.

4. This one
  is a list
  because of the indented text.
5. More wrapped
  items.
6. And unwrapped.

7. The blank line stops the heuristic.
-- gofmt --
Text.

1. Not a list
2. because it is
3. unindented.

 4. This one
    is a list
    because of the indented text.
 5. More wrapped
    items.
 6. And unwrapped.

7. The blank line stops the heuristic.

---

### Src Go Doc Comment Testdata Para (`src/go/doc/comment/testdata/para.txt`)

-- input --
Hello, world.
This is a paragraph.

-- gofmt --
Hello, world.
This is a paragraph.

-- text --
Hello, world. This is a paragraph.

-- markdown --
Hello, world. This is a paragraph.

-- html --
<p>Hello, world.
This is a paragraph.

---

### Src Go Doc Comment Testdata Quote (`src/go/doc/comment/testdata/quote.txt`)

-- input --
Doubled single quotes like `` and '' don't turn into Unicode double quotes,
and neither do single quotes ` and '.
Misplaced markdown fences ``` do not either.
-- gofmt --
Doubled single quotes like `` and '' don't turn into Unicode double quotes,
and neither do single quotes ` and '.
Misplaced markdown fences ``` do not either.
-- text --
Doubled single quotes like `` and '' don't turn into Unicode double quotes, and
neither do single quotes ` and '. Misplaced markdown fences ``` do not either.
-- html --
<p>Doubled single quotes like `` and &apos;&apos; don&apos;t turn into Unicode double quotes,
and neither do single quotes ` and &apos;.
Misplaced markdown fences ``` do not either.

---

### Src Go Doc Comment Testdata Text (`src/go/doc/comment/testdata/text.txt`)

{"TextPrefix":"|", "TextCodePrefix": "@"}
-- input --
Hello, world
 Code block here.
More text.
Tight list
 - one
 - two
 - three
Loose list
 - one

 - two

 - three

# Heading

More text.
-- gofmt --
Hello, world

	Code block here.

More text.
Tight list
  - one
  - two
  - three

Loose list

  - one

  - two

  - three

# Heading

More text.
-- text --
|Hello, world
|
@Code block here.
|
|More text. Tight list
|  - one
|  - two
|  - three
|
|Loose list
|
|  - one
|
|  - two
|
|  - three
|
|# Heading
|
|More text.

---

### Src Go Doc Comment Testdata Text2 (`src/go/doc/comment/testdata/text2.txt`)

{"TextWidth": -1}
-- input --
Package gob manages streams of gobs - binary values exchanged between an
Encoder (transmitter) and a Decoder (receiver). A typical use is
transporting arguments and results of remote procedure calls (RPCs) such as
those provided by package "net/rpc".

The implementation compiles a custom codec for each data type in the stream
and is most efficient when a single Encoder is used to transmit a stream of
values, amortizing the cost of compilation.
-- text --
Package gob manages streams of gobs - binary values exchanged between an Encoder (transmitter) and a Decoder (receiver). A typical use is transporting arguments and results of remote procedure calls (RPCs) such as those provided by package "net/rpc".

The implementation compiles a custom codec for each data type in the stream and is most efficient when a single Encoder is used to transmit a stream of values, amortizing the cost of compilation.

---

### Src Go Doc Comment Testdata Text3 (`src/go/doc/comment/testdata/text3.txt`)

{"TextWidth": 30}
-- input --
Package gob manages streams of gobs - binary values exchanged between an
Encoder (transmitter) and a Decoder (receiver). A typical use is
transporting arguments and results of remote procedure calls (RPCs) such as
those provided by package "net/rpc".

The implementation compiles a custom codec for each data type in the stream
and is most efficient when a single Encoder is used to transmit a stream of
values, amortizing the cost of compilation.
-- text --
Package gob manages streams
of gobs - binary values
exchanged between an Encoder
(transmitter) and a Decoder
(receiver). A typical use is
transporting arguments and
results of remote procedure
calls (RPCs) such as those
provided by package "net/rpc".

The implementation compiles
a custom codec for each data
type in the stream and is
most efficient when a single
Encoder is used to transmit a
stream of values, amortizing
the cost of compilation.

---

### Src Go Doc Comment Testdata Text4 (`src/go/doc/comment/testdata/text4.txt`)

{"TextWidth": 29}
-- input --
Package gob manages streams of gobs - binary values exchanged between an
Encoder (transmitter) and a Decoder (receiver). A typical use is
transporting arguments and results of remote procedure calls (RPCs) such as
those provided by package "net/rpc".

The implementation compiles a custom codec for each data type in the stream
and is most efficient when a single Encoder is used to transmit a stream of
values, amortizing the cost of compilation.
-- text --
Package gob manages streams
of gobs - binary values
exchanged between an Encoder
(transmitter) and a Decoder
(receiver). A typical use
is transporting arguments
and results of remote
procedure calls (RPCs) such
as those provided by package
"net/rpc".

The implementation compiles
a custom codec for each data
type in the stream and is
most efficient when a single
Encoder is used to transmit a
stream of values, amortizing
the cost of compilation.

---

### Src Go Doc Comment Testdata Text5 (`src/go/doc/comment/testdata/text5.txt`)

{"TextWidth": 20}
-- input --
Package gob manages streams of gobs - binary values exchanged between an
Encoder (transmitter) and a Decoder (receiver). A typical use is
transporting arguments and results of remote procedure calls (RPCs) such as
those provided by package "net/rpc".

The implementation compiles a custom codec for each data type in the stream
and is most efficient when a single Encoder is used to transmit a stream of
values, amortizing the cost of compilation.
-- text --
Package gob
manages streams
of gobs - binary
values exchanged
between an Encoder
(transmitter) and a
Decoder (receiver).
A typical use
is transporting
arguments and
results of remote
procedure calls
(RPCs) such as those
provided by package
"net/rpc".

The implementation
compiles a custom
codec for each
data type in the
stream and is most
efficient when a
single Encoder is
used to transmit a
stream of values,
amortizing the cost
of compilation.

---

### Src Go Doc Comment Testdata Text6 (`src/go/doc/comment/testdata/text6.txt`)

-- input --
Package gob manages streams of gobs - binary values exchanged between an
Encoder (transmitter) and a Decoder (receiver). A typical use is
transporting arguments and results of remote procedure calls (RPCs) such as
those provided by package "net/rpc".

The implementation compiles a custom codec for each data type in the stream
and is most efficient when a single Encoder is used to transmit a stream of
values, amortizing the cost of compilation.
-- text --
Package gob manages streams of gobs - binary values exchanged between an Encoder
(transmitter) and a Decoder (receiver). A typical use is transporting arguments
and results of remote procedure calls (RPCs) such as those provided by package
"net/rpc".

The implementation compiles a custom codec for each data type in the stream and
is most efficient when a single Encoder is used to transmit a stream of values,
amortizing the cost of compilation.

---

### Src Go Doc Comment Testdata Text7 (`src/go/doc/comment/testdata/text7.txt`)

{"TextPrefix": "                    "}
-- input --
Package gob manages streams of gobs - binary values exchanged between an
Encoder (transmitter) and a Decoder (receiver). A typical use is
transporting arguments and results of remote procedure calls (RPCs) such as
those provided by package "net/rpc".

The implementation compiles a custom codec for each data type in the stream
and is most efficient when a single Encoder is used to transmit a stream of
values, amortizing the cost of compilation.
-- text --
                    Package gob manages streams of gobs - binary values
                    exchanged between an Encoder (transmitter) and a Decoder
                    (receiver). A typical use is transporting arguments and
                    results of remote procedure calls (RPCs) such as those
                    provided by package "net/rpc".

                    The implementation compiles a custom codec for each data
                    type in the stream and is most efficient when a single
                    Encoder is used to transmit a stream of values, amortizing
                    the cost of compilation.

---

### Src Go Doc Comment Testdata Text8 (`src/go/doc/comment/testdata/text8.txt`)

{"TextWidth": 40}
-- input --
If the arguments have version suffixes (like @latest or @v1.0.0), "go install"
builds packages in module-aware mode, ignoring the go.mod file in the current
directory or any parent directory, if there is one. This is useful for
installing executables without affecting the dependencies of the main module.
To eliminate ambiguity about which module versions are used in the build, the
arguments must satisfy the following constraints:

 - Arguments must be package paths or package patterns (with "..." wildcards).
 They must not be standard packages (like fmt), meta-patterns (std, cmd,
 all), or relative or absolute file paths.

 - All arguments must have the same version suffix. Different queries are not
 allowed, even if they refer to the same version.

 - All arguments must refer to packages in the same module at the same version.

 - Package path arguments must refer to main packages. Pattern arguments
 will only match main packages.

 - No module is considered the "main" module. If the module containing
 packages named on the command line has a go.mod file, it must not contain
 directives (replace and exclude) that would cause it to be interpreted
 differently than if it were the main module. The module must not require
 a higher version of itself.

 - Vendor directories are not used in any module. (Vendor directories are not
 included in the module zip files downloaded by 'go install'.)

If the arguments don't have version suffixes, "go install" may run in
module-aware mode or GOPATH mode, depending on the GO111MODULE environment
variable and the presence of a go.mod file. See 'go help modules' for details.
If module-aware mode is enabled, "go install" runs in the context of the main
module.
-- text --
If the arguments have version suffixes
(like @latest or @v1.0.0), "go install"
builds packages in module-aware mode,
ignoring the go.mod file in the current
directory or any parent directory,
if there is one. This is useful for
installing executables without affecting
the dependencies of the main module.
To eliminate ambiguity about which
module versions are used in the build,
the arguments must satisfy the following
constraints:

  - Arguments must be package paths
    or package patterns (with "..."
    wildcards). They must not be
    standard packages (like fmt),
    meta-patterns (std, cmd, all),
    or relative or absolute file paths.

  - All arguments must have the same
    version suffix. Different queries
    are not allowed, even if they refer
    to the same version.

  - All arguments must refer to packages
    in the same module at the same
    version.

  - Package path arguments must refer
    to main packages. Pattern arguments
    will only match main packages.

  - No module is considered the "main"
    module. If the module containing
    packages named on the command line
    has a go.mod file, it must not
    contain directives (replace and
    exclude) that would cause it to be
    interpreted differently than if it
    were the main module. The module
    must not require a higher version of
    itself.

  - Vendor directories are not used in
    any module. (Vendor directories are
    not included in the module zip files
    downloaded by 'go install'.)

If the arguments don't have version
suffixes, "go install" may run in
module-aware mode or GOPATH mode,
depending on the GO111MODULE environment
variable and the presence of a go.mod
file. See 'go help modules' for details.
If module-aware mode is enabled,
"go install" runs in the context of the
main module.

---

### Src Go Doc Comment Testdata Text9 (`src/go/doc/comment/testdata/text9.txt`)

{"TextPrefix":"|", "TextCodePrefix": "@"}
-- input --
Hello, world
 Code block here.
-- gofmt --
Hello, world

	Code block here.
-- text --
|Hello, world
|
@Code block here.

---

### Src Go Doc Comment Testdata Words (`src/go/doc/comment/testdata/words.txt`)

-- input --
This is an italicword and a linkedword and Unicöde.
-- gofmt --
This is an italicword and a linkedword and Unicöde.
-- text --
This is an italicword and a linkedword and Unicöde.
-- markdown --
This is an *italicword* and a [*linkedword*](https://example.com/linkedword) and Unicöde.
-- html --
<p>This is an <i>italicword</i> and a <a href="https://example.com/linkedword"><i>linkedword</i></a> and Unicöde.

---

### Doc Next 6 Stdlib 99 Minor Crypto X509 79860 (`doc/next/6-stdlib/99-minor/crypto/x509/79860.md`)

[ParseCertificate], [ParseCertificateRequest], [ParseRevocationList] and
[ParsePKIXPublicKey] now reject trailing data after the parameters of an
AlgorithmIdentifier, after the RSAPublicKey structure of an RSA public key
and after its public exponent, and after the named curve of an ECDSA public key.

---

### Doc Next 6 Stdlib 99 Minor Crypto X509 81798 (`doc/next/6-stdlib/99-minor/crypto/x509/81798.md`)

[ParseCertificate] and [ParseCertificateRequest] now reject trailing data
after the value of the key usage, basic constraints, subject alternative
name, extended key usage and certificate policies extensions.

---

### Doc Next 6 Stdlib 99 Minor Debug Pe 81594 (`doc/next/6-stdlib/99-minor/debug/pe/81594.md`)

The [ImportDirectory] type is now marked as deprecated.
It was exported by accident, is an internal detail of the package,
and should not be used directly.

---

### Doc Next 6 Stdlib 99 Minor Encoding Base32 20235 (`doc/next/6-stdlib/99-minor/encoding/base32/20235.md`)

[Encoding.EncodedLen] now panics if the encoded length overflows int,
rather than returning a negative number.

---

### Doc Next 6 Stdlib 99 Minor Encoding Base64 20235 (`doc/next/6-stdlib/99-minor/encoding/base64/20235.md`)

[Encoding.EncodedLen] now panics if the encoded length overflows int,
rather than returning a negative number.

---

### Doc Next 6 Stdlib 99 Minor Go Build 75129 (`doc/next/6-stdlib/99-minor/go/build/75129.md`)

The [build.ArchChar] function is deprecated, as it no longer varies by architecture.

---

### Doc Next 6 Stdlib 99 Minor Go Parser 79802 (`doc/next/6-stdlib/99-minor/go/parser/79802.md`)

The [ResolveFile] function performs legacy syntactic identifier
resolution on an [ast.File] syntax tree. This resolution is
deprecated; new applications should instead use [go/types].
This function is provided to ease the transition away from the old
resolution in applications that mostly parse files in
[SkipObjectResolution] mode but later encounter some cases where the
old resolution is needed.

---

### Doc Next 6 Stdlib 99 Minor Log Slog 81838 (`doc/next/6-stdlib/99-minor/log/slog/81838.md`)

In Go 1.27.1, direct calls to [Handler.WithGroup] that passed `""`, including
those inside [MultiHandler], would erroneously insert a group with name `""`
instead of doing nothing. This bug is now fixed.

---

### Doc Next 6 Stdlib 99 Minor Net Http 79040 (`doc/next/6-stdlib/99-minor/net/http/79040.md`)

The long-deprecated [Transport.CancelRequest] now does nothing.
Use [NewRequestWithContext] (available since Go 1.13)
to create a cancellable request.

---

### Doc Next 6 Stdlib 99 Minor Net Http 79656 (`doc/next/6-stdlib/99-minor/net/http/79656.md`)

[ProxyFromEnvironment] now prioritizes lowercase proxy environment variables
(`http_proxy`, `https_proxy`, and `no_proxy`) over the uppercase versions if
both are set to different values. This change also affects default proxy lookups
in [DefaultTransport] and [DefaultClient] by extension.

---

### Doc Next 6 Stdlib 99 Minor Net Http 80058 (`doc/next/6-stdlib/99-minor/net/http/80058.md`)

The new [MethodQuery] constant represents the HTTP QUERY method defined in
[RFC 10008](https://www.rfc-editor.org/rfc/rfc10008).

---

### Doc Next 6 Stdlib 99 Minor Net Http 80735 (`doc/next/6-stdlib/99-minor/net/http/80735.md`)

The HTTP/2 server now lets a connection's serve goroutine exit while
the connection has nothing to do, restarting it on demand. This
reduces memory usage for servers with many idle connections or many
handlers idling mid-response (such as long polls).

---

### Doc Next 6 Stdlib 99 Minor Net Url 79946 (`doc/next/6-stdlib/99-minor/net/url/79946.md`)

The new [MustParse] function returns the parsed [URL]
or panics on error.
It can simplify some common uses of [Parse].
For instance, initializing variables with valid URL string constants.

---

### Doc Next 6 Stdlib 99 Minor Testing Fstest 80822 (`doc/next/6-stdlib/99-minor/testing/fstest/80822.md`)

The `ReadAt` methods of files returned by [testing/fstest.MapFile.Open]
now return [io.EOF] when called with an offset at or beyond the end
of the file, as required by [io.ReaderAt].

---

### Doc Next 6 Stdlib 99 Minor Testing Synctest 77320 (`doc/next/6-stdlib/99-minor/testing/synctest/77320.md`)

The new [Subtest] convenience function combines [testing.(*T).Run] and [testing/synctest.Test].

---

--- METRICS ---
- Files Extracted: 85
- Estimated Token Budget: ~21170 tokens
- Canonical Reference: https://codewiki.google/github.com/golang/go
