mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 09:20:55 +00:00
fix bug
This commit is contained in:
parent
bf5c5626ab
commit
0e369e6df8
@ -201,9 +201,12 @@ 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)
|
||||
execElem.FieldByName(fieldType.Name).Set(fieldVal)
|
||||
|
||||
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