1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

feat: add deprecat IntSlice, InterfaceSlice and StringSlice

This commit is contained in:
dudaodong
2022-12-03 14:00:44 +08:00
parent 0a8058956f
commit 18914ee2cd

View File

@@ -437,6 +437,7 @@ func Repeat[T any](item T, n int) []T {
}
// InterfaceSlice convert param to slice of interface.
// This function is deprecated, use generics feature of go1.18+ for replacement
func InterfaceSlice(slice any) []any {
sv := sliceValue(slice)
if sv.IsNil() {
@@ -452,6 +453,7 @@ func InterfaceSlice(slice any) []any {
}
// StringSlice convert param to slice of string.
// This function is deprecated, use generics feature of go1.18+ for replacement
func StringSlice(slice any) []string {
v := sliceValue(slice)
@@ -468,6 +470,7 @@ func StringSlice(slice any) []string {
}
// IntSlice convert param to slice of int.
// This function is deprecated, use generics feature of go1.18+ for replacement
func IntSlice(slice any) []int {
sv := sliceValue(slice)