Skip to content

Instantly share code, notes, and snippets.

@keizo042
Last active August 29, 2015 14:21
Show Gist options
  • Save keizo042/d7f2fab15cb73aaefd7a to your computer and use it in GitHub Desktop.
Save keizo042/d7f2fab15cb73aaefd7a to your computer and use it in GitHub Desktop.
Restricted wordそのさん
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