code: func wrapValue(rval reflect.Value, rtype reflect.Type) interface{} {
  	pval := rval.Interface()
  
  	if rval.Kind() == reflect.Slice {
  		// Convert slice to types.ArrayOf*
  		switch v := pval.(type) {
  		case []string:
  			pval = &types.ArrayOfString{
  				String: v,
  			}
  		case []uint8:
  			pval = &types.ArrayOfByte{
  				Byte: v,
  			}
  		case []int16:
  			pval = &types.ArrayOfShort{
  				Short: v,
  			}
  		case []int32:
  			pval = &types.ArrayOfInt{
  				Int: v,
  			}
  		case []int64:
  			pval = &types.ArrayOfLong{
  				Long: v,
  			}
  		default:
  			kind := rtype.Elem().Name()
  			// Remove govmomi interface prefix name
  			kind = strings.TrimPrefix(kind, "Base")
  			akind, _ := defaultMapType("ArrayOf" + kind)
  			a := reflect.New(akind)
  			a.Elem().FieldByName(kind).Set(rval)
  			pval = a.Interface()
  		}
  	}
  
  	return pval
  }
docs: // wrapValue converts slice types to the appropriate ArrayOf type used in property collector responses.