Skip to content

Instantly share code, notes, and snippets.

View sidchilling's full-sized avatar

Siddharth Saha sidchilling

View GitHub Profile
@sidchilling
sidchilling / go_routine.go
Created March 25, 2021 11:18
Go Routing question
package main
// Below is a function `sum()` that takes a number, runs a loop to add, and returns the result.
// In the main function, we call `sum()` once with a small number (e.g. 1000) and once
// with a large number (e.g. 1000000000) and prints the result. After that, the main()
// prints the string "All Done!"
// Your job is to convert the main() so that we call sum() concurrently, but wait for all the invocations
// to sum() to complete before printing "All Done".