package main import ( "container/vector" "fmt" ) func main() { vec := vector.New(0) vec.Push("apple") vec.Push("banana") vec.Push("cherry") fmt.Println(vec.Len()) // Output: 3 }
package main import ( "container/vector" "fmt" ) func main() { vec := vector.New(0) fmt.Println(vec.Len()) // Output: 0 }In this example, we create a new vector using `vector.New` but don't push any values into it. We then call the `Len` method to get the length of the vector, which is 0. Package library: `container`.