Why does append modify passed slice
<p>How could I iterate through the slice and pass somewhere the slice except the current element? Seems <strong>append()</strong> function modifies the underlying slice as we could see in documentation. But anyway I still don't know how to reach this.</p>

<pre><code>func main() {
    args := []string{ "2", "3", "8" }

    for i, _ := range args {
        fmt.Println(append(args[:i], args[i+1:]...)) // or pass to function
    }

    fmt.Println(args)
}
</code></pre>

<p>result:</p>

<pre><code>[3 8]
[3 8]
[3 8]
[3 8 8] // it is args now
</code></pre>

<p>what I expect:</p>

<pre><code> [3 8]
 [2 8]
 [2 3]
</code></pre>

<p>I already saw this <a href="https://stackoverflow.com/questions/17395261/why-does-append-modify-the-provided-slice-see-example">Why does append() modify the provided slice? (See example)</a></p>

<p>but what is the <strong>Capacity</strong> of the slice is the secret for me, and I dont understand why did I exceed it.</p>