refactor(优化代码): 优化代码

This commit is contained in:
xiaoqidun 2020-11-26 11:04:00 +08:00
parent 4349dffbe5
commit 6310bae091

@ -225,10 +225,9 @@ func (ini *GoINI) MapToStruct(ptr interface{}) (err error) {
if t.Kind() != reflect.Ptr { if t.Kind() != reflect.Ptr {
err = errors.New("input struct ptr") err = errors.New("input struct ptr")
return return
} else { }
t = t.Elem() t = t.Elem()
v = v.Elem() v = v.Elem()
}
for i := 0; i < t.NumField(); i++ { for i := 0; i < t.NumField(); i++ {
if !v.CanInterface() { if !v.CanInterface() {
continue continue