Last active
August 29, 2015 14:21
-
-
Save keizo042/d7f2fab15cb73aaefd7a to your computer and use it in GitHub Desktop.
Restricted wordそのさん
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type Hello struct { | |
hello string | |
world string | |
zero int | |
} | |
func main() { | |
t := &Hello{} | |
r := reflect.TypeOf(*t) | |
fmt.Print(r.Field(t.zero).Name) | |
t.zero++ | |
fmt.Println(r.Field(t.zero).Name) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment