From bacfa526966858c2f363f51bd03eeb7708f7c80d Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 10 Oct 2018 00:19:33 +0800 Subject: [PATCH] drop data if not use --- module/message-command/line-group.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module/message-command/line-group.go b/module/message-command/line-group.go index 7b723bb..6ce0095 100644 --- a/module/message-command/line-group.go +++ b/module/message-command/line-group.go @@ -350,6 +350,15 @@ func lottery(sub, txt string, s *lineobj.SourceObject) (res string) { for idx, val := range perm { dest[val] = arr[idx] } + defer func() { + for i := range perm { + dest[i] = nil + arr[i] = nil + } + dest = nil + arr = nil + perm = nil + }() data := dest[0]