func parseTag(t reflect.StructTag) (name string, keep bool, other interface{}, err error) {
	s := t.Get("datastore")
	parts := strings.Split(s, ",")
	if parts[0] == "-" && len(parts) == 1 {
		return "", false, nil, nil
	}
	if parts[0] != "" && !validPropertyName(parts[0]) {
		err = fmt.Errorf("datastore: struct tag has invalid property name: %q", parts[0])
		return "", false, nil, err
	}
	var opts saveOpts
	if len(parts) > 1 {
		for _, p := range parts[1:] {
			switch p {
			case "flatten":
				opts.flatten = true
			case "omitempty":
				opts.omitEmpty = true
			case "noindex":
				opts.noIndex = true
			default:
				err = fmt.Errorf("datastore: struct tag has invalid option: %q", p)
				return "", false, nil, err
			}
		}
		other = opts
	}
	return parts[0], true, other, nil
}
parseTag interprets datastore struct field tags
package datastore
import (
	"fmt"
	"reflect"
	"strings"
	"unicode"
	"cloud.google.com/go/internal/fields"
)
const maxIndexedProperties = 20000
const maxBlobLen = 1 << 20
type Property struct {
	Name string
	Value interface{}
	NoIndex bool
}
type Entity struct {
	Key        *Key
	Properties []Property
}
type PropertyLoadSaver interface {
	Load([]Property) error
	Save() ([]Property, error)
}
type KeyLoader interface {
	PropertyLoadSaver
	LoadKey(k *Key) error
}
type PropertyList []Property
var (
	typeOfPropertyLoadSaver = reflect.TypeOf((*PropertyLoadSaver)(nil)).Elem()
	typeOfPropertyList      = reflect.TypeOf(PropertyList(nil))
)
func (l *PropertyList) Load(p []Property) error {
	*l = append(*l, p...)
	return nil
}
func (l *PropertyList) Save() ([]Property, error) {
	return *l, nil
}
func validPropertyName(name string) bool {
	if name == "" {
		return false
	}
	for _, s := range strings.Split(name, ".") {
		if s == "" {
			return false
		}
		first := true
		for _, c := range s {
			if first {
				first = false
				if c != '_' && !unicode.IsLetter(c) {
					return false
				}
			} else {
				if c != '_' && !unicode.IsLetter(c) && !unicode.IsDigit(c) {
					return false
				}
			}
		}
	}
	return true
}