I would like to get the string name of a field like it is possible to do in C#:
if (x == null)
throw new ArgumentNullException(nameof(x));
In GO I have the following:
package main
type Test struct{
X int
Y string
}
func main() {
fmt.Println(nameof(Test.X))
}
How I can implement the nameof
func?