diff --git a/context/attributes.go b/context/attributes.go index d440050..696fc83 100644 --- a/context/attributes.go +++ b/context/attributes.go @@ -16,8 +16,9 @@ type AttributeManagers struct { func (am *AttributeManagers) Init() { if nil == am.attributes { - am.attributes = make(map[string]interface{}) + am.Destroy() } + am.attributes = make(map[string]interface{}) } func (am *AttributeManagers) SetAttribute(key string, value interface{}) { @@ -62,7 +63,7 @@ func (am *AttributeManagers) Contains(key string) (exist bool) { } func (am *AttributeManagers) Destroy() { - if nil == am.attributes { + if nil != am.attributes { am.attributes = nil } }