by programd · 4y ago · 0 comments
exec.LookPath("prog")
you now have to explicitly say exec.LookPath("./prog")
to find prog in the current directory. The os/exec docs have more info on how to error handle this correctly.Edit: checking the actual os/exec docs instead of the release notes, it’s actually not as bad as it sounds. What the change actually seems to be is that relative paths are now ignored even if they are in $PATH.
But this is a change on Windows, where bad practices stick around because backward compatibility. (Lots of things would break if cmd.exe changed; but fortunately they fixed this in PowerShell.)
[1]: https://people.engr.ncsu.edu/gjin2/Classes/246/Spring2019/Se...