You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Compile and run
package main
import (
"fmt"
"reflect"
)
func main() {
x := string("hello")
v := reflect.ValueOf(&x).Elem()
oldvalue := v.Interface()
v.SetString("world")
newvalue := v.Interface()
fmt.Println(oldvalue, newvalue)
n := int64(1)
v = reflect.ValueOf(&n).Elem()
oldvalue = v.Interface()
v.SetInt(2)
newvalue = v.Interface()
fmt.Println(oldvalue, newvalue)
}
What is the expected output? What do you see instead?
Expected:
hello world
1 2
Seen (GOARCH=386):
world world
2 2
Seen (GOARCH=amd64):
world world
1 2
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: