aboutsummaryrefslogtreecommitdiff
path: root/lib/bytes/bytes.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-01-22 21:33:10 +0700
committerShulhan <ms@kilabit.info>2025-01-22 21:34:16 +0700
commit360cd7bdc721c2aa968e2f6888db1c7e36538ae2 (patch)
tree08c6610214a4da1b54707231c235e81127deeae6 /lib/bytes/bytes.go
parentcdf43c8a97f6fbe7548aa45d3ce2680bdeb70e36 (diff)
downloadpakakeh.go-360cd7bdc721c2aa968e2f6888db1c7e36538ae2.tar.xz
lib/bytes: replace Copy and Concat with standard library
Since Go 1.20, the standard bytes package have the Copy function. Since Go 1.22, the standard slices package have the Concat function.
Diffstat (limited to 'lib/bytes/bytes.go')
-rw-r--r--lib/bytes/bytes.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/bytes/bytes.go b/lib/bytes/bytes.go
index 3bbf529b..76bb7874 100644
--- a/lib/bytes/bytes.go
+++ b/lib/bytes/bytes.go
@@ -71,31 +71,6 @@ func AppendUint64(data []byte, v uint64) []byte {
return data
}
-// Concat merge one or more []byte or string in args into slice of
-// byte.
-// Any type that is not []byte or string in args will be ignored.
-func Concat(args ...interface{}) (out []byte) {
- for _, arg := range args {
- switch v := arg.(type) {
- case string:
- out = append(out, []byte(v)...)
- case []byte:
- out = append(out, v...)
- }
- }
- return out
-}
-
-// Copy slice of bytes from parameter.
-func Copy(src []byte) (dst []byte) {
- if len(src) == 0 {
- return
- }
- dst = make([]byte, len(src))
- copy(dst, src)
- return
-}
-
// CutUntilToken cut text until we found token.
//
// If token found, it will return all bytes before token, position of byte