This commit is contained in:
cdle
2021-09-15 17:48:01 +08:00
parent 6f1fe94e20
commit 883665bfbb
+6 -6
View File
@@ -9,23 +9,23 @@ import (
func init() {
AddCommand("", []Function{
{
Rules: []string{"set ? ?"},
Rules: []string{"set ? ? ?"},
Handle: func(s im.Sender) interface{} {
sillyGirl.Set(s.Get(0), s.Get(1))
Bucket(s.Get(0)).Set(s.Get(1), s.Get(2))
return "设置成功"
},
},
{
Rules: []string{"delete ?"},
Rules: []string{"delete ? ?"},
Handle: func(s im.Sender) interface{} {
sillyGirl.Set(s.Get(), "")
Bucket(s.Get(0)).Set(s.Get(1), "")
return "删除成功"
},
},
{
Rules: []string{"get ?"},
Rules: []string{"get ? ? ?"},
Handle: func(s im.Sender) interface{} {
v := sillyGirl.Get(s.Get())
v := Bucket(s.Get(0)).Get(s.Get(1))
if v == "" {
return errors.New("空值")
}