By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Here’s What You Need to Know About Go 1.22 | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > Here’s What You Need to Know About Go 1.22 | HackerNoon
Computing

Here’s What You Need to Know About Go 1.22 | HackerNoon

News Room
Last updated: 2025/06/15 at 1:41 PM
News Room Published 15 June 2025
Share
SHARE

Today the Go team is thrilled to release Go 1.22, which you can get by visiting the download page.

Go 1.22 comes with several important new features and improvements. Here are some of the notable changes; for the full list, refer to the release notes.

Language changes

The long-standing “for” loop gotcha with accidental sharing of loop variables between iterations is now resolved. Starting with Go 1.22, the following code will print “a”, “b”, and “c” in some order:

func main() {
    done := make(chan bool)

    values := []string{"a", "b", "c"}
    for _, v := range values {
        go func() {
            fmt.Println(v)
            done <- true
        }()
    }

    // wait for all goroutines to complete before exiting
    for _ = range values {
        <-done
    }
}

For more information about this change and the tooling that helps keep code from breaking accidentally, see the earlier loop variable blog post.

The second language change is support for ranging over integers:

package main

import "fmt"

func main() {
    for i := range 10 {
        fmt.Println(10 - i)
    }
    fmt.Println("go1.22 has lift-off!")
}

The values of i in this countdown program go from 0 to 9, inclusive. For more details, please refer to the spec.

Improved performance

Memory optimization in the Go runtime improves CPU performance by 1-3%, while also reducing the memory overhead of most Go programs by around 1%.

In Go 1.21, we shipped profile-guided optimization (PGO) for the Go compiler and this functionality continues to improve. One of the optimizations added in 1.22 is improved devirtualization, allowing static dispatch of more interface method calls. Most programs will see improvements between 2-14% with PGO enabled.

Standard library additions

  • A new math/rand/v2 package provides a cleaner, more consistent API and uses higher-quality, faster pseudo-random generation algorithms. See the proposal for additional details.

  • The patterns used by net/http.ServeMux now accept methods and wildcards.

    For example, the router accepts a pattern like GET /task/{id}/, which matches only GET requests and captures the value of the {id} segment in a map that can be accessed through Request values.

  • A new Null[T] type in database/sql provides a way to scan nullable columns.

  • A Concat function was added in package slices, to concatenate multiple slices of any type.


Thanks to everyone who contributed to this release by writing code and documentation, filing bugs, sharing feedback, and testing the release candidates. Your efforts helped to ensure that Go 1.22 is as stable as possible. As always, if you notice any problems, please file an issue.

Enjoy Go 1.22!


Eli Bendersky, on behalf of the Go team

Photo by Pawel Czerwinski on Unsplash

This article is available on The Go Blog under a CC BY 4.0 DEED license.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Feel Old Yet? You Can Now Emulate PS3 Games on Android Phones
Next Article FIFA Club World Cup Soccer: Stream PSG vs. Atlético Madrid Live From Anywhere
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Taiwan places export controls on Huawei and SMIC | News
News
Ford recalls over 1m vehicles but drivers can skip dealership trip for fix
News
A New Obesity Pill May Burn Fat Without Suppressing Appetite
Gadget
How To Add Music to Instagram Stories & Posts |
Computing

You Might also Like

Computing

How To Add Music to Instagram Stories & Posts |

3 Min Read
Computing

China’s Ministry of Industry and Information Technology establishes AI Standardization Technical Committee · TechNode

1 Min Read
Computing

How to Schedule Instagram Carousel Posts with

4 Min Read
Computing

Porsche vows to “win back” Chinese consumers by 2026: executive · TechNode

1 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?