aboutsummaryrefslogtreecommitdiff
path: root/concat
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-08 19:26:14 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-09 14:05:15 -0700
commit9c44621ee1ca9abfca79c593e80193afd9204c83 (patch)
tree03b438ebba58d1fb4a2a5460291ab2357be54fba /concat
parent9a75b7cbfa6fa37ed10732bbff8b722d652a1cdc (diff)
Replace custom slice concat func with slices.Concat
Diffstat (limited to 'concat')
-rw-r--r--concat/slices.go17
1 files changed, 0 insertions, 17 deletions
diff --git a/concat/slices.go b/concat/slices.go
deleted file mode 100644
index 88b9fae..0000000
--- a/concat/slices.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package concat
-
-// Slices is a utility function to make appending multiple slices less painful and more efficient
-// Source: https://stackoverflow.com/questions/37884361/concat-multiple-slices-in-golang
-func Slices(slices ...[]byte) []byte {
- var totalLen int
- for _, s := range slices {
- totalLen += len(s)
- }
- tmp := make([]byte, totalLen)
- var i int
- for _, s := range slices {
- i += copy(tmp[i:], s)
- }
-
- return tmp
-}