Question : golang prepend
Answered by : tired-termite-xg1l1kqp17md
package main
import "fmt"
func main () { data := []string{"A", "B", "C", "D"} data = append([]string{"Prepend Item"}, data...) fmt.Println(data) // [Prepend Item A B C D]
}
Source : https://codingair.wordpress.com/2014/07/18/go-appendprepend-item-into-slice/ | Last Update : Wed, 13 Apr 22