aboutsummaryrefslogtreecommitdiffstats
path: root/common/buffer/option.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/buffer/option.go')
-rw-r--r--common/buffer/option.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/buffer/option.go b/common/buffer/option.go
new file mode 100644
index 0000000..2e802e6
--- /dev/null
+++ b/common/buffer/option.go
@@ -0,0 +1,9 @@
+package buffer
+
+type Option func(*Buffer)
+
+func WithData(data []byte) Option {
+ return func(b *Buffer) {
+ b.buf = data
+ }
+}