When we'd like to concatenates slices in Go, most people usually reach out for append. Most of the time this solution is OK, however if you need to squeeze more performance - copy will be better.
EDIT: As suggested, if you pre-allocate the slice to append it'll fast as well.
No comments:
Post a Comment