FrontInterfaceCenter/internal/pkg/helper/convert.go

11 lines
262 B
Go

package helper
import "github.com/duke-git/lancet/v2/slice"
func SliceConvertSlice[O int | int32 | int64 | int8, T int | int32 | int64 | int8](inputSlice []T) []O {
output := slice.Map(inputSlice, func(_ int, item T) O {
return O(item)
})
return output
}