Go是否在C ++中提供像memmove这样的功能

I searched online, and found runtime package has this function but it's unexported.

Does Golang have something like memmove in C++?

void * memmove ( void * destination, const void * source, size_t num );

I believe copy is what you are looking for.

src := []byte("some data")
dst := make([]byte, len(src))
copy(dst, src)

println(string(dst)) // prints 'some data'

Finally, I decided to use Cgo. It may lose type safety benefits by calling C. But I can not find any native go code solution.

//#include <string.h>
import "C"
import "unsafe"

func Memmove(src, dest unsafe.Pointer, length int) {
    C.memmove(dest, src, C.size_t(length))
}