All languages

Go for DevOps

You're viewing a free preview. Sign in free to read every script.

Why this exists DevOps tools generate files constantly: nginx or Prometheus configuration from a service list, Kubernetes manifests, an HTML status page. Go's text/template package does this well, and embed puts the…

Generating Config Files and Reports with text/template and embed

Render configuration and HTML reports from data using Go templates: embedding template files in the binary, custom functions, failing on missing keys, choosing text/template versus html/template, and writing the output atomically.

Sign in free to read this script, along with the rest of the library.

Sign in free