mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 10:24:37 +03:00
add comment about the sconf config file format at the top of the config files
hopefully this helps admins editing the file and prevent mistakes about config files. for issue #56 by kikoreis, thanks!
This commit is contained in:
6
vendor/github.com/mjl-/sconf/parse.go
generated
vendored
6
vendor/github.com/mjl-/sconf/parse.go
generated
vendored
@ -245,8 +245,8 @@ func (p *parser) parseStruct0(v reflect.Value) {
|
||||
if vv == zeroValue {
|
||||
p.stop(fmt.Sprintf("unknown key %q", k))
|
||||
}
|
||||
if ft, _ := t.FieldByName(k); isIgnore(ft.Tag.Get("sconf")) {
|
||||
p.stop(fmt.Sprintf("unknown key %q (has ignore tag)", k))
|
||||
if ft, _ := t.FieldByName(k); !ft.IsExported() || isIgnore(ft.Tag.Get("sconf")) {
|
||||
p.stop(fmt.Sprintf("unknown key %q (has ignore tag or not exported)", k))
|
||||
}
|
||||
vv.Set(p.parseValue(vv))
|
||||
}
|
||||
@ -254,7 +254,7 @@ func (p *parser) parseStruct0(v reflect.Value) {
|
||||
n := t.NumField()
|
||||
for i := 0; i < n; i++ {
|
||||
f := t.Field(i)
|
||||
if isIgnore(f.Tag.Get("sconf")) || isOptional(f.Tag.Get("sconf")) {
|
||||
if !f.IsExported() || isIgnore(f.Tag.Get("sconf")) || isOptional(f.Tag.Get("sconf")) {
|
||||
continue
|
||||
}
|
||||
if _, ok := seen[f.Name]; !ok {
|
||||
|
Reference in New Issue
Block a user