MCPcopy Create free account
hub / github.com/astercloud/aster / normalizeSlice

Function normalizeSlice

pkg/util/json.go:155–165  ·  view source on GitHub ↗

normalizeSlice 处理 slice

(v reflect.Value)

Source from the content-addressed store, hash-verified

153
154// normalizeSlice 处理 slice
155func normalizeSlice(v reflect.Value) any {
156 if v.IsNil() {
157 return nil
158 }
159
160 result := make([]any, v.Len())
161 for i := 0; i < v.Len(); i++ {
162 result[i] = normalizeValue(v.Index(i))
163 }
164 return result
165}
166
167// normalizeArray 处理数组
168func normalizeArray(v reflect.Value) any {

Callers 1

normalizeValueFunction · 0.85

Calls 3

normalizeValueFunction · 0.85
IndexMethod · 0.80
LenMethod · 0.65

Tested by

no test coverage detected