Skip to content

Commit 78e280e

Browse files
committed
fixup: Change code comment according to code reviewer request
1 parent 808aaea commit 78e280e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/reflect/value.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ func (v Value) Addr() Value {
257257
if v.flag&flagAddr == 0 {
258258
panic("reflect.Value.Addr of unaddressable value")
259259
}
260-
// Inherits possible read only flags from this value,
261-
// so that later Elem() will restore equivalent value back.
260+
// Preserve flagRO instead of using v.flag.ro() so that
261+
// v.Addr().Elem() is equivalent to v (#32772)
262262
fl := v.flag & flagRO
263263
return Value{v.typ.ptrTo(), v.ptr, fl | flag(Ptr)}
264264
}

0 commit comments

Comments
 (0)