Closed VojtechVitek closed 9 years ago
Hi Vojtech,
I understand the idea, but that makes the exposed API to maintain much larger. I'd really prefer to keep it as it currently is, and keep the internal functions implementation details so it can be changed at will (for example, one thing I'd like to do eventually is to do the normalization on the raw bytes or in a buffer instead of on strings, and avoid unnecessary allocations).
Of course, you can still control which normalization gets applied using the flags.
Martin
The exposed "API" would be just a function name, which by the way pairs 1:1 to (already public) Flag name. You could still change the internal implementation details of all public functions, the func WhateverFunc(u *url.URL)
interface doesn't change.
Are you saying that you want to change function names or the interface in the future and you don't want your hands tied?
I don't want a larger public API, currently it is just the Normalize*
funcs and the flags, I don't want to add a dozen functions to that. As I said, you can still select the normalization to apply with the flags, the overhead is very small, the flag-to-func is a hashtable lookup.
I'd like to be able to use some of the normalizing functions in external project without the need of purell flags and
NormalizeURL*()
functions.Would you be OK with this change?