Go in a Go
Go was designed with the following goals for a new language.
- Fast compilation.
- Code that is less cumbersome.
- With garbage collection, unneeded memory is automatically freed.
- Multi-tasking software that is easy to write (concurrency)
- Multicore processors are well supported.
Who Uses Go
-
Google
Golang was designed by Google engineers and is often used there for internal projects. Google Chrome and Google Earth were created in this way. It is also used in YouTube and Google App Engine.
-
Uber
One of the biggest companies using Golang is Uber. It is used there for the geofence service, which serves the user’s location and product availability. Geofence makes it possible to precisely define the area with special requirements (e.g. taking into account places such as airports) and to implement dynamic prices. The service has a guaranteed high reliability. It has been running continuously for 99.99% of the time since its commissioning. Rare downtime was caused by third-party libraries, while there were no problems in terms of the language itself.
-
Netflix
Netflix incorporates the power of Go into its development process, playing a crucial role in shaping the streaming app we all know.
Golang concurrency capabilities allow Netflix to handle multiple user requests simultaneously. It ensures your favourite shows start promptly, without annoying delays or buffering issues.
But Go’s benefits continue beyond there. One of its standout features is simplicity. Netflix’s developers appreciate Go’s clean and intuitive syntax, which allows them to focus on writing clean code and building new features.
-
Twitch
In Twitch, Go is used for the most-loaded systems. It is appreciated for its simplicity, security, efficiency and readability, which means that it perfectly manages problems encountered when displaying live video and simultaneous chats of a large number of users.
Above all, however, Go enabled Twitch to improve 20 times the GC (garbage collection) factor responsible for automatically managing dynamically allocated memory.
-
Dropbox
Dropbox, one of the leaders in cloud computing services constitutes another great example of a major company using Golang. It needs this language to scale its systems in a more efficient way. To this end, the company migrated its critical systems with Python.
To deal with the problem of insufficient depth of Go libraries and to be able to build larger systems, Dropbox began to build its own libraries.
This allowed them to improve caching, improve the standard error interface, enable programmers to generate SQL statements programmatically, and to implement fully functional memcache client libraries.
Dropbox plans to expand Golang libraries and make internally used libraries public on GitHub.
-
SoundCloud
One of the biggest companies using Golang is SoundCloud. It decided to use Go language in addition to Ruby on Rails.
Its engineers described Golang as a WYSIWYG language, which means that the code entered does exactly what appears on the page. In addition, they appreciate the “one problem – one solution” philosophy, which means less time is spent thinking about the code.
For SoundCloud, the ability to perform static analysis in real time was also important, which was possible thanks to static typing and fast compilation enabled by Go.
This significantly accelerated the work on applications.
Currently, SoundCloud uses 6 services and a dozen or so repositories completely written in Go.
-
Kubernetes
Kubernetes (K8s) – Google’s most recent container-management system is an open-source system for automating deployment, scaling, and management of containerized applications.
Many More...
Go vs Other Languages
The Go Playground
The easiest way to try Go is to visit https://go.dev/play in your web browser.
Installation
Follow instructions given in https://go.dev/doc/install
Go Tools
When you install go, it adds an executable named go to your command prompt.
Importing Packages
An import can describe how to obtain the package source code using a revision control system such as Git.
package main
import (
"fmt"
"github.com/google/go-cmp/cmp"
)
func main() {
fmt.Println(cmp.Diff("Hello World", "Hello Go"))
}
When you run commands like ‘go install,’ ‘go build,’ or ‘go run,’ the ‘go’ command will automatically download the remote module and record its version in your ‘go.mod’ file.