Why the world needs another programming language, the buzz behind it and How the developers are nailing it right. <Add Google Background info>
Lets kick this off quickly:
Go Package == A Folder. A folder in which source files are bundled together to be compiled. Functions, variables and constants are implicitly shared with everybody in the package.
Go Module == The Mother Folder. Collection of packages (or folders) and a go.mod file at the root.
go.mod == A simple file with a path inside that serves two purpose: it becomes the “import path prefix” for all the packages (or folders) within a module, which is a string that anybody in the world will use to import your package into their code. And it also points where the go command should look to download your module.
Main Package == A special package that will auto-compile the contents within it when we run: go install or go run.
go build == does not produce an output file. It saves the compiled package into local build cache.
go tidy == if you are using an external package, this command will resolve the missing dependencies and remove any unwanted requirements. Module dependencies are downloaded on the pkag/mod path on GOPATH.
Closure:
A function returning an anonymous/inner function. Closure is an inner function that has access to all the variables in the scope where it was created. This applies even after the outer function finishes execution. Thats sounds hackish!
WaitGroups:
To wait for multiple goroutines to finish, we can use a wait group |
Interfaces shine in patterns emphasizing behavior or interaction between objects, like the Strategy or Observer patterns.