Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,740 for REFLECT (0.09 sec)

  1. src/cmd/gofmt/rewrite.go

    	var rewriteVal func(val reflect.Value) reflect.Value
    	rewriteVal = func(val reflect.Value) reflect.Value {
    		// don't bother if val is invalid to start with
    		if !val.IsValid() {
    			return reflect.Value{}
    		}
    		val = apply(rewriteVal, val)
    		clear(m)
    		if match(m, pat, val) {
    			val = subst(m, repl, reflect.ValueOf(val.Interface().(ast.Node).Pos()))
    		}
    		return val
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 27 22:07:13 UTC 2023
    - 8.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go

    }
    
    func isPointerKind(kind reflect.Kind) bool {
    	return kind == reflect.Pointer
    }
    
    func isStructKind(kind reflect.Kind) bool {
    	return kind == reflect.Struct
    }
    
    func isValueKind(kind reflect.Kind) bool {
    	switch kind {
    	case reflect.String, reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16,
    		reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 25 16:23:43 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  3. test/fixedbugs/issue30606b.go

    var smallPtrType = reflect.ArrayOf(100, ptrType)
    var mediumPtrType = reflect.ArrayOf(1000, ptrType)
    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},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 00:06:12 UTC 2019
    - 1.5K bytes
    - Viewed (0)
  4. src/internal/reflectlite/tostring_test.go

    	switch val.Kind() {
    	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
    		return strconv.FormatInt(val.Int(), 10)
    	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
    		return strconv.FormatUint(val.Uint(), 10)
    	case reflect.Float32, reflect.Float64:
    		return strconv.FormatFloat(val.Float(), 'g', -1, 64)
    	case reflect.Complex64, reflect.Complex128:
    		c := val.Complex()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 26 14:24:17 UTC 2021
    - 2.4K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top