From 522d94e31e90762d23bbef4e2e2fb9a6bff92f9e Mon Sep 17 00:00:00 2001 From: siddontang Date: Wed, 29 Oct 2014 10:29:50 +0800 Subject: [PATCH] add go slice --- store/driver/slice.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 store/driver/slice.go diff --git a/store/driver/slice.go b/store/driver/slice.go new file mode 100644 index 0000000..d0c80e0 --- /dev/null +++ b/store/driver/slice.go @@ -0,0 +1,21 @@ +package driver + +type ISlice interface { + Data() []byte + Size() int + Free() +} + +type GoSlice []byte + +func (s GoSlice) Data() []byte { + return []byte(s) +} + +func (s GoSlice) Size() int { + return len(s) +} + +func (s GoSlice) Free() { + +}