Learning Go Language – Day 6
Goroutines Creating Goroutines: - Use the "go" keyword in front of function call - When using anonymous functions, pass data as local variables Synchronization: - Use sync.WaitGroup to wait for…
Goroutines Creating Goroutines: - Use the "go" keyword in front of function call - When using anonymous functions, pass data as local variables Synchronization: - Use sync.WaitGroup to wait for…
Functions Basic syntax: - func foo() { ... } Parameters: - Comma delimited list of variable and types - func foo(bar string, baz int) - Parameters of same type list…
If-Statements If-Statements: - Initializers: Allows you to generate a statement to set-up for a comparison - Variables in an if-statement are block-scoped - Comparison operators (primarily for numeric types): -…