Skip to content

Instantly share code, notes, and snippets.

@jordanorelli
Created June 1, 2012 21:00
Show Gist options
  • Save jordanorelli/2855117 to your computer and use it in GitHub Desktop.
Save jordanorelli/2855117 to your computer and use it in GitHub Desktop.
package main
import (
"reflect"
"fmt"
)
func main() {
var x struct {
MyField int `core:"required"`
}
t := reflect.TypeOf(x)
for i := 0; i < t.NumField(); i++ {
field := t.Field(i)
fmt.Println(field.Name, ":", field.Tag.Get("core"))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment