IT Pro is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission. Learn more

Go 1.18 promises to be the most significant update to the language ever

A host of features aiming to simplify and streamline critical functions, as well as big performance boosts, are expected to improve the development experience for all

The development team behind the Google-created Go programming language has released what it’s calling the “biggest change ever to the language”.

Go version 1.18 is available to download now and brings with it support for generic code using parameterised types – often simply referred to as ‘generics’ – a most-requested feature from the Go community, the development team said.

Generics is an approach that can be found in other popular programming languages like Java, Python, Rust, and Swift, and allows developers to write data structures and functions in a way that they can be applied to many different cases.

For example, a developer may want to code a ‘reverse’ function for integers, but also want it to apply to strings – two different types of data. Generics makes this less difficult to achieve by opening up the function to accept different, unspecified data types.

“Supporting generics has been Go’s most often requested feature, and we’re proud to deliver the generic support that the majority of users need today,” said Go. “Subsequent releases will provide additional support for some of the more complicated generic use cases.”

Go said the generics support is a “major” addition but is fully backwards-compatible in the language. While it believes the feature has been implemented well, it said it does not have much testing data from real-world applications, and so advises developers to exercise caution when deploying generic code.

It's the first implementation of generics in Go and there is a possibility that generic code written in Go 1.18 may break in later releases if the method of implementation has to be changed, the development team said.

“We will minimise any such breakage as much as possible, but we can't guarantee that the breakage will be zero,” it said.

Full details of what Go supports with generics and what its current limitations are can be found in the official release notes.

Fuzzing

Go has also implemented fuzzing – another of the most requested features from its community and the first major programming language to fully integrate fuzzing into its toolchain, the development team said.

Fuzzing is an automated testing tool that feeds invalid or random data into an application’s code as a way to test it for bugs or problems that could lead to crashes.

Go said its fuzzing can be particularly useful for developers looking to test for security exploits and vulnerabilities in the edge cases humans often miss.

The developers warned that using fuzzing in an application can consume a lot of system memory and that developers may experience significant performance dips on their machines while it runs. There is also no limit to the number of files or total bytes that can be written to the fuzz cache, which may lead to multiple gigabytes of storage being used.

Workspaces and performance improvements 

Go has introduced multi-module workspaces that allow developers to tell the Go command that code is being written on multiple modules at the same time.

Related Resource

Four strategies for building a hybrid workplace that works

All indications are that the future of work is hybrid, if it's not here already

Black whitepaper cover with title and blue and orange square speech bubble graphicsFree webinar

It addresses one of the chief challenges identified in the development team’s annual survey of Go programmers that showed it was difficult to work using Go across multiple modules. The new workspace mode makes this a more streamlined process.

Go also said the latest version delivers performance increases of up to 20% when using Apple M1, ARM64, and PowerPC64 thanks to an expansion of Go 1.17’s register ABI calling convention to the architectures.

The improvement is significant, and Go emphasised that while it’s proud of the speed increase, it’s still only the fourth most important part of the release, underlining how significant the other changes are.

Featured Resources

Four strategies for building a hybrid workplace that works

All indications are that the future of work is hybrid, if it's not here already

Free webinar

The digital marketer’s guide to contextual insights and trends

How to use contextual intelligence to uncover new insights and inform strategies

Free Download

Ransomware and Microsoft 365 for business

What you need to know about reducing ransomware risk

Free Download

Building a modern strategy for analytics and machine learning success

Turning into business value

Free Download

Recommended

Apple executive rejoins Google over remote work policy
flexible working

Apple executive rejoins Google over remote work policy

18 May 2022
Here’s the first look at Google’s new Bay View campus
Business operations

Here’s the first look at Google’s new Bay View campus

17 May 2022
Google offers UK SMBs £87,000 scholarships to boost tech skills
Careers & training

Google offers UK SMBs £87,000 scholarships to boost tech skills

10 May 2022
Google Cloud confirms it is building a dedicated team to support Web3 developers
Cloud

Google Cloud confirms it is building a dedicated team to support Web3 developers

9 May 2022

Most Popular

Russian hackers declare war on 10 countries after failed Eurovision DDoS attack
hacking

Russian hackers declare war on 10 countries after failed Eurovision DDoS attack

16 May 2022
Windows Server admins say latest Patch Tuesday broke authentication policies
Server & storage

Windows Server admins say latest Patch Tuesday broke authentication policies

12 May 2022
Microsoft to double salary budget to retain workers
Careers & training

Microsoft to double salary budget to retain workers

17 May 2022