Level Up Your Golang: 5 Concepts You Need to know

  Рет қаралды 2,497

Flo Woelki

Flo Woelki

Күн бұрын

You have to know these 5 concepts and keywords in Golang to improve your Golang code! An additional one are variadic functions, luckily I've also made a video about this concept: • The Spread Operator (o...
📝 Description
Dive deep into the fascinating world of Golang as we explore five powerful yet often overlooked concepts that can supercharge your coding skills. In this video, we'll unravel the mysteries of iota, the versatile constant generator that simplifies enum-like declarations. Discover the magic of the 'new' keyword and how it can streamline your struct initialization. We'll also dare to venture into the controversial realm of 'goto' statements, discussing their rare but valid use cases in Go. Learn how to tame complex nested loops with the elegant solution of loop labels. Finally, we'll unveil the secrets of the humble underscore and its various applications in Go programming.
⏳ Timestamps:
00:00 - Introduction
00:40 - iota Easy Example
04:02 - iota Advanced Example
06:57 - new
09:57 - loop labels
12:55 - goto
15:22 - underscore
18:56 - Outro
👋 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!
Buy me a coffee: www.buymeacoffee.com/florianw...
Become a member. / @flowoelki
Discord: / discord
Instagram: / flowydev
LinkedIn: / florian-woelki
TikTok: / florianwoelki
GitHub: github.com/FlorianWoelki
#golang #go #concepts

Пікірлер: 16
@matthew1106
@matthew1106 23 күн бұрын
More videos like this please!
@FloWoelki
@FloWoelki 21 күн бұрын
Sure, I'll try my best!
@cariyaputta
@cariyaputta 18 күн бұрын
Nice golang focused videos, added to my library.
@FloWoelki
@FloWoelki 17 күн бұрын
That's awesome, thank you :)
@sehbazrafik
@sehbazrafik 23 күн бұрын
amazing video, can you please have your dev setup on the laptop + desk tour video.
@MattRobinsonDev
@MattRobinsonDev 22 күн бұрын
great stuff
@FloWoelki
@FloWoelki 21 күн бұрын
Thank you :)
@CrayonEater9845
@CrayonEater9845 20 күн бұрын
I've been writing Go for a month, but have 5 years in industry. These are all pretty basic concepts in Go. Also don't use goto. It destroys control flow and there are other ways to do what it enables. If you look at C, goto exists, but you really only see its use when taking emergency recovery actions like in the Linux kernel.
@FloWoelki
@FloWoelki 20 күн бұрын
I agree with you, but it's definitely good to know the concepts. Sure, they do destroy in some way the control flow, but when used correctly, they can simplify things a lot and make your code even more readable and maintainable. Even the official standard library uses `goto`.
@richardbolanos50
@richardbolanos50 21 күн бұрын
When it comes to the new keyword what is the difference between return new(Counter) and return &Counter{} if any. Is there a performance benefit by any chance
@loo_9
@loo_9 20 күн бұрын
there should not be a performance difference, but the only way to truly know this is benchmarking. the compiler would recognize that the memory escapes the function scope so it has to be heap allocated. the only difference is that {} you can specify initial values
@FloWoelki
@FloWoelki 20 күн бұрын
I agree; there shouldn't be any performance difference because the Go compiler optimizes both expressions similarly. I think this is a valuable discussion: groups.google.com/g/golang-nuts/c/GDXFDJgKKSs
@richardbolanos50
@richardbolanos50 20 күн бұрын
@loo_9 and @FloWoelki thanks for taking the time to reply.
@lemurza5236
@lemurza5236 20 күн бұрын
Generally speaking you should avoid labels. They are one of the features of Go that hurt the language in a big way. Labels and Goto are horrible and should be avoided at all costs
@FloWoelki
@FloWoelki 20 күн бұрын
I agree, generally speaking you should avoid these, especially for simple flows. However, they do exist for a reason, and even the standard library of Golang uses both concepts. Obviously, they should be used judiciously. But, especially for things like simplifying error handling and cleanup code (in some cases) can lead to more readable and maintainable code.
@ArthurSchoppenweghauer
@ArthurSchoppenweghauer 4 күн бұрын
iota is a greek word and is pronouced iota.
Creating custom struct tags in Golang is awesome!
24:42
Flo Woelki
Рет қаралды 3 М.
This is your last video about Golang Structs!
15:57
Flo Woelki
Рет қаралды 2,3 М.
Эффект Карбонаро и нестандартная коробка
01:00
История одного вокалиста
Рет қаралды 10 МЛН
Summer shower by Secret Vlog
00:17
Secret Vlog
Рет қаралды 14 МЛН
Clown takes blame for missing candy 🍬🤣 #shorts
00:49
Yoeslan
Рет қаралды 47 МЛН
Defer Functions In Golang: Everything You Need To Know
12:17
Golang: The Last Interface Explanation You'll Ever Need
17:58
Flo Woelki
Рет қаралды 4,8 М.
VSCode is Not Enough Anymore in 2024
3:21
Dev Panda
Рет қаралды 13 М.
Errors as Values are the Future
7:19
Isaac Harris-Holt
Рет қаралды 35 М.
My Initial Impresson Of Go
12:39
TheVimeagen
Рет қаралды 81 М.
Go Error Handling Best Practices & Advanced Tips
6:49
Golang Dojo
Рет қаралды 36 М.
You are providing fallback values in Golang wrong!
13:10
Flo Woelki
Рет қаралды 1,5 М.
why golang is sucessful by creator of golang by rob pike
22:26
The ugly duckling
Рет қаралды 8 М.
Why HTMX and Golang? The answer might surprise you...
12:04
Flo Woelki
Рет қаралды 6 М.
The standard library now has all you need for advanced routing in Go.
13:52
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 488 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 8 МЛН
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 1,5 МЛН
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 3,3 МЛН