title: Address of a temporary in Go?
body: <p>What's the cleanest way to handle a case such as this:</p>
  
  <pre><code>func a() string {
      /* doesn't matter */
  }
  
  b *string = &amp;a()
  </code></pre>
  
  <p>This generates the error:</p>
  
  <blockquote>
    <p>cannot take the address of a()</p>
  </blockquote>
  
  <p>My understanding is that Go automatically promotes a local variable to the heap if its address is taken. Here it's clear that the address of the return value is to be taken. What's an idiomatic way to handle this?</p>