I came up with a way to pad leading zeros into a Go string. I'm not sure if this is the way you do this in Go. Is there a proper way to do this in Go? This is what I came up with and can be found inside the second if block. I tried Google to see if it had something built in without luck.
func integerToStringOfFixedWidth(n int, w int) string {
s := strconv.Itoa(n)
l := len(s)
if …Run Code Online (Sandbox Code Playgroud)