← All insightsAutomation

Automating Go for DevOps from scratch

CodeWizard Academy · 8 October 2025 · 3 min read · Intermediate

Anything you do to Go for DevOps twice should be automated. This walks the path from a manual install to a repeatable, pipeline-driven setup.

1. Install it reproducibly

bash
# install via your package manager or from go.dev/dl
go version
go mod init github.com/acme/tool

2. Describe the desired state

A tiny HTTP health server with graceful shutdown.

go
package main

import (
  "net/http"
  "log"
)

func main() {
  http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("ok"))
  })
  log.Fatal(http.ListenAndServe(":8080", nil))
}

3. Run it from CI

Build, vet and test in CI.

yaml
- uses: actions/setup-go@v5
  with: { go-version: '1.22', cache: true }
- run: go vet ./... && go test ./... -race -cover

Want senior help putting Go for DevOps to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult