code: func GetFieldByTag(ival interface{}, tagName string, fieldNames []string) (interface{}, error) {
  	if len(fieldNames) == 0 {
  		return nil, trace.BadParameter("missing field names")
  	}
  	val := reflect.ValueOf(ival)
  	if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr {
  		val = val.Elem()
  	}
  	if val.Kind() != reflect.Struct {
  		return nil, trace.NotFound("field name %v is not found", strings.Join(fieldNames, "."))
  	}
  	fieldName := fieldNames[0]
  	rest := fieldNames[1:]
  
  	valType := val.Type()
  	for i := 0; i < valType.NumField(); i++ {
  		tagValue := valType.Field(i).Tag.Get(tagName)
  		parts := strings.Split(tagValue, ",")
  		if parts[0] == fieldName {
  			value := val.Field(i).Interface()
  			if len(rest) == 0 {
  				return value, nil
  			}
  			return GetFieldByTag(value, tagName, rest)
  		}
  	}
  	return nil, trace.NotFound("field name %v is not found", strings.Join(fieldNames, "."))
  }
docs: // GetFieldByTag returns a field from the object based on the tag