In this post, I will create a simple function that will allow you to ask the user a question, receive a valid response, and return it as a Boolean type. And if needed, the user will be able to tap Ctrl+C at any time to exit the program. Also importantly, despite using the operating system input, we will create unit tests for os.stdin.
This article will go through creating byte unit methods for both metric and binary prefixes. The two stringers will take a float64 value and round it with a metric unit.
This guide will show how simple it is to center text in a terminal or a text file using the Go standard and external libraries. We will create two functions,
NCenter, which provides for a width parameter, and a
Center func that will determine the center placement based on the width of the terminal screen.
One of the great things about the Go standard library is how easy it is to create a sophisticated tool using a small amount of code. In this entry, I will explain how to make a variable-length random string generator that can support any Unicode character.
Go is a strongly typed programming language, and many SQL databases also support unknown values. These unknowns can lead to complications in Go. Such as in this example, when a
NULL value is in use for an empty string, it throws the unhelpful error converting
NULL to string is unsupported.
In this guide, let’s go through the process of installing and configuring WordPress on a Docker container using docker-compose. The primary goals are to install a bare-bones install with the ability to customise
my.cnf. There is an expectation that you are familiar with Docker, WordPress, PHP and MySQL configuration files.