code: func supportPointers(hook DecodeHookFunc) (outputHook DecodeHookFunc) {
  	outputHook = func(from, to reflect.Type, data reflect.Value) (reflect.Value, error) {
  		// Get rid of pointers in either direction. This lets us parse **foo if we
  		// know how to parse foo.
  		switch {
  		case from.Kind() == reflect.Ptr: // *foo => bar
  			// Decoding a pointer type to a non-pointer type. Dereference if
  			// non-nil, use zero-value otherwise.
  			from = from.Elem()
  			if data.IsNil() {
  				data = reflect.Zero(from)
  			} else {
  				data = data.Elem()
  			}
  			return outputHook(from, to, data)
  		case to.Kind() == reflect.Ptr: // foo => *bar
  			// Decoding a non-pointer type to a pointer. Decode as usual and take
  			// a pointer to the result.
  			out, err := outputHook(from, to.Elem(), data)
  			if err != nil {
  				return out, err
  			}
  
  			// If we didn't know what to do with the input, the returned value
  			// will just be the data as-is and it won't have the correct type.
  			if !out.Type().AssignableTo(to.Elem()) {
  				return data, nil
  			}
  
  			result := reflect.New(to.Elem())
  			result.Elem().Set(out)
  			return result, nil
  		}
  
  		return hook(from, to, data)
  	}
  	return
  }
docs: // Wraps a DecodeHookFunc to support pointers in either direction (source and
  // destination).