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

Maybe use url.URL? #158

Open
bcl opened this issue Feb 18, 2025 · 0 comments
Open

Maybe use url.URL? #158

bcl opened this issue Feb 18, 2025 · 0 comments

Comments

@bcl
Copy link
Collaborator

bcl commented Feb 18, 2025

In his review of #150 @supakeen suggested using url.URL for the url handling in APIURL and RawURL instead of fmt.Sprintf.
Initially I thought it was a good idea, but after converting weldr I realize that this would make things awkward. Passing in elements to use with url.JoinPath would be really awkward compared to string constants, and constructing query strings would be messy, requiring you to call a function instead of just slapping it on the end of the route.
The urls used are all internal constants, and the protocol and host are hard-coded to http and localhost so I'm not really sure what the benefit of using url.URL would be.

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