gitlab.com/ethan.reesor/vscode-notebooks/yaegi@v0.0.0-20220417214422-5c573557938e/_test/append3.go (about)

     1  package main
     2  
     3  import "fmt"
     4  
     5  func main() {
     6  	a := []int{1, 2}
     7  	b := [2]int{3, 4}
     8  	fmt.Println(append(a, b[:]...))
     9  	fmt.Println(append(a, []int{5, 6}...))
    10  }
    11  
    12  // Output:
    13  // [1 2 3 4]
    14  // [1 2 5 6]