return new GoOs(getEffectiveValue_NonNull(GoEnvironmentPrefs.GO_OS, project, GOOS));
}
public static GoPath getEffectiveGoPath(IProject project) {
String goPathPref = getEffectiveValue_NonNull(GoEnvironmentPrefs.GO_PATH, project, GOPATH);
GoPath rawGoPath = new GoPath(goPathPref);
if(project == null) {
return rawGoPath;
}
IPath location = project.getLocation();
if(location == null) {
return rawGoPath;
}
java.nio.file.Path projectPath = location.toFile().toPath();
java.nio.file.Path goPathEntry = rawGoPath.findGoPathEntryForSourcePath(projectPath);
if(goPathEntry != null) {
// GOPATH already contains project location
return rawGoPath;
}
// Implicitly add project location to GOPATH
ArrayList2<String> newGoPathEntries = new ArrayList2<>(projectPath.toString());
newGoPathEntries.addElements(rawGoPath.getGoPathEntries());
return new GoPath(newGoPathEntries);
}