”工欲善其事,必先利其器。“—孔子《论语.录灵公》
首页 > 编程 > 学习 Golang 的最佳资源

学习 Golang 的最佳资源

发布于2024-11-01
浏览:702

Hi there! I haven’t introduced myself yet, as I haven’t had the chance. My name is Harutyun {ha.root.eeoon}, and I’m a Software Engineer and passionate Golang Developer. I really adore the language and enjoy working with its toolchain. I’ve been working with Go for the past five years. Before switching to Golang, I worked as a Full Stack Developer, with PHP as my main backend language and JS jQuery for the frontend.

At that time, I noticed that many companies were transitioning to Golang from Ruby, NodeJS, and PHP to improve latency, introduce concurrency, and enable background task execution for their products. The first article I came across was on Shopify’s blog, explaining how switching to Golang improved their service latency by 80%. I was fascinated by the article and began reading up on references, language concepts, and Golang’s official blog to better understand the language.

After PHP, Golang felt like a breath of fresh air—everything was fast, incredibly fast. I remember the first program I wrote: a file checksum validator for some open-sourced NASA data from the Apollo mission. It involved a collection of five files, each around 2GB in size. Seeing an execution time of 1.4 seconds blew my mind. At that moment, I knew I had to switch my stack to Golang to create and develop awesome software.

In this article, I want to share some resources that helped me become a Golang Engineer and continue to help me develop new skills while staying up to date with the latest technologies.

Books: The Saint Triada

The Best Resources for Learning Golang

Get Programming with Go by Nathan Youngman and Roger Peppé

If you’re just getting started with Go and want a book that makes the learning process easy and approachable, I highly recommend “Get Programming with Go” by Nathan Youngman and Roger Peppé. This book is perfect for beginners because it really focuses on the basics without overwhelming you with too much information at once. What’s great about this book is how clearly it explains everything. It starts right from the ground up, walking you through the core concepts of Go step-by-step. You’ll learn the essentials like how to declare variables, use loops, and write functions, but the authors do it in a way that’s super accessible—even if you don’t have a ton of programming experience.

If you’re new to Go or even new to programming in general, “Get Programming with Go” is one of the best places to start. It’s designed to help you build a strong foundation in the language without feeling lost or frustrated, and by the time you’re finished, you’ll have a solid understanding of how Go works. One thing I really liked is that the book doesn’t assume you already know a bunch of other programming languages. It’s written in plain language and focuses on helping you understand Go’s syntax and structure in a simple, straightforward way. It also covers Go’s unique approach to things like error handling and memory management, but again, in a way that’s very beginner-friendly.

Learning Go by Jon Bodner

If you’ve already gone through “Get Programming with Go” and are looking to take your Go skills to the next level, I highly recommend following up with “Learning Go” by Jon Bodner. While “Get Programming with Go” gives you a solid foundation and introduces the language in a very beginner-friendly way, “Learning Go” goes deeper into the more complex aspects of the language, perfect for when you’re ready to explore Go in greater detail.

This book builds on the basics and really helps you understand the intricacies of Go, like its concurrency model, interfaces, and error handling. Where the first book focuses on helping you get started, “Learning Go” dives deeper into Go’s unique features, and it gives you a much clearer picture of how to write more efficient, maintainable code. The explanations are still very approachable, but they’re more comprehensive, covering concepts that you might not have tackled yet. So if you’ve finished “Get Programming with Go” and are ready for more depth, “Learning Go” is the perfect next step. It’s a great way to continue your Go journey and really master the language.

100 Go Mistakes and How to Avoid Them by Teiva Harsanyi

After building a solid foundation with “Get Programming with Go” and diving deeper into Go’s core concepts with “Learning Go”, the next logical step in mastering the language is “100 Go Mistakes and How to Avoid Them” by Teiva Harsanyi. This book is the perfect continuation of your Go journey because it shifts the focus from learning the language to refining your skills and avoiding common pitfalls that even experienced developers encounter.

Where the previous two books helped you understand how Go works and how to use its features, “100 Go Mistakes” takes a more practical, hands-on approach by highlighting real-world mistakes that often trip up developers and how to steer clear of them. It’s a fantastic resource for developers who want to sharpen their expertise by learning from others’ experiences. The book covers mistakes across a wide range of topics, including concurrency, error handling, testing, and memory management, giving you insights into how to write more robust, efficient, and bug-free Go code. It’s not just about coding best practices, but about understanding the deeper reasons behind why certain approaches might seem right at first but can lead to subtle errors later. This book is invaluable for improving your Go skills, helping you think more critically about your code, and ensuring you avoid common traps as you progress toward writing more professional-level Go programs.

Each book builds upon the previous one, ensuring a comprehensive learning journey from the basics to mastering Go’s intricacies. You start with “Get Programming with Go” to establish a solid foundation, as it introduces the language in a simple, beginner-friendly way. “Learning Go” then takes you deeper into Go’s core features and concepts, giving you a more thorough understanding of the language’s capabilities. Finally, “100 Go Mistakes and How to Avoid Them” focuses on practical, real-world advice, helping you identify and avoid common pitfalls, making you a more efficient and confident Go developer.

BONUS Book

The Best Resources for Learning Golang

Test-Driven Development in Go by Adelina Simion

"Test-Driven Development in Go" by Adelina Simion is the latest addition to my collection. With its fresh perspective and modern approach to TDD, this book will further solidify developers ability to write reliable, thoroughly tested Go code while keeping up with the latest development practices. This book will guide you through adopting test-driven development, ensuring that your Go code is not only functional but also robust and maintainable. By focusing on writing tests first and using them to guide your coding process, you’ll gain deeper insights into producing higher-quality code.

Blogs: Go Wisdom and Witty Wonders

research!rsc: Thoughts and links about programming, by Russ Cox

https://research.swtch.com

It’s the personal blog of Russ Cox, a key contributor to the Go programming language. Russ Cox is one of the original developers of Go and has written extensively about the language, its development, and software engineering concepts in general. His blog covers deep technical topics, particularly around Go’s design decisions, tooling, concurrency model, and performance optimizations. It’s an excellent resource for gaining insight into Go’s evolution and understanding the rationale behind many of the language’s features. Cox also writes about broader topics related to programming languages, compilers, and computer science theory. It’s a go-to for developers who want to dive into the intricacies of Go, and it offers unique perspectives on how Go is designed to solve practical problems.

Dave Cheney: The acme of foolishness

https://dave.cheney.net

Dave Cheney is a prominent figure in the Go community and has contributed significantly to the language, particularly in areas like performance optimization, error handling, and best practices. His blog is well-known for providing in-depth, practical advice on writing idiomatic and efficient Go code. Topics he covers include Go’s concurrency model, memory management, testing strategies, and performance tuning. Dave is also known for breaking down complex topics in an accessible way, making his blog an excellent resource for both beginner and advanced Go developers. He has written about common Go design patterns, performance pitfalls, and how to get the most out of the language’s features, offering tips that help developers write more robust and maintainable Go programs. If you’re looking to deepen your understanding of Go or explore advanced techniques, Dave Cheney’s blog is a fantastic resource.

Julia Evans' Blog

https://jvns.ca

While Julia’s blog isn’t exclusively about Go, it’s well-known for its approachable and insightful posts on a wide range of technical topics, including systems programming, debugging, networking, and sometimes Go. Her writing style is casual and highly readable, making complex subjects easier to understand, even for beginners. One of the things that sets Julia apart is her ability to take intricate concepts whether it’s networking fundamentals or how operating systems work and break them down into simple, digestible posts. She often uses zines and illustrations to make technical content more engaging, which is a unique aspect of her blog. Even though Go is not the primary focus, when she does write about Go, it’s from a practical, systems-level perspective. If you’re into systems programming and want to see how Go fits into that world, Julia Evans’ blog is a great resource!

The Go Blog

https://go.dev/blog/

The official blog for the Go programming language, maintained by the Go team at Google. This blog covers new releases, features, design decisions, and community updates. It’s a great source for understanding Go from the perspective of the core developers. It’s the primary source of updates, news, and in-depth posts about the Go programming language, maintained by the core Go development team at Google. This blog covers a wide range of topics, including:

  • New Go releases: Detailed explanations of what’s new in each version, including features, bug fixes, and improvements.
  • Language design decisions: Insights into why certain features were added or how Go continues to evolve.
  • Best practices: Articles on how to use Go more effectively, including tips on performance optimization, memory management, and concurrency.
  • Community and ecosystem updates: Highlights of community projects, Go conferences, and tools that enhance the Go ecosystem.

Useful Telegram channels

Unfortunately, these are Russian-only channels, and most of the posts come from Russian sources, so they may not be a good fit for many. But if you know Russian, you’re all set!

  • @goproglib - All the most useful things for a Go developer in one channel.
  • @go_in_action - Everything about the Go programming language in Russian and English
  • @golangtests - Golang challenges
  • @golang_interview - Golang challenges and interview preparation resources

