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
# install via your package manager or from go.dev/dl
go version
go mod init github.com/acme/tool2. Describe the desired state
A tiny HTTP health server with graceful shutdown.
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.
- uses: actions/setup-go@v5
with: { go-version: '1.22', cache: true }
- run: go vet ./... && go test ./... -race -coverWant 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.