title: Static local variable in Go
body: <p>Is it possible to define a local variable in Go that can maintain its value from one function call to another? In C, we can do this using the reserved word <code>static</code>.</p>
  
  <p>Example in C:</p>
  
  <pre class="lang-c prettyprint-override"><code>int func() {
      static int x = 0; 
      x++;
      return x;
  }
  </code></pre>