title: How to delete an element from a Slice in Golang
body: <pre><code>fmt.Println("Enter position to delete::")
  fmt.Scanln(&amp;pos)
  
  new_arr := make([]int, (len(arr) - 1))
  k := 0
  for i := 0; i &lt; (len(arr) - 1); {
      if i != pos {
          new_arr[i] = arr[k]
          k++
          i++
      } else {
          k++
      }
  }
  
  for i := 0; i &lt; (len(arr) - 1); i++ {
      fmt.Println(new_arr[i])
  }
  </code></pre>
  
  <p>I am using this command to delete an element from a Slice but it is not working, please suggest.</p>