Code from the workshop about Git and Golang on 2019-11-03
We have a workshop about Golang and also some Git on Sunday 3 november. This is the repo that we will use for the Git part and it will contain the code we will build.
To follow the workshop, you will need some programs to participate:
- Git
- Golang
- A text editor to program Go (I will use Visual Studio Code)
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.
- Download the binary for your operating system
- Install the binary.
- Debian based:
sudo apt install git
- Arch based:
sudo pacman -S git
- Red Hat based:
sudo yum install git
The Go programming language is an open source project to make programmers more productive.
Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.
- Download the binary for your operating system.
- Follow the instructions on the install page of golang.
Use package manager or follow the installation instructions
You can test the Golang installation by writing a basic 'hello world' program:
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
To run the program, navigate to the directory in your terminal and run the go run .
command.
You are free to use whatever text editor you want for Go. After all the code is just plain text. I prefer to use Visual Studio Code. Other common options are The Go Playground, GoLand, Atom, Vim,...
For all these editors, plugins can be found (plugins).
The most commonly used debbuger for go is delve. You can
install the debugger with a go get
command: go get -u github.com/go-delve/delve/cmd/dlv
.