Last active
September 10, 2015 08:34
-
-
Save fsamin/dccdcb7491edd282e9f9 to your computer and use it in GitHub Desktop.
Gulp go fmt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
path = require('path'), | |
tap = require('gulp-tap'), | |
exec = require('child_process').exec; | |
var serverPaths = { | |
ALL_GO: ['./server/**/*.go'], | |
}; | |
gulp.task('go-fmt', function() { | |
gulp.src(serverPaths.ALL_GO) | |
.pipe(tap(function(file, t) { | |
console.log(file.path); | |
exec('go fmt ' + file.path, function (err, stdout, stderr) { | |
if (err) { | |
throw err | |
} | |
}); | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment