Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 36 for TypeFor (0.26 sec)

  1. src/html/template/content.go

    		return a
    	}
    	v := reflect.ValueOf(a)
    	for v.Kind() == reflect.Pointer && !v.IsNil() {
    		v = v.Elem()
    	}
    	return v.Interface()
    }
    
    var (
    	errorType       = reflect.TypeFor[error]()
    	fmtStringerType = reflect.TypeFor[fmt.Stringer]()
    )
    
    // indirectToStringerOrError returns the value, after dereferencing as many times
    // as necessary to reach the base type (or nil) or an implementation of fmt.Stringer
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 01 14:30:25 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  2. src/net/http/transfer_test.go

    func (w *mockTransferWriter) Write(p []byte) (int, error) {
    	w.WriteCalled = true
    	return io.Discard.Write(p)
    }
    
    func TestTransferWriterWriteBodyReaderTypes(t *testing.T) {
    	fileType := reflect.TypeFor[*os.File]()
    	bufferType := reflect.TypeFor[*bytes.Buffer]()
    
    	nBytes := int64(1 << 10)
    	newFileFunc := func() (r io.Reader, done func(), err error) {
    		f, err := os.CreateTemp("", "net-http-newfilefunc")
    		if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:16:28 UTC 2023
    - 9.1K bytes
    - Viewed (0)
  3. src/unique/handle_test.go

    		s: [2]testStringStruct{testStringStruct{"y"}, testStringStruct{"z"}},
    	})
    	testHandle[testStruct](t, testStruct{0.5, "184"})
    }
    
    func testHandle[T comparable](t *testing.T, value T) {
    	name := reflect.TypeFor[T]().Name()
    	t.Run(fmt.Sprintf("%s/%#v", name, value), func(t *testing.T) {
    		t.Parallel()
    
    		v0 := Make(value)
    		v1 := Make(value)
    
    		if v0.Value() != v1.Value() {
    			t.Error("v0.Value != v1.Value")
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 18:14:07 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  4. src/encoding/xml/read.go

    		return nil
    	}
    
    	return copyValue(val, []byte(attr.Value))
    }
    
    var (
    	attrType            = reflect.TypeFor[Attr]()
    	unmarshalerType     = reflect.TypeFor[Unmarshaler]()
    	unmarshalerAttrType = reflect.TypeFor[UnmarshalerAttr]()
    	textUnmarshalerType = reflect.TypeFor[encoding.TextUnmarshaler]()
    )
    
    const (
    	maxUnmarshalDepth     = 10000
    	maxUnmarshalDepthWasm = 5000 // go.dev/issue/56498
    )
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 22.4K bytes
    - Viewed (0)
  5. doc/next/3-tools.md

    by any [`//go:build` constraints](https://pkg.go.dev/cmd/go#hdr-Build_constraints)
    in the file.)
    
    For example, it will report a diagnostic for a reference to the
    `reflect.TypeFor` function (introduced in go1.22) from a file in a
    module whose go.mod file specifies `go 1.21`.
    
    ### Cgo {#cgo}
    
    <!-- go.dev/issue/66456 -->
    [cmd/cgo] supports the new `-ldflags` flag for passing flags to the C linker.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 28 19:06:07 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  6. src/encoding/xml/read_test.go

    	v, e any
    }{
    	{&BadPathTestA{}, &TagPathError{reflect.TypeFor[BadPathTestA](), "First", "items>item1", "Second", "items"}},
    	{&BadPathTestB{}, &TagPathError{reflect.TypeFor[BadPathTestB](), "First", "items>item1", "Second", "items>item1>value"}},
    	{&BadPathTestC{}, &TagPathError{reflect.TypeFor[BadPathTestC](), "First", "", "Second", "First"}},
    	{&BadPathTestD{}, &TagPathError{reflect.TypeFor[BadPathTestD](), "First", "", "Second", "First"}},
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 29.1K bytes
    - Viewed (0)
  7. doc/next/9-todo.md

    CL 514775 - implements a performance optimization for accepted proposal https://go.dev/issue/59488
    CL 484995 - x/sys CL implements accepted proposal https://go.dev/issue/59537 to add x/sys/unix API
    CL 555597 - optimizes TypeFor (added in accepted proposal https://go.dev/issue/60088) for non-interface types; doesn't seem to need a release note
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 17:18:52 UTC 2024
    - 6K bytes
    - Viewed (0)
  8. src/text/template/exec.go

    		}
    	}
    	s.errorf("can't evaluate field %s in type %s", fieldName, typ)
    	panic("not reached")
    }
    
    var (
    	errorType        = reflect.TypeFor[error]()
    	fmtStringerType  = reflect.TypeFor[fmt.Stringer]()
    	reflectValueType = reflect.TypeFor[reflect.Value]()
    )
    
    // evalCall executes a function or method call. If it's a method, fun already has the receiver bound, so
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 21:22:24 UTC 2024
    - 32K bytes
    - Viewed (0)
  9. api/go1.22.txt

    pkg net/netip, method (AddrPort) Compare(AddrPort) int #61642
    pkg os, method (*File) WriteTo(io.Writer) (int64, error) #58808
    pkg reflect, func PtrTo //deprecated #59599
    pkg reflect, func TypeFor[$0 interface{}]() Type #60088
    pkg slices, func Concat[$0 interface{ ~[]$1 }, $1 interface{}](...$0) $0 #56353
    pkg syscall (linux-386), type SysProcAttr struct, PidFD *int #51246
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 20:54:27 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  10. src/database/sql/driver/types.go

    // are an error.
    var DefaultParameterConverter defaultConverter
    
    type defaultConverter struct{}
    
    var _ ValueConverter = defaultConverter{}
    
    var valuerReflectType = reflect.TypeFor[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: Tue Feb 27 16:30:20 UTC 2024
    - 8.8K bytes
    - Viewed (0)
Back to top