From 4474e9151c5f708c006ed9a9f1bdcddb1d54cf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 12 Jun 2023 18:43:14 +0800 Subject: [PATCH] clean code --- array.go | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/array.go b/array.go index 01d6553..5845aa8 100644 --- a/array.go +++ b/array.go @@ -36,8 +36,8 @@ type ArrayType struct { value interface{} convertResult []interface{} convertErr error - isSimpleSlice bool - itemType reflect.Kind + isSimpleSlice bool // 是否简单list, 即数据的每一项类型相同, 且都是基础内置数据类型 + itemType reflect.Kind // 简单list场景下, 每一项的数据类型 } // IsNil 输入是否为nil @@ -205,40 +205,12 @@ func (at *ArrayType) Convert() { } } -// IsSimpleSlice 是否简单list, 即数据的每一项类型相同, 且都是基础内置数据类型 -// -// Author : go_developer@163.com<白茶清欢> -// -// Date : 17:50 2023/6/12 -func (at *ArrayType) IsSimpleSlice() bool { - if at.ItemIsInterface() { - // 每一项都是interface - return false - } - switch at.value.(type) { - case []int8: - case []int16: - case []int32: - case []int64: - case []int: - case []uint: - case []uint8: - case []uint16: - case []uint32: - case []uint64: - case []float32: - case []float64: - case []bool: - - } - return false -} - // Unique 对数据结果进行去重 // // Author : go_developer@163.com<白茶清欢> // // Date : 17:43 2023/6/12 func (at *ArrayType) Unique() []interface{} { + return []interface{}{} }