title: Set an interface to nil in Golang
body: <p>I'm trying to set an internal value of an interface to <code>nil</code> something like the following :</p>
  
  <pre><code>typ := &amp;TYP{InternalState: "filled"}
  setNil(typ)
  
  fmt.Printf("Expecting that %v to be nil", typ)
  </code></pre>
  
  <p>And I need to know how to implement the <code>setNil(typ interface{})</code> method.</p>
  
  <p>For more details <a href="http://play.golang.org/p/W-0yw1NrD9" rel="nofollow noreferrer">see this code in play.golang.org</a>.</p>