Skip to content

Instantly share code, notes, and snippets.

@fsamin
Last active September 10, 2015 08:34
Show Gist options
  • Save fsamin/dccdcb7491edd282e9f9 to your computer and use it in GitHub Desktop.
Save fsamin/dccdcb7491edd282e9f9 to your computer and use it in GitHub Desktop.
Gulp go fmt
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