- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 54 for mkstruct (0.12 sec)
-
test/typeparam/issue50109.go
return NewAny[T]() } type MyStruct struct { Name string } func main() { // Create a generic cache. // All items are cached as interface{} so they need to be cast back to their // original type when retrieved. // Failure in issue doesn't happen with 'any' replaced by 'interface{}' c := NewAnyCacher[any]() myStruct := &MyStruct{"MySuperStruct"} c.Set("MySuperStruct", myStruct)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 2.2K bytes - Viewed (0) -
test/fixedbugs/issue24547.go
// based on the promoted method, not the shadowed method. package main import ( "bytes" "fmt" ) type mystruct struct { f int } func (t mystruct) String() string { return "FAIL" } func main() { type deep struct { mystruct } s := struct { deep *bytes.Buffer }{ deep{}, bytes.NewBufferString("ok"), } if got := s.String(); got != "ok" {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 27 18:56:36 UTC 2018 - 757 bytes - Viewed (0) -
src/cmd/compile/internal/types2/struct.go
) // ---------------------------------------------------------------------------- // API // A Struct represents a struct type. type Struct struct { fields []*Var // fields != nil indicates the struct is set up (possibly with len(fields) == 0) tags []string // field tags; nil if there are no tags } // NewStruct returns a new struct with the given fields and corresponding field tags.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 29 22:06:18 UTC 2024 - 6.6K bytes - Viewed (0) -
test/typeparam/struct.go
// license that can be found in the LICENSE file. package main import ( "fmt" ) type E[T any] struct { v T } type S1 struct { E[int] v string } type Eint = E[int] type Ebool = E[bool] type Eint2 = Eint type S2 struct { Eint Ebool v string } type S3 struct { *E[int] } func main() { s1 := S1{Eint{2}, "foo"} if got, want := s1.E.v, 2; got != want {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 05 16:29:58 UTC 2024 - 801 bytes - Viewed (0) -
src/go/types/struct.go
) // ---------------------------------------------------------------------------- // API // A Struct represents a struct type. type Struct struct { fields []*Var // fields != nil indicates the struct is set up (possibly with len(fields) == 0) tags []string // field tags; nil if there are no tags } // NewStruct returns a new struct with the given fields and corresponding field tags.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 29 22:06:18 UTC 2024 - 6.1K bytes - Viewed (0) -
src/internal/types/testdata/check/compliterals.go
// license that can be found in the LICENSE file. // Composite literals with parameterized types package comp_literals type myStruct struct { f int } type slice[E any] []E func struct_literals[S struct{f int}|myStruct]() { _ = S{} _ = S{0} _ = S{f: 0} _ = slice[int]{1, 2, 3} _ = slice[S]{{}, {0}, {f:0}}
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 02 02:58:32 UTC 2022 - 442 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) -
src/go/printer/testdata/alignment.golden
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 14 20:40:15 UTC 2018 - 4.1K bytes - Viewed (0) -
src/go/printer/testdata/alignment.input
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 14 20:40:15 UTC 2018 - 4.9K 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)