A vector is a one-dimensional array that is often used for storing data. Go originally had a container/vector implementation, but this was removed on 18 October 2011, as slices were deemed more idiomatic for vector use in Go. The functionality provided by the built-in slice gives plenty of vector manipulation help. A slice would be a row vector, or 1 × m matrix, implementation. A simple row vector looks as follows:
As you can see, we have a 1 × m matrix. To implement a simple row vector in Go, we can use a slice representation, like so:
v := []int{0, 1, 2, 3}
This is an easy way to portray a simple row vector using Go's built-in functionality.