package
0.0.0-20190806085950-af561f6ff7a1
Repository: https://github.com/kylebanks/go-kit.git
Documentation: pkg.go.dev

# README

convert

-- import "github.com/KyleBanks/go-kit/convert/"

Package convert provides generalized type conversion utilities.

Usage

func IntSliceToStringSlice

func IntSliceToStringSlice(ints []int) []string

IntSliceToStringSlice converts a slice of ints to a slice of strings.

func SliceToStringSlice

func SliceToStringSlice(s []interface{}) []string

SliceToStringSlice converts a slice into a slice of their string representations.

func StringSliceToIntSlice

func StringSliceToIntSlice(strs []string) ([]int, error)

StringSliceToIntSlice accepts a slice of strings and returns a slice of parsed ints.

If any of the strings cannot be parsed to an integer, an error will be returned.

func UintSliceToStringSlice

func UintSliceToStringSlice(ints []uint) []string

UintSliceToStringSlice converts a slice of uints to a slice of strings.

# Functions

IntSliceToStringSlice converts a slice of ints to a slice of strings.
SliceToStringSlice converts a slice into a slice of their string representations.
StringSliceToIntSlice accepts a slice of strings and returns a slice of parsed ints.
UintSliceToStringSlice converts a slice of uints to a slice of strings.