Golang: Implementing subcommands for command line applications

Golang flag package provides flag and subcommand parsing of command line arguments. Basic flags are available for most of the buildin data types (string, integer, boolean and time.Duration). To declare a string flag username with a default value root and short description, you should use the following code: package main import "flag" import "fmt" func main() { username := flag.String("user", "root", "Username for this server") flag.Parse() fmt.Printf("Your username is %q.", *username) } Once all flags are declared, call flag....

July 4, 2015 · 2 min · Svetlin Ralchev

SSL support for Busybox docker containers

I am running my official website and this blog on busybox docker containers. I noticed today that this image does not support certificate trust stores and therefore cannot request an SSL-enabled web services. My website is using Google recaptcha to handle spam requests on its contact form. However, the website throws the following exception when recaptch API is requested: x509: failed to load system roots and no roots provided First approach would be to use COPY command to load the certificate store bundle in to the image....

April 23, 2015 · 1 min · Svetlin Ralchev