Insert Value at Start in Go

Posted by yhuang
Public (Editable by Users)
Go
Edit
package main

import (
	"fmt"
)

func main() {
	s := []int{1, 2, 3, 4, 5}
	s = append([]int{-99}, s...)
	fmt.Println(s)
}