Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 36 for TypeFor (0.42 sec)

  1. src/encoding/xml/typeinfo.go

    	fAny
    
    	fOmitEmpty
    
    	fMode = fElement | fAttr | fCDATA | fCharData | fInnerXML | fComment | fAny
    
    	xmlName = "XMLName"
    )
    
    var tinfoMap sync.Map // map[reflect.Type]*typeInfo
    
    var nameType = reflect.TypeFor[Name]()
    
    // getTypeInfo returns the typeInfo structure with details necessary
    // for marshaling and unmarshaling typ.
    func getTypeInfo(typ reflect.Type) (*typeInfo, error) {
    	if ti, ok := tinfoMap.Load(typ); ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:23:29 UTC 2023
    - 9.6K bytes
    - Viewed (0)
  2. src/encoding/xml/marshal.go

    		if prefix == "" {
    			break
    		}
    		p.deleteAttrPrefix(prefix)
    	}
    }
    
    var (
    	marshalerType     = reflect.TypeFor[Marshaler]()
    	marshalerAttrType = reflect.TypeFor[MarshalerAttr]()
    	textMarshalerType = reflect.TypeFor[encoding.TextMarshaler]()
    )
    
    // marshalValue writes one or more XML elements representing val.
    // If val was obtained from a struct field, finfo must have its details.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 18:46:41 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  3. src/encoding/json/decode.go

    		return Number(s), nil
    	}
    	f, err := strconv.ParseFloat(s, 64)
    	if err != nil {
    		return nil, &UnmarshalTypeError{Value: "number " + s, Type: reflect.TypeFor[float64](), Offset: int64(d.off)}
    	}
    	return f, nil
    }
    
    var numberType = reflect.TypeFor[Number]()
    
    // literalStore decodes a literal stored in item into v.
    //
    // fromQuoted indicates whether this literal came from unwrapping a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 35.3K bytes
    - Viewed (0)
  4. src/encoding/json/bench_test.go

    		maxTypes = 1e3 // restrict cache sizes on builders
    	}
    
    	// Dynamically generate many new types.
    	types := make([]reflect.Type, maxTypes)
    	fs := []reflect.StructField{{
    		Type:  reflect.TypeFor[string](),
    		Index: []int{0},
    	}}
    	for i := range types {
    		fs[0].Name = fmt.Sprintf("TypeFieldsCache%d", i)
    		types[i] = reflect.StructOf(fs)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 15:00:17 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  5. src/html/template/js.go

    	"in":         true,
    	"instanceof": true,
    	"return":     true,
    	"throw":      true,
    	"try":        true,
    	"typeof":     true,
    	"void":       true,
    }
    
    var jsonMarshalType = reflect.TypeFor[json.Marshaler]()
    
    // indirectToJSONMarshaler returns the value, after dereferencing as many times
    // as necessary to reach the base type (or nil) or an implementation of json.Marshal.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  6. src/database/sql/convert.go

    	case reflect.Bool:
    		return strconv.AppendBool(buf, rv.Bool()), true
    	case reflect.String:
    		s := rv.String()
    		return append(buf, s...), true
    	}
    	return
    }
    
    var valuerReflectType = reflect.TypeFor[driver.Valuer]()
    
    // callValuerValue returns vr.Value(), with one exception:
    // If vr.Value is an auto-generated method on a pointer type and the
    // pointer is nil, it would panic at runtime in the panicwrap
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 16.2K bytes
    - Viewed (0)
  7. src/encoding/json/encode.go

    	f = newTypeEncoder(t, true)
    	wg.Done()
    	encoderCache.Store(t, f)
    	return f
    }
    
    var (
    	marshalerType     = reflect.TypeFor[Marshaler]()
    	textMarshalerType = reflect.TypeFor[encoding.TextMarshaler]()
    )
    
    // newTypeEncoder constructs an encoderFunc for a type.
    // The returned encoder only checks CanAddr when allowAddr is true.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 36.2K bytes
    - Viewed (0)
  8. src/net/rpc/server.go

    	"sync"
    )
    
    const (
    	// Defaults used by HandleHTTP
    	DefaultRPCPath   = "/_goRPC_"
    	DefaultDebugPath = "/debug/rpc"
    )
    
    // Precompute the reflect type for error.
    var typeOfError = reflect.TypeFor[error]()
    
    type methodType struct {
    	sync.Mutex // protects counters
    	method     reflect.Method
    	ArgType    reflect.Type
    	ReplyType  reflect.Type
    	numCalls   uint
    }
    
    type service struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 21.6K bytes
    - Viewed (0)
  9. src/encoding/gob/gobencdec_test.go

    	oldNestingDepth := maxIgnoreNestingDepth
    	maxIgnoreNestingDepth = 100
    	defer func() { maxIgnoreNestingDepth = oldNestingDepth }()
    	b := new(bytes.Buffer)
    	enc := NewEncoder(b)
    	typ := reflect.TypeFor[int]()
    	nested := reflect.ArrayOf(1, typ)
    	for i := 0; i < 100; i++ {
    		nested = reflect.ArrayOf(1, nested)
    	}
    	badStruct := reflect.New(reflect.StructOf([]reflect.StructField{{Name: "F", Type: nested}}))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 01 14:26:13 UTC 2023
    - 19.2K bytes
    - Viewed (0)
  10. src/reflect/all_test.go

    	if ovf := TypeFor[float32]().OverflowFloat(ovfFloat32); !ovf {
    		t.Errorf("%v should overflow float32", ovfFloat32)
    	}
    	if ovf := TypeFor[float32]().OverflowFloat(-ovfFloat32); !ovf {
    		t.Errorf("%v should overflow float32", -ovfFloat32)
    	}
    
    	maxInt32 := int64(0x7fffffff)
    	if ovf := TypeFor[int32]().OverflowInt(maxInt32); ovf {
    		t.Errorf("%v wrongly overflows int32", maxInt32)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top