Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 1,740 for REFLECT (0.11 sec)

  1. operator/pkg/tpath/struct.go

    	// Special case: map out type must be set through map ptr.
    	if util.IsMap(val) && util.IsMapPtr(out) {
    		reflect.ValueOf(out).Elem().Set(reflect.ValueOf(val))
    		return nil
    	}
    	if util.IsSlice(val) && util.IsSlicePtr(out) {
    		reflect.ValueOf(out).Elem().Set(reflect.ValueOf(val))
    		return nil
    	}
    
    	if reflect.TypeOf(val) != reflect.TypeOf(out) {
    		return fmt.Errorf("setFromPath from type %T != to type %T, %v", val, out, util.IsSlicePtr(out))
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  2. src/database/sql/driver/types.go

    		}
    		return b, nil
    	}
    
    	sv := reflect.ValueOf(src)
    	switch sv.Kind() {
    	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
    		iv := sv.Int()
    		if iv == 1 || iv == 0 {
    			return iv == 1, nil
    		}
    		return nil, fmt.Errorf("sql/driver: couldn't convert %d into type bool", iv)
    	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
    		uv := sv.Uint()
    		if uv == 1 || uv == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 16:30:20 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/conversion/helper.go

    package conversion
    
    import (
    	"fmt"
    	"reflect"
    )
    
    // EnforcePtr ensures that obj is a pointer of some sort. Returns a reflect.Value
    // of the dereferenced pointer, ensuring that it is settable/addressable.
    // Returns an error if this is not possible.
    func EnforcePtr(obj interface{}) (reflect.Value, error) {
    	v := reflect.ValueOf(obj)
    	if v.Kind() != reflect.Pointer {
    		if v.Kind() == reflect.Invalid {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 25 16:23:43 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  4. test/fixedbugs/issue39541.go

    // license that can be found in the LICENSE file.
    
    package main
    
    import "reflect"
    
    func sub(args []reflect.Value) []reflect.Value {
    	type A struct {
    		s int
    		t int
    	}
    	return []reflect.Value{reflect.ValueOf(A{1, 2})}
    }
    
    func main() {
    	f := reflect.MakeFunc(reflect.TypeOf((func() interface{})(nil)), sub).Interface().(func() interface{})
    	c := make(chan bool, 100)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 19 02:11:35 UTC 2020
    - 631 bytes
    - Viewed (0)
  5. src/runtime/pprof/runtime_test.go

    // license that can be found in the LICENSE file.
    
    package pprof
    
    import (
    	"context"
    	"fmt"
    	"reflect"
    	"testing"
    )
    
    func TestSetGoroutineLabels(t *testing.T) {
    	sync := make(chan struct{})
    
    	wantLabels := map[string]string{}
    	if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) {
    		t.Errorf("Expected parent goroutine's profile labels to be empty before test, got %v", gotLabels)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 06 20:29:37 UTC 2017
    - 3K bytes
    - Viewed (0)
  6. test/fixedbugs/issue19168.go

    package p
    
    import (
    	"reflect"
    	"unsafe"
    
    	reflect2 "reflect"
    )
    
    func sink(e interface{})
    
    func a(hdr *reflect.SliceHeader, p *byte) {
    	hdr.Data = uintptr(unsafe.Pointer(p)) // ERROR "write barrier"
    }
    
    func b(hdr *reflect.StringHeader, p *byte) {
    	hdr.Data = uintptr(unsafe.Pointer(p)) // ERROR "write barrier"
    }
    
    func c(hdrs *[1]reflect.SliceHeader, p *byte) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 02 17:21:50 UTC 2017
    - 1.3K bytes
    - Viewed (0)
  7. test/fixedbugs/issue30041.go

    	badPtr = uintptr(unsafe.Pointer(&b[len(b)-1])) + 1
    }
    
    type ft func() *int
    
    var fn ft
    
    func rf([]reflect.Value) []reflect.Value {
    	a := reflect.ValueOf((*int)(nil))
    	return []reflect.Value{a}
    }
    
    const N = 1000
    
    func main() {
    	fn = reflect.MakeFunc(reflect.TypeOf(fn), rf).Interface().(ft)
    
    	// Keep running GC so the write barrier is on.
    	go func() {
    		for i := 0; i < N; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 01 19:23:02 UTC 2019
    - 1.1K bytes
    - Viewed (0)
  8. pkg/kubelet/apis/config/register_test.go

    		AddToScheme:        AddToScheme,
    		AllowedTags: map[reflect.Type]bool{
    			reflect.TypeOf(logsapi.LoggingConfiguration{}):    true,
    			reflect.TypeOf(tracingapi.TracingConfiguration{}): true,
    			reflect.TypeOf(metav1.Duration{}):                 true,
    			reflect.TypeOf(metav1.TypeMeta{}):                 true,
    			reflect.TypeOf(v1.NodeConfigSource{}):             true,
    			reflect.TypeOf(v1.Taint{}):                        true,
    		},
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Aug 01 16:55:02 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  9. src/go/ast/print.go

    	"fmt"
    	"go/token"
    	"io"
    	"os"
    	"reflect"
    )
    
    // A FieldFilter may be provided to [Fprint] to control the output.
    type FieldFilter func(name string, value reflect.Value) bool
    
    // NotNilFilter is a [FieldFilter] that returns true for field values
    // that are not nil; it returns false otherwise.
    func NotNilFilter(_ string, v reflect.Value) bool {
    	switch v.Kind() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  10. schema/serializer.go

    	switch v := fieldValue.(type) {
    	case int64, int, uint, uint64, int32, uint32, int16, uint16:
    		result = time.Unix(reflect.Indirect(rv).Int(), 0).UTC()
    	case *int64, *int, *uint, *uint64, *int32, *uint32, *int16, *uint16:
    		if rv.IsZero() {
    			return nil, nil
    		}
    		result = time.Unix(reflect.Indirect(rv).Int(), 0).UTC()
    	default:
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Mar 18 08:28:46 UTC 2024
    - 4.6K bytes
    - Viewed (0)
Back to top