Skip to content

Commit 3f333a2

Browse files
committed
修复config检测未导出变量bug
1 parent e86a512 commit 3f333a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

config/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,10 @@ func (c *Config) Parse(result interface{}) error {
252252

253253
for j := 0; j < ft.NumField(); j++ {
254254
sf := ft.Field(j)
255-
if f.PkgPath != "" && !f.Anonymous { // unexported
255+
if sf.PkgPath != "" && !sf.Anonymous { // unexported
256256
continue
257257
}
258+
258259
sfv := fv.Field(j)
259260
if sf.Type.Kind() == reflect.Ptr {
260261
sfv = reflect.New(sfv.Elem().Type())

0 commit comments

Comments
 (0)