From aa7b89115062a25eaeb8b4f3c33ed3593348c55e Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 20 Jan 2022 17:29:38 +0800 Subject: [PATCH] chat log model update --- pkg/utils/map.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/utils/map.go b/pkg/utils/map.go index 05712fe64..fc24cc87d 100644 --- a/pkg/utils/map.go +++ b/pkg/utils/map.go @@ -121,6 +121,9 @@ func GetSwitchFromOptions(Options map[string]bool, key string) (result bool) { } return false } -func SetSwitchFromOptions(Options map[string]bool, key string, value bool) { - Options[key] = value +func SetSwitchFromOptions(options map[string]bool, key string, value bool) { + if options == nil { + options = make(map[string]bool, 5) + } + options[key] = value }