The Go Language

Getting Started

# macOS
brew install go
# Debian
apt install golang-go

Your First Program


Programs in go are made up of multiple packages, and will run starting from the code defined in the main package.

Vim Plugin

If you want to edit your Go projects in Vim, there's a very healthy ecosystem to support you.

" Install the libraries needed for `vim-go`
" Getting help
:help vim-go

I've included some useful commands below:

" Run the code in the current buffer

" Compile the code

" Install the coe

" Test the code

" Test a single function

" See dependencies of the current package

" See all source files in cwd

" Rename an identifier

" Format the document according to the go style guide

" Resolve all needed package imports & remove all unused packages

" Import the package `math` #study #rise&grind
:GoImport math

" Drop the package `math` #jk2cool4school
:GoDrop math

" Pull up documentation for the function `Printf` package `fmt`
:GoDoc fmt Printf

Posted on: Feb 16, 2020
Last modified: Sep 19, 2020