mirror of
https://github.com/xiaoqidun/goini.git
synced 2024-12-23 03:28:17 +08:00
refactor(优化代码): 优化代码
This commit is contained in:
parent
4349dffbe5
commit
6310bae091
5
goini.go
5
goini.go
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user