mcp/Resource: Refactor URI Template Matching with uritemplate Library (#100)

1. Replaced the `uriTemplateToRegexp` function with the use of
[yosida95/uritemplate](https://github.com/yosida95/uritemplate) to
handle URI template matching as per the request.
2. Updated the relevant test cases to verify the new implementation and
fixed an invalid URI template (`"file:///{}/{a}/{b}"`) that doesn't
conform to RFC 6570 due to an empty `{}` expression.
3. Updated `go.mod` and `go.sum` to reflect the new dependency.

Fixes #11.
This commit is contained in:
cryo 2025-07-09 03:52:54 +08:00 • committed by GitHub
commit fbff31af14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

1
go.mod
View file

@ -4,5 +4,6 @@ go 1.23.0
require (
github.com/google/go-cmp v0.7.0
github.com/yosida95/uritemplate/v3 v3.0.2
golang.org/x/tools v0.34.0
)