-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsliceConversion.go
33 lines (26 loc) · 967 Bytes
/
sliceConversion.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package golist
import "github.com/emylincon/golist/core"
// ConvertToSliceFloat32 converts golist to []float32
func (arr *List) ConvertToSliceFloat32() ([]float32, error) {
return core.ConvertToFloat32(arr.list)
}
// ConvertToSliceFloat64 converts golist to []float64
func (arr *List) ConvertToSliceFloat64() ([]float64, error) {
return core.ConvertToFloat64(arr.list)
}
// ConvertToSliceInt64 converts golist to []int64
func (arr *List) ConvertToSliceInt64() ([]int64, error) {
return core.ConvertToInt64(arr.list)
}
// ConvertToSliceInt32 converts golist to []int32
func (arr *List) ConvertToSliceInt32() ([]int32, error) {
return core.ConvertToInt32(arr.list)
}
// ConvertToSliceInt converts golist to []int
func (arr *List) ConvertToSliceInt() ([]int, error) {
return core.ConvertToInt(arr.list)
}
// ConvertToSliceString converts golist to []string
func (arr *List) ConvertToSliceString() ([]string, error) {
return core.ConvertToString(arr.list)
}