Skip to content

Commit

Permalink
refactor: Slightly improve variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
TwiN committed Jun 8, 2024
1 parent f1518cb commit bd0134d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...)
}

0 comments on commit bd0134d

Please sign in to comment.