Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 46 for structfield2 (0.36 sec)

  1. src/reflect/type_test.go

    		}
    	}
    }
    
    func TestStructOfEmbeddedIfaceMethodCall(t *testing.T) {
    	type Named interface {
    		Name() string
    	}
    
    	typ := reflect.StructOf([]reflect.StructField{
    		{
    			Anonymous: true,
    			Name:      "Named",
    			Type:      reflect.TypeFor[Named](),
    		},
    	})
    
    	v := reflect.New(typ).Elem()
    	v.Field(0).Set(
    		reflect.ValueOf(reflect.TypeFor[string]()),
    	)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 23:39:44 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  2. src/cmd/fix/egltype_test.go

    var y = x == nil
    var z = x != nil
    `,
    			Out: `package main
    
    // typedef void *$EGLTYPE;
    import "C"
    
    var x C.$EGLTYPE
    var y = x == 0
    var z = x != 0
    `,
    		},
    		{
    			Name: "egl.StructField",
    			In: `package main
    
    // typedef void *$EGLTYPE;
    import "C"
    
    type T struct {
    	x C.$EGLTYPE
    }
    
    var t = T{x: nil}
    `,
    			Out: `package main
    
    // typedef void *$EGLTYPE;
    import "C"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 16 22:02:42 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go

    	MarshalQueryParameter() (string, error)
    }
    
    // Unmarshaler converts a string representation to an object
    type Unmarshaler interface {
    	UnmarshalQueryParameter(string) error
    }
    
    func jsonTag(field reflect.StructField) (string, bool) {
    	structTag := field.Tag.Get("json")
    	if len(structTag) == 0 {
    		return "", false
    	}
    	parts := strings.Split(structTag, ",")
    	tag := parts[0]
    	if tag == "-" {
    		tag = ""
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 25 16:23:43 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  4. src/reflect/example_test.go

    	fileType := reflect.TypeOf((*os.File)(nil))
    	fmt.Println(fileType.Implements(writerType))
    
    	// Output:
    	// true
    }
    
    func ExampleStructOf() {
    	typ := reflect.StructOf([]reflect.StructField{
    		{
    			Name: "Height",
    			Type: reflect.TypeOf(float64(0)),
    			Tag:  `json:"height"`,
    		},
    		{
    			Name: "Age",
    			Type: reflect.TypeOf(int(0)),
    			Tag:  `json:"age"`,
    		},
    	})
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 20:04:36 UTC 2022
    - 4.5K bytes
    - Viewed (0)
  5. src/internal/abi/type.go

    	Elem *Type // pointer element (pointed at) type
    }
    
    type StructField struct {
    	Name   Name    // name is always non-empty
    	Typ    *Type   // type of field
    	Offset uintptr // byte offset of field
    }
    
    func (f *StructField) Embedded() bool {
    	return f.Name.IsEmbedded()
    }
    
    type StructType struct {
    	Type
    	PkgPath Name
    	Fields  []StructField
    }
    
    // Name is an encoded type Name with optional extra data.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:09:59 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  6. api/go1.17.txt

    pkg net, method (IP) IsPrivate() bool
    pkg net/http, func AllowQuerySemicolons(Handler) Handler
    pkg net/url, method (Values) Has(string) bool
    pkg reflect, func VisibleFields(Type) []StructField
    pkg reflect, method (Method) IsExported() bool
    pkg reflect, method (StructField) IsExported() bool
    pkg reflect, method (Value) CanConvert(Type) bool
    pkg reflect, method (Value) InterfaceData //deprecated
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 20:31:46 UTC 2023
    - 18K bytes
    - Viewed (0)
  7. src/debug/dwarf/type_test.go

    			break
    		}
    
    		if e.Tag == TagStructType {
    			typ, err := d.Type(e.Offset)
    			if err != nil {
    				t.Fatal("d.Type:", err)
    			}
    
    			t1 := typ.(*StructType)
    
    			bitInfoDump := func(f *StructField) string {
    				res := fmt.Sprintf("S:%d", f.BitSize)
    				if f.BitOffset != 0 {
    					res += fmt.Sprintf(" BO:%d", f.BitOffset)
    				}
    				if f.DataBitOffset != 0 {
    					res += fmt.Sprintf(" DBO:%d", f.DataBitOffset)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 15:49:05 UTC 2022
    - 8.8K bytes
    - Viewed (0)
  8. src/cmd/vendor/github.com/google/pprof/internal/driver/config.go

    	name         string              // JSON field name/key in variables
    	urlparam     string              // URL parameter name
    	saved        bool                // Is field saved in settings?
    	field        reflect.StructField // Field in config
    	choices      []string            // Name Of variables in group
    	defaultValue string              // Default value for this field.
    }
    
    var (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 16 15:19:53 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  9. src/encoding/xml/typeinfo.go

    			}
    		}
    	}
    
    	ti, _ := tinfoMap.LoadOrStore(typ, tinfo)
    	return ti.(*typeInfo), nil
    }
    
    // structFieldInfo builds and returns a fieldInfo for f.
    func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, error) {
    	finfo := &fieldInfo{idx: f.Index}
    
    	// Split the tag from the xml namespace if necessary.
    	tag := f.Tag.Get("xml")
    	if ns, t, ok := strings.Cut(tag, " "); ok {
    		finfo.xmlns, tag = ns, t
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:23:29 UTC 2023
    - 9.6K bytes
    - Viewed (0)
  10. src/cmd/link/internal/ld/decodesym.go

    	}
    }
    
    func commonsize(arch *sys.Arch) int      { return abi.CommonSize(arch.PtrSize) }      // runtime._type
    func structfieldSize(arch *sys.Arch) int { return abi.StructFieldSize(arch.PtrSize) } // runtime.structfield
    func uncommonSize(arch *sys.Arch) int    { return int(abi.UncommonSize()) }           // runtime.uncommontype
    
    // Type.commonType.kind
    func decodetypeKind(arch *sys.Arch, p []byte) abi.Kind {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 16:25:18 UTC 2024
    - 9.9K bytes
    - Viewed (0)
Back to top