I have a map
called nearby
func Delete(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
delete(nearby, params["id"])
}
I want to find out if the delete() call actually found a key to delete, I tried reading the return value:
func Delete(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
result := delete(nearby, params["id"])
}
but the compiler didn't like that - how can I find out if a key/val was deleted?