This commit is contained in:
pyihe
2022-08-15 15:00:04 +08:00
parent 65dfb49f35
commit 36122134d1
2 changed files with 9 additions and 1 deletions

View File

@@ -7,6 +7,14 @@ import (
"github.com/pyihe/go-pkg/errors"
)
func Copy(src []byte) (b []byte) {
if len(src) > 0 {
b = make([]byte, len(src))
copy(b, src)
}
return
}
func Int64(b []byte) (v int64, err error) {
if len(b) == 0 {
return