JRJürgen Ryannelincode-harmony.hashnode.dev·Jan 29 · 16 min readTesting Go CLI Applications: A Comprehensive GuideUnit Testing and Testscript Approaches for Robust Command-Line Tools Version: 1.0Date: January 2025Author: Technical Documentation Executive Summary Command-line interface (CLI) applications built with Go present unique testing challenges. Unlike w...00
JRJürgen Ryannelincode-harmony.hashnode.dev·Jan 3, 2023 · 2 min readGO 04 - Using Chi routerA program that uses two routes for the conversion of Fahrenheit to Celsius using the chi router and standard HTTP package. package main import ( "fmt" "net/http" "strconv" "github.com/go-chi/chi" ) func fahrenheitToCelsius(fahrenhe...00
JRJürgen Ryannelincode-harmony.hashnode.dev·Jan 3, 2023 · 2 min readGO 03 - HTTP ServerHere is a simple program that starts an HTTP server and listens for requests on port 8080. When the server receives a request, it checks the path of the request to determine whether to convert a temperature from Fahrenheit to Celsius, or from Celsius...00
JRJürgen Ryannelincode-harmony.hashnode.dev·Jan 2, 2023 · 2 min readGo 02 - Parse command line flagsA go program to convert temperatures from and to Fahrenheit using command line flags. Simple Program A simple program that allows you to convert temperatures between Fahrenheit and Celsius using command line flags: package main import ( "fmt" ...00
JRJürgen Ryannelincode-harmony.hashnode.dev·Jan 2, 2023 · 2 min readGo 01 - Convert temperaturesConvert Fahrenheit to Celsius Here is a simple function that takes a temperature in Fahrenheit and returns the equivalent temperature in Celsius: func fahrenheitToCelsius(fahrenheit float64) float64 { return (fahrenheit - 32) * 5/9 } This functi...00