Tutorial by Examples

Install Atom. You can get atom from here Go to Atom settings (ctrl+,). Packages -> Install go-plus package (go-plus) After Installing go-plus in Atom: Get these dependencies using go get or another dependency manager: (open a console and run these commands) go get -u golang.org/x/...
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) %>'], { ...
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) }
Now you can start writing your own go code with auto-completion using Atom and Gulp: package main import ( "fmt" "mypackage" ) func main() { println("4! = ", mypackage.Factorial(4)) }

Page 1 of 1