code: func baseType(t reflect.Type, expected reflect.Kind) (reflect.Type, error) {
  	t = reflectx.Deref(t)
  	if t.Kind() != expected {
  		return nil, fmt.Errorf("expected %s but got %s", expected, t.Kind())
  	}
  	return t, nil
  }
docs: // reflect helpers