基本的に[[Goは値渡し]]だが、[[スライス (Go)|スライス]]は[[参照の値渡し]]なので要注意。
```go
package main
import "fmt"
func destroySlice(s []int) {
s[0] = 65535
s[1] = 65535
}
func main() {
s := []int{1, 2, 3}
destroySlice(s)
fmt.Println(s)
// [65535 65535 3]
}
```
<button class="playground"><a href="https://go.dev/play/p/F1nspnBNLZD">Playground</a></button>