

The Go programming language team at Google Cloud today released Go 1.18, which includes a massive number of performance improvements and features requested by developers.
Go was publicly announced in 2009 by Google as a way to improve programming productivity for multicore, networked machines dealing with large codebases. The language is similar to C, with static typing, meaning that its variables must be defined ahead of time, making it more secure and easier to optimize. Its coding is also designed for readability and usability similar to JavaScript.
Right out of the gate, Go 1.18 is getting central processing unit speed performance boost of up to 20% for Apple M1, ARM64 and PowerPC64 chips. This is all from an expansion of Go 1.17’s calling conventions for the application binary interface on these processor architectures.
The next thing that Go 1.18 has added is the concept of generic support for functions. That’s useful because Go, as a statically typed language, must have all variables defined ahead of time. These defined variables must also happen when they are being passed into functions to be processed. That can become a disadvantage when writing code for processing data, for example producing the sum of an array of types.
Without generics, different functions would need to be written to process each of the different types, be they bytes, integers, floating points or the like. However, with a generic function, it’s now possible to pass data structures in a generic form where all the types can be factored out afterward. As a result, only one function needs to be written to do all the heavy lifting for the developer within. More details are available in the release notes and a tutorial.
Generics came out in the 1.18 preview in December, and the team intends for the design to be fully reverse-compatible. However, as a brand-new language feature, it could still have unexpected or unspecified behaviors or bugs that may need to be addressed down the line that might break compatibility, the team warned.
Another milestone with 1.18 includes the full integration of fuzzing into the Go toolchain. Fuzzing is a type of automated testing that throws random data at the inputs of the program with the intent of crashing it or causing unexpected behavior. The objective of fuzzing is to aid the programmer in discovering potential exploits or edge cases where the code could be vulnerable that could be easily missed through standard testing.
Examples of vulnerabilities that could be detected via fuzzing are SQL code injections, buffer overflows, cross-site scripting attacks and other exploits that attack out of band inputs. More details are also available in the Go 1.18 release notes and there is a tutorial available as well.
THANK YOU