title: How to assign a value to the empty slice after the declaration
body: <p>I am trying to assign a value to the empty slice as follows.</p>
  
  <pre><code>func main() {
      var s []int
      fmt.Println(s, len(s), cap(s))
      s[0] = 99
  }
  </code></pre>
  
  <p>And it throws an exception,</p>
  
  <blockquote>
    <p>panic: runtime error: index out of range</p>
  </blockquote>
  
  <p>Note: 
  I know one way of doing this by initializing the value at declaration part as follows. But in the above example I am trying to assign a value after the declaration.</p>
  
  <pre><code>var s []int{99}
  </code></pre>
  
  <p>Is there a way to achieve this?</p>