Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 46 for structfield (0.28 sec)

  1. src/reflect/visiblefields_test.go

    package reflect_test
    
    import (
    	. "reflect"
    	"strings"
    	"testing"
    )
    
    type structField struct {
    	name  string
    	index []int
    }
    
    var fieldsTests = []struct {
    	testName string
    	val      any
    	expect   []structField
    }{{
    	testName: "SimpleStruct",
    	val: struct {
    		A int
    		B string
    		C bool
    	}{},
    	expect: []structField{{
    		name:  "A",
    		index: []int{0},
    	}, {
    		name:  "B",
    		index: []int{1},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 08 13:44:41 UTC 2022
    - 5.3K bytes
    - Viewed (0)
  2. test/fixedbugs/issue30606b.go

    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},
    	{Name: "F2", Type: bigPtrType},
    }))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 00:06:12 UTC 2019
    - 1.5K bytes
    - Viewed (0)
  3. schema/relationship.go

    		ownFieldsMap[joinFieldName] = ownField
    		fieldsMap[joinFieldName] = ownField
    		joinTableFields = append(joinTableFields, reflect.StructField{
    			Name:    joinFieldName,
    			PkgPath: ownField.StructField.PkgPath,
    			Type:    ownField.StructField.Type,
    			Tag: removeSettingFromTag(appendSettingFromTag(ownField.StructField.Tag, "primaryKey"),
    				"column", "autoincrement", "index", "unique", "uniqueindex"),
    		})
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  4. test/fixedbugs/issue30606.go

    package main
    
    import "reflect"
    
    func main() {}
    
    func typ(x interface{}) reflect.Type { return reflect.ValueOf(x).Type() }
    
    var x = reflect.New(reflect.StructOf([]reflect.StructField{
    	{Name: "F5", Type: reflect.StructOf([]reflect.StructField{
    		{Name: "F4", Type: reflect.ArrayOf(5462,
    			reflect.SliceOf(typ(uint64(0))))},
    	})},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 20:22:14 UTC 2019
    - 502 bytes
    - Viewed (0)
  5. src/reflect/badlinkname.go

    //go:linkname badlinkname_rtype_Field reflect.(*rtype).Field
    func badlinkname_rtype_Field(*rtype, int) StructField
    
    //go:linkname badlinkname_rtype_FieldAlign reflect.(*rtype).FieldAlign
    func badlinkname_rtype_FieldAlign(*rtype) int
    
    //go:linkname badlinkname_rtype_FieldByIndex reflect.(*rtype).FieldByIndex
    func badlinkname_rtype_FieldByIndex(*rtype, []int) StructField
    
    //go:linkname badlinkname_rtype_FieldByName reflect.(*rtype).FieldByName
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  6. schema/field.go

    				}
    				// index is negative means is pointer
    				if field.FieldType.Kind() == reflect.Struct {
    					ef.StructField.Index = append([]int{fieldStruct.Index[0]}, ef.StructField.Index...)
    				} else {
    					ef.StructField.Index = append([]int{-fieldStruct.Index[0] - 1}, ef.StructField.Index...)
    				}
    
    				if prefix, ok := field.TagSettings["EMBEDDEDPREFIX"]; ok && ef.DBName != "" {
    					ef.DBName = prefix + ef.DBName
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 32K bytes
    - Viewed (0)
  7. src/reflect/visiblefields.go

    func VisibleFields(t Type) []StructField {
    	if t == nil {
    		panic("reflect: VisibleFields(nil)")
    	}
    	if t.Kind() != Struct {
    		panic("reflect.VisibleFields of non-struct type")
    	}
    	w := &visibleFieldsWalker{
    		byName:   make(map[string]int),
    		visiting: make(map[Type]bool),
    		fields:   make([]StructField, 0, t.NumField()),
    		index:    make([]int, 0, 2),
    	}
    	w.walk(t)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 26 14:24:17 UTC 2021
    - 3K bytes
    - Viewed (0)
  8. test/fixedbugs/issue49110.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    import "reflect"
    
    func main() {
    	_ = reflect.StructOf([]reflect.StructField{
    		{Name: "_", PkgPath: "main", Type: reflect.TypeOf(int(0))},
    		{Name: "_", PkgPath: "main", Type: reflect.TypeOf(int(0))},
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 27 21:35:48 UTC 2021
    - 389 bytes
    - Viewed (0)
  9. src/go/internal/gccgoimporter/importer_test.go

    	{pkgpath: "v1reflect", name: "Type", want: "type Type interface{Align() int; AssignableTo(u Type) bool; Bits() int; ChanDir() ChanDir; Elem() Type; Field(i int) StructField; FieldAlign() int; FieldByIndex(index []int) StructField; FieldByName(name string) (StructField, bool); FieldByNameFunc(match func(string) bool) (StructField, bool); Implements(u Type) bool; In(i int) Type; IsVariadic() bool; Key() Type; Kind() Kind; Len() int; Method(int) Method; MethodByName(string) (Method, bool); Name()...
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 15 20:17:57 UTC 2022
    - 7.2K bytes
    - Viewed (0)
  10. src/cmd/link/internal/ld/testdata/deadcode/structof_funcof.go

    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",
    			Type: reflect.TypeOf(int(0)),
    		},
    	})
    	println(t.Name())
    }
    
    func useFuncOf() {
    	t := reflect.FuncOf(
    		[]reflect.Type{reflect.TypeOf(int(0))},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:07:26 UTC 2023
    - 994 bytes
    - Viewed (0)
Back to top