use go's native copy function instead of loop