Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make normalizing functions public for external consumption #12

Closed

Conversation

VojtechVitek
Copy link

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?

@mna
Copy link
Member

mna commented Mar 28, 2015

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

@mna mna closed this Mar 28, 2015
@VojtechVitek
Copy link
Author

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?

@mna
Copy link
Member

mna commented Mar 29, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants