After Installing go-plus in Atom:
go get -u golang.org/x/tools/cmd/goimports
go get -u golang.org/x/tools/cmd/gorename
go get -u github.com/sqs/goreturns
go get -u github.com/nsf/gocode
go get -u github.com/alecthomas/gometalinter
go get -u github.com/zmb3/gogetdoc
go get -u github.com/rogpeppe/godef
go get -u golang.org/x/tools/cmd/guru
$ npm install --global gulp
var gulp = require('gulp');
var path = require('path');
var shell = require('gulp-shell');
var goPath = 'src/mypackage/**/*.go';
gulp.task('compilepkg', function() {
return gulp.src(goPath, {read: false})
.pipe(shell(['go install <%= stripPath(file.path) %>'],
{
templateData: {
stripPath: function(filePath) {
var subPath = filePath.substring(process.cwd().length + 5);
var pkg = subPath.substring(0, subPath.lastIndexOf(path.sep));
return pkg;
}
}
})
);
});
gulp.task('watch', function() {
gulp.watch(goPath, ['compilepkg']);
});
In the code above we defined a compliepkg task that will be triggered every time any go file in goPath (src/mypackage/) or subdirectories changes. the task will run the shell command go install changed_file.go
After creating the gulp file in go path and define the task open a command line and run:
gulp watch
package mypackage
var PublicVar string = "Hello, dear reader!"
//Calculates the factorial of given number recursively!
func Factorial(x uint) uint {
if x == 0 {
return 1
}
return x * Factorial(x-1)
}