func TagNameFromStructField(name string, post interface{}) string {
	if name == "" {
		return name
	}
	field, ok := reflect.TypeOf(post).Elem().FieldByName(name)
	if !ok {
		panic("Couldn't get struct field for: " + name + ". Make sure you pass the right field name to editor field elements.")
	}
	tag, ok := field.Tag.Lookup("json")
	if !ok {
		panic("Couldn't get json struct tag for: " + name + ". Struct fields for content types must have 'json' tags.")
	}
	return tag
}
TagNameFromStructField does a lookup on the `json` struct tag for a given
field of a struct
package editor
import (
	"fmt"
	"reflect"
	"strings"
)