You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
m, found, err:=nestedMapNoCopy(obj, true, fields...)
212
+
if!found||err!=nil||m==nil {
213
+
returnnil, found, err
214
+
}
215
+
strMap:=make(map[string]string, len(m))
216
+
fork, v:=rangem {
217
+
ifstr, ok:=v.(string); ok {
218
+
strMap[k] =str
219
+
} elseifv==nil {
220
+
strMap[k] =""
221
+
} else {
222
+
returnnil, false, fmt.Errorf("%v accessor error: contains non-string value in the map under key %q: %v is of the type %T, expected string", jsonPath(fields), k, v, v)
223
+
}
224
+
}
225
+
returnstrMap, true, nil
226
+
}
227
+
206
228
// NestedMap returns a deep copy of map[string]interface{} value of a nested field.
207
229
// Returns false if value is not found and an error if not a map[string]interface{}.
0 commit comments