feat: Remove if inside loop from String()

This commit is contained in:
Marcell Martini 2020-12-27 18:19:33 -04:00
parent 98f9efbfb8
commit 08fdacc082
1 changed files with 2 additions and 8 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"flag"
"log"
"strings"
"os"
@ -14,14 +15,7 @@ import (
type multiValueFlag []string
func (f *multiValueFlag) String() string {
vs := ""
for i, v := range *f {
vs += v
if i < len(*f)-1 {
vs += ", "
}
}
return vs
return strings.Join([]string(*f), ", ")
}
func (f *multiValueFlag) Set(v string) error {