Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 3,055 for REFLECT (0.1 sec)

  1. callbacks/associations.go

    				isPtr := fieldType.Kind() == reflect.Ptr
    				if !isPtr {
    					fieldType = reflect.PtrTo(fieldType)
    				}
    				elems := reflect.MakeSlice(reflect.SliceOf(fieldType), 0, 10)
    				distinctElems := reflect.MakeSlice(reflect.SliceOf(fieldType), 0, 10)
    				joins := reflect.MakeSlice(reflect.SliceOf(reflect.PtrTo(rel.JoinTable.ModelType)), 0, 10)
    				objs := []reflect.Value{}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Apr 11 03:06:13 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  2. test/fixedbugs/issue52788a.go

    package main
    
    import (
    	"fmt"
    	"reflect"
    	"os"
    )
    
    func f(next func() bool) {
    	for b := next(); b; b = next() {
    		fmt.Printf("%v\n", b)
    		os.Exit(0)
    	}
    }
    
    func main() {
    	next := reflect.MakeFunc(reflect.TypeOf((func() bool)(nil)), func(_ []reflect.Value) []reflect.Value {
    		return []reflect.Value{reflect.ValueOf(true)}
    	})
    	reflect.ValueOf(f).Call([]reflect.Value{next})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 09 17:29:53 UTC 2022
    - 600 bytes
    - Viewed (0)
  3. src/text/template/funcs.go

    	uintKind
    )
    
    func basicKind(v reflect.Value) (kind, error) {
    	switch v.Kind() {
    	case reflect.Bool:
    		return boolKind, nil
    	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
    		return intKind, nil
    	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
    		return uintKind, nil
    	case reflect.Float32, reflect.Float64:
    		return floatKind, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 22:23:55 UTC 2024
    - 20.9K bytes
    - Viewed (0)
  4. schema/utils.go

    	}
    	return reflect.StructTag(fmt.Sprintf(`gorm:"%s;%s"`, value, t))
    }
    
    // GetRelationsValues get relations's values from a reflect value
    func GetRelationsValues(ctx context.Context, reflectValue reflect.Value, rels []*Relationship) (reflectResults reflect.Value) {
    	for _, rel := range rels {
    		reflectResults = reflect.MakeSlice(reflect.SliceOf(reflect.PtrTo(rel.FieldSchema.ModelType)), 0, 1)
    
    		appendToResults := func(value reflect.Value) {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Aug 19 13:35:14 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  5. test/fixedbugs/issue37716.go

    package main
    
    import "reflect"
    
    // complicated enough to require a compile-generated hash function
    type K struct {
    	a, b int32 // these get merged by the compiler into a single field, something typehash doesn't do
    	c    float64
    }
    
    func main() {
    	k := K{a: 1, b: 2, c: 3}
    
    	// Make a reflect map.
    	m := reflect.MakeMap(reflect.MapOf(reflect.TypeOf(K{}), reflect.TypeOf(true)))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 10 16:26:59 UTC 2020
    - 872 bytes
    - Viewed (0)
  6. test/fixedbugs/issue30606.go

    // license that can be found in the LICENSE file.
    
    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)
  7. src/time/tzdata_test.go

    			}
    		}
    		return true
    	case reflect.Struct:
    		nf := f1.Type().NumField()
    		for i := 0; i < nf; i++ {
    			if !equal(t, f1.Field(i), f2.Field(i)) {
    				return false
    			}
    		}
    		return true
    	case reflect.String:
    		return f1.String() == f2.String()
    	case reflect.Bool:
    		return f1.Bool() == f2.Bool()
    	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
    		return f1.Int() == f2.Int()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 18 20:57:35 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  8. src/internal/fmtsort/sort_test.go

    	"cmp"
    	"fmt"
    	"internal/fmtsort"
    	"math"
    	"reflect"
    	"runtime"
    	"slices"
    	"strings"
    	"testing"
    	"unsafe"
    )
    
    var compareTests = [][]reflect.Value{
    	ct(reflect.TypeOf(int(0)), -1, 0, 1),
    	ct(reflect.TypeOf(int8(0)), -1, 0, 1),
    	ct(reflect.TypeOf(int16(0)), -1, 0, 1),
    	ct(reflect.TypeOf(int32(0)), -1, 0, 1),
    	ct(reflect.TypeOf(int64(0)), -1, 0, 1),
    	ct(reflect.TypeOf(uint(0)), 0, 1, 5),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  9. src/encoding/xml/read.go

    			return err
    		}
    		return nil
    
    	case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.String:
    		saveData = v
    
    	case reflect.Struct:
    		typ := v.Type()
    		if typ == nameType {
    			v.Set(reflect.ValueOf(start.Name))
    			break
    		}
    
    		sv = v
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 22.4K bytes
    - Viewed (0)
  10. test/fixedbugs/issue28748.go

    			panic("wanted a reflect error, got this instead:\n" + text)
    		}
    	}()
    	r := reflect.MakeFunc(reflect.TypeOf(func() error { return nil }),
    		func(args []reflect.Value) []reflect.Value {
    			var x [1]reflect.Value
    			return x[:]
    		}).Interface().(func() error)
    	r()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 21:23:29 UTC 2019
    - 712 bytes
    - Viewed (0)
Back to top