Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,466 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/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)
  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. 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)
  6. 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)
  7. 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)
  8. src/reflect/example_test.go

    package reflect_test
    
    import (
    	"bytes"
    	"encoding/json"
    	"fmt"
    	"io"
    	"os"
    	"reflect"
    )
    
    func ExampleKind() {
    	for _, v := range []any{"hi", 42, func() {}} {
    		switch v := reflect.ValueOf(v); v.Kind() {
    		case reflect.String:
    			fmt.Println(v.String())
    		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
    			fmt.Println(v.Int())
    		default:
    			fmt.Printf("unhandled kind %s", v.Kind())
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 20:04:36 UTC 2022
    - 4.5K bytes
    - Viewed (0)
  9. src/reflect/nih_test.go

    		t.Fatalf("got %d, want 7", got)
    	}
    
    	v = ValueOf((*nih)(unsafe.Pointer(new(int))))
    	shouldPanic("reflect: reflect.Value.Elem on an invalid notinheap pointer", func() { v.Elem() })
    	shouldPanic("reflect: reflect.Value.Pointer on an invalid notinheap pointer", func() { v.Pointer() })
    	shouldPanic("reflect: reflect.Value.UnsafePointer on an invalid notinheap pointer", func() { v.UnsafePointer() })
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 31 01:16:54 UTC 2022
    - 1004 bytes
    - Viewed (0)
  10. test/fixedbugs/issue52788.go

    package main
    
    import (
    	"fmt"
    	"reflect"
    )
    
    func f(next func() bool) {
    	for b := next(); b; b = next() {
    		fmt.Printf("next() returned %v\n", b)
    	}
    }
    
    func main() {
    	next := reflect.MakeFunc(reflect.TypeOf((func() bool)(nil)), func(_ []reflect.Value) []reflect.Value {
    		return []reflect.Value{reflect.ValueOf(false)}
    	})
    	reflect.ValueOf(f).Call([]reflect.Value{next})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 09 16:02:28 UTC 2022
    - 605 bytes
    - Viewed (0)
Back to top