Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of about 10,000 for fStruct (0.72 sec)

  1. src/testing/quick/quick_test.go

    	reportError("fString", CheckEqual(fString, fString, nil), t)
    	reportError("fStringAlias", CheckEqual(fStringAlias, fStringAlias, nil), t)
    	reportError("fStruct", CheckEqual(fStruct, fStruct, nil), t)
    	reportError("fStructAlias", CheckEqual(fStructAlias, fStructAlias, nil), t)
    	reportError("fUint16", CheckEqual(fUint16, fUint16, nil), t)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 12:54:00 UTC 2019
    - 9K bytes
    - Viewed (0)
  2. test/interface/struct.go

    package main
    
    import "os"
    
    var fail int
    
    func check(b bool, msg string) {
    	if (!b) {
    		println("failure in", msg)
    		fail++
    	}
    }
    
    type I1 interface { Get() int; Put(int) }
    
    type S1 struct { i int }
    func (p S1) Get() int { return p.i }
    func (p S1) Put(i int) { p.i = i }
    
    func f1() {
    	s := S1{1}
    	var i I1 = s
    	i.Put(2)
    	check(i.Get() == 1, "f1 i")
    	check(s.i == 1, "f1 s")
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Feb 19 06:33:41 UTC 2012
    - 2.4K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. operator/pkg/tpath/struct.go

    	}
    
    	return nil, false, nil
    }
    
    // SetFromPath sets out with the value at path from node. out is not set if the path doesn't exist or the value is nil.
    // All intermediate along path must be type struct ptr. Out must be either a struct ptr or map ptr.
    // TODO: move these out to a separate package (istio/istio#15494).
    func SetFromPath(node any, path string, out any) (bool, error) {
    	val, found, err := GetFromStructPath(node, path)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  7. test/fixedbugs/bug054.go

    type Element interface {
    }
    
    type Vector struct {
    	elem []Element;
    }
    
    func (v *Vector) At(i int) Element {
    	return v.elem[i];
    }
    
    type TStruct struct {
    	name string;
    	fields *Vector;
    }
    
    func (s *TStruct) field(i int) *TStruct {
    	return s.fields.At(i).(*TStruct);
    }
    
    func main() {
    	v := new(Vector);
    	v.elem = make([]Element, 10);
    	t := new(TStruct);
    	t.name = "hi";
    	v.elem[0] = t;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 04:48:57 UTC 2012
    - 669 bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types/type.go

    }
    
    // StructType contains Type fields specific to struct types.
    type Struct struct {
    	fields fields
    
    	// Maps have three associated internal structs (see struct MapType).
    	// Map links such structs back to their map type.
    	Map *Type
    
    	ParamTuple bool // whether this struct is actually a tuple of signature parameters
    }
    
    // StructType returns t's extra struct-specific fields.
    func (t *Type) StructType() *Struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  9. src/cmd/link/internal/ld/dwarf_test.go

    	mustHaveDWARF(t)
    
    	t.Parallel()
    
    	dir := t.TempDir()
    
    	const prog = `package main
    
    import "fmt"
    
    type astruct struct {
    	X int
    }
    
    type bstruct struct {
    	X float32
    }
    
    var globalptr *astruct
    var globalvar astruct
    var bvar0, bvar1, bvar2 bstruct
    
    func main() {
    	fmt.Println(globalptr, globalvar, bvar0, bvar1, bvar2)
    }
    `
    
    	f := gobuild(t, dir, prog, NoOpt)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 01:38:11 UTC 2024
    - 48.6K bytes
    - Viewed (0)
  10. test/typeparam/issue47716.go

    	return unsafe.Sizeof(x)
    }
    
    // size returns the alignment of type T
    func align[T any](x T) uintptr {
    	return unsafe.Alignof(x)
    }
    
    type Tstruct[T any] struct {
    	f1 T
    	f2 int
    }
    
    // offset returns the offset of field f2 in the generic type Tstruct
    func (r *Tstruct[T]) offset() uintptr {
    	return unsafe.Offsetof(r.f2)
    }
    
    func main() {
    	v1 := int(5)
    	if got, want := size(v1), unsafe.Sizeof(v1); got != want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 1.6K bytes
    - Viewed (0)
Back to top