My Go cheatsheet

print struct with field names:

fmt.Printf("%+v\n", myStruct)

foreach

for key := range myArray {
}

check if key is in map

if val, ok := myMap["key"]; ok {
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *