@leedohm Thanks for the response! I already use path.join extensively for paths which I compute; I suppose path.normalize would make sense for absolute or relative paths that the user supplies.
I do think the defaults requires some special treatment in Atom core, as the settings view will visualize defaults with placeholders, and it’s desirable to not explicitly set a user’s settings just because they’re on Windows.
GofmtPath [https://github.com/joefitzgerald/go-plus/blob/master/lib/go-plus.coffee#L14] is a preference that sets the path to an external executable. The default is OS X specific, and someone might override it to use
goimports by setting the preference to
- The user is now on Windows
- They set
- They use goimports for a while, then want to switch back to
- They remove their preference for
- Things are broken, because the default is a path to
/usr/local/go/bin/gofmt which will not normalize to anything that exists at `c:\usr\local\go\bin\gofmt
- They now have to explicitly set the path to gofmt
While I could detect an *nix path for that and then explicitly set the Windows equivalent, I think that is an anti-pattern and defeats the purpose of the defaults. Even if I did that, if the user removed the value, the package would no longer work again, as the defaults are *nix specific.
This seems like nitpicking, but I just think that to guarantee a good cross-platform experience, things like this should be in the core. Go has a very large Windows install base (I assume due to all the great Chinese gophers out there!), which is motivating me to address Windows support ahead of the curve.