Closed jbuberel closed 8 years ago
Right now the differentiation is not exposed via the API. golangconfig prints a warning to the console when part of GOPATH or GOROOT can not be found on the filesystem. However, if the setting is not present or effectively not present by pointing to a bad value, golangconfig always returns None
.
The end-user message would be changed in Golang Build, but it sounds like we should possibly add an exception to be thrown when GOPATH or GOROOT have values that are invalid.
If being able to differentiate between those two conditions is that much work, I suggest we make the error message more general:
"Unable to configure your $GOPATH. Please make sure the value is set and that it only contains references to valid filesystem paths."
I don't think it is too much work, just explaining what the current checks are and how the error is displayed now.
I'll work on a CL for sublime-config to raise an new exception type if a defined GOPATH can't be found, and another CL for sublime-build to handle that.
Verified - working nicely in 0.9.0 release.
The
$GOPATH
validation should differentiate between these two cases:$GOPATH
environment variable was not defined at all or contains invalid characters (is broken)$GOPATH
could not be resolved to directories in the local filesystem.In the case of 2, the message should be something like "There was an error parsing your $GOPATH. One or more directories could not be found."