Skip to main content

ADR-001: Go as Primary Language

Status: Accepted Date: 2026-04-04

Context

Consul Guardian needs a programming language for implementation. The team has deep .NET expertise, but the tool targets the DevOps and infrastructure ecosystem where Go is the dominant language. Consul itself, Terraform, Nomad, and most HashiCorp tooling is written in Go.

Decision

Use Go as the primary language for Consul Guardian.

Consequences

Positive

  • Single binary deployment. No runtime dependency. Copy the binary to a server and run it.
  • Native Consul ecosystem compatibility. The official Consul client library (hashicorp/consul/api) is Go-first. No SDK translation layer needed.
  • Goroutines for concurrent watchers. Each KV prefix gets its own blocking query goroutine. Go's concurrency model handles this cleanly without thread pool tuning.
  • Cobra + Viper CLI patterns. Industry-standard CLI framework used by kubectl, docker, gh, and most Go CLI tools.
  • Trivial cross-compilation. GOOS=linux GOARCH=amd64 go build produces a Linux binary from macOS.
  • Small Docker images. The final Alpine-based image is under 30MB.

Negative

  • The team needs to learn Go (coming from a senior .NET background).
  • A .NET SDK for consumers will be a separate effort.
  • Existing .NET libraries cannot be reused directly.

Alternatives Considered

LanguageProsCons
.NETTeam expertise, mature ecosystemHeavier runtime, less DevOps ecosystem fit, larger Docker images
RustBest performance, memory safetySteeper learning curve, slower development velocity
PythonFastest prototypingNo single binary, GIL limits concurrency, runtime dependency