# Go "protoc-gen-go: program not found" - Fix in CI

> Fix protoc "protoc-gen-go: program not found or is not executable" in CI - the Go protobuf plugin is not installed or not on PATH. Install it and export GOBIN.

Source: https://latchkey.dev/learn/go/go-protoc-gen-go-not-found-in-ci  
Updated: 2026-06-26

protoc finds its plugins by looking for protoc-gen-<name> on PATH. When protoc-gen-go was never installed, or GOBIN is not on PATH, protoc cannot launch the Go generator.

## Diagnose it: toolchain, tags, or platform?

Go build failures that only appear in CI usually come from a different toolchain version, different build tags, or cross-compilation defaults that differ from your machine.

```Terminal
go version
go env GOOS GOARCH CGO_ENABLED GOFLAGS GOTOOLCHAIN

# build exactly what CI builds, verbosely
go build -v ./... 2>&1 | tail -40

# CGO is the usual difference: on by default locally, often off in a slim CI image
CGO_ENABLED=0 go build ./...
```

> A package that imports C fails only when `CGO_ENABLED=1`, and the default differs between environments and base images. Set it explicitly in CI rather than inheriting it.

## FAQ

### What causes Go "protoc-gen-go: program not found"?

There are 2 common causes: plugin not installed and gobin not on path. protoc-gen-go was never go installed in the runner, so protoc cannot find it.

### How do I fix Go "protoc-gen-go: program not found"?

There are 2 fixes depending on which cause you have: install the plugin and export path and pin the plugin version. Work through them in order, since the first is the most common.

### What does Go "protoc-gen-go: program not found" actually mean?

A protobuf codegen step fails with protoc-gen-go: program not found or is not executable.

### How do I stop Go "protoc-gen-go: program not found" happening again?

Install codegen plugins in CI before running protoc. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
