The Must pattern in Golang clearly explained!
Flo Woelki
View ChannelAbout
Creating content about software engineering with Paper and "Drawings".
Latest Posts
Video Description
DISCLAIMER: This video only demonstrates the usage of the Must pattern, which should simplify a few things with your error handling. However, it does not praise the usage of `panic,` and you should not use it except if you are 100% sure that an error should not occur (e.g., where the programmer does the input, like in the regex example). You must use this custom functionality in Golang more often to reduce your error-checking code! In this video, I'll explain the must concept and how you can leverage it in your codebase. If you are also curious about more ways to handle errors: https://www.youtube.com/watch?v=4qU6FyrMUQw π Description In this video, I'll show you the function you might have never seen before but you might need in your codebase. Especially when you have to deal with a lot of redundant error checking. In this video, you will learn the following things: β’ How we can reduce error checks in Golang β’ What is the `must` concept in Golang is β’ What are the advantages and disadvantages of the `must` concept in Golang β³ Timestamps: 00:00 - Introduction 01:13 - Example 1 07:02 - Example 2 15:00 - Outro Correction: 01:20 DISCLAIMER: This video only demonstrates the usage of the Must pattern, which should simplify a few things with your error handling. However, it does not praise the usage of `panic,` and you should not use it except if you are 100% sure that an error should not occur (e.g., where the programmer does the input, like in the regex example). π Hey there! If you are new to this channel: Hey π my name is Flo and I am a professional software engineer with a passion for coding in Golang, TypeScript, JavaScript, and Rust. This channel is where I share that passion and dive into the exciting world of software engineering. Plus, I love using emojis and paper-based animations (so have a look for that if you want to find my videos). π¨ Support and Connect! Become a member. https://www.youtube.com/@FloWoelki/membership Discord: https://discord.gg/TnA7drJ X / Twitter: https://x.com/FlorianWoelki LinkedIn: https://www.linkedin.com/in/florian-woelki/ GitHub: https://github.com/FlorianWoelki π Copyright Notice The original Go Gopher version is originally designed by RenΓ©e French (Source: https://go.dev/blog/gopher License details: https://creativecommons.org/licenses/by/4.0/). The gopher used in the video and thumbnail is inspired by this author. #golang #go #must
You May Also Like
Elevate Your Golang Skills
AI-recommended products based on this video





















