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

Split(".www.miek.nl.") -> []string{"", "www", "miek", "nl"}, #306

Closed
miekg opened this issue Jan 25, 2016 · 8 comments
Closed

Split(".www.miek.nl.") -> []string{"", "www", "miek", "nl"}, #306

miekg opened this issue Jan 25, 2016 · 8 comments

Comments

@miekg
Copy link
Owner

miekg commented Jan 25, 2016

This might be a bug (or not). It's is basically an illegal domain name that you then split...

@andrewtj
Copy link
Collaborator

andrewtj commented Feb 3, 2016

Change the interface, add a new func or make a note of it for a someday-maybe dns2?

@miekg
Copy link
Owner Author

miekg commented Feb 3, 2016

We could return []{0} for this... but yeah returning an error is better...

@andrewtj
Copy link
Collaborator

Maybe a simple breaking change log could make things like this easier. A low effort way to do it would be to just put '#breaking` or similar in commit messages and then extract into the readme a list of commits that break things. This would be even more useful for changes that silently break things like #281 seems to have done to rrda (see fcambus/rrda#11).

@miekg
Copy link
Owner Author

miekg commented Feb 21, 2016

[ Quoting notifications@github.com in "Re: [dns] Split(".www.miek.nl.") ->..." ]

Maybe a simple breaking change log could make things like this easier. A low effort way to do it would be to just put '#breaking` or similar in commit messages and then extract into the readme a list of commits that break things. This would be even more useful for changes that silently break things like #281 seems to have done to rrda (see fcambus/rrda#11).

I agree. Should still be careful, but bugs need to be fixed even though that could
break backwards compat.

I also like the '#breaking' idea.

/Miek

Miek Gieben

@andrewtj
Copy link
Collaborator

Sketched up a way it could work.

@miekg
Copy link
Owner Author

miekg commented Feb 23, 2016

Coming back to this specific issue and looking through other label function, such as CountLabel for instance, they don't return a value plus error. So either we break them all, or we assume and document that in the input should be a properly formatted dns name/label. I'm leaning towards the latter (garbage in, garbage out)

@andrewtj
Copy link
Collaborator

That sounds okay. If there's demand in the future error returning variants could always go in dnsutil.

@miekg
Copy link
Owner Author

miekg commented Feb 23, 2016

[ Quoting notifications@github.com in "Re: [dns] Split(".www.miek.nl.") ->..." ]

That sounds okay. If there's demand in the future error returning variants could always go in dnsutil.

Ok, let's agree to that. They are some prinln("deprecated") littered in the
source and at some point all of these functions/methods should be deprecated
(pref. in one big bang release)

/Miek

Miek Gieben

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

No branches or pull requests

2 participants