From 3d02c3fb6704da4d21b09a57aabaae536b1ddbfe Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Wed, 11 Jul 2018 21:11:20 -0400 Subject: Add conv.ToStrings function Signed-off-by: Dave Henderson --- conv/conv.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'conv') diff --git a/conv/conv.go b/conv/conv.go index 01416125..e9e3033e 100644 --- a/conv/conv.go +++ b/conv/conv.go @@ -96,6 +96,15 @@ func ToString(in interface{}) string { return fmt.Sprint(in) } +// ToStrings - +func ToStrings(in ...interface{}) []string { + out := make([]string, len(in)) + for i, v := range in { + out[i] = ToString(v) + } + return out +} + // MustParseInt - wrapper for strconv.ParseInt that returns 0 in the case of error func MustParseInt(s string, base, bitSize int) int64 { i, _ := strconv.ParseInt(s, base, bitSize) -- cgit v1.2.3