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

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

View File

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