Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 4,062 for structpb (0.35 sec)

  1. 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)
  2. test/codegen/structs.go

    package codegen
    
    // This file contains code generation tests related to the handling of
    // struct types.
    
    // ------------- //
    //    Zeroing    //
    // ------------- //
    
    type Z1 struct {
    	a, b, c int
    }
    
    func Zero1(t *Z1) { // Issue #18370
    	// amd64:`MOVUPS\tX[0-9]+, \(.*\)`,`MOVQ\t\$0, 16\(.*\)`
    	*t = Z1{}
    }
    
    type Z2 struct {
    	a, b, c *int
    }
    
    func Zero2(t *Z2) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 923 bytes
    - Viewed (0)
  3. 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)
  4. src/runtime/chan_test.go

    			x = make(chan *byte, 8)
    		}
    		close(x)
    	})
    	b.Run("Struct", func(b *testing.B) {
    		b.Run("0", func(b *testing.B) {
    			var x chan struct0
    			for i := 0; i < b.N; i++ {
    				x = make(chan struct0, 8)
    			}
    			close(x)
    		})
    		b.Run("32", func(b *testing.B) {
    			var x chan struct32
    			for i := 0; i < b.N; i++ {
    				x = make(chan struct32, 8)
    			}
    			close(x)
    		})
    		b.Run("40", func(b *testing.B) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 31 20:47:35 UTC 2023
    - 23.4K bytes
    - Viewed (0)
  5. doc/next/6-stdlib/3-structs.md

    ### New structs package
    
    The new [structs] package provides
    types for struct fields that modify properties of
    the containing struct type such as memory layout.
    
    In this release, the only such type is
    [`HostLayout`](/pkg/structs#HostLayout)
    which indicates that a structure with a field of that
    type has a layout that conforms to host platform
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 16:06:02 UTC 2024
    - 356 bytes
    - Viewed (0)
  6. test/fixedbugs/issue30606b.go

    var bigPtrType = reflect.ArrayOf(16385, ptrType)
    
    var x0 = reflect.New(reflect.StructOf([]reflect.StructField{
    	{Name: "F1", Type: byteType},
    	{Name: "F2", Type: bigPtrType},
    }))
    var x1 = reflect.New(reflect.StructOf([]reflect.StructField{
    	{Name: "F1", Type: smallPtrType},
    	{Name: "F2", Type: bigPtrType},
    }))
    var x2 = reflect.New(reflect.StructOf([]reflect.StructField{
    	{Name: "F1", Type: mediumPtrType},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 00:06:12 UTC 2019
    - 1.5K bytes
    - Viewed (0)
  7. test/nilcheck.go

    package p
    
    type Struct struct {
    	X int
    	Y float64
    }
    
    type BigStruct struct {
    	X int
    	Y float64
    	A [1 << 20]int
    	Z string
    }
    
    type Empty struct {
    }
    
    type Empty1 struct {
    	Empty
    }
    
    var (
    	intp       *int
    	arrayp     *[10]int
    	array0p    *[0]int
    	bigarrayp  *[1 << 26]int
    	structp    *Struct
    	bigstructp *BigStruct
    	emptyp     *Empty
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 30 18:41:59 UTC 2022
    - 3.7K bytes
    - Viewed (0)
  8. src/cmd/link/internal/ld/testdata/deadcode/structof_funcof.go

    // Methods of reflect.rtype use StructOf and FuncOf which in turn depend on
    // reflect.Value.Method. StructOf and FuncOf must not disable the DCE.
    
    package main
    
    import "reflect"
    
    type S int
    
    func (s S) M() { println("S.M") }
    
    func (s S) N() { println("S.N") }
    
    type T float64
    
    func (t T) F(s S) {}
    
    func useStructOf() {
    	t := reflect.StructOf([]reflect.StructField{
    		{
    			Name: "X",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:07:26 UTC 2023
    - 994 bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/sizes.go

    //     a struct of n consecutive fields of the array's element type.
    //   - The size of a struct is the offset of the last field plus that
    //     field's size. As with all element types, if the struct is used
    //     in an array its size must first be aligned to a multiple of the
    //     struct's alignment.
    //   - All other types have size WordSize.
    //   - Arrays and structs are aligned per spec definition; all other
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  10. src/reflect/type_test.go

    }
    
    func TestIsRegularMemory(t *testing.T) {
    	type args struct {
    		t reflect.Type
    	}
    	type S struct {
    		int
    	}
    	tests := []struct {
    		name string
    		args args
    		want bool
    	}{
    		{"struct{i int}", args{reflect.TypeOf(struct{ i int }{})}, true},
    		{"struct{}", args{reflect.TypeOf(struct{}{})}, true},
    		{"struct{i int; s S}", args{reflect.TypeOf(struct {
    			i int
    			s S
    		}{})}, true},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 23:39:44 UTC 2024
    - 4.2K bytes
    - Viewed (0)
Back to top