Quick actions

cmd+k|ctrl+k

Navigation

Languages

copy slice to array

Snippet info

Language

Go

Visibility

public

Author

bingoohuang

Created

2019-04-29T09:48:30Z

Updated

2019-04-29T09:48:30Z

package main

import "fmt"

func main() {
	a := [2]string{
		"hello",
		"world",
	}
	b := []string{
		"goodbye",
		"world",
	}

	copy(a[:], b)

	fmt.Println(a)
}
INFO