remove response mutex
This commit is contained in:
parent
4e51d59f2f
commit
badf6dcf57
|
@ -12,23 +12,15 @@ func NewResponse() *Response {
|
|||
}
|
||||
|
||||
func (i *Response) Set(name string, value interface{}) {
|
||||
i.m.Lock()
|
||||
defer i.m.Unlock()
|
||||
|
||||
i.data[name] = value
|
||||
}
|
||||
|
||||
func (i *Response) Get(name string) interface{} {
|
||||
i.m.Lock()
|
||||
value, _ := i.data[name]
|
||||
i.m.Unlock()
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
func (i *Response) Dump() map[string]interface{} {
|
||||
i.m.Lock()
|
||||
defer i.m.Unlock()
|
||||
|
||||
return i.data
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package implement
|
|||
|
||||
import (
|
||||
"git.xdrm.io/go/aicra/err"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type Arguments map[string]interface{}
|
||||
|
@ -10,6 +9,5 @@ type Controller func(Arguments, *Response) Response
|
|||
|
||||
type Response struct {
|
||||
data map[string]interface{}
|
||||
m sync.Mutex
|
||||
Err err.Error
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue