title: Remove and adding elements to array in GO lang
body: <p>I have 2 arrays declared as : 
  <code>var input []string</code> and <code>var output []string</code> . </p>
  
  <p>The input array is filled with some IDs initially. Output array is NULL.</p>
  
  <p>After every iteration I want to remove a random element from input array and add it to output array. </p>
  
  <p>At the end all the elements in output array will be same as input array (but with different ordering(indexing)). </p>
  
  <pre><code>for index := 0; index &lt; len(input); index++ {
      if !visited[index] {
          //do something
      }
  }
  output[#iteration index] = input[current index]
  </code></pre>
  
  <p>When I try to do this, I get <code>array out of bounds error</code>.</p>