jeudi 28 juillet 2016

GOlang - Check if JSON has multiple of the same key

I'm trying to see if a .json file has multiple of the same keys

"gauge1":{
    "name":"someName",
    "name":"someName1"
}

is there a way in go to check if the key 'name' in the json is used more than once? In go if you unmarshal the json file with multiple keys of the same name, it will rewrite the previously written key and gauge1.name will become someName1

Any help would be grateful thank you!

Aucun commentaire:

Enregistrer un commentaire