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

Add support for Go's net/url JoinPath #9694

Closed
mattdeluco opened this issue Mar 20, 2022 · 3 comments · Fixed by #10897
Closed

Add support for Go's net/url JoinPath #9694

mattdeluco opened this issue Mar 20, 2022 · 3 comments · Fixed by #10897

Comments

@mattdeluco
Copy link

I ran into an issue trying to use path.Join to join a path to a Permalink (I'm new to Hugo and Go): path.Join uses filepath.Join under the hood, which calls filepath.Clean. Among other things, Clean will remove any consecutive slashes, clobbering https:// in .Permalink, making it for example https:/example.com/path/to/a/thing. Go's path.Join also does the same thing with its own implementation of Clean.

I dug around and found there's a very recently added (March 9th) JoinPath function in net/url. I think it may have missed Go 1.18 by 5 days: it would be a convenient addition to Hugo on the next release of Go.

@bep bep removed the NeedsTriage label Mar 21, 2022
@bep bep added this to the v0.96.0 milestone Mar 21, 2022
@bep
Copy link
Member

bep commented Mar 21, 2022

path.Join uses filepath.Join under the hood, which calls

I'm pretty sure the above isn't true, but you are right, we are going to use the new JoinPath, but assuming it's not backported to Go 1.18, I suspect we need to wait until Go 1.20.

@bep bep modified the milestones: v0.96.0, v0.97.0 Mar 24, 2022
@earthboundkid
Copy link
Contributor

I think it may have missed Go 1.18 by 5 days

For the record, even though Go 1.18 shipped in March, the feature freeze for it was back in November. It's part of the Go release cycle: https://github.com/golang/go/wiki/Go-Release-Cycle#timeline

I actually did just barely miss the window for adding http.MaxBytesError to 1.18 because I wasn't paying attention to the freeze date.

@bep bep modified the milestones: v0.97.0, v0.98.0 Apr 13, 2022
@bep bep modified the milestones: v0.98.0, v0.99.0 Apr 28, 2022
@bep bep modified the milestones: v0.99.0, v0.100.0 May 24, 2022
@bep bep modified the milestones: v0.100.0, v0.101.0 May 31, 2022
@bep bep modified the milestones: v0.101.0, v0.102.0 Jun 16, 2022
@bep bep modified the milestones: v0.102.0, v0.103.0 Aug 28, 2022
@bep bep modified the milestones: v0.103.0, v0.104.0 Sep 15, 2022
@bep bep modified the milestones: v0.104.0, v0.105.0 Sep 23, 2022
@bep bep modified the milestones: v0.105.0, v0.106.0 Oct 26, 2022
@bep bep modified the milestones: v0.106.0, v0.107.0 Nov 18, 2022
@bep bep modified the milestones: v0.107.0, v0.108.0 Dec 3, 2022
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants