/go-snippets-sky-slides

This repo is corresponding to the Introduction to Golang slides

Primary LanguageGo

This repo is corresponding to the Introduction to Golang slides

To run code in this repo locally, first install go from https://golang.org/doc/install on your machine and set up necessary env vars and directory structures (normally your go workspace would be consisted of 3 directories, i.e. bin/ (binaries), pkg/ (compiled packages and deployment config) and src/ (human code that you wrote); then clone this repo to your machine.

Each directory that contains a main.go should be treated as an individual package (of course they are not reusable packages, they are just code snippets as illustrations to fundamental golang syntax and charastics), therefore you should cd into any package and run command go run main.go or specifiy the path to the main.go from your current location after go run (e.g. if you are in root directory of the repo and would like to run data-store-in-bits/main.go, run go run awesome-bit-operations/data-store-in-bits/main.go or go build awesome-bit-operations/data-store-in-bits/main.go to build the binary first and execute the binary instead if you prefer that way). If you do go build you would be able to see executables and binaries in your bin/ and pkg/ directories.

If you don't want to run it locally, you can click into the go playground links on the slides, and run it there; though playground can't show multi-processor goroutines, or any server operations.