Around Go: DevOps and reliability · 8 MIN READ

DevOps is a delivery feedback loop; Go builds its tools

Connect a service change to tests, delivery, operation and feedback, and choose a small automation project with a measurable outcome.

A DevOps engineer helps teams deliver and operate changes reliably. Go is useful for portable command-line tools, controllers, exporters and services. The work also involves Linux, networking, release ownership, incident response and collaboration. Start with one service and a repeatable feedback loop rather than collecting tool names.

Go for DevOps and reliability · A MAP OF THE IDEA

  1. Define a small contract
  2. Verify one artifact
  3. Observe the deployed result
  4. Feed evidence back

Useful when

  • Connect a service change to tests, delivery, operation and feedback, and choose a small automation project with a measurable outcome.
  • Make changes reviewable and verify the result against the original contract.

Watch out

  • A useful automation reduces repeated manual work while keeping changes bounded, observable and recoverable; its command count is not the success criterion.

Implementation & operation cost: Automation needs explicit ownership, bounded privileges, tests and recovery evidence; a shorter command is not sufficient.

01

Follow one change through the whole loop

Suppose a Go API must return a new optional JSON field. Write the observable contract and a compatibility test, inspect the current module/toolchain, build one immutable artifact, deploy it to an isolated environment, check a real request and useful telemetry, then promote the same artifact. A green build does not establish that the deployed route reaches the intended version. Record a source revision, artifact digest, target, rollout outcome and a recovery decision. Feedback from production should change the next test or design, rather than disappear into a chat message.

02

Use the existing foundation in a deliberate order

Before this unit, complete Command line: arguments, exit codes, processes, Git, HTTP and Linux services. Then study Containers and Kubernetes: images, persistent data, contexts, probes and rollouts. The modules lessons explain toolchain pins and build capacity; service-security and SQL lessons cover trust boundaries and transaction ownership. This unit joins those topics into an operational workflow. A disposable local service is enough for the first exercises; paid cloud resources, a public cluster and production credentials are unnecessary.

03

Choose toil that can be reduced safely

Write down a repeated task, its current frequency, failure modes and time cost. A useful first tool may validate a configuration, produce an inventory report or compare desired and observed state. Give it read-only credentials first. Require a reviewable plan before mutation, bounded work, cancellation, structured output and tests for partial failure. Measure whether the tool reduced repeated manual work without creating a new unowned service. Keep a simple script when it remains clear; move to Go when types, testing, concurrency or distribution make the contract easier to maintain.

04

Run a local evidence loop

These commands belong on a native development machine in a repository you control. Tests need independent assertions; vet and vulnerability checks answer different questions. A clean run cannot prove operational readiness, secrets hygiene or rollback safety.

bash
go version
go env GOMOD GOTOOLCHAIN
go test -count=1 ./...
go vet ./...
go build -trimpath -o ./build/service ./cmd/service
Read the code

Use the repository’s pinned toolchain and an explicitly reviewed working directory. Do not paste deployment or deletion commands into a production shell while exploring this lesson.

05

Your first operational contract

Create a small Go HTTP service in a disposable native environment. Define one successful request, a bounded shutdown, a health contract and one expected failure. Write a runbook containing the exact environment, observable symptom, first read-only checks, a reversible mitigation and how to verify recovery. Ask another person to follow it without undocumented credentials or shell history. The deliverable is a working feedback loop with evidence, not a claim to have completed every DevOps discipline.

06

Run the capstone model

Return to this capstone after completing the six DevOps readings. Download the complete lab, including independent tests and its README, from https://gopherforge.app/downloads/go-devops-capstone-20261106.zip. The default main.go below uses httptest recorders: it opens no socket and prints readiness 503, then 204, and version 200 with revision local-review. It can be explored in GopherForge. The optional -serve mode listens only on loopback and belongs in a native development environment. Liveness and readiness express different contracts; a successful health request does not prove a successful business operation.

go
package main

import (
	"context"
	"encoding/json"
	"errors"
	"flag"
	"fmt"
	"io"
	"log"
	"net"
	"net/http"
	"net/http/httptest"
	"os"
	"os/signal"
	"strings"
	"sync/atomic"
	"syscall"
	"time"
)

var buildRevision = "local-review"

