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

Function normalizeArray

pkg/util/json.go:168–174  ·  view source on GitHub ↗

normalizeArray 处理数组

(v reflect.Value)

Source from the content-addressed store, hash-verified

166
167// normalizeArray 处理数组
168func normalizeArray(v reflect.Value) any {
169 result := make([]any, v.Len())
170 for i := 0; i < v.Len(); i++ {
171 result[i] = normalizeValue(v.Index(i))
172 }
173 return result
174}
175
176// normalizeStruct 处理结构体
177// 注意:Go 的 json.Marshal 对结构体已经是确定性的(按字段定义顺序)

Callers 1

normalizeValueFunction · 0.85

Calls 3

normalizeValueFunction · 0.85
IndexMethod · 0.80
LenMethod · 0.65

Tested by

no test coverage detected