Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for TypeFor (0.46 sec)

  1. src/reflect/type_test.go

    	)
    
    	testcases := []struct {
    		wantFrom any
    		got      reflect.Type
    	}{
    		{new(int), reflect.TypeFor[int]()},
    		{new(int64), reflect.TypeFor[int64]()},
    		{new(string), reflect.TypeFor[string]()},
    		{new(mystring), reflect.TypeFor[mystring]()},
    		{new(any), reflect.TypeFor[any]()},
    		{new(myiface), reflect.TypeFor[myiface]()},
    	}
    	for _, tc := range testcases {
    		want := reflect.ValueOf(tc.wantFrom).Elem().Type()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 23:39:44 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  2. src/cmd/vet/testdata/stdversion/stdversion.go

    package stdversion
    
    import "reflect"
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 01:02:40 UTC 2024
    - 142 bytes
    - Viewed (0)
  3. src/encoding/gob/type_test.go

    	newtyp := getTypeUnlocked("int", reflect.TypeFor[int]())
    	if newtyp != tInt.gobType() {
    		t.Errorf("reregistration of %s got new type", newtyp.string())
    	}
    	newtyp = getTypeUnlocked("uint", reflect.TypeFor[uint]())
    	if newtyp != tUint.gobType() {
    		t.Errorf("reregistration of %s got new type", newtyp.string())
    	}
    	newtyp = getTypeUnlocked("string", reflect.TypeFor[string]())
    	if newtyp != tString.gobType() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 01 14:26:13 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  4. src/database/sql/fakedb_test.go

    	case "bool":
    		return reflect.TypeFor[bool]()
    	case "nullbool":
    		return reflect.TypeFor[NullBool]()
    	case "int16":
    		return reflect.TypeFor[int16]()
    	case "nullint16":
    		return reflect.TypeFor[NullInt16]()
    	case "int32":
    		return reflect.TypeFor[int32]()
    	case "nullint32":
    		return reflect.TypeFor[NullInt32]()
    	case "string":
    		return reflect.TypeFor[string]()
    	case "nullstring":
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 01 12:38:07 UTC 2024
    - 30.3K bytes
    - Viewed (0)
  5. src/encoding/gob/type.go

    var (
    	gobEncoderInterfaceType        = reflect.TypeFor[GobEncoder]()
    	gobDecoderInterfaceType        = reflect.TypeFor[GobDecoder]()
    	binaryMarshalerInterfaceType   = reflect.TypeFor[encoding.BinaryMarshaler]()
    	binaryUnmarshalerInterfaceType = reflect.TypeFor[encoding.BinaryUnmarshaler]()
    	textMarshalerInterfaceType     = reflect.TypeFor[encoding.TextMarshaler]()
    	textUnmarshalerInterfaceType   = reflect.TypeFor[encoding.TextUnmarshaler]()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 02:00:26 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  6. src/unique/clone_test.go

    	testCloneSeq[testStruct](t, cSeq(8))
    }
    
    func cSeq(stringOffsets ...uintptr) cloneSeq {
    	return cloneSeq{stringOffsets: stringOffsets}
    }
    
    func testCloneSeq[T any](t *testing.T, want cloneSeq) {
    	typName := reflect.TypeFor[T]().Name()
    	typ := abi.TypeOf(*new(T))
    	t.Run(typName, func(t *testing.T) {
    		got := makeCloneSeq(typ)
    		if !reflect.DeepEqual(got, want) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 18:14:07 UTC 2024
    - 1K bytes
    - Viewed (0)
  7. src/encoding/json/decode_test.go

    	{CaseName: Name(""), in: `{"X": [1,2,3], "Y": 4}`, ptr: new(T), out: T{Y: 4}, err: &UnmarshalTypeError{"array", reflect.TypeFor[string](), 7, "T", "X"}},
    	{CaseName: Name(""), in: `{"X": 23}`, ptr: new(T), out: T{}, err: &UnmarshalTypeError{"number", reflect.TypeFor[string](), 8, "T", "X"}},
    	{CaseName: Name(""), in: `{"x": 1}`, ptr: new(tx), out: tx{}},
    	{CaseName: Name(""), in: `{"x": 1}`, ptr: new(tx), out: tx{}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 16:40:14 UTC 2024
    - 67.6K bytes
    - Viewed (0)
  8. src/cmd/fix/cftype.go

    	// There's no easy way to map from an ast.Expr to all the places that use them, so
    	// we use reflect to find all such references.
    	if len(badNils) > 0 {
    		exprType := reflect.TypeFor[ast.Expr]()
    		exprSliceType := reflect.TypeFor[[]ast.Expr]()
    		walk(f, func(n any) {
    			if n == nil {
    				return
    			}
    			v := reflect.ValueOf(n)
    			if v.Type().Kind() != reflect.Pointer {
    				return
    			}
    			if v.IsNil() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:25:49 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  9. pkg/typemap/map.go

    }
    
    func Set[T any](t TypeMap, v T) {
    	interfaceType := reflect.TypeOf((*T)(nil)).Elem()
    	t.inner[interfaceType] = v
    }
    
    func Get[T any](t TypeMap) *T {
    	v, f := t.inner[reflect.TypeFor[T]()]
    	if f {
    		return ptr.Of(v.(T))
    	}
    	return nil
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 16:38:40 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  10. src/encoding/asn1/asn1.go

    	return
    }
    
    var (
    	bitStringType        = reflect.TypeFor[BitString]()
    	objectIdentifierType = reflect.TypeFor[ObjectIdentifier]()
    	enumeratedType       = reflect.TypeFor[Enumerated]()
    	flagType             = reflect.TypeFor[Flag]()
    	timeType             = reflect.TypeFor[time.Time]()
    	rawValueType         = reflect.TypeFor[RawValue]()
    	rawContentsType      = reflect.TypeFor[RawContent]()
    	bigIntType           = reflect.TypeFor[*big.Int]()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 31.8K bytes
    - Viewed (0)
Back to top