Skip to content

Conversation

igorpeshansky
Copy link
Contributor

Fixes #83.

/cc @adjackura

@igorpeshansky igorpeshansky force-pushed the igorpeshansky-normalize-backslashes branch from f30d327 to 4e36569 Compare August 3, 2021 18:12
}
*str = filepath.Clean("/" + *str)[1:]
}
if runtime.GOOS == "windows" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is needed and in fact is kinda pointless, any filesystem actions taken by googet will run through oswrap library, and that will call filepath.Clean on all paths. That will replace all "/" with "" on windows

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right that this change is irrelevant for filesystem actions. This was done for backward compatibility. These strings are compared verbatim with the result of mapFiles() in verifyFiles() in goopack.go. Without this change, old goospec files with backslashes would stop working. This is just to ensure that internally, all package file paths are represented with forward slashes. Does this help the change make sense?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah I see the code path where goopack will use this, I don't think this would have any other side effects either because of the call to clean

@adjackura adjackura merged commit 2246e59 into google:master Aug 3, 2021
@igorpeshansky igorpeshansky deleted the igorpeshansky-normalize-backslashes branch August 3, 2021 20:44
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.

Running goopack on Windows requires backslashes in package files

2 participants