Closed latifuluman closed 4 years ago
I solved it without using sjson, but using recursive function like following:
func changePassword(myMap map[string]interface{}) {
for key, value := range myMap {
if key == "password" {
myMap [key] = "******"
}
if _, ok := value.(map[string]interface{}); ok {
changePassword(value.(map[string]interface{}))
}
}
}
I have an unstructured dynamic object. So I can not know the path. It is like following: {
I want to edit password values to "secret", but in my program I dont know the path. Can I use prefix-posfix etc... How can i handle this problem?