title: Do I need to set a map to nil in order for it to be garbage collected?
body: <p>Let's say I have a simple map with string as keytype and a self-defined struct as valuetype. Like this: <code>map[string]*struct</code></p>
  
  <p>I populate this map with a lot of different values and a lot of these values will never be used again after a certain period of time. </p>
  
  <p>So I wasn't sure whether the golang garbage collector will clean up my map for me or I need to do it myself. Then I came across this answer on a different question: <a href="https://stackoverflow.com/questions/23229975/is-it-safe-to-remove-selected-keys-from-golang-map-within-a-range-loop/23231539#23231539">Is it safe to remove selected keys from Golang map within a range loop?</a> </p>
  
  <p>This makes it look like the garbage collector won't do it for me and my only solution is to set my map to nil if i want to free up some memory every now and then.</p>
  
  <p>Is this true? Or is there another way to do it without losing values in my map that are not 'inactive'?</p>