Is there a stdlib equivalent of this method?
func Join(sep string, values ...interface{}) string {
strs := make([]string, len(values))
for i, v := range values {
strs[i] = fmt.Sprintf("%s", v)
}
return strings.Join(strs, sep)
}
The strings
package has a Join
method, but it only joins a string slice. I feel like the fmt package could have something like this, I don't know all the % variables that exist.