gigibytes / golang-yaml-template-tutorial

A simple tutorial that shows how to replace values in a YAML file with values coming from another YAML file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

golang-yaml-template-tutorial

Go templating is a powerful feature provided by the Go programming language that allows you to generate text output by replacing placeholders (variables) in a template with their corresponding values. It's a convenient way to generate dynamic content, including YAML files.

Helm, a package manager for Kubernetes, utilizes Go templating to generate Kubernetes manifest files from templates.

In this tutorial we'll see how we can use Go templating to replace values in a YAML file with values from another YAML file, similar to what Helm does.

running it

$ make run

It will generate parsed/parsed.yaml file as a result of replacing placeholders in template/template.yaml with values coming from template/values.yaml.

unit tests

$ make test

unit test coverage

$ make coverage

About

A simple tutorial that shows how to replace values in a YAML file with values coming from another YAML file.

License:MIT License


Languages

Language:Go 93.9%Language:Makefile 6.1%