Tags: darlinggo/trout
Tags
Rewrite for 2.0.0! This is basically a ground-up rewrite/refactor. A lot of more complicated code was rewritten to use types that make it clearer and a lot less fragile. We changed the trie around a bit to the point where I'm not sure if it counts as a trie anymore, but we're no longer mingling static and dynamic path elements, which makes everything much clearer. We're also termining endpoints and prefixes with a special nul node in the trie, to make it clear when the full thing has been matched. The nul node is also what gets methods on it, which makes things a bit more straightforward. We now also have executable and testable examples, which is cool.
v1.0.1: patch release. Fix two bugs: first, when dealing with different child routes with a common ancestor, correct how the route trie gets constructed so all child routes actually match. Second, when calculating the priority of a matching node to decide which node to use as the result, calculate the ancestors' priorities recursively, and add them to the current node's priority. This is a change from how it was done previously, where only the immediate ancestor's priority was considered.