Create a Go slice using the make function for specific capacity or slice literals for immediate values.
Use the make function to create a slice with a specific length and capacity, or the slice literal syntax for immediate initialization.
// Create empty slice with length 3 and capacity 5
s1 := make([]int, 3, 5)
// Create slice initialized with values
s2 := []int{1, 2, 3}
// Create empty slice (length 0, capacity 0)
s3 := []int{}
A slice is a dynamic list of items that can grow or shrink as needed. You create one to store a collection of values like numbers or strings without knowing the final size in advance. Think of it as a flexible shopping list where you can add or remove items at any time.