get in touch

Go 1.24, scheduled for release in February 2025, brings significant improvements across performance, security, developer tooling, and standard library enhancements. This comprehensive overview details the most impactful changes and additions to the language.

golang 1.24 vs 1.23 performance improvements

Core Performance Improvements

The runtime has achieved a 2-3% reduction in CPU overhead through several key optimizations:

  • A new Swiss Tables-based map implementation
  • Optimized small object memory allocation
  • Improved runtime-internal mutex implementation
  • Enhanced cgo performance with new directives (noescape and nocallback)

These improvements can be optionally disabled using GOEXPERIMENT=noswissmap and GOEXPERIMENT=nospinbitmutex if needed.

Language Enhancements

Generic Type Aliases

Go 1.24 introduces full support for generic type aliases, allowing parameterization similar to defined types. This feature can be temporarily disabled using GOEXPERIMENT=noaliastypeparams, though this option will be removed in Go 1.25.

DNS security diagram

Major Security Features

Post-Quantum Cryptography

  • New crypto/mlkem package implementing ML-KEM-768 and ML-KEM-1024
  • Integration with TLS through the crypto/tls package
  • Default enablement of X25519MLKEM768 key exchange mechanism

Encrypted Client Hello (ECH)

  • Added support in TLS server implementation
  • Configurable through Config.EncryptedClientHelloKeys
  • Enhances privacy by encrypting server identity information

Cryptographic Improvements

  • New cryptographic packages: crypto/hkdf, crypto/pbkdf2, and crypto/sha3
  • Enhanced RSA security with minimum 1024-bit key requirement
  • Improved performance for various cryptographic operations

Developer Tools and Testing

Module Management

  • New tool directive in go.mod for executable dependencies
  • Simplified tool management with go get -tool and go install tool
  • Build cache support for go run executables

Testing Enhancements

  • New testing.B.Loop method for more efficient benchmarking
  • Context support via T.Context() and B.Context()
  • Introduction of testing/synctest package for concurrent code testing
  • New tests analyzer in vet tool for identifying common test declaration mistakes

Build and Compilation

  • JSON output support for build and test results
  • Improved authentication for private module fetches via GOAUTH
  • Version control information embedding in compiled binaries
  • Enhanced objdump support for additional architectures
go1.24 features map

Standard Library Enhancements

Memory Management

  • New weak package providing weak pointer implementation
  • Improved cleanup mechanism with runtime.AddCleanup
  • Enhanced sync.Map implementation for better performance

File System Operations

  • New os.Root type for directory-limited filesystem access
  • Secure filesystem operations within specific directories

JSON Handling

  • New omitzero tag for improved zero value handling
  • Better error messages in UnmarshalTypeError

Networking

  • MPTCP support by default in ListenConfig
  • Unencrypted HTTP/2 support
  • Enhanced TLS configuration options

String and Data Processing

  • New iterator-based functions in strings and bytes packages
  • Improved encoding interfaces with TextAppender and BinaryAppender
  • Enhanced template support for range-over-func and range-over-int

Platform Support Updates

System Requirements

  • Linux kernel 3.2+ required
  • macOS 12 Monterey will be required for Go 1.25
  • Windows/ARM port marked as broken

WebAssembly

  • New go:wasmexport directive
  • Enhanced type support for WebAssembly imports/exports
  • Support for building as reactor/library on WASIP1

Deprecations and Removals

  • Deprecated runtime.GOROOT function
  • Removed X25519Kyber768Draft00 key exchange support
  • Deprecated certain crypto/cipher functions (NewOFB, NewCFBEncrypter, NewCFBDecrypter)

Best Practices and Recommendations

  1. Security: Use authenticated encryption modes instead of OFB/CFB Implement the new crypto package features for enhanced security Utilize the new RSA key generation requirements
  2. Performance: Take advantage of the new map implementation. Use the improved sync. Map for concurrent access. Implement weak pointers for memory-efficient structures.
  3. Testing: Adopt testing.B.Loop for benchmarks Utilize the new context support in tests Implement sync test for concurrent code testing
  4. Tool Usage: Migrate to the new tool directive system Use JSON output for build and test integration Implement the new filesystem security features

This release represents a significant step forward in Go's evolution, particularly in areas of security, performance, and developer experience. The introduction of post-quantum cryptography and enhanced testing capabilities demonstrates Go's commitment to staying ahead of emerging technical challenges while maintaining its focus on simplicity and efficiency.