Skip to content

Commit 4f79059

Browse files
authored
Merge pull request revel#1115 from mephi-ut/master
Bugfix: reflect.Value.Addr of unaddressable value
2 parents a343bf7 + ad5230e commit 4f79059

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

binder.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ var (
153153

154154
PointerBinder = Binder{
155155
Bind: func(params *Params, name string, typ reflect.Type) reflect.Value {
156-
return Bind(params, name, typ.Elem()).Addr()
156+
v := Bind(params, name, typ.Elem())
157+
if v.CanAddr() {
158+
return v.Addr()
159+
}
160+
161+
return v
157162
},
158163
Unbind: func(output map[string]string, name string, val interface{}) {
159164
Unbind(output, name, reflect.ValueOf(val).Elem().Interface())

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy