
Implement Your Own Tool Using HCL (Part 2)
This is the second part of my HCL series. You find the first part here (Part 1)
In the second post of my HCL series I want to extend our example with:
- Cobra Command-line
- Variables
- Functions
Cobra
Cobra is my favorite library to build command-line tools.
We start off with the example program from the first post (source).
As I write before I want to introduce you to the Cobra command-line tool. In order to use it we have to add a new import:
import (
“fmt”
“os”“github.com/spf13/cobra”
// …
)
I would love to cross-post the full article to medium but it is too much work to convert all the code samples into Gists to be displayed here. If you like to continue the tutorial then please visit the post here
Apologies for the inconvenience.