- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 20 for MyStruct (0.15 sec)
-
test/typeparam/genembed2.go
package main import ( "fmt" "sync" ) type MyStruct[T any] struct { val T } type Lockable[T any] struct { MyStruct[T] mu sync.Mutex } // Get returns the value stored in a Lockable. func (l *Lockable[T]) Get() T { l.mu.Lock() defer l.mu.Unlock() return l.MyStruct.val } // Set sets the value in a Lockable. func (l *Lockable[T]) Set(v T) { l.mu.Lock()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 801 bytes - Viewed (0) -
src/slices/sort_benchmark_test.go
} }) } } type myStruct struct { a, b, c, d string n int } func BenchmarkBinarySearchFuncStruct(b *testing.B) { for _, size := range []int{16, 32, 64, 128, 512, 1024} { b.Run(fmt.Sprintf("Size%d", size), func(b *testing.B) { structs := make([]*myStruct, size) for i := range structs { structs[i] = &myStruct{n: i} } midpoint := len(structs) / 2
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 04 23:39:07 UTC 2024 - 2.1K bytes - Viewed (0) -
src/reflect/internal/example1/example.go
// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package example1 type MyStruct struct { MyStructs []MyStruct MyStruct *MyStruct
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Nov 09 14:05:53 UTC 2022 - 246 bytes - Viewed (0) -
test/typeparam/issue51219.dir/a.go
package a // Type I is the first basic test for the issue, which relates to a type that is recursive // via a type constraint. (In this test, I -> IConstraint -> MyStruct -> I.) type JsonRaw []byte type MyStruct struct { x *I[JsonRaw] } type IConstraint interface { JsonRaw | MyStruct } type I[T IConstraint] struct {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 28 14:59:04 UTC 2022 - 487 bytes - Viewed (0) -
src/sort/sort_slices_benchmark_test.go
structs := make([]*myStruct, n) for i := 0; i < n; i++ { structs[i] = &myStruct{n: r.IntN(n)} } return structs } func TestStructSorts(t *testing.T) { ss := makeRandomStructs(200) ss2 := make([]*myStruct, len(ss)) for i := range ss { ss2[i] = &myStruct{n: ss[i].n} } Sort(ss) slices.SortFunc(ss2, func(a, b *myStruct) int { return a.n - b.n })
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 08 22:59:40 UTC 2024 - 4K bytes - Viewed (0) -
test/abi/convF_criteria.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 08 19:58:50 UTC 2021 - 424 bytes - Viewed (0) -
src/reflect/internal/example2/example.go
// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package example2 type MyStruct struct { MyStructs []MyStruct MyStruct *MyStruct
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Nov 09 14:05:53 UTC 2022 - 246 bytes - Viewed (0) -
test/fixedbugs/issue24547.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 27 18:56:36 UTC 2018 - 757 bytes - Viewed (0) -
src/internal/types/testdata/examples/functions.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 30 20:19:38 UTC 2023 - 5.5K bytes - Viewed (0) -
test/abi/convT64_criteria.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "fmt" ) type MyStruct struct { F0 [0]float64 F1 byte F2 int16 _ struct { F0 uint32 } } func main() { p0 := MyStruct{F0: [0]float64{}, F1: byte(27), F2: int16(9887)} fmt.Println(p0)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 08 17:44:21 UTC 2021 - 387 bytes - Viewed (0)