- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for TypeFor (0.21 sec)
-
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) -
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) -
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) -
pkg/typemap/map.go
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed Apr 17 16:38:40 UTC 2024 - 1.2K bytes - Viewed (0) -
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) -
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) -
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) -
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) -
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) -
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)