Тёмный

The secret to making Golang error handling a breeze 

Earthly
Подписаться 3,4 тыс.
Просмотров 12 тыс.
50% 1

Earthly ➤ earthly.dev
In this video, we delve into Golang's unique approach to error handling. We highlight how Go's error handling differs from other programming languages and showcase its effectiveness when following the right idioms. We demonstrate the simplicity of implementing the error interface and constructing errors using the errors package. We emphasize that in Go, errors are not exceptions and should be returned like any other value.
Adam provides practical examples of error handling in Go, underscoring the importance of returning both results and errors. Learn how to effectively manage errors using conditional checks and type assertions. Additionally, we explore the concept of error wrapping to provide precise insights into the origin of errors.
Third Party Review:
This video provides a great overview of idiomatic error handling in Golang. It explains how Golang handles errors differently than other languages like Java or C# that use exceptions. Instead, Golang uses explicit error returning and checking. The video covers how to create custom error types and sentinel errors in Golang. It also demonstrates error wrapping to propagate context and "stack traces" as errors bubble up through multiple levels of code. Best practices like explicitly checking for errors after function calls are shown. The presenter explains how these techniques help make error handling in Golang very visible and debuggable compared to exception handling. Overall, this is a useful tutorial for anyone wanting to understand proper error handling and propagation in Golang.
Subscribe now and Master the art of error handling in Go with us!
➡️ Earthly: earthly.dev/
📒 Links 📒
Article version of this tutorial:
earthly.dev/bl...
GO website
go.dev/
📒 About Earthly 📒
Earthly is a command line tool that simplifies build processes, especially for complex projects involving multiple programming languages. It helps manage communication between different languages, making builds easier to manage. If you want to streamline your build processes and work with multiple languages, Earthly can help.

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
Далее
This is your last video about Golang Structs!
15:57
Просмотров 7 тыс.
Обработка ошибок в go в 2023
15:59
Просмотров 2,1 тыс.
Cool Parenting Gadget Against Mosquitos! 🦟👶
00:21
САМАЯ ТУПАЯ СМЕРТЬ / ЧЕРНЕЦ
1:04:43
err != nil Is GOOD? (And Why)
7:19
Просмотров 93 тыс.
5 Levels of Go Error Handling
19:13
Просмотров 13 тыс.
Understanding Contexts in Go in 5(-ish?) Minutes
15:14
How to Use Poetry in Python to avoid Dependency Hell
20:21
This Is The BEST Way To Structure Your GO Projects
11:08
My Initial Impresson Of Go
12:39
Просмотров 95 тыс.