mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 11:10:57 +00:00
Merge pull request #2978 from BorisBorshevsky/fix_reflection_bug
fix bug #2972
This commit is contained in:
commit
f16688817a
@ -201,10 +201,13 @@ func (p *ControllerRegister) addWithMethodParams(pattern string, c ControllerInt
|
||||
|
||||
numOfFields := elemVal.NumField()
|
||||
for i := 0; i < numOfFields; i++ {
|
||||
fieldVal := elemVal.Field(i)
|
||||
fieldType := elemType.Field(i)
|
||||
|
||||
if execElem.FieldByName(fieldType.Name).CanSet() {
|
||||
fieldVal := elemVal.Field(i)
|
||||
execElem.FieldByName(fieldType.Name).Set(fieldVal)
|
||||
}
|
||||
}
|
||||
|
||||
return execController
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user