mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-25 15:55:44 +00:00
.
This commit is contained in:
committed by
Adnan Zahir
parent
d41e16cab9
commit
ad815b3412
+19
@@ -0,0 +1,19 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"sync"
|
||||
)
|
||||
|
||||
// sync pools
|
||||
var (
|
||||
normalPool sync.Map
|
||||
poolInitializer = func(reflectType reflect.Type) FieldNewValuePool {
|
||||
v, _ := normalPool.LoadOrStore(reflectType, &sync.Pool{
|
||||
New: func() interface{} {
|
||||
return reflect.New(reflectType).Interface()
|
||||
},
|
||||
})
|
||||
return v.(FieldNewValuePool)
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user