mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-28 16:36:36 +08:00
使用KV存储实现指标统计
This commit is contained in:
@@ -18,8 +18,8 @@ func Append(b []byte, b2 ...byte) []byte {
|
||||
return append(Copy(b), b2...)
|
||||
}
|
||||
|
||||
// Contact bytes
|
||||
func Contact(b []byte, b2 ...[]byte) []byte {
|
||||
// Concat bytes
|
||||
func Concat(b []byte, b2 ...[]byte) []byte {
|
||||
b = Copy(b)
|
||||
for _, b3 := range b2 {
|
||||
b = append(b, b3...)
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestConcat(t *testing.T) {
|
||||
var prefix []byte
|
||||
prefix = append(prefix, 1, 2, 3)
|
||||
|
||||
var b = byteutils.Contact(prefix, []byte{4, 5, 6}, []byte{7})
|
||||
var b = byteutils.Concat(prefix, []byte{4, 5, 6}, []byte{7})
|
||||
t.Log(b)
|
||||
|
||||
a.IsTrue(bytes.Equal(b, []byte{1, 2, 3, 4, 5, 6, 7}))
|
||||
|
||||
Reference in New Issue
Block a user