reflect.Value.Type (method)

159 uses

	reflect (current package)
		deepequal.go#L31: 	if v1.Type() != v2.Type() {
		deepequal.go#L80: 		typ := v1.Type()
		deepequal.go#L109: 		if v1.Type().Elem().Kind() == Uint8 {
		deepequal.go#L235: 	if v1.Type() != v2.Type() {
		iter.go#L41: 			rf := MakeFunc(v.Type().In(0), func(in []Value) []Value {
		iter.go#L49: 		return rangeNum[int](v.Int(), v.Type())
		iter.go#L51: 		return rangeNum[int8](v.Int(), v.Type())
		iter.go#L53: 		return rangeNum[int16](v.Int(), v.Type())
		iter.go#L55: 		return rangeNum[int32](v.Int(), v.Type())
		iter.go#L57: 		return rangeNum[int64](v.Int(), v.Type())
		iter.go#L59: 		return rangeNum[uint](v.Uint(), v.Type())
		iter.go#L61: 		return rangeNum[uint8](v.Uint(), v.Type())
		iter.go#L63: 		return rangeNum[uint16](v.Uint(), v.Type())
		iter.go#L65: 		return rangeNum[uint32](v.Uint(), v.Type())
		iter.go#L67: 		return rangeNum[uint64](v.Uint(), v.Type())
		iter.go#L69: 		return rangeNum[uintptr](v.Uint(), v.Type())
		iter.go#L116: 	panic("reflect: " + v.Type().String() + " cannot produce iter.Seq[Value]")
		iter.go#L127: 			rf := MakeFunc(v.Type().In(0), func(in []Value) []Value {
		iter.go#L172: 	panic("reflect: " + v.Type().String() + " cannot produce iter.Seq2[Value, Value]")
		makefunc.go#L107: 	ftyp := (*funcType)(unsafe.Pointer(v.Type().(*rtype)))
		swapper.go#L35: 	typ := v.Type().Elem().common()
		value.go#L439: 		if xt, targ := in[i].Type(), t.In(i); !xt.AssignableTo(toRType(targ)) {
		value.go#L450: 			if xt := x.Type(); !xt.AssignableTo(elem) {
		value.go#L1633: 			if !v.Field(i).IsZero() && v.Type().Field(i).Name != "_" {
		value.go#L2656: 	return "<" + v.Type().String() + " Value>"
		value.go#L2681: func (v Value) Type() Type {
		value.go#L2963: 	typesMustMatch("reflect.AppendSlice", s.Type().Elem(), t.Type().Elem())
		value.go#L3393: 	vt := v.Type()
		value.go#L3424: 		switch v.Type().Elem().Kind() {
		value.go#L3426: 			for i := 0; i < v.Type().Len(); i++ {
		value.go#L3433: 		return v.Type().Comparable()
		value.go#L3447: 		return v.Type().Comparable()
		value.go#L3471: 	if v.Kind() != u.Kind() || v.Type() != u.Type() {
		value.go#L3499: 			if !v.Type().Elem().Comparable() {
		value.go#L3522: 	panic("reflect.Value.Equal: values of type " + v.Type().String() + " are not comparable")
		value.go#L3735: 	if v.Type().Kind() == Float32 && t.Kind() == Float32 {

	database/sql/driver
		types.go#L235: 		rv.Type().Elem().Implements(valuerReflectType) {
		types.go#L286: 		ek := rv.Type().Elem().Kind()

	encoding/asn1
		asn1.go#L680: 	fieldType := v.Type()
		asn1.go#L901: 		if val.Type().Size() == 4 {
		asn1.go#L990: 	err = StructuralError{"unsupported: " + v.Type().String()}
		marshal.go#L459: 	switch value.Type() {
		marshal.go#L485: 		t := v.Type()
		marshal.go#L533: 		sliceType := v.Type()
		marshal.go#L581: 	if v.Kind() == reflect.Interface && v.Type().NumMethod() == 0 {
		marshal.go#L590: 		defaultValue := reflect.New(v.Type()).Elem()
		marshal.go#L602: 		if reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) {
		marshal.go#L607: 	if v.Type() == rawValueType {
		marshal.go#L621: 	matchAny, tag, isCompound, ok := getUniversalType(v.Type())
		marshal.go#L623: 		return nil, StructuralError{fmt.Sprintf("unknown Go type: %v", v.Type())}

	encoding/binary
		binary.go#L683: 		t := v.Type().Elem()
		binary.go#L697: 		t := v.Type()
		binary.go#L707: 			return sizeof(v.Type())
		binary.go#L836: 		t := v.Type()
		binary.go#L905: 		t := v.Type()

	encoding/json
		decode.go#L444: 	if v.Kind() != reflect.Pointer && v.Type().Name() != "" && v.CanAddr() {
		decode.go#L476: 			v.Set(reflect.New(v.Type().Elem()))
		decode.go#L478: 		if v.Type().NumMethod() > 0 && v.CanInterface() {
		decode.go#L510: 		d.saveError(&UnmarshalTypeError{Value: "array", Type: v.Type(), Offset: int64(d.off)})
		decode.go#L528: 		d.saveError(&UnmarshalTypeError{Value: "array", Type: v.Type(), Offset: int64(d.off)})
		decode.go#L588: 		v.Set(reflect.MakeSlice(v.Type(), 0, 0))
		decode.go#L607: 		d.saveError(&UnmarshalTypeError{Value: "object", Type: v.Type(), Offset: int64(d.off)})
		decode.go#L612: 	t := v.Type()
		decode.go#L709: 								d.saveError(fmt.Errorf("json: cannot set embedded pointer to unexported struct: %v", subv.Type().Elem()))
		decode.go#L716: 							subv.Set(reflect.New(subv.Type().Elem()))
		decode.go#L752: 				d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal unquoted value into %v", subv.Type()))
		decode.go#L848: 		d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
		decode.go#L859: 				d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
		decode.go#L869: 			d.saveError(&UnmarshalTypeError{Value: val, Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L875: 				return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())
		decode.go#L889: 			d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
		decode.go#L902: 			d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
		decode.go#L908: 				d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
		decode.go#L910: 				d.saveError(&UnmarshalTypeError{Value: "bool", Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L918: 				d.saveError(&UnmarshalTypeError{Value: "bool", Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L926: 				return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())
		decode.go#L932: 			d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L934: 			if v.Type().Elem().Kind() != reflect.Uint8 {
		decode.go#L935: 				d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L947: 			if v.Type() == numberType && !isValidNumber(t) {
		decode.go#L955: 				d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L962: 				return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())
		decode.go#L968: 			if v.Kind() == reflect.String && v.Type() == numberType {
		decode.go#L975: 				return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())
		decode.go#L977: 			d.saveError(&UnmarshalTypeError{Value: "number", Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L985: 				d.saveError(&UnmarshalTypeError{Value: "number", Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L993: 				d.saveError(&UnmarshalTypeError{Value: "number " + string(item), Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L1001: 				d.saveError(&UnmarshalTypeError{Value: "number " + string(item), Type: v.Type(), Offset: int64(d.readIndex())})
		decode.go#L1007: 			n, err := strconv.ParseFloat(string(item), v.Type().Bits())
		decode.go#L1009: 				d.saveError(&UnmarshalTypeError{Value: "number " + string(item), Type: v.Type(), Offset: int64(d.readIndex())})
		encode.go#L340: 	return typeEncoder(v.Type())
		encode.go#L449: 		e.error(&MarshalerError{v.Type(), err, "MarshalJSON"})
		encode.go#L468: 		e.error(&MarshalerError{v.Type(), err, "MarshalJSON"})
		encode.go#L484: 		e.error(&MarshalerError{v.Type(), err, "MarshalText"})
		encode.go#L498: 		e.error(&MarshalerError{v.Type(), err, "MarshalText"})
		encode.go#L569: 	if v.Type() == numberType {
		encode.go#L673: 	e.error(&UnsupportedTypeError{v.Type()})
		encode.go#L743: 			e.error(&UnsupportedValueError{v, fmt.Sprintf("encountered a cycle via %s", v.Type())})
		encode.go#L758: 			e.error(fmt.Errorf("json: encoding error for type %q: %q", v.Type().String(), err.Error()))
		encode.go#L826: 			e.error(&UnsupportedValueError{v, fmt.Sprintf("encountered a cycle via %s", v.Type())})
		encode.go#L882: 			e.error(&UnsupportedValueError{v, fmt.Sprintf("encountered a cycle via %s", v.Type())})

	fmt
		print.go#L377: 	p.buf.writeString(v.Type().String())
		print.go#L392: 		p.buf.writeString(p.value.Type().String())
		print.go#L563: 			p.buf.writeString(value.Type().String())
		print.go#L807: 			p.buf.writeString(f.Type().String())
		print.go#L836: 			p.buf.writeString(f.Type().String())
		print.go#L848: 				if name := f.Type().Field(i).Name; name != "" {
		print.go#L860: 				p.buf.writeString(f.Type().String())
		print.go#L872: 			t := f.Type()
		print.go#L891: 			p.buf.writeString(f.Type().String())
		scan.go#L1021: 			s.errorString("type not a pointer: " + val.Type().String())
		scan.go#L1028: 			v.SetInt(s.scanInt(verb, v.Type().Bits()))
		scan.go#L1030: 			v.SetUint(s.scanUint(verb, v.Type().Bits()))
		scan.go#L1035: 			typ := v.Type()
		scan.go#L1037: 				s.errorString("can't scan type: " + val.Type().String())
		scan.go#L1047: 			v.SetFloat(s.convertFloat(s.floatToken(), v.Type().Bits()))
		scan.go#L1049: 			v.SetComplex(s.scanComplex(verb, v.Type().Bits()))
		scan.go#L1051: 			s.errorString("can't scan type: " + val.Type().String())

	github.com/oapi-codegen/runtime
		bindform.go#L40: 	tValue := ptrVal.Type()
		bindform.go#L96: 	tValue := ptrVal.Type()
		bindform.go#L133: 			ptrData = reflect.New(v.Type().Elem())
		bindform.go#L154: 			result := reflect.MakeSlice(v.Type(), indexedElementsCount+len(items), indexedElementsCount+len(items))
		bindform.go#L177: 			field := v.Type().Field(i)
		bindform.go#L236: 	valueType := additionalProperties.Type().Elem()
		bindform.go#L241: 		tag := parentStruct.Type().Field(i).Tag.Get(tagName)
		bindform.go#L249: 	result := reflect.MakeMap(additionalProperties.Type())
		bindform.go#L300: 			field := v.Type().Field(i)
		bindparam.go#L110: 	t := v.Type()
		bindparam.go#L235: 	t := v.Type()
		bindparam.go#L333: 			t := v.Type()
		bindparam.go#L350: 	t := v.Type()
		bindparam.go#L537: 	if v.Type().NumMethod() > 0 && v.CanInterface() {
		bindparam.go#L543: 	t := v.Type()
		bindstring.go#L42: 		t = v.Type()
		bindstring.go#L52: 		t = v.Type()
		deepobject.go#L200: 	it := iv.Type()
		deepobject.go#L204: 		dstMap := reflect.MakeMap(iv.Type())
		deepobject.go#L207: 			dstVal := reflect.New(iv.Type().Elem())
		styleparam.go#L67: 		t = v.Type()
		styleparam.go#L73: 		t := reflect.Indirect(reflect.ValueOf(value)).Type()
		styleparam.go#L189: 	t := v.Type()
		styleparam.go#L271: 		if f.Type().Kind() == reflect.Ptr && f.IsNil() {
		styleparam.go#L409: 	t := v.Type()

	internal/fmtsort
		sort.go#L50: 	if mapValue.Type().Kind() != reflect.Map {
		sort.go#L73: 	aType, bType := aVal.Type(), bVal.Type()
		sort.go#L127: 		c := compare(reflect.ValueOf(aVal.Elem().Type()), reflect.ValueOf(bVal.Elem().Type()))

	net/http
		h2_error.go#L15: 	dstType := dst.Type()
		h2_error.go#L20: 	srcType := src.Type()
		h2_error.go#L34: 		df.Set(src.Field(i).Convert(df.Type()))
		transport.go#L382: 	if rv := reflect.ValueOf(altProto["https"]); rv.IsValid() && rv.Type().Kind() == reflect.Struct && rv.Type().NumField() == 1 {

	net/http/httptrace
		trace.go#L181: 	structType := tv.Type()
		trace.go#L184: 		hookType := tf.Type()