Introduction

Did you ever wanted to program go in AIX ? Now you can.

Installing GoLang on AIX

First, add /opt/freeware/bin to the beginning of the current PATH. For example:

export PATH=/opt/freeware/bin:$PATH

Next install Go on AIX (and increase /opt and /var sizes if needed):

chfs -a size=+512M /opt
chfs -a size=+260M /var
dnf install golang

Create a sample program

Next, let’s create a sample Go Hello World program:

package main

import "fmt"

func main() {
    fmt.Println("hello world")
}

Building and running the program

First, lets’s initialize the main module

go mod init example.com/main

Next, let’s build it for AIX:

GOOS=aix GOARCH=ppc64 go build hello-world.go

If everything it’s ok, now we can run it:

./hello-world