Skip to content

Commit 4cb4bea

Browse files
committed
Bugfix: reflect.Value.Addr of unaddressable value
1 parent 8d01a05 commit 4cb4bea

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
@@ -155,7 +155,12 @@ var (
155155

156156
PointerBinder = Binder{
157157
Bind: func(params *Params, name string, typ reflect.Type) reflect.Value {
158-
return Bind(params, name, typ.Elem()).Addr()
158+
v := Bind(params, name, typ.Elem())
159+
if v.CanAddr() {
160+
return v.Addr()
161+
}
162+
163+
return v
159164
},
160165
Unbind: func(output map[string]string, name string, val interface{}) {
161166
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