I came across this in lecture notes:
setCollection := map[string]struct{}{
"uniqElement1": {},
"uniqElement2": {},
"uniqElement3": {},
}
As I understand, {} here represents the empty struct, but I never saw this before. Does this always mean an empty struct? Also, when can we use this notation? This code doesn't work:
setCollection["newElem"] = {}