From 18914ee2cd8ccde0b8ed80e73b286977c3e5c5bb Mon Sep 17 00:00:00 2001 From: dudaodong Date: Sat, 3 Dec 2022 14:00:44 +0800 Subject: [PATCH] feat: add deprecat IntSlice, InterfaceSlice and StringSlice --- slice/slice.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slice/slice.go b/slice/slice.go index a175387..8a33d32 100644 --- a/slice/slice.go +++ b/slice/slice.go @@ -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)