Go - 101
Golang Programming
Golang Programming - Go - 101
###Introduction Go, also known as Golang, is a statically typed, compiled programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Go is syntactically similar to C, but with memory safety, garbage collection, structural typing, and communicating sequential processes (CSP)-style concurrency.
####Why pick Go?
- Go is one of the languages with the biggest demands on the market.
- Provides highly efficient compilations.
- Provides highly efficient execution.
- Simple and explicit constructs.
- Multiplatform
####What is Go good for?
- Web services at scale.
- Networking (http, tcp, udp).
- Concurrent/Parallel programming.
- Systems.
- Automation and command-line tools.
- Crypto.
- Image processing.
###Installation Installing Go is generally easy with very clear and simple to use installers that can be found at https://golang.org/dl/.
After installing the executables, a workspace is required to be setup on your device.
Workspaces consist of:
- A folder - any name, any location with the a bin, pkg, and src folders inside.
- GOROOT - environment variable that indicates where our go binaries are located.
- GOPATH - environment variable pointing to the folder we created before.
###Playground If you want to try Go in your browser, please try this playground. It will let you write and run your code without needing to install anything on your computer. [Go playground] (https://play.golang.org/ “Playground”)
###Overview Golang provides a very solid and complete set of introductory lessons that can be found at https://tour.golang.org/. It’s highly recommended to complete the tour for people who’re unfamiliar with the language to have a general understanding of what features are offered.
###Commands
go versionis used to check your running Golang version.go envdisplays the environment variables used by Go.go helpshows a list of commands that can be run with go.go fmtformats go files using the recommended linting rules established.go runcompiles and runs a specified go file.go buildcompiles a project into either a binary or a package.go getis used to fetch external dependencies for our go installation.