title: Returning a pointer on stack
body: <p>In C when I return a pointer of a stack-created variable from a function, the memory discards after the function is returned, thus making the pointer impossible to dereference. But in Go, the compiler is not giving me any errors. Does that mean that this is safe to do?</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  )
  
  func main() {
      fmt.Println(*(something()))
  }
  
  func something() *string {
      s := "a"
      return &amp;s
  } 
  </code></pre>