From bd0134de09360bccf8bdc8aeb2e008a905d19d98 Mon Sep 17 00:00:00 2001 From: TwiN Date: Sat, 8 Jun 2024 12:49:24 -0400 Subject: [PATCH] refactor: Slightly improve variable naming --- auto.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/auto.go b/auto.go index db0324e..ea570d7 100644 --- a/auto.go +++ b/auto.go @@ -18,12 +18,11 @@ var colorsToRotate = []string{ // Example: // // println(Autof("Hello, %s.", "world")) -func Autof(format string, a ...any) string { - if len(a) == 0 { // || Reset == "" - return fmt.Sprintf(format, a...) +func Autof(format string, v ...any) string { + if len(v) == 0 { // || Reset == "" + return fmt.Sprintf(format, v...) } currentColorIndex, maxColorIndex := 0, len(colorsToRotate)-1 - //var coloredFormat string var insideSpecifier bool formatLength := len(format) var lastMergedIndex int @@ -65,5 +64,5 @@ func Autof(format string, a ...any) string { if lastMergedIndex < formatLength { sb.WriteString(format[lastMergedIndex:]) } - return fmt.Sprintf(sb.String(), a...) + return fmt.Sprintf(sb.String(), v...) }