The Golang Compiler Feature You Might Not Know!?

  Рет қаралды 10,916

Anthony GG

Anthony GG

2 ай бұрын

► Join my Discord community for free education 👉 / discord
► Exclusive Lessons, Mentorship, And Videos 👉 / anthonygg_
► 33% OFF on my Go + HTMX + Templ Course PRESALE 👉bit.ly/3UFruxO
► Enjoy a 60% Black Friday Discount on My Golang Course 👉 fulltimegodev.com
► Learn how I became a self-taught software engineer 👉fulltimegodev.com/#mystory
► Follow me on Twitter 👉 / anthdm
► Follow me on GitHub 👉 github.com/anthdm
Grab yourself a 33% OFF on the PRESALE event of my building production ready applications with GO + HTMX + Templ + Tailwindcss + JQuery course here: bit.ly/3UFruxO
SUBSCRIBE OR NO MARGARITAS
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

Пікірлер: 42
@anthonygg_
@anthonygg_ 2 ай бұрын
► 33% OFF on my Go + HTMX + Templ Course PRESALE 👉bit.ly/3UFruxO ► Join my Discord community for free education 👉 discord.com/invite/Ac7CWREe58 ► Exclusive Lessons, Mentorship, And Videos 👉 www.patreon.com/anthonygg_ ► 60% OFF on my Golang course 👉 fulltimegodev.com Thanks for watching
@mrkostya008
@mrkostya008 2 ай бұрын
i think another cool usage pattern can be config packages: the prod would load everything from environment variables while dev build will have everything hardcoded, which is easier to manage.
@derpenstocks
@derpenstocks 2 ай бұрын
Btw neovim currently has the same issue around displaying errors related to build tags. Pretty sure it's just a gopls problem.
@nodidog
@nodidog 2 ай бұрын
Been like that for years. If you want a workaround, check the issue: golang/go/issues/29202 You can just add all of your common tags (dev, prod, etc.)
@DrewryPope
@DrewryPope 2 ай бұрын
You can set the tags for gopls to use in settings
@derpenstocks
@derpenstocks 2 ай бұрын
@@DrewryPope honestly I tried but never got a configuration that worked. Eventually just gave up
@nodidog
@nodidog 2 ай бұрын
I left an explanation for a fix, but KZbin deleted by comment, I assume because it had a link in it. Thanks YT - fighting the good fight, as usual.
@mementomori8856
@mementomori8856 2 ай бұрын
I always learn something new with every video you release
@anthonygg_
@anthonygg_ 2 ай бұрын
Thats the goal 😘
@ForeverZer0
@ForeverZer0 2 ай бұрын
It might be worth noting that the "+build tag" syntax is deprecated, and was replaced (i think in version 1.16?) with the "go:build tag". gofmt will automatically update it to the newer syntax, and the compiler will continue to work with it for a few versions during transition (according to Google), but unless you are writing code that is intending to be compiled with old versions of Go, you do not need to bother with the "+build".
@anthonygg_
@anthonygg_ 2 ай бұрын
Thanks for mentioning this
@joeyhills212
@joeyhills212 Ай бұрын
This is so useful for something im working on right now thank you! I have a raspberry pi that needs to run to run some CGO that only compiles for ARM chips and when i run the server code on my x86 server i cant get it to compile because of the C library dependency.
@AmirHosseinHonardust
@AmirHosseinHonardust 2 ай бұрын
Amazing. This can help me have a very good way of managing my runtime for my computer where I can make a local friendly runtime without the danger of pushing my changes to the server.
@LeeZhenYong
@LeeZhenYong 2 ай бұрын
Love the use case at the end 👍🏼
@demmidemmi
@demmidemmi 2 ай бұрын
Á similar trick is to pass in variables at build time with - ldflags, for example version numbers.
@michelTH2022
@michelTH2022 2 ай бұрын
As usual, a great video 🙂 More videos on that topic would be interesting.
@davidhinojosa3680
@davidhinojosa3680 2 ай бұрын
This is awesome! I was struggling to make the hot reload work in dev while still using the embed functionality. I was importing all of tailwind in dev for the meantime 😂 Will definitely try this.
@donnacasterr6223
@donnacasterr6223 2 ай бұрын
Good tip. FIrst time learning of this. Thanks
@Tobsson
@Tobsson 2 ай бұрын
I always loved the idea of go, but you can bundle all the css, html or whatever you want into the binary? That's crazy! 😅
@onlineque
@onlineque 2 ай бұрын
Thanks, man 🙏 Great video
@terraflops
@terraflops 2 ай бұрын
new to Go lang and this is very helpful to know.
@suikast420
@suikast420 2 ай бұрын
Hey Anthony . Great talk again. I have had seen a video from you where you talk about of reusing golang references with a repository pattern for avoiding gc cycles. But I can't find anymore. Can you give me a hint?
@NiltonOS
@NiltonOS 2 ай бұрын
Anthony nice tips !!!, Thanks
@inaccessiblecardinal9352
@inaccessiblecardinal9352 2 ай бұрын
This is pretty neat. Already know use cases.
@derpenstocks
@derpenstocks 2 ай бұрын
off topic question: what's with the prettier thing in the bottom right of your vscode? Are you using prettier to format go (serious question, I know it can be used to format rust)
@anthonygg_
@anthonygg_ 2 ай бұрын
I think its an old relic when writing typescript
@Yoshidzo
@Yoshidzo 2 ай бұрын
Hey Anthony, what's your VSCode theme? Love the videos.
@anthonygg_
@anthonygg_ 2 ай бұрын
Gruvbox
@lowmagnet
@lowmagnet 2 ай бұрын
That's a nice use case!
@kiquetal
@kiquetal 2 ай бұрын
i'm trying to be a pro, and use my intellij with go-plugin(ex java dev,here) is extremely ama zing learn from you Sir,thanks!
@thoriqadillah7780
@thoriqadillah7780 2 ай бұрын
I miss code with golang. Currently coding with express + typescript, and that thing eating my machine. Building the project eats 2 gb of ram and 8 gb of my laptop is barely capable for development. That's crazy for a 2 weeks old of project. Meanwhile my download manager written in golang that has more files and it feels like nothing
@NiltonOS
@NiltonOS 2 ай бұрын
Anthony, I'm a student on your HMTX course, can you give me a better coupon so I can buy the other Full Time Go Dev course?
@aamonaze
@aamonaze 2 ай бұрын
finally his back
@javadahmadian7782
@javadahmadian7782 2 ай бұрын
So good
@morkhoudia9
@morkhoudia9 2 ай бұрын
what is the difference btw anthonygg and golang std library ? One talking and practicing, the other a high documentation not well understood to all except anthony gg. 🙂
@shivamkumarz
@shivamkumarz 2 ай бұрын
Amazing
@snake3837
@snake3837 2 ай бұрын
Use lazyvim or astronvim instead of building everything from scratch.
@brickmastertube
@brickmastertube 2 ай бұрын
The fact that you're basing your yt tutorial videos on actual real projects you're working on makes all the difference.
@agp745
@agp745 2 ай бұрын
The Go Goat
@cougarmama7589
@cougarmama7589 2 ай бұрын
Gave the video a thumbs up for the leechers
3 Golang Tips For Beginners I Wish I Knew Sooner
13:18
Anthony GG
Рет қаралды 30 М.
My Best Advice After 20 Years of Programming Experience
13:15
Anthony GG
Рет қаралды 26 М.
КАРМАНЧИК 2 СЕЗОН 6 СЕРИЯ
21:57
Inter Production
Рет қаралды 411 М.
Pray For Palestine 😢🇵🇸|
00:23
Ak Ultra
Рет қаралды 31 МЛН
Normal vs Smokers !! 😱😱😱
00:12
Tibo InShape
Рет қаралды 119 МЛН
A Beautiful Way To Deal With ERRORS in Golang HTTP Handlers
8:42
The Most Efficient Struct Configuration Pattern For Golang
11:10
Golang Channels Or Wait Groups? Let Me Explain.
18:32
Anthony GG
Рет қаралды 16 М.
20 Must have Obsidian Plugins
9:24
Paul Dickson
Рет қаралды 2,4 М.
3 Important Use Cases Why The Industry Is Using Kafka
7:52
Anthony GG
Рет қаралды 12 М.
A Practical Example How To Use Interfaces In Golang
14:42
Anthony GG
Рет қаралды 17 М.
THIS is the BEST Way to Write HTTP Services in Golang
13:53
10 Million Messages In 1 Second With Golang Actors
7:33
Anthony GG
Рет қаралды 12 М.
Zed - A Visual Studio Code Killer?
9:28
Gamefromscratch
Рет қаралды 88 М.
Go Pointers: When & How To Use Them Efficiently
14:09
Anthony GG
Рет қаралды 64 М.
КАРМАНЧИК 2 СЕЗОН 6 СЕРИЯ
21:57
Inter Production
Рет қаралды 411 М.