Skip to content

bkemper/test_drive-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Test Drive Go

The purpose of this test drive is to understand the setup and capabilities of the Go programming language. Before wasting your time, take a look at the resources used to fuel this test drive.

Setup

Installation

To easily install, manage, and work with multiple Go versions, install Go Version Manager with these instructions.

Prepend to your ~/.bash_profile:

[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"

Reload your profile:

$ source ~/.bash_profile

Install latest Go version:

$ gvm install go1.4

Set as default:

$ gvm use go1.4 --default

Linting

To lint your code, install Golint.

$ go get -u github.com/golang/lint/golint

Append to your ~/.vimrc to print style mistakes after a save:

" https://github.com/golang/lint#vim
set rtp+=$GOPATH/src/github.com/golang/lint/misc/vim
autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow

Documentation

To view your program documentation, install GoDoc.

$ go get -u golang.org/x/tools/cmd/godoc

Refer to the Godoc: documenting Go code blog post for some background and comment convention.

Other Tools

For other awesome tools, check out Go Tools.

Capabilities

Run from source

Write a program and use run:

$ go run src/testdrive/main.go

Run from binary

Compile your source code using build:

$ go build -o bin/testdrive src/testdrive/main.go

Run:

$ ./bin/testdrive

Example Packages

  • Basics - Importing packages, variables, functions, etc.

About

Test Drive Go the language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages