title: How to clear sync.Map
body: <p>option 1:</p>
  
  <pre class="lang-golang prettyprint-override"><code>cache.Range(func(key, value interface{}) bool {
      cache.Delete(key)
      return true
  })
  </code></pre>
  
  <p>option 2:</p>
  
  <pre class="lang-golang prettyprint-override"><code>cache = sync.Map{}
  </code></pre>
  
  <p>I want to flush cache and <strong>option 1</strong> don't look good. </p>
  
  <p>But I am not sure that <strong>option 2</strong> is safe when other goroutine is <code>Storing</code> or <code>Loading</code>.</p>