return copies lock value: github.com/GoAdminGroup/go-admin/modules/config.Config contains sync.RWMutex
889 panic(err)
890 }
891
892 return cfg 893}
894
895// ReadFromINI read the Config from a INI file.
return copies lock value: github.com/GoAdminGroup/go-admin/modules/config.Config contains sync.RWMutex
870 panic(err)
871 }
872
873 return cfg 874}
875
876// ReadFromYaml read the Config from a YAML file.
return copies lock value: github.com/GoAdminGroup/go-admin/modules/config.Config contains sync.RWMutex
919 cfg.Databases[child.Name()[9:]] = d
920 }
921
922 return cfg 923}
924
925func SetDefault(cfg *Config) *Config {
Description
Inadvertently copying a value containing a lock, such as sync.Mutex or sync.WaitGroup, may cause both copies to malfunction. Generally such values should be referred to through a pointer.
For example,
var x *sync.Mutex
p := x
var y sync.Mutex
p = &y
*p = *x
is not recommended because it copies the lock value.