title: How do I do a literal *int64 in Go?
body: <p>I have a struct type with a <code>*int64</code> field.</p>
  
  <pre><code>type SomeType struct {
      SomeField *int64
  }
  </code></pre>
  
  <p>At some point in my code, I want to declare a literal of this (say, when I know said value should be 0, or pointing to a 0, you know what I mean)</p>
  
  <pre><code>instance := SomeType{
      SomeField: &amp;0,
  }
  </code></pre>
  
  <p>...except this doesn't work</p>
  
  <pre><code>./main.go:xx: cannot use &amp;0 (type *int) as type *int64 in field value
  </code></pre>
  
  <p>So I try this</p>
  
  <pre><code>instance := SomeType{
      SomeField: &amp;int64(0),
  }
  </code></pre>
  
  <p>...but this also doesn't work</p>
  
  <pre><code>./main.go:xx: cannot take the address of int64(0)
  </code></pre>
  
  <p>How do I do this? The only solution I can come up with is using a placeholder variable</p>
  
  <pre><code>var placeholder int64
  placeholder = 0
  
  instance := SomeType{
      SomeField: &amp;placeholder,
  }
  </code></pre>
  
  <p><s>Note: the <code>&amp;0</code> syntax works <em>fine</em> when it's a *int instead of an <code>*int64</code>.</s> Edit: no it does not. Sorry about this.</p>
  
  <p>Edit:</p>
  
  <p>Aparently there was too much ambiguity to my question. I'm looking for a way to <em>literally state</em> a <code>*int64</code>. This could be used inside a constructor, or to state literal struct values, or even as arguments to other functions. But helper functions or using a different type are not solutions I'm looking for.</p>