Closed Tyl13 closed 2 months ago
Thank you for reporting the issue! Currently, we don't test on Windows, but this is a good suggestion. We should set up a new GitHub action to test on Windows.
I like the second solution. I think we can get a correct path using filepath.FromSlash()
and only replace the message in the regular expression
Resolved in #74 Thank you @Tyl13!
The issue has two parts to it. The first being that paths in Windows uses backslashes instead of forward slashes that is used in other operating systems. Using runtime.GOOS allows you to check if the system is windows, and you can then use a backslash instead. A small note for that is for the regex to recognize
\
means that it actually needs to be\\\\
. This is because it is first compiled, then parsed. The regex compiles down the four\\\\
into\\
that is correctly parsed directly as\
.The second issue is that the error message given is different on Windows. Specifically instead of being
no such file or directory
, the message isThe system cannot find the file specified.
Two possible solutions, replacing the original assert with either:
or something like this to reduce code repetition