Golang
··2 mins
Table of Contents
Go To References #
- The Go Playground - Run, test, and share Golang code in the browser
- A Tour of Go - Great introduction to Golang syntax and features with live, in browser examples
- Go Data Structures - Overview of how primitive Golang data structures are stored in memory
- TheAlgorithms | Go - Golang implementation of common algorithms
- The 3 ways to sort in Go | YourBasic
- Go says WAT? | GopherCon 2018 - 16 examples of cases where the results may not be as we anticipated. Key takeaways:
- map is a pointer to the data structure; slice is a struct containing a pointer to a data structure
defer
runs right before exit, in LIFO order- use named returns carefully
- be wary of
nil
interface comparisons - use
go vet -shadow
to understand issues with shadowed variables within blocks
- Constants - Details of how constants work (behave like regular numbers)
- Go Slices: usage and internals - Introduction to what slices are and how they work
- Arrays, slices (and strings): The mechanics of ‘append’ - Details about arrays and how slices differ
- Strings, bytes, runes and characters in Go - Details about how strings and other textual characters in Golang, how they are different, and how they should be used
- Text normalization in Go - Details about string representation
- Go maps in action - Details on map usage in Golang
- create with
m = make(map[string]int)
- create with data:
commits := map[string]int{ "rsc": 3711, "r": 2138, "gri": 1908, "adg": 912, }
- set with
m["route"] = 66
- get with
i := m["route"]
- iterate with:
for key, value := range m { fmt.Println("Key:", key, "Value:", value) }
- create with
- Channels offer synchronized communication - Provides basic examples to get started with channels
- Data races explained - Explanation of how go routines can result in race conditions, as well as how to avoid them
- Why Generics? - What generics means within Golang