package main

import (
	"fmt"
	"slices"
)

func main() {
	// section: example
	numbers := []int{1, 2, 3}
	fmt.Printf("Original: len=%d, cap=%d, slice=%v\n",
		len(numbers), cap(numbers), numbers)

	// Grow increases capacity by at least n elements
	numbers = slices.Grow(numbers, 10)
	fmt.Printf("After Grow(10): len=%d, cap=%d, slice=%v\n",
		len(numbers), cap(numbers), numbers)

	// This is useful when you know you'll be appending many elements
	// It pre-allocates capacity to avoid multiple reallocations
	// section: example
}