Conclusion

Learning Go is a rewarding journey, and having the right resources makes all the difference. Whether you’re just starting out or looking to dive deep into more advanced concepts, the blogs and books mentioned here offer invaluable insights and guidance. From mastering the basics to avoiding common pitfalls, these resources have been carefully curated to ensure you can develop your Go skills effectively and confidently.

As you continue exploring Go, remember that the strength of the Go community lies not only in its powerful language but also in its willingness to share knowledge. The resources available today reflect the hard work and dedication of countless contributors who want to help you succeed. Dive in, keep learning, and enjoy the process because with Go, the possibilities are endless!

A Huge Thank You to the Go Community!

I want to take a moment to express my appreciation for the incredible resources that have made learning Go such a rewarding experience. From in-depth blog posts on language design and performance to practical advice on writing efficient, idiomatic code, the contributions of so many in the community have been invaluable. The clarity, passion, and dedication behind these resources have helped countless developers, including myself, improve and grow.

Thank you for making Go such an enjoyable and enriching journey for all of us!

版本声明 本文转载于:https://dev.to/crusty0gphr/the-best-resources-for-learning-golang-51f6?1如有侵犯,请联系[email protected]删除
最新教程 更多>
  • 自定义 Django 面板:分步指南
    自定义 Django 面板:分步指南
    在本指南中,我将引导您了解如何修改和扩展 Django 默认管理面板/界面,使其更加用户友好。 1.设置项目: 首先在 Django 中创建一个全新的项目和应用程序 django-admin startproject myprojectname cd myprojectname python man...
    编程 发布于2024-11-07
  • 了解身份验证流程
    了解身份验证流程
    什么是身份验证流程? 身份验证流程是确认用户身份并管理他们对应用程序某些部分的访问的过程。当您使用网络应用程序(例如社交媒体网站)时,这涉及检查用户是否是他们所说的人(登录),然后授予他们访问某些功能的权限。 它在 React 中是如何工作的? 在 React 中,...
    编程 发布于2024-11-07
  • 如何使用 mysqli_pconnect() 在 PHP 中实现 MySQL 连接池?
    如何使用 mysqli_pconnect() 在 PHP 中实现 MySQL 连接池?
    MySQL 的 PHP 连接池在 PHP 中,维护数据库连接会影响性能。为了优化这一点,开发人员经常考虑使用连接池技术。MySQL 的连接池MySQL 没有内置的连接池机制。然而,MySQLi 扩展提供了 mysqli_pconnect() 函数,其作用与 mysqli_connect() 类似,但...
    编程 发布于2024-11-07
  • 将 HTMX 添加到 GO
    将 HTMX 添加到 GO
    HTMX 是 intercooler.js 的后继者,用于使用 HTTP 命令扩展 HTML,而无需编写 API。现在,我知道一开始我说我要删除抽象层,但是我更多的是系统/工具程序员,所以我仍然需要一些抽象,直到我掌握了底层实际发生的情况。 基本概念 HTMX 部署 AJAX 命令来...
    编程 发布于2024-11-07
  • 发现 itertools
    发现 itertools
    Itertools 是最有趣的 Python 库之一。它包含一系列受函数式语言启发的函数,用于与迭代器一起使用。 在这篇文章中,我将提到一些最引起我注意并且值得牢记的内容,以免每次都重新发明轮子。 数数 好几次我都实现了无限计数(好吧,结束了 显式地在某个点用中断)使用 while ...
    编程 发布于2024-11-07
  • 为什么每个人都应该学习 Go(即使您认为生活中不需要另一种语言)
    为什么每个人都应该学习 Go(即使您认为生活中不需要另一种语言)
    啊,Go,编程语言。您可能听说过,也许是从办公室里一位过于热情的开发人员那里听说过的,他总是不停地谈论他们的 API 现在有多“快得惊人”。当然,您已经涉足过其他语言,也许您会想:“我真的需要另一种语言吗?”剧透警报:是的,是的,你知道。 Go 就是那种语言。让我以最讽刺、最真诚的方式为你解释一下。...
    编程 发布于2024-11-07
  • 如何计算 Pandas 中多列的最大值?
    如何计算 Pandas 中多列的最大值?
    在 Pandas 中查找多列的最大值假设您有一个包含多列的数据框,并且希望创建一个包含两个或多个列中的最大值的新列现有的列。例如,给定 A 列和 B 列,您需要创建 C 列,其中:C = max(A, B)要完成此任务:使用 max 函数和 axis=1 计算指定列中每行的最大值:df[["...
    编程 发布于2024-11-07
  • 如何在 PHP 中从目录中检索文件名?
    如何在 PHP 中从目录中检索文件名?
    从 PHP 中的目录中检索文件如何在 PHP 中访问目录中的文件名?事实证明,确定正确的命令具有挑战性。这个问题旨在为寻求类似解决方案的个人提供帮助。PHP提供了几种从目录获取文件列表的方法:DirectoryIterator(推荐)此类允许对目录中的文件进行迭代:foreach (new Dire...
    编程 发布于2024-11-07
  • 使用 Linq、Criteria API 和 Query Over 扩展 NHibernate 的 Ardalis.Specification
    使用 Linq、Criteria API 和 Query Over 扩展 NHibernate 的 Ardalis.Specification
    Ardalis.Specification is a powerful library that enables the specification pattern for querying databases, primarily designed for Entity Framework Cor...
    编程 发布于2024-11-07
  • PYTHON:OOP {初学者版}
    PYTHON:OOP {初学者版}
    Python:面向对象编程[OOP]:是一种编程范式(模型),使用对象和类来构建软件一种模拟现实世界实体和关系的方法。这是基于对象可以包含数据和操作该数据的代码的想法。 关于面向对象编程,您需要了解一些关键概念: 班级 目的 属性 方法 遗产 封装 多态性 抽象 下面的示例是一个帮助您参考正在解释的...
    编程 发布于2024-11-07
  • Neo.mjs:一个高性能开源 JavaScript 框架。
    Neo.mjs:一个高性能开源 JavaScript 框架。
    在浏览 GitHub 并寻找可协作的开源项目时,我发现了 Neo.mjs。我对这个项目产生了兴趣,并开始更多地研究这个新框架。我想在这篇博文中分享我发现的所有内容。 什么是 Neo.mjs? Neo.mjs 旨在构建高性能、数据驱动的 Web 应用程序,重点关注利用 Web Work...
    编程 发布于2024-11-07
  • 将 Azure Functions 部署到 Azure 容器应用程序的两种方法的比较
    将 Azure Functions 部署到 Azure 容器应用程序的两种方法的比较
    昨天,我写了一篇题为“在 Azure 容器应用程序上部署 Java Azure Function”的文章。 在那篇文章中,我提到使用 Azure 的集成管理功能,我想澄清这意味着什么以及它与本文中以前的方法有何不同。 旧方法:使用 az containerapp create 创建 ...
    编程 发布于2024-11-07
  • 如何使用 MinGW 在 Windows 上构建 GLEW?分步指南。
    如何使用 MinGW 在 Windows 上构建 GLEW?分步指南。
    使用 MinGW 在 Windows 上构建 GLEW:综合指南使用 GLEW,这是一个无缝集成 OpenGL 和 WGL 函数的纯头文件库,使用 MinGW 增强 Windows 上 OpenGL 应用程序的开发。为了使用 MinGW 有效构建 GLEW,需要一组特定的命令和步骤。首先,创建两个名...
    编程 发布于2024-11-07
  • 如何使用 CSS 创建带有对角线的双色调背景?
    如何使用 CSS 创建带有对角线的双色调背景?
    使用对角线创建双色调背景要使用 CSS 实现由对角线分为两部分的背景,请执行以下操作这些步骤:1。创建两个 Div:创建两个单独的 div 来表示两个背景部分。2.设置 Div 样式:将以下 CSS 应用于 div:.solid-div { background-color: [solid co...
    编程 发布于2024-11-07
  • 文档的力量:阅读如何改变我在 JamSphere 上使用 Redux 的体验
    文档的力量:阅读如何改变我在 JamSphere 上使用 Redux 的体验
    作为开发人员,我们经常发现自己一头扎进新的库或框架,渴望将我们的想法变为现实。跳过文档并直接跳到编码的诱惑很强烈——毕竟,这有多难呢?但正如我通过构建音乐管理平台 JamSphere 的经验所了解到的那样,跳过这一关键步骤可能会将顺利的旅程变成充满挑战的艰苦战斗。 跳过文档的魅力 当...
    编程 发布于2024-11-07

免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。

Copyright© 2022 湘ICP备2022001581号-3