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

Config.URLs Structure Type #954

Open
ptth404 opened this issue Dec 1, 2023 · 1 comment
Open

Config.URLs Structure Type #954

ptth404 opened this issue Dec 1, 2023 · 1 comment

Comments

@ptth404
Copy link

ptth404 commented Dec 1, 2023

Currently Config.URLs is represented as a map.

For what I found looks like starting from Go 1.12 it really guarantee a stable iteration order over map keys. Which only means the iteration order would be the same among any other iteration.

But I didn't find any confirmation that the iteration order really preserve the order keys were defined on creation or added after.

As a hash map I believe the order might even depend on a keys number in it.

From the other hand the order of [url ] sections in a config are critically matters for the way rules would be matched/applied during resolution.

So is it really the right structure for URLs?

Related #863

@ptth404
Copy link
Author

ptth404 commented Dec 1, 2023

github.com/wk8/go-ordered-map

Same as regular maps, but also remembers the order in which keys were inserted

This implementation probably confirms standard map doesn't preserve the keys order.

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

1 participant