package main import ( "reflect" "strconv" ) type Test struct { Field1 string Field2 string Field3 int } func main() { st := Test{"value1", "value2", 1234} v := reflect.Indirect(reflect.ValueOf(st)) t := v.Type() for i := 0; i < t.NumField(); i++ { // フィールド名 println("Field: " + t.Field(i).Name) // 値 f := v.Field(i) i := f.Interface() if value, ok := i.(int); ok { println("Value: " + strconv.Itoa(va