2. Why Go?
● Statically Typed Compiled Language
● Fast Compilation
● Built in Concurrency
● Built in unit testing
● Go Tooling
● 25 keywords.
● Mostly has only one way to do it.
3. Organising Go Code
● Packages
● GOPATH - where all the source code will be available for the tools
● $HOME/go is the default GOPATH. src folder under this will hold all the code.
5. Packages
● Every file in Go belongs to a package.
● Collection of source files in a directory.
● Visibility - First character upper case
● Local package
● Remote package
● Import “github.com/golang/x/tools”
● Remote packages are fetched by go get github.com/x/y/z
6. Go Std lib packages
● fmt
● io
● os
● strings
● strconv
● time
● sync
● net/http
● encoding/json
● math
13. Interfaces
● A type defined with set of methods definitions
● Implicit implementation
● Interface values - a tuple of value and type
● Nil interfaces
● Empty interfaces
● Type Assertion
● Type Switch
14. Error handling
● error is an interface in Go
● Check for error before proceeding
● Panic
15. ● A lightweight thread
● Use the go keyword to make any function a goroutine
● Channels
○ Typed data structures for communication
○ Buffered vs Unbuffered
○ ch <- v //Send
○ v := <-ch //Receive
Goroutines
16. Resources
● Effective Go
● A Tour of Go
● The Go Programming Language by Kernighan, Donovich
● Go in Action by Bill Kennedy