go/constant: add Val accessor and Make constructor to handle varied types
This change adds a Val accessor that returns the underlying type for a given constant.Value. This change also adds a Make constructor that builds a constant.Value given a value of a specific type. Fixes #29820 Change-Id: I4fc3f5221408e24af42ffecd21ce4099ee75b47a Reviewed-on: https://go-review.googlesource.com/c/go/+/164538Reviewed-by: Robert Griesemer <gri@golang.org>
Showing
Please register or sign in to comment