func newService(revision string, ready *atomic.Bool) (http.Handler, error) {
	if strings.TrimSpace(revision) == "" || ready == nil {
		return nil, errors.New("revision and readiness owner are required")
	}
	mux := http.NewServeMux()
	mux.HandleFunc("GET /livez", func(w http.ResponseWriter, _ *http.Request) {
		w.WriteHeader(http.StatusNoContent)
	})
	mux.HandleFunc("GET /readyz", func(w http.ResponseWriter, _ *http.Request) {
		if !ready.Load() {
			http.Error(w, "not ready", http.StatusServiceUnavailable)
			return
		}
		w.WriteHeader(http.StatusNoContent)
	})
	mux.HandleFunc("GET /version", func(w http.ResponseWriter, _ *http.Request) {
		w.Header().Set("Content-Type", "application/json")
		if err := json.NewEncoder(w).Encode(map[string]string{"revision": revision}); err != nil {
			log.Printf("version response: %v", err)
		}
	})
	return mux, nil
}

func probe(handler http.Handler, method, path string) *httptest.ResponseRecorder {
	recorder := httptest.NewRecorder()
	handler.ServeHTTP(recorder, httptest.NewRequest(method, path, nil))
	return recorder
}

// The default demonstration opens no socket: it also works as a local model.
func demonstrate(out io.Writer, revision string) error {
	var ready atomic.Bool
	handler, err := newService(revision, &ready)
	if err != nil {
		return err
	}
	if _, err := fmt.Fprintln(out, "not ready:", probe(handler, "GET", "/readyz").Code); err != nil {
		return err
	}
	ready.Store(true)
	if _, err := fmt.Fprintln(out, "ready:", probe(handler, "GET", "/readyz").Code); err != nil {
		return err
	}
	version := probe(handler, "GET", "/version")
	_, err = fmt.Fprintf(out, "version: %d %s", version.Code, version.Body.String())
	return err
}

// Native development only. This owner joins its HTTP serving goroutine.
func serveOwned(ctx context.Context, listener net.Listener, handler http.Handler, ready *atomic.Bool) error {
	server := &http.Server{
		Handler: handler, ReadHeaderTimeout: 2 * time.Second,
		IdleTimeout: 30 * time.Second, WriteTimeout: 5 * time.Second,
		MaxHeaderBytes: 16 << 10,
	}
	finished := make(chan error, 1)
	ready.Store(true)
	go func() { finished <- server.Serve(listener) }()
	select {
	case err := <-finished:
		ready.Store(false)
		if errors.Is(err, http.ErrServerClosed) {
			return nil
		}
		return err
	case <-ctx.Done():
		ready.Store(false)
		shutdown, cancel := context.WithTimeout(context.Background(), 2*time.Second)
		defer cancel()
		err := server.Shutdown(shutdown)
		if err != nil {
			_ = server.Close()
		}
		serveErr := <-finished
		if err != nil {
			return err
		}
		if !errors.Is(serveErr, http.ErrServerClosed) {
			return serveErr
		}
		return nil
	}
}

func run(args []string, out io.Writer) error {
	flags := flag.NewFlagSet("service", flag.ContinueOnError)
	flags.SetOutput(io.Discard)
	serve := flags.Bool("serve", false, "listen in a native development environment")
	address := flags.String("addr", "127.0.0.1:8080", "explicit loopback address")
	revision := flags.String("revision", buildRevision, "reported build label")
	if err := flags.Parse(args); err != nil {
		return err
	}
	if flags.NArg() != 0 {
		return errors.New("unexpected positional argument")
	}
	if !*serve {
		return demonstrate(out, *revision)
	}
	var ready atomic.Bool
	handler, err := newService(*revision, &ready)
	if err != nil {
		return err
	}
	host, _, err := net.SplitHostPort(*address)
	ip := net.ParseIP(host)
	if err != nil || ip == nil || !ip.IsLoopback() {
		return errors.New("this lab listens only on an explicit loopback IP")
	}
	listener, err := net.Listen("tcp", *address)
	if err != nil {
		return err
	}
	defer listener.Close()
	ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
	defer stop()
	return serveOwned(ctx, listener, handler, &ready)
}

func main() {
	if err := run(os.Args[1:], os.Stdout); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}
Read the code

