Go on z/OS - Group home

IBM Open Enterprise SDK for Go 1.22 (on-prem and container image) is now available!


Go 1.22 emerges as an exceptional release by addressing an enduring loop variable issue. This update rectifies the loop variable oversight and introduces several enhancements that streamline code execution and enhance developer productivity. The new syntactic sugar for iterating over integers feature simplifies and beautifies code, making it more elegant and readable. In addition, the introduction of a new math/rand/v2 package for handling random numbers facilitates more efficient and versatile random number generation.

  • Profile-guided Optimization (PGO) builds can now de-virtualize a higher proportion of calls than previously possible. Most programs form a representative set of Go programs now see between improvement from enabling PGO. The compiler now interleaves devirtualization and inlining, so interface method calls are better optimized
  • The runtime now keeps type-based garbage collection metadata nearer to each heap object, improving the CPU performance (latency or throughput) of Go programs. This change also reduces the memory overhead of the majority of Go programs by deduplicating redundant metadata
  • “For” loops may now range over integers reducing bugs
  • Pattern-based HTTP routing: this enhancement empowers developers to create more expressive and flexible web applications, streamlining the routing process and improving overall code organization
  • One improvement is for the Trace Tool’s web UI (user interface) which is refreshed to support the new tracer. The web UI now supports exploring traces in a thread-oriented view. The trace viewer now also displays the full duration of all system calls
  • Other improvements are made in the toolchains and minor changes to the library

Reference: https://tip.golang.org/doc/go1.22

New features in Open Enterprise SDK for Go 1.22 from IBM include the following (z/OS specific updates)

  • Supporting sys calls available in z/OS 3.1: Also in Open Enterprise SDK for Go 1.22 is support for more than 50 additional Linux-like system calls which were introduced in z/OS 3.1. For example InotifyAddWatch, Futimesat, Getxattr, Openat, etc. With the support of these additional system calls, developers of Go applications can now efficiently port packages and modules originally written for Linux to z/OS
  • CGO call backs: CGO callbacks is a new feature in Open Enterprise SDK for Go 1.22. While CGO has always allowed Go to call a C program, CGO callbacks now enables a C program called from Go, to call back to the original Go program. For example, calling a C program to perform a quicksort, but providing a function written in Go as the comparator to the quicksort invocation written in C
  • A number of tools such as Github CLI and Github runner have been upstreamed to the z/OS Open Tools site. These tools are written in Go demonstrating how the Go language is becoming popular within z/OS. These tools are useful for not only Go users but for all users of z/OS. They can be found at the IBM z/OS Open Tools github site.

Go extends applications into modern cloud environments with the new Go container image option:

Users now have the capability to accelerate their transformation to greater portability and agility in a hybrid cloud environment using containers and Kubernetes orchestration for existing and new IBM z/OS applications and workloads.

Go extends applications into modern cloud environments. Go has emerged as the language of choice for many cloud native operations. It forms the foundation for container orchestration such as Kubernetes, containerization technology such as Open Container Initiative, and container application platforms such as OpenShift. As clients embark on their cloud native journey on z/OS, Go is essential for enabling new cloud workloads and connecting z/OS to their private cloud, strengthening z/OS as a first-class hybrid cloud platform.

With the orchestration of the Go container and container runtime for z/OS users can:

  • Increase speed from development to deployment of z/OS-based applications, users can worry less about the system setup/configuration
  • Increase predictability and repeatability across the application lifecycle for z/OS applications
  • Scaling and load balancing made easy, spread the load on different containers and processors
  • Enhance practices across z/OS development, testing, and operations through a wide ecosystem of open-source application container-based tools
  • With the release of IBM Open Enterprise SDK for Go 1.22, the Go compiler is now available as a container image in conjunction with the IBM z/OS Container Platform (5655-MC3). You are now able to develop Go applications and deploy them natively as container images in z/OS containers. 

Here are some resources you could use for the next steps: 

#golang #ApplicationModernization #IBMz/OSContainer #containers