Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
reflect: CanSet returns true for unexported embedded struct fields. #7363
What steps will reproduce the problem? 1. http://play.golang.org/p/P5IJiLANVg What is the expected output? No output. What do you see instead? panic: B.a is an unexported embedded struct field Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? Ubuntu 12.04 LTS Which version are you using? (run 'go version') go version go1.2 linux/amd64 Please provide any additional information below. According to http://golang.org/pkg/reflect/#Value.CanSet, "A Value can be changed only if it is addressable and was not obtained by the use of unexported struct fields." The first clause holds in the example, but the current behavior violates the second clause.