Run without flags first. newService owns route contracts, demonstrate drives readiness explicitly, and serveOwned owns the native HTTP serving goroutine. On cancellation it clears readiness, bounds HTTP shutdown to two seconds, closes on timeout and joins Serve. Application workers, hijacked connections and deployment traffic draining need their own owners; this example does not establish their shutdown. A revision label, which -revision can override, is not proof of binary identity.

07

Retain one verified artifact

In the downloaded lab, run ./verify.sh from a native development machine or a clean CI checkout with a reviewed Go 1.27 toolchain and C compiler for the race detector. The independent tests check response contracts, invalid input, readiness and native cancellation. Retain the generated executable, source manifest, toolchain, build information and executable digest together. Promote those exact bytes after verification; a later rebuild needs its own evidence. Source and artifact digests identify bytes; they are not signatures or trusted provenance attestations. Vulnerability checks, signing policy and deployment decisions remain separate gates.

bash
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
export GOTOOLCHAIN=local
mkdir -p build
go version > build/toolchain.txt
go test -race -count=1 ./...
go vet ./...
shasum -a 256 main.go main_test.go go.mod verify.sh > build/sources.sha256
source_id="$(shasum -a 256 build/sources.sha256 | cut -d ' ' -f 1)"
go build -trimpath -ldflags "-X main.buildRevision=$source_id" -o build/service .
shasum -a 256 build/service > build/service.sha256
go version -m build/service > build/buildinfo.txt
printf 'Verified one artifact. Review build/service.sha256 and retain these exact bytes.\n'
Read the code

The script stops on a failed test, race check, vet or build. It writes evidence into build/, embeds a source-manifest label and hashes the resulting native executable. These shell commands and -race do not run inside the app or browser WASI sandbox. The script performs no deployment.

08

Finish the capstone with evidence

The lab README gives exact commands and expected results. Add an optional service field while retaining the old revision contract: first observe a failing independent test, then fix the code and rerun verification. Demonstrate 503 → 204 → 503 readiness, an unknown route and rejected invalid configuration. Run the native cancellation test under the race detector. Record artifact identity and target, define an SLI event/window, and write a runbook another person can follow: symptom, read-only checks, reversible mitigation and recovery evidence. Describe compatibility and accepted-data handling before choosing rollback. The lab has no database or production load balancer, so it cannot prove data-migration safety, a production rollout or an SLO from a few local requests.

09

Offline capstone source: README.md

Complete file from the multi-file capstone. It is included in the course download for offline reading and copying. The default model runs in WASI; native server, race-detector and infrastructure exercises require your own disposable native environment. The linked ZIP is an optional convenience, not a prerequisite for reading these files offline.

text
# Go DevOps capstone: prove one service change

Complete the six GopherForge DevOps readings, then return to this lab. The goal is a small, reviewable delivery loop with evidence. Go builds the service and its checks; deployment, monitoring and recovery still need explicit owners.

## Run the local model

Use Go 1.27 with the toolchain version recorded in your evidence. The project has no third-party dependencies. From this directory:

```sh
go run .
```

Expected output:

```text
not ready: 503
ready: 204
version: 200 {"revision":"local-review"}
```

The default mode uses `httptest` recorders and opens no network socket. Copy `main.go` into GopherForge to explore that mode. Listening, process signals, shell commands and the race detector belong in a native development environment, outside the app/browser sandbox.

## Verify and retain one artifact

On a native machine with a supported C compiler for Go's race detector:

```sh
./verify.sh
./build/service
go version -m ./build/service
shasum -a 256 ./build/service
```

The script runs independent contract tests, a race check and `go vet`, records the toolchain and a source manifest, and builds one executable. It embeds the manifest digest in `/version` and records the binary digest. Keep `build/toolchain.txt`, `build/sources.sha256`, `build/buildinfo.txt` and `build/service.sha256` with that exact executable. A source digest is an identifier, not a signature or a trusted build attestation. The `-revision` flag can override the label; the label alone never proves binary identity.

The same `./verify.sh` command can be a CI step after a clean checkout and installation of the reviewed Go/C toolchains. Restrict the job to the permissions it needs. A vulnerability check, provenance/signing policy and deployment approval are separate gates; this script does not establish them.

## Inspect the native service

In one terminal, run the verified artifact on loopback:

```sh
./build/service -serve -addr 127.0.0.1:8080
```

In another terminal:

```sh
curl --fail --silent --show-error http://127.0.0.1:8080/version
curl --fail --silent --show-error -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8080/readyz
curl --silent --show-error -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8080/missing
```

Expect the recorded revision, `204`, and `404`. Stop the first terminal with Ctrl-C. The server owner clears readiness, gives HTTP shutdown two seconds, closes on timeout and joins its serving goroutine. It does not own hypothetical application workers or hijacked connections. A real deployment also needs traffic draining and explicit ownership of those resources. The test suite checks readiness transitions directly; this lab does not simulate a production load balancer.

## Acceptance checklist

1. Add an optional `service` field to `/version`. Keep an independent test for the existing `revision` field so older clients remain compatible. Change the test expectation first, observe failure, then implement the field and rerun verification.
2. Demonstrate invalid configuration, an unknown route and readiness changing from `503` to `204` and back. Explain why liveness and readiness are different contracts.
3. Run the native cancellation test under `-race`. Record the process exit and explain which goroutine is joined, the shutdown deadline and what still needs a separate owner.
4. Record the exact verified binary digest and target environment. Promote those bytes; rebuilding for a later environment creates a different artifact that needs new evidence. Never use the `/version` label as a substitute for the artifact digest.
5. Draft a runbook with an observable symptom, first read-only checks, a reversible mitigation and a recovery check. Specify the success/error event and time window you would measure for an SLI; three local requests do not establish an SLO.
6. Write a recovery decision for the optional-field change. Explain compatibility and accepted-data handling. This lab has no database; it cannot prove that rolling back a real data migration preserves writes. Have another person follow the runbook in an environment you control.

Keep a short evidence file with commands, observed outcomes, source and artifact identities, target and remaining limits. A green test run is one input to a release decision. It is not evidence of a production rollout or a complete DevOps qualification.
Read the code

Start with the stated acceptance contract and prerequisites. The documented commands form one repeatable evidence loop; local success still needs the separate isolated service deployment and recovery checks described in this lesson.

10

Offline capstone source: go.mod

Complete file from the multi-file capstone. It is included in the course download for offline reading and copying. The default model runs in WASI; native server, race-detector and infrastructure exercises require your own disposable native environment. The linked ZIP is an optional convenience, not a prerequisite for reading these files offline.

text
module example.com/gopherforge-devops-capstone

go 1.27.0
Read the code

The module path identifies this standalone exercise and the Go directive declares its language baseline. There are no third-party requirements, so the example can be inspected and compiled without fetching provider or deployment SDKs.

11

Offline capstone source: main.go

Complete file from the multi-file capstone. It is included in the course download for offline reading and copying. The default model runs in WASI; native server, race-detector and infrastructure exercises require your own disposable native environment. The linked ZIP is an optional convenience, not a prerequisite for reading these files offline.

go
package main

import (
	"context"
	"encoding/json"
	"errors"
	"flag"
	"fmt"
	"io"
	"log"
	"net"
	"net/http"
	"net/http/httptest"
	"os"
	"os/signal"
	"strings"
	"sync/atomic"
	"syscall"
	"time"
)

var buildRevision = "local-review"

func newService(revision string, ready *atomic.Bool) (http.Handler, error) {
	if strings.TrimSpace(revision) == "" || ready == nil {
		return nil, errors.New("revision and readiness owner are required")
	}
	mux := http.NewServeMux()
	mux.HandleFunc("GET /livez", func(w http.ResponseWriter, _ *http.Request) {
		w.WriteHeader(http.StatusNoContent)
	})
	mux.HandleFunc("GET /readyz", func(w http.ResponseWriter, _ *http.Request) {
		if !ready.Load() {
			http.Error(w, "not ready", http.StatusServiceUnavailable)
			return
		}
		w.WriteHeader(http.StatusNoContent)
	})
	mux.HandleFunc("GET /version", func(w http.ResponseWriter, _ *http.Request) {
		w.Header().Set("Content-Type", "application/json")
		if err := json.NewEncoder(w).Encode(map[string]string{"revision": revision}); err != nil {
			log.Printf("version response: %v", err)
		}
	})
	return mux, nil
}

func probe(handler http.Handler, method, path string) *httptest.ResponseRecorder {
	recorder := httptest.NewRecorder()
	handler.ServeHTTP(recorder, httptest.NewRequest(method, path, nil))
	return recorder
}

// The default demonstration opens no socket: it also works as a local model.
func demonstrate(out io.Writer, revision string) error {
	var ready atomic.Bool
	handler, err := newService(revision, &ready)
	if err != nil {
		return err
	}
	if _, err := fmt.Fprintln(out, "not ready:", probe(handler, "GET", "/readyz").Code); err != nil {
		return err
	}
	ready.Store(true)
	if _, err := fmt.Fprintln(out, "ready:", probe(handler, "GET", "/readyz").Code); err != nil {
		return err
	}
	version := probe(handler, "GET", "/version")
	_, err = fmt.Fprintf(out, "version: %d %s", version.Code, version.Body.String())
	return err
}

// Native development only. This owner joins its HTTP serving goroutine.
func serveOwned(ctx context.Context, listener net.Listener, handler http.Handler, ready *atomic.Bool) error {
	server := &http.Server{
		Handler: handler, ReadHeaderTimeout: 2 * time.Second,
		IdleTimeout: 30 * time.Second, WriteTimeout: 5 * time.Second,
		MaxHeaderBytes: 16 << 10,
	}
	finished := make(chan error, 1)
	ready.Store(true)
	go func() { finished <- server.Serve(listener) }()
	select {
	case err := <-finished:
		ready.Store(false)
		if errors.Is(err, http.ErrServerClosed) {
			return nil
		}
		return err
	case <-ctx.Done():
		ready.Store(false)
		shutdown, cancel := context.WithTimeout(context.Background(), 2*time.Second)
		defer cancel()
		err := server.Shutdown(shutdown)
		if err != nil {
			_ = server.Close()
		}
		serveErr := <-finished
		if err != nil {
			return err
		}
		if !errors.Is(serveErr, http.ErrServerClosed) {
			return serveErr
		}
		return nil
	}
}

func run(args []string, out io.Writer) error {
	flags := flag.NewFlagSet("service", flag.ContinueOnError)
	flags.SetOutput(io.Discard)
	serve := flags.Bool("serve", false, "listen in a native development environment")
	address := flags.String("addr", "127.0.0.1:8080", "explicit loopback address")
	revision := flags.String("revision", buildRevision, "reported build label")
	if err := flags.Parse(args); err != nil {
		return err
	}
	if flags.NArg() != 0 {
		return errors.New("unexpected positional argument")
	}
	if !*serve {
		return demonstrate(out, *revision)
	}
	var ready atomic.Bool
	handler, err := newService(*revision, &ready)
	if err != nil {
		return err
	}
	host, _, err := net.SplitHostPort(*address)
	ip := net.ParseIP(host)
	if err != nil || ip == nil || !ip.IsLoopback() {
		return errors.New("this lab listens only on an explicit loopback IP")
	}
	listener, err := net.Listen("tcp", *address)
	if err != nil {
		return err
	}
	defer listener.Close()
	ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
	defer stop()
	return serveOwned(ctx, listener, handler, &ready)
}

func main() {
	if err := run(os.Args[1:], os.Stdout); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}
Read the code

Trace the program from its bounded input through validation to the reported outcome. Read the explicit failure paths and ownership rules before changing the success case. The code models a delivery contract without acquiring real deployment authority.

12

Offline capstone source: main_test.go

Complete file from the multi-file capstone. It is included in the course download for offline reading and copying. The default model runs in WASI; native server, race-detector and infrastructure exercises require your own disposable native environment. The linked ZIP is an optional convenience, not a prerequisite for reading these files offline.

go
package main

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"net"
	"net/http"
	"sync/atomic"
	"testing"
	"time"
)

