How to delete struct object in go? : <p>Let's say I have the following struct:</p>

<pre><code>type Person struct {
    name string
    age  int
}
</code></pre>

<p>If I make an object of that struct</p>

<pre><code>person1 := Person{name: "Name", age: 69}
</code></pre>

<p>If I set this object to nil </p>

<pre><code>person1 = nil
</code></pre>

<p>it doesn't work, in fact it's a type assignment error, but it works for maps and slices. So, how otherwise would I remove the object i.e deallocate? I looked at the documentation for delete builtin but it removes an entry from a given map. Thanks.</p>
