Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for EqFunc (0.06 sec)

  1. test/fixedbugs/issue56923.go

    // license that can be found in the LICENSE file.
    
    package p
    
    type Eq[T any] interface {
    	Eqv(a T, b T) bool
    }
    
    type EqFunc[T any] func(a, b T) bool
    
    func (r EqFunc[T]) Eqv(a, b T) bool {
    	return r(a, b)
    }
    
    func New[T any](f func(a, b T) bool) Eq[T] {
    	return EqFunc[T](f)
    }
    
    func Equal(a, b []byte) bool {
    	return string(a) == string(b)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 14 17:22:18 UTC 2023
    - 496 bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/third_party/forked/golang/reflect/deep_equal.go

    			return err
    		}
    	}
    	return nil
    }
    
    // AddFunc uses func as an equality function: it must take
    // two parameters of the same type, and return a boolean.
    func (e Equalities) AddFunc(eqFunc interface{}) error {
    	fv := reflect.ValueOf(eqFunc)
    	ft := fv.Type()
    	if ft.Kind() != reflect.Func {
    		return fmt.Errorf("expected func, got: %v", ft)
    	}
    	if ft.NumIn() != 2 {
    		return fmt.Errorf("expected two 'in' params, got: %v", ft)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 20 17:18:42 UTC 2022
    - 10.8K bytes
    - Viewed (0)
Back to top