diff options
Diffstat (limited to 'lib/compilers/golang.js')
-rw-r--r-- | lib/compilers/golang.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/compilers/golang.js b/lib/compilers/golang.js index 08c30c48d..9469e489c 100644 --- a/lib/compilers/golang.js +++ b/lib/compilers/golang.js @@ -27,6 +27,7 @@ var _ = require('underscore-node'); function compilenewgol(info, env) { var compiler = new Compile(info, env); + compiler.originalGetDefaultExecOptions = compiler.getDefaultExecOptions; function convertNewGoL(code) { var re = /^\s+(0[xX]?[0-9A-Za-z]+)?\s?[0-9]+\s*\(([^:]+):([0-9]+)\)\s*([A-Z]+)(.*)/; @@ -60,6 +61,16 @@ function compilenewgol(info, env) { compiler.optionsForFilter = function (filters, outputFilename, userOptions) { return ['tool', 'compile', '-o', outputFilename, '-S']; }; + + compiler.getDefaultExecOptions = function () { + var execOptions = this.originalGetDefaultExecOptions(); + var goroot = this.env.compilerProps("compiler." + this.compiler.id + ".goroot"); + if (goroot) { + execOptions.env.GOROOT = goroot; + } + return execOptions; + }; + return compiler.initialise(); } |