mirror of
https://gitee.com/johng/gf
synced 2026-07-04 21:03:13 +08:00
fix issue in New when creating concurrent-safety var for package gvar (#2573)
This commit is contained in:
@ -28,7 +28,7 @@ type Var struct {
|
||||
// The optional parameter `safe` specifies whether Var is used in concurrent-safety,
|
||||
// which is false in default.
|
||||
func New(value interface{}, safe ...bool) *Var {
|
||||
if len(safe) > 0 && !safe[0] {
|
||||
if len(safe) > 0 && safe[0] {
|
||||
return &Var{
|
||||
value: gtype.NewInterface(value),
|
||||
safe: true,
|
||||
|
||||
Reference in New Issue
Block a user