Answers for "how to add keys in map golang"

Go
6

golang map has key

if val, ok := dict["foo"]; ok {
    //do something here
}
Posted by: Guest on February-23-2020
0

appending map into map golang

for _, note := range notes {
        thisNote := map[string]string{
            "Title":note.Title,
            "Body":note.Body,
        }

        content["notes"] = append(content["notes"], thisNote)
}
Posted by: Guest on November-01-2020

Browse Popular Code Answers by Language