mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-12-24 13:48:04 +08:00
chore: add config parse nil value soluition
This commit is contained in:
@@ -101,6 +101,12 @@ func (config *Config) Parse(s any, prefix ...string) {
|
||||
}
|
||||
|
||||
config.Ptr = v
|
||||
|
||||
if v.IsZero() || v.IsNil() {
|
||||
fmt.Println("parse to ", prefix, config.name, s, "is zero or nil")
|
||||
return
|
||||
}
|
||||
|
||||
config.Default = v.Interface()
|
||||
|
||||
if l := len(prefix); l > 0 { // 读取环境变量
|
||||
|
||||
Reference in New Issue
Block a user