@@ -303,37 +303,6 @@ func (s *scope) errorf(message string, args ...interface{}) error {
303
303
return fmt .Errorf (where + message , args ... )
304
304
}
305
305
306
- // Verifies whether a conversion function has a correct signature.
307
- func verifyConversionFunctionSignature (ft reflect.Type ) error {
308
- if ft .Kind () != reflect .Func {
309
- return fmt .Errorf ("expected func, got: %v" , ft )
310
- }
311
- if ft .NumIn () != 3 {
312
- return fmt .Errorf ("expected three 'in' params, got: %v" , ft )
313
- }
314
- if ft .NumOut () != 1 {
315
- return fmt .Errorf ("expected one 'out' param, got: %v" , ft )
316
- }
317
- if ft .In (0 ).Kind () != reflect .Ptr {
318
- return fmt .Errorf ("expected pointer arg for 'in' param 0, got: %v" , ft )
319
- }
320
- if ft .In (1 ).Kind () != reflect .Ptr {
321
- return fmt .Errorf ("expected pointer arg for 'in' param 1, got: %v" , ft )
322
- }
323
- scopeType := Scope (nil )
324
- if e , a := reflect .TypeOf (& scopeType ).Elem (), ft .In (2 ); e != a {
325
- return fmt .Errorf ("expected '%v' arg for 'in' param 2, got '%v' (%v)" , e , a , ft )
326
- }
327
- var forErrorType error
328
- // This convolution is necessary, otherwise TypeOf picks up on the fact
329
- // that forErrorType is nil.
330
- errorType := reflect .TypeOf (& forErrorType ).Elem ()
331
- if ft .Out (0 ) != errorType {
332
- return fmt .Errorf ("expected error return, got: %v" , ft )
333
- }
334
- return nil
335
- }
336
-
337
306
// RegisterUntypedConversionFunc registers a function that converts between a and b by passing objects of those
338
307
// types to the provided function. The function *must* accept objects of a and b - this machinery will not enforce
339
308
// any other guarantee.
@@ -636,10 +605,6 @@ type kvValue interface {
636
605
637
606
type stringMapAdaptor reflect.Value
638
607
639
- func (a stringMapAdaptor ) len () int {
640
- return reflect .Value (a ).Len ()
641
- }
642
-
643
608
func (a stringMapAdaptor ) keys () []string {
644
609
v := reflect .Value (a )
645
610
keys := make ([]string , v .Len ())
@@ -669,11 +634,6 @@ func (a stringMapAdaptor) confirmSet(key string, v reflect.Value) bool {
669
634
670
635
type structAdaptor reflect.Value
671
636
672
- func (a structAdaptor ) len () int {
673
- v := reflect .Value (a )
674
- return v .Type ().NumField ()
675
- }
676
-
677
637
func (a structAdaptor ) keys () []string {
678
638
v := reflect .Value (a )
679
639
t := v .Type ()
0 commit comments