func findField(v interface{}, tag, tagval string) *reflect.Value {
	val := reflect.ValueOf(v)
	ty := val.Type()
	if ty.Kind() == reflect.Ptr {
		ty = ty.Elem()  
		val = val.Elem()
	}
	for i := 0; i < ty.NumField(); i++ {  
		if x := ty.Field(i).Tag.Get(tag); x == tagval {
			f := val.Field(i)  
			return &f          
		}
	}
	return nil
}
findField by tagkey tagvalue pair
package frontmatter
import (
	"reflect"
)
var (
	stringType = reflect.ValueOf("txt").Type()
)
func ReadString(v interface{}, tag, tagval string) (txt string, err error) {
	fv := findField(v, tag, tagval)  
	if fv == nil {                   
		return "", ErrNoContentField
	}
	if !fv.Type().ConvertibleTo(stringType) {
		return "", ErrWrongContentFieldType  
	}
	txt = fv.Convert(stringType).Interface().(string)
	return
}
func WriteString(v interface{}, tag, tagval, txt string) error {
	fv := findField(v, tag, tagval)
	if fv == nil {
		return ErrNoContentField
	}
	if !fv.CanSet() {
		return ErrUnexported
	}
	fvt := fv.Type()
	switch {
	case reflect.TypeOf(txt).ConvertibleTo(fvt):
		fv.Set(reflect.ValueOf(txt).Convert(fvt))
	case reflect.TypeOf(&txt).ConvertibleTo(fvt):
		fv.Set(reflect.ValueOf(&txt).Convert(fvt))
	default:
		return ErrWrongContentFieldType
	}
	return nil
}