reflect: fix pointer receiver for MakeRO

This commit is contained in:
Damian Gryski
2026-06-08 12:21:07 -07:00
committed by Damian Gryski
parent 7fa50a55cf
commit 33ddee76db
2 changed files with 3 additions and 3 deletions
+2 -1
View File
@@ -51,12 +51,13 @@ func (v Value) IsRO() bool {
return v.flags&(valueFlagRO) != 0
}
func (v *Value) MakeRO(ro bool) {
func (v Value) MakeRO(ro bool) Value {
if ro {
v.flags |= valueFlagRO
} else {
v.flags &^= valueFlagRO
}
return v
}
func (v Value) checkRO() {
+1 -2
View File
@@ -4727,8 +4727,7 @@ func IsRO(v Value) bool {
}
func MakeRO(v Value) Value {
v.MakeRO(true)
return v
return Value{v.MakeRO(true)}
}
func TestConvert(t *testing.T) {