func TestReadinessAndVersionContract(t *testing.T) {
	var ready atomic.Bool
	handler, err := newService("reviewed-a1", &ready)
	if err != nil {
		t.Fatal(err)
	}
	if got := probe(handler, "GET", "/readyz").Code; got != 503 {
		t.Fatal(got)
	}
	if got := probe(handler, "GET", "/livez").Code; got != 204 {
		t.Fatal(got)
	}
	ready.Store(true)
	if got := probe(handler, "GET", "/readyz").Code; got != 204 {
		t.Fatal(got)
	}
	version := probe(handler, "GET", "/version")
	var payload map[string]string
	if err := json.Unmarshal(version.Body.Bytes(), &payload); err != nil {
		t.Fatal(err)
	}
	if version.Code != 200 || payload["revision"] != "reviewed-a1" || version.Header().Get("Content-Type") != "application/json" {
		t.Fatal(version, payload)
	}
	if got := probe(handler, "POST", "/version").Code; got != 405 {
		t.Fatal(got)
	}
	if got := probe(handler, "GET", "/missing").Code; got != 404 {
		t.Fatal(got)
	}
	ready.Store(false)
	if got := probe(handler, "GET", "/readyz").Code; got != 503 {
		t.Fatal(got)
	}
}

type failedWriter struct{}

func (failedWriter) Write([]byte) (int, error) { return 0, errors.New("output unavailable") }
func TestInvalidConfigurationAndOutputFailure(t *testing.T) {
	var ready atomic.Bool
	if _, err := newService(" ", &ready); err == nil {
		t.Fatal("blank revision accepted")
	}
	if _, err := newService("a1", nil); err == nil {
		t.Fatal("missing owner accepted")
	}
	for _, args := range [][]string{{"-typo"}, {"extra"}, {"-serve", "-addr", "0.0.0.0:8080"}} {
		if err := run(args, &bytes.Buffer{}); err == nil {
			t.Fatal("invalid input accepted", args)
		}
	}
	if err := demonstrate(failedWriter{}, "a1"); err == nil {
		t.Fatal("output failure hidden")
	}
	var out bytes.Buffer
	if err := run(nil, &out); err != nil {
		t.Fatal(err)
	}
	if out.String() != "not ready: 503\nready: 204\nversion: 200 {\"revision\":\"local-review\"}\n" {
		t.Fatal(out.String())
	}
}

func TestNativeServerJoinsAfterCancellation(t *testing.T) {
	listener, err := net.Listen("tcp", "127.0.0.1:0")
	if err != nil {
		t.Fatal(err)
	}
	defer listener.Close()
	var ready atomic.Bool
	handler, err := newService("native-test", &ready)
	if err != nil {
		t.Fatal(err)
	}
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()
	finished := make(chan error, 1)
	go func() { finished <- serveOwned(ctx, listener, handler, &ready) }()
	client := &http.Client{Timeout: 2 * time.Second}
	response, err := client.Get("http://" + listener.Addr().String() + "/version")
	if err != nil {
		cancel()
		t.Fatal(err)
	}
	response.Body.Close()
	if response.StatusCode != 200 {
		t.Fatal(response.StatusCode)
	}
	cancel()
	select {
	case err := <-finished:
		if err != nil || ready.Load() {
			t.Fatal(err, ready.Load())
		}
	case <-time.After(4 * time.Second):
		t.Fatal("server owner did not join")
	}
}
Read the code

The tests exercise independent success and failure cases against the public behavior of the model. Change an input or break an invariant to see a real failure, then restore the contract and rerun; a green result only establishes the behavior covered here.

13

Offline capstone source: verify.sh

Complete file from the multi-file capstone. It is included in the course download for offline reading and copying. The default model runs in WASI; native server, race-detector and infrastructure exercises require your own disposable native environment. The linked ZIP is an optional convenience, not a prerequisite for reading these files offline.

bash
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
export GOTOOLCHAIN=local
mkdir -p build
go version > build/toolchain.txt
go test -race -count=1 ./...
go vet ./...
shasum -a 256 main.go main_test.go go.mod verify.sh > build/sources.sha256
source_id="$(shasum -a 256 build/sources.sha256 | cut -d ' ' -f 1)"
go build -trimpath -ldflags "-X main.buildRevision=$source_id" -o build/service .
shasum -a 256 build/service > build/service.sha256
go version -m build/service > build/buildinfo.txt
printf 'Verified one artifact. Review build/service.sha256 and retain these exact bytes.\n'
Read the code

Run these checks from the exercise directory on an owned native environment with Go installed. The script stops on a failed check and records verification evidence. It never grants release permissions or proves the state of an external deployment.

TAKE THIS WITH YOU

Connect a service change to tests, delivery, operation and feedback, and choose a small automation project with a measurable outcome.

Check your understanding

Which sequence forms a DevOps delivery feedback loop?

Go to the source

Progress stays in this browser. No account needed.