@@ -157,7 +157,7 @@ func Format(template string, args ...any) string {
157157 // 2.2 Segment formatting
158158 if ! isEven {
159159 j += repeatingOpenBrackets - 1
160- argNumber := - 1
160+ var argNumber int
161161 var err error
162162 var argFormatOptions string
163163 if len (argNumberStr ) == 1 {
@@ -185,9 +185,6 @@ func Format(template string, args ...any) string {
185185 }
186186 if argNumber < 0 {
187187 argNumber , err = strconv .Atoi (argNumberStr )
188- if err == nil {
189- //rawWrite = false
190- }
191188 }
192189 }
193190
@@ -410,7 +407,7 @@ func FormatComplex(template string, args map[string]any) string {
410407
411408 arg , ok = args [argKey ]
412409 }
413- if ok || ( argFormatOptions != "" && ! ! repeatingOpenBracketsCollected ) {
410+ if ok || argFormatOptions != "" {
414411 // get number from placeholder
415412 strVal := ""
416413 if arg != nil {
@@ -542,13 +539,12 @@ func getItemAsStr(item *any, itemFormat *string) string {
542539 dividerVal , err := strconv .ParseFloat (dividerStr , 32 )
543540 if err == nil {
544541 // 1. Convert arg to float
545- val := (* item ).(interface {})
546542 var floatVal float64
547- switch val .(type ) {
543+ switch ( * item ) .(type ) {
548544 case float64 :
549- floatVal = val .(float64 )
545+ floatVal = ( * item ) .(float64 )
550546 case int :
551- floatVal = float64 (val .(int ))
547+ floatVal = float64 (( * item ) .(int ))
552548 default :
553549 floatVal = 0
554550 }
@@ -566,10 +562,11 @@ func getItemAsStr(item *any, itemFormat *string) string {
566562
567563 // slice processing converting to {item}{delimiter}{item}{delimiter}{item}
568564 slice , ok := (* item ).([]any )
565+ //nolint:ineffassign
569566 if ok {
570567 if len (slice ) == 1 {
571568 // this is because slice in 0 item contains another slice, we should take it
572- slice , ok = slice [0 ].([]any )
569+ slice , _ = slice [0 ].([]any )
573570 }
574571 return SliceToString (& slice , & separator )
575572 } else {
0 commit comments