字符串拼接
package str import ( "strconv" ) func ToString(args ...interface{}) string { result := "" for _,arg := range args { switch val := arg.(type) { case int: result += strconv.Itoa(val) case string: result += val } } return result }使用ToString("abcd",12,45) => abcd1245 原文链接:https://www.f2er.com/go/191158.html