Go 1.27 is not yet released. These are work-in-progress release notes. Go 1.27 is expected to be released in August 2026.
A key in a struct literal may now be any valid field selector for the struct type, not just a (top-level) field name of the struct.
Go 1.27 now supports generic methods: a method declaration may declare its own type parameters. This widely anticipated change allows adding generic functions within the namespace of a particular data type where before one had to declare such functions with a scope of the entire package. Note that methods of interfaces may not declare type parameters nor can interface methods be implemented by generic methods.
Function type inference has been generalized to apply in all contexts where a generic function is assigned to a variable of (or converted to) a matching function type.
Response file (@file) parsing is now supported for the compile, link, asm, cgo, cover, and pack tools. The response file contains whitespace-separated arguments with support for single-quoted and double-quoted strings, escape sequences, and backslash-newline line continuation. The format is compatible with GCC's response file implementation to ensure interoperability with existing build systems.
go test now invokes the stdversion vet check by default. This reports the use of standard library symbols that are too new for the Go version in force in the referring file, as determined by go directive in go.mod and build tags on the file.
The go command no longer has support for the bzr version control system. It will no longer be able to directly fetch modules hosted on bzr servers.
The go fix command contains several new modernizers (atomictypes, embedlit, slicesbackward, and unsafefuncs). The existing fmtappendf analyzer was removed due to stylistic concerns. The existing waitgroup analyzer was renamed to waitgroupgo to avoid ambiguity.
Starting with the Go 1.27 tool chain, the go command now recognizes a GODEBUG setting for which support was removed (such as asynctimerchan, see below) if it appears in go.mod files (go debug entries) and .go source files (//go:debug comments). It accepts these settings if they are set to the final default value established before the setting was removed. If they are set to an old value, the go command will fail. This change is in the spirit of the Go 1 compatibility guarantee and allows existing programs that set supported GODEBUG settings to continue to build and run without changes even when the respective setting support has been removed.
For modules specifying go 1.27 or later in their go.mod file, go mod tidy now automatically merges duplicate require blocks. This ensures the file maintains a clean, standard structure containing at most two require blocks: one for direct dependencies and one for indirect dependencies.
Existing comment blocks attached to dependencies are preserved during this consolidation. If a comment block is associated with a mixed set of directives (containing both direct and indirect dependencies), the comment block is merged and attached to the new direct dependency block.
Previously, if a go.mod file accumulated multiple disjoint require blocks (often due to manual edits, unresolved Git merge conflicts, or legacy upgrades) go mod tidy would leave the extra blocks intact or inadvertently create new ones. The tool now strictly enforces the two-block layout, consolidating disparate requirements into their respective blocks and cleaning up the structure of the module file automatically.
go tool trace's -http argument now restricts the listen address to localhost when passed only a port (e.g., -http=:6060). This change makes go tool trace consistent with the behavior of go tool pprof's -http flag. To listen on all addresses, explicitly include the specified address (e.g., -http=0.0.0.0:6060).
Tracebacks for modules with go directives configuring Go 1.27 or later will now include runtime/pprof goroutine labels in the header line. This behavior can be disabled with GODEBUG=tracebacklabels=0 (added in Go 1.26). This opt-out is expected to be kept indefinitely in case goroutine labels acquire sensitive information that shouldn't be made available in tracebacks.
The asynctimerchan GODEBUG setting (added in Go 1.23) has been removed permanently. Channels created by package time are now always unbuffered (synchronous), irrespective of GODEBUG settings.
The compiler will now generate calls to size-specialized memory allocation routines, reducing the cost of some small (<80 byte) memory allocations by up to 30%. Improvements vary depending on the workload, but the overall improvement is expected to be ~1% in real allocation-heavy programs. This causes the binary size to increase by about 60 KB (independent of the workload). Please file an issue if you notice any regressions. You may set GOEXPERIMENT=nosizespecializedmalloc at build time to disable it. This opt-out setting is expected to be removed in Go 1.28.
The compiler now resolves a relative filename in a //line or /*line*/ directive against the directory of the file containing the directive, matching go/scanner. Absolute filenames are unaffected. See #70478.
The new uuid package generates and parses UUIDs.
The new crypto/mldsa package implements the post-quantum ML-DSA signature scheme specified in FIPS 204.
crypto/x509 now supports ML-DSA private keys, public keys, and signatures.
crypto/tls now supports ML-DSA signatures in TLS 1.3, with the new [MLDSA44], [MLDSA65], and [MLDSA87] [SignatureScheme] values.
bytesThe new CutLast function slices a []byte around the last occurrence of a separator. It can replace and simplify some common uses of LastIndex.
cryptoThe new MLDSAMu Hash value is meant to be used as a signaling mechanism for External μ ML-DSA signing.
crypto/ecdsaPrivateKey.Sign now checks that the length of the hash is correct, if opts is not nil.
crypto/mldsacrypto/tlsThe new QUICConfig.ClientHelloInfoConn field specifies the net.Conn to use for the ClientHelloInfo.Conn field during QUIC server handshakes.
The MLKEM1024 key exchange is now supported. It can be enabled by adding it to Config.CurvePreferences.
Config.Rand is now deprecated. For deterministic testing, use testing/cryptotest.SetGlobalRandom.
Post-quantum hybrid key exchanges can now be explicitly enabled in Config.CurvePreferences even if the tlsmlkem=0 or tlssecpmlkem=0 GODEBUG options are used. Those options were always meant to only apply to the default set used when Config.CurvePreferences is nil.
crypto/x509When parsing into pkix.Name fields, a wider range of pkix.AttributeTypeAndValue.Value types is now supported, and unknown types are parsed into asn1.RawValue.
The new Certificate.RawSignatureAlgorithm, CertificateRequest.RawSignatureAlgorithm, and RevocationList.RawSignatureAlgorithm fields expose the DER-encoded AlgorithmIdentifier of the signature algorithm, including when the SignatureAlgorithm field is UnknownSignatureAlgorithm.
SystemCertPool now respects SSL_CERT_FILE and SSL_CERT_DIR on Windows and Darwin. When these environment variables are set, roots are loaded from disk and instead of using the platform certificate verification APIs, the native Go verifier is used. This behavior can be disabled with GODEBUG=x509sslcertoverrideplatform=0.
crypto/x509/pkixRDNSequence.String (and therefore Name.String) now renders string-typed attribute values as strings even when the attribute's OID is unrecognized. Previously such values were always hex-encoded in their DER form. See #33093.
database/sqlThe new ConvertAssign function gives database drivers access to the type conversions performed by Rows.Scan.
database/sql/driverDrivers may implement the new RowsColumnScanner interface to scan directly into user-provided destinations.
go/constantThe new StringLen function returns the length of a string Value. For an Unknown value, the length is 0.
go/scannerThe scanner now allows retrieving the end position of a token via the new Scanner.End method.
go/tokenFile now has a String method.
go/typesThe Hasher type is an implementation of maphash.Hasher for [Type]s that respects the Identical equivalence relation, allowing Types to be used in hash tables and similar data structures (see container/hash). HasherIgnoreTags is the analogous hasher for IdenticalIgnoreTags.
The gotypesalias GODEBUG setting (added in Go 1.22) has been removed permanently and the package go/types now always produces an Alias type node for alias declarations irrespective of GODEBUG settings.
hash/maphashThe Hasher interface type defines the contract between values of a particular type and future hash-based data structures such as hash tables and Bloom filters; see #70471.
math/bigInt now has method Int.Divide to compute quotient and remainder of two Int values. It supports rounding modes Trunc, Floor, Round and Ceil.
math/rand/v2add the generic method *Rand.N, matching the behavior of the top-level N function.
netUnixConn read methods now return io.EOF directly instead of wrapping it in net.OpError when the underlying read returns EOF.
net/httpTransport and Server support TLS ALPN protocol negotiation on user-provided net.Conn connections which implement a ConnectionState() tls.ConnectionState method.
HTTP/2 server now accepts client priority signals, as defined in RFC 9218, allowing it to prioritize serving HTTP/2 streams with higher priority. If the old behavior is preferred, where streams are served in a round-robin manner regardless of priority, Server.DisableClientPriority can be set to true.
HTTP/1 Response.Body now automatically drains any unread content upon being closed, up to a conservative limit, to allow better connection reuse. For most programs, this change should be a no-op, or result in a performance improvement. In rare cases, programs that do not benefit from connection reuse might experience performance degradation if they had been improperly allowing an excessive amount of idle connections to linger; usually by setting Transport.MaxIdleConns to 0 or using different [Client]s for different requests, thereby bypassing Transport.MaxIdleConns limit. In these cases, setting Transport.DisableKeepAlives to true will disable connection reuse. However, such performance degradation usually indicates improper configuration or usage of Transport or Client in the first place, and a deeper look would likely be beneficial.
net/http/httptestNewTestServer creates a Server configured to use an in-memory fake network suitable for use with the testing/synctest package.
net/urlThe new URL.Clone method creates a deep copy of a URL. The new Values.Clone method creates a deep copy of Values.
stringsThe new CutLast function slices a string around the last occurrence of a separator. It can replace and simplify some common uses of LastIndex.
testing/synctestThe new Sleep helper function combines time.Sleep and testing/synctest.Wait.
unicodeThe unicode package and associated support throughout the system has been upgraded from Unicode 15 to Unicode 17. See the Unicode 16.0.0 and Unicode 17.0.0 release notes for information about the changes.
uuidAs announced in the Go 1.26 release notes, Go 1.27 requires macOS 13 Ventura or later; support for previous versions has been discontinued.
On ppc64, the ABI has been migrated to ELFv2. This change has no effect for those building and running pure Go binaries.
On ppc64, external linking, cgo, and PIE binaries are now supported. Using these features requires an ELFv2 compatible runtime (libc, kernel, and all linked and loaded libraries).
Please convert these into documentation in the right places. Some of them may not need any documentation or may be false positives from automation.
all: switch linux-ppc64 target to ELFv2 ABIcmd/link: add -macos and -macsdk flags to set LC_BUILD_VERSIONinternal/goexperiment,runtime: drop goroutineleakprofile experimentcmd/doc: add example supportcmd/go: add example support to go doc outputx/crypto/ssh: add NewControlClientConnssh: add openssh controlmaster socket supportcmd/go: continue conversion to bug-resistant //go:build constraintscmd/dist: use go/build/constraint to parse build constraintsall: document uses of context.Background by APIslog/slog: document context.Background use in non-Context methodscmd/go: stamp the pseudo-version in builds generated by `go build` extension/src/language: update developer version detection logicruntime: enforce standard descriptors are open on initializationruntime: std FDs are always opened, not only when AT_SECURE is setcmd: drop support for GOROOT_FINALinternal/relui: leave out GOROOT_FINAL when building distpackstesting: annotate output text typetesting: annotate output text typecmd/internal/test2json: generate and validate test artifactstesting: escapes framing markerscmd/doc: support 'go doc package@version' syntaxcmd/go/internal/doc: support @version suffix on first argumentdoc/godebug: allow carve out for GODEBUGs introduced in security releasesdoc: document GODEBUG carve out for security releasesx/net/http2: deprecate WriteSchedulerhttp2: deprecate write schedulerscrypto/tls: add X25519MLKEM768 and use by default; remove x25519Kyber768Draft00crypto/tls: let Config.CurvePreferences override GODEBUG optionscrypto/tls: add support for NIST curve based ML-KEM hybridscrypto/tls: let Config.CurvePreferences override GODEBUG optionsencoding/json/v2: new API for encoding/jsoninternal/buildcfg: enable JSONv2 as baselineencoding/json: clarify that v1 Marshal calls MarshalerTo methodsencoding/json/internal/jsontest: rename testdata to _embedcmd/go, cmd/distpack: build and run tools that are not necessary for builds as needed and don't include in binary distributioncmd/go: specify full path to go command when running go tool covdataruntime/pprof,runtime: new goroutine leak profileinternal/buildcfg: enable goroutineleakprofile GOEXPERIMENT by defaultinternal/goexperiment,runtime: drop goroutineleakprofile experimentinternal/goexperiment: actually delete goroutineleakprofile experimentcrypto/sha3: make the zero value of SHA3 useablecrypto/sha3: ensure unwrapped *sha3.Digest are usablecrypto: remove in Go 1.27 GODEBUGs introduced in Go 1.23 and earliercrypto/tls: remove the tlsunsafeekm GODEBUG settingcrypto/tls: remove tlsrsakex GODEBUG settingcrypto/tls: remove tls3des GODEBUG settingcrypto/tls: remove the tls10server GODEBUG settingcrypto/tls: remove the x509keypairleaf GODEBUG settingx/crypto/ssh: add AuthCallback to ClientConfigssh: add AuthCallback to ClientConfigsecret,crypto/subtle: make all "bubbles" inherited across goroutinesruntime/secret: implement goroutine inheriting secret statex/net/html: add NodeType.String() methodhtml: add NodeType.String() methodcmd/go: change `go mod init` default go directive back to 1.Ncmd/go: revert update default go directive in mod or work init