if (getResult == downloaded || !exists(targetBinaryFilename)) {
getLogger().info("Get tool {}...", dependency.getGroup());
progress.progress("Get tool " + dependency.getGroup() + "...");
delete(targetBinaryFilename.getParent());
executor(toolchain.getGoBinary())
<BUG>.workingDirectory(build.getGopath())

.env("GOPATH", build.getGopath())
</BUG>
.env("GOROOT", toolchain.getGoroot())

if (getResult == downloaded || !exists(targetBinaryFilename)) {
getLogger().info("Get tool {}...", dependency.getGroup());
progress.progress("Get tool " + dependency.getGroup() + "...");
delete(targetBinaryFilename.getParent());
executor(toolchain.getGoBinary())
.workingDirectory(build.getFirstGopath())
.env("GOPATH", build.getGopathAsString())
.env("GOROOT", toolchain.getGoroot())
