Beginner’s guide to learn golang: Your first steps to get started.

Lakin Mohapatra
5 min readDec 17, 2022

--

Google created Go programming language, also known as Golang, to address some of the shortcomings and inefficiencies they were experiencing with existing languages and tools.

Google created Golang for the following reasons :

  1. Compile time : Google has historically struggled with long compile times for its projects having large codebases. This problem has been so significant that Google has developed build tools to separate the dependency analysis and compiling, just to gain a few percent in build time using conventional languages. In an effort to address this issue, Google created the programming language Go, which is designed for faster compilation without the need for dependency checking.
  2. String processing: Google frequently processes and analyzes large amounts of text data in the form of web pages, requiring efficient manipulation of strings. To meet this need, the company incorporated a comprehensive set of string functions into the Go programming language, which also uses garbage collection to make working with strings more efficient compared to some other languages like C++.
  3. Concurrency: The rise of multicore CPUs in the past argued that a language should provide first-class support for some sort of concurrency or parallelism. And to make resource management tractable in a large concurrent program, garbage collection, or at least some sort of safe automatic memory management was required. To address the complexity and difficulty of concurrent programming, where multiple parts of a program run simultaneously, is challenging to do well. Go was designed to make it easier to write concurrent programs by providing built-in support for concurrency and synchronization.
  4. Learning curve: Go is a relatively simple language with a straightforward syntax and a small set of core features. This makes it easy for programmers to learn and use, even if they are new to programming.
  5. Modern software development practices: Go was designed to support modern software development practices such as agile development, continuous integration, and test-driven development. It includes features such as built-in testing and support for dependency management.

Go = C + strings + garbage collection + concurrency.

Key features :

Some of the key features of Go include:

  1. Concurrency: Go is built with concurrency in mind and provides a number of features to make it easy to write concurrent code.
  2. Garbage collection: Go includes a garbage collector that automatically manages memory, making it easier for developers to write code without having to worry about memory management.
  3. Static typing: Go is a statically-typed language, which means that variables are explicitly declared with a specific type and the type of a variable cannot be changed during its lifetime. This can help catch errors at compile time and improve the overall reliability of the code.
  4. Lightweight: Goroutines take only 8 kilobytes and you can have thousands of them.
  5. Fast compilation: Go has a fast compiler that can quickly build large programs, making it suitable for building scalable applications.
  6. Zero dependency: Since the language does not rely on any external libraries or frameworks, you do not need to worry about installing those dependencies on the target machine. This can simplify the deployment process and reduce the risk of issues caused by missing or incompatible dependencies. This can be particularly useful for building applications that need to be deployed in a variety of different environments.
  7. Built-in support for testing: Go includes built-in support for writing and running tests, making it easy to test and verify code.
  8. Strong community: Go has a strong and active community of developers who contribute to the language and its ecosystem, including libraries and tools.

Overall, Go is a versatile and powerful programming language that can be used in a wide range of projects. Whether you’re building a web application, a network server, or a command-line tool, Go is a good language to consider.

As more and more companies and people began to realize Go’s potential, it became a mainstream language to build following kinds of products.

  1. World-class system tools like Docker and Kubernetes
  2. Advanced databases like CockroachDB and InfluxDB
  3. Decentralized Blockchain platforms like Ethereum
  4. To separate configuration into infrastructure layer like Istio
  5. Faster continuous deployment like Drone.
  6. More performant messaging systems like NATS.
  7. Widely used CLI tools like Cobra

Here are some good resources to learn golang.

  1. 𝐓𝐡𝐞 𝐨𝐟𝐟𝐢𝐜𝐢𝐚𝐥 𝐆𝐨𝐥𝐚𝐧𝐠 𝐰𝐞𝐛𝐬𝐢𝐭𝐞 provides comprehensive documentation, tutorials, and other resources for learning the language.
  2. 𝐆𝐨 𝐛𝐲 𝐄𝐱𝐚𝐦𝐩𝐥𝐞” website provides a collection of short, easy-to-understand examples of how to use various Golang features.
  3. 𝐀 𝐓𝐨𝐮𝐫 𝐨𝐟 𝐆𝐨” website provides an interactive, in-browser tutorial that teaches the basics of Golang.
  4. Effective Gois a free resource to learn the Go programming language and it is available on the official website of Golang. This course provides an explanation of all the key concepts in the Go programming language, how to use them, and their syntax.
  5. GopherCon UK 2022 Conference YouTube playlist includes a series of talks and presentations on various topics related to Golang.
  6. 𝐆𝐨𝐩𝐡𝐞𝐫𝐜𝐢𝐬𝐞𝐬 — a FREE course by John Calhoun of calhoun.io.
  7. Golang Crash Course by Traversy MediaThis Go language crash course explains all the fundamentals of Golang.
  8. Learn Go Programming by Building 11 Projects — Course by FreeCodeCampThis Golang course is completely free and published on freeCodeCamp’s YouTube channel.
  9. 𝐓𝐡𝐞 𝐆𝐨 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 𝐋𝐚𝐧𝐠𝐮𝐚𝐠𝐞” book by Alan A. A. Donovan and Brian W. Kernighan is a comprehensive guide to the language, with detailed explanations and examples.
  10. 𝐆𝐨𝐥𝐚𝐧𝐠 𝐍𝐞𝐰𝐬” website provides the latest news, articles, and resources related to Golang.
  11. 𝐆𝐨 𝐅𝐨𝐫𝐮𝐦” is an online community where you can ask questions and get help from other Golang developers.
  12. 𝐆𝐨𝐥𝐚𝐧𝐠 𝐒𝐥𝐚𝐜𝐤” is an online community where you can join channels and discuss Golang with other developers.

Although the design of most languages concentrates on innovations in syntax, semantics, or typing, Go is focused on the software development process itself. Go is efficient, easy to learn, and freely available, but we believe that what made it successful was the approach it took toward writing programs, particularly with multiple programmers working on a shared codebase.
Source — Reddit

As the author of this article, I hope, it will be a helpful resource for developers interested in learning Go. By following the guidance and resources provided in this article, I believe that developers will be able to effectively utilize Go in their work and see the benefits it has to offer.

Thanks for reading my article so far.

You can connect me via Linkedin or Twitter

Please check below article if you are struggling with a mental health issue, anxiety, or depression, and are not able to focus on work.
What is Binaural Beats and How It Enhanced My Productivity Up to the Utmost Extent

References :

  1. https://commandcenter.blogspot.com/2017/09/go-ten-years-and-climbing.html
  2. https://go.dev/talks/2012/splash.article
  3. https://go.dev/doc/faq#What_is_the_purpose_of_the_project
  4. https://cacm.acm.org/magazines/2022/5/260357-the-go-programming-language-and-environment/fulltext
  5. https://www.reddit.com/r/golang/comments/v5ydj2/why_would_you_learn_go/

--

--

Lakin Mohapatra
Lakin Mohapatra

Written by Lakin Mohapatra

Software Engineer | Hungry coder | Proud Indian | Cyber Security Researcher | Blogger | Architect (web2 + web 3)