Skip to content

Conversation

@Nusiq
Copy link

@Nusiq Nusiq commented Dec 2, 2025

Go 1.23 changed the junction handling on Windows. Junctions are no longer reported with the os.ModeSymlink bit set. Instead, they set the os.ModeIrregular.

This PR makes the the copy function correctly copy the junctions again, like it used to do before Go 1.23 instead of returning an error.

…stent behavior between Go versions before and after version 1.23.

switch {
case info.Mode()&os.ModeSymlink != 0:
case info.Mode()&os.ModeSymlink != 0 || info.Mode()&os.ModeIrregular != 0:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just adding another case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, It's your code. If the junctions are handled the same way as symlinks the result is the same. I'm not sure if they require any special handling so I put it in one case.

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

Successfully merging this pull request may close these issues.

2 participants