Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of about 10,000 for struct (0.11 sec)

  1. 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)
  2. 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)
  3. 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)
  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. operator/pkg/tpath/struct.go

    // See the License for the specific language governing permissions and
    // limitations under the License.
    
    /*
    struct.go contains functions for traversing and modifying trees of Go structs.
    */
    package tpath
    
    import (
    	"fmt"
    	"reflect"
    	"strconv"
    
    	"google.golang.org/protobuf/types/known/structpb"
    
    	"istio.io/istio/operator/pkg/util"
    )
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  6. test/struct0.go

    // license that can be found in the LICENSE file.
    
    // Test zero length structs.
    // Used to not be evaluated.
    // Issue 2232.
    
    package main
    
    func recv(c chan interface{}) struct{} {
    	return (<-c).(struct{})
    }
    
    var m = make(map[interface{}]int)
    
    func recv1(c chan interface{}) {
    	defer rec()
    	m[(<-c).(struct{})] = 0
    }
    
    func rec() {
    	recover()
    }
    
    func main() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 565 bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. src/reflect/abi_test.go

    type Struct6 struct {
    	Struct1
    }
    
    // Struct7 is a struct with a nested array-typed field
    // that cannot be passed in registers as a result.
    type Struct7 struct {
    	Struct1
    	Struct2
    }
    
    // Struct8 is large aggregate struct type that may be
    // passed in registers.
    type Struct8 struct {
    	Struct5
    	Struct1
    }
    
    // Struct9 is a type that has an array type nested
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 05 17:54:15 UTC 2022
    - 26.4K bytes
    - Viewed (0)
  10. src/internal/types/testdata/check/conversions1.go

    	var u struct {
    		x struct {
    			x int "bar"
    		} "bar"
    	}
    	s = s
    	s = t // ERRORx `cannot use .* in assignment`
    	s = u // ERRORx `cannot use .* in assignment`
    	s = S(s)
    	s = S(t)
    	s = S(u)
    	t = u // ERRORx `cannot use .* in assignment`
    	t = T(u)
    }
    
    func _() {
    	type E1 struct {
    		x int "foo"
    	}
    	type E2 struct {
    		x int "bar"
    	}
    	type S struct{ x E1 }
    	type T struct {
    		x E2 "foo"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 5.1K bytes
    - Viewed (0)
Back to top