Answer the question
In order to leave comments, you need to log in
How to write the correct task in gulp for go?
Hello, where can I find an example or information showing how to compile a go application using gulp?
The goal is this. We track changes in .go files (gulp-watch) - if there is a change, then we execute the go build main.go command.
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
gulp.task('go:build', function() {
var build = child.spawnSync('go', ['build', 'main.go']);
if (build.stderr.length) {
var lines = build.stderr.toString()
.split('\n').filter(function(line) {
return line.length
});
for (var l in lines)
util.log(util.colors.red(
'Error (go build): ' + lines[l]
));
notifier.notify({
title: 'Error (go build)',
message: lines
});
}
return build;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question