code: func unmarshalerHook(opts *options) DecodeHookFunc {
  	return func(from, to reflect.Type, data reflect.Value) (reflect.Value, error) {
  		if from == to {
  			return data, nil
  		}
  
  		if !reflect.PtrTo(to).Implements(opts.Unmarshaler.Interface) {
  			return data, nil
  		}
  
  		// The following lines are roughly equivalent to,
  		// 	value := new(foo)
  		// 	err := value.Decode(...)
  		// 	return *value, err
  		value := reflect.New(to)
  		err := opts.Unmarshaler.Unmarshal(value, decodeFrom(opts, data.Interface()))
  		if err != nil {
  			err = fmt.Errorf("could not decode %v from %v: %v", to, from, err)
  		}
  		return value.Elem(), err
  	}
  }
docs: // Builds a DecodeHookFunc which unmarshals types using the given unmarshaling
  // scheme. See the unmarshaler type for more information.