All Episodes

September 13, 2025 40 mins
Mark as Played
Transcript

Episode Transcript

Available transcripts are automatically generated. Complete accuracy is not guaranteed.
Shay Nehmad (00:00):
This show is supported by you. Stick around
till the break to hear moreabout that. Welcome back to
Cup o' Go for 09/13/2025. Keepup to date with the important

(00:22):
happenings in the Go communityin about fifteen minutes per
week, almost every week. I'mShay Nehmad.

Jonathan Hall (00:28):
Welcome back. How are feeling, man?

Shay Nehmad (00:30):
I'm feeling a lot better. I had a stomach bug, you
know, those they just, like,shut you down for a day.

Jonathan Hall (00:34):
I had an infected tooth and couldn't do anything
either. So, I'm glad we're bothback in the saddle again, ready
to talk about go news.

Shay Nehmad (00:41):
Yeah. And since we missed a week, there are a few
things we bumped to the backlogthat's not gonna make it this
show. And I think this show isalso probably gonna be a little
bit longer. Mhmm. Althoughpeople like listening on their
podcast things, they theyalready know what the length of
the show is.
I don't know yet. True. But webumped we we know that the JSON
v two blog is out. We'll talkabout it some other time. And we

(01:05):
know that, Google has announcedthe Genkit one point zero thing,
and we bumped that as well.
I just wanna we just wanna getsome hands on time with it
before we actually talk about iton the show. So we know we know
we missed some we missed somestuff, but we'll try to, get you
up to speed. And thank you foryour patience letting us take a
week off.

Jonathan Hall (01:25):
Yeah. First up, we have new point releases. This
actually happened, what, a weekand a half ago, nine days ago.
So it's not that new. Wewould've talked about it last
week if we'd been around, but goone point twenty five point one
and one point twenty four pointseven have both been released.

Shay Nehmad (01:39):
Yeah. And it's with one of these bugs that's like I
literally imagine the Go teamgoing like, you know, the screen
going black and white and theaudio getting kind of crackly
and be like, is this everhappened to you? And you see
like a hapless housewife, liketrying to do the dishes and they
fall out of their hands, youknow? Yeah. Yeah.
So has this ever happened toyou, Jonathan? You're trying to

(02:01):
configure your API endpoints,but you're uncertain whether you
should add a leading slash ornot.

Jonathan Hall (02:06):
Yeah. That happens all the time. Or
trailing slashes or middleslashes, you know, forward or
backslashes. My gosh, slashesare so confusing.

Shay Nehmad (02:15):
So for just $9.99, so three simple payments, Go's
course protection now doesn'texempt things without the
missing slashes, which I'm sureis a strict is gonna be an
actually strict 5050% split ofpeople who did it one way and
people did it another waybecause it's just random. But,

(02:35):
yeah, it's like when you did apattern and you added the, like
an insecure bypass pattern, someextra patterns without the slash
were also exempted. And becauseit's like a security bypass,
they were like, hey, if you wantthe extra slash, you put it
there as well. This is one ofthose things that's mostly
useful for development. Like,you shouldn't have insecure
bypass patterns on productionnormally for cross origin.

(02:58):
Yeah. So as a developer, you'llimmediately notice that it
happened after you upgrade andjust add a slash through the
pattern. So it's not a it's nota huge downgrade in terms of dev
experience, but it's a it it isbetter in terms of security. So
Yeah. And I know we bothdiscussed this in before the
show.
It's like we understand whatcross origin policy means

(03:18):
theoretically. Right?

Jonathan Hall (03:19):
Right. Yeah.

Shay Nehmad (03:20):
What what is it then?

Jonathan Hall (03:21):
Oh, you're putting me on the spot now.

Shay Nehmad (03:24):
We all know it just for the other people.

Jonathan Hall (03:26):
Yeah. Right. Right. Right.

Shay Nehmad (03:27):
Right. The show, we talked about, like, how
everybody knows conceptuallywhat cross origin is, but, you
know, how it always gets alittle fuzzy. You actually

Jonathan Hall (03:36):
explain Super fuzzy.

Shay Nehmad (03:37):
Yeah. Yeah. We won't go into the details, right
now, but it's just a securityfeature in, you know, HTTP web
servers.

Jonathan Hall (03:44):
And if you don't know what it is conceptually,
don't feel too bad either. It'snot really

Shay Nehmad (03:48):
It's confusing, man.

Jonathan Hall (03:48):
It's confusing, and it only matters if you're
really doing web front enddevelopment for the most part.

Shay Nehmad (03:53):
You should know it if you're doing web

Jonathan Hall (03:54):
If you're doing web front end, you should know
it. If you're not, don't worryabout it.

Shay Nehmad (03:57):
Yes. But now it's slightly, slightly more secure.

Jonathan Hall (04:00):
So that's our security release out of the way.
We have a couple other communityreleases we'll be talking about.
But first, I guess this is alsoa release. Go for Con Europe has
released all of their videosfrom the conference. So if you
didn't make it to Go for ConEurope, or if you wanna relive
the experience on their YouTubechannel, they have 17 talks up.

(04:22):
There's some good ones on herefrom Dave Chaney, from the Go
team, Brittany Elisch. There's abunch here, Jonathan Amsterdam.
Have you watched any of these,Shy? Anything of them that
jumped out at you?

Shay Nehmad (04:33):
I have not yet. I've actually been waiting for
you to like For me to summarize.Summarize. I I love their
format. They have like talkingabout topics and then lightning
talks.
I wonder who they ate to thatformat from. There's one thing,
speakers versus the audiencegame show. Oh, man. That I don't
know what's going on there, butI I feel bad for missing it.

(04:57):
Like, the FOMO is real.

Jonathan Hall (04:58):
I also really like their, their music. Anyway,
one talk that really jumped outat me was one from Damian Neal
about testing time.

Shay Nehmad (05:19):
We mentioned this in the past.

Jonathan Hall (05:22):
Yes. We have. We have.

Shay Nehmad (05:24):
And now it's the future even though when you
change the past. You rememberthat scene from, the latest
Avengers? Haven't seen any

Jonathan Hall (05:33):
of the Avengers, but I'm sure that most of our
audience have.

Shay Nehmad (05:36):
So there's the the last one, is like a time travel
movie. Like it's basically Backto the Future with superheroes.
Okay. And there's one scenewhere the Hulk explains, like,
you can't go back to the futureand change your past because if
you change the past, you'rechanging someone else's future.
Blah blah blah.
Nice. So that that's what'sgoing on with this, with this

(05:56):
topic, right, of testing time,basically.

Jonathan Hall (05:58):
Yes. So I remember last episode or a
couple episodes ago, talkedabout the blog post. It was also
incidentally written by DamianNeal about testing time, similar
title to the talk. Interesting.And it's really just about the
testing sync test package, whichallows you gives you some extra
levers to pull when you'retesting code that depends on

(06:23):
time in asynchronous ways.
I'm sure we've all written testswhere you like, oh, I have to
wait for this thing to finish.I'm going to do a sleep one
second or something like that.And so you sleep to let some
background process do its thingand you hope that's long enough
and that your CI pipeline isn'tso slow on running on some some
slow server that one second isactually long enough for it to
happen. This is a way to not dothat. The testing sync test

(06:45):
package basically lets you sortof wait until all go routines
are blocking and waiting forsomething to happen and then
advance to the next thing.
So if you have something that'swaiting, you know, one go
routine is waiting on another goroutine to complete something,
then once all go routines areblocked waiting on each other,
that means that that thing isprobably completed. Now we can
move on to the next bit in yourtest without sleeping

(07:06):
arbitrarily long amounts oftime. I've really oversimplified
it because I want you to go readthe blog post and or watch the
video of Damien talking aboutthis rather than listening to me
talk about it.

Shay Nehmad (07:17):
I will say that this is a problem that I've
faced. Like, lot of the thingswe talk about, you know, the the
Go announcement, the securityrelease we just mentioned, it's
like something global. It's HTTPthing, but it's specific to Go.
And the next thing we're gonnatalk about, GoFumped and Naked
Returns, it's like a superspecific Go thing that doesn't
exist in any other language.Right?
But this problem of, like,dealing with time in tests is

(07:41):
super universal. I just wanna,like, say, if you work, in other
languages alongside Go likemyself, there's there's
equivalent things in otherlanguages as well, but only as
third party libraries. Forexample, Python, I used to use
FreezeGun a lot to, like,eliminate flakiness from tests,
which lets the the test, like,freeze the time at a specific
time for that test using adecorator.

Jonathan Hall (08:03):
Right.

Shay Nehmad (08:03):
And I think in JavaScript, there's Sinos Sinon,
sorry, Sinon, which is wayharder to use. And this is just
a very universal problem ingeneral. And it kinda sucks
that, you know, every singletesting course I see is all
about, like, writing tests, butnot with dealing with these

(08:23):
problems that happen on everysingle software project that I
will that of, like, sufficientcomplexity that I work on. Mhmm.
Mhmm.
It's like a so so Go having itas part of the standard library,
just again well, you know,standard. It's just part of it
goes to show when people say Gois, like, production language
or, like, a real businesslanguage. It, like, deals with
pains that actual softwaredevelopers have. Yeah. And not,

(08:46):
like, fancy nonsense that nobodycares about.
Because I've dealt with thisproblem maybe five times already
in my

Jonathan Hall (08:52):
software Yeah. It comes up fairly often for me
too.

Shay Nehmad (08:55):
If I, used to work to resolve this myself, is like
the are you happy with, like,the API of a sync test testing
sync test?

Jonathan Hall (09:04):
I've I've only played with it a little bit.
It's it's simpler than I wouldhave invented myself. So, yes,
I'm happy for it in that sense.

Shay Nehmad (09:14):
They did Better than the code I would write is
pretty has a pretty low bar. Iknow for you it's a higher bar,
but for me it's like

Jonathan Hall (09:21):
So just like when I when I think about trying to
solve that problem, the thesolutions I come up with are
much more complicated than whatthey have, which is great that
they've they've taken the timeto think it through and come up
with a simple approach to afairly complex problem. What I
don't know yet from experienceis if it will solve all of my
time related testing problems.I'll have to play with it for

(09:42):
probably a couple of yearsbefore I figure that out. But
it's definitely helping, willhelp me in a number of cases. I
have some test cases I could goback and rewrite now.
I have one bug I'm trying todebug on a project that's about
timing. I'm actually looking atrewriting those tests with sync
test to see if that helpsisolate the bug. So, yeah, I

(10:02):
think it's a great step in theright direction, a huge step in
the right direction for formaking these tests easier to
deal with.

Shay Nehmad (10:08):
Yeah. And both the talk and the blog post are are
the type of blog posts that Ilike, which are like a story.
It's not like, here's how to usethe new sync test. If you need
that, just go to the sync testdocumentation. But if you wanna,
like, the story behind it andthe experiment and what's going
on right now, you shoulddefinitely, like, read it at the

(10:29):
of the bottom.
It's pretty good. It's prettygood. And I assume, you know,
people will start using syncsync test and will just collect
feed feedback and issues, andnow it's just part of the
standard library and we'llimprove it.

Jonathan Hall (10:39):
Yep. Cool. Cool.

Shay Nehmad (10:40):
Cool. As I've mentioned Mhmm. You this is an
audio format. Right? You can'tsee it, but we're both, naked
right now.

Jonathan Hall (10:48):
We should I don't

Shay Nehmad (10:49):
know how to segue from that to the fact that the
new this release is on nakedreturns. I'll just say, I said
it because it's on nakedreturns. Looking at the at the
relevant issue, I see it's bysomeone. Oh, who is this
handsome fellow? Oh my goodness.
It's like, all you need to do issearch for the word naked and go

(11:11):
related to the repositories, andyou'll find Jonathan there. So
you opened this on October 2023,which is forever ago. Yeah. Is
it before we started? When didwe start it?
Never mind. No. It's not.

Jonathan Hall (11:25):
No. I think we already started the show.

Shay Nehmad (11:27):
Yeah. But, yeah. Can you explain what are naked
returns and why do you hate themso much?

Jonathan Hall (11:32):
I have a whole video about this. I know. Put a
link to that for anybody who'smissed it. But the TLDR, a naked
return in Go, you're allowed toname your return variables when
you define a function, right? Soyou might have a function that
returns an int and error.
Maybe you call it count and soyou name your return values. If
you do that

Shay Nehmad (11:50):
I still have to type them. I do like count int
and then error.

Jonathan Hall (11:54):
Yeah, right. You have to type them in the
function definition. But then inthe function body, when you
return, you're allowed to thenjust say return without telling
the values that you return andreturns whatever those values
are that may have been set inthe function or not. That's
called a naked return. And Ihate them because

Shay Nehmad (12:12):
they're So so hard to when I write the names in the
function signature, it basicallyis it's not part of the function
signature, like in the in thephysical space it is, but it's
actually two variable definitionlines in the function.

Jonathan Hall (12:30):
It like automatically declares those
functions, those values to theirzero value when the function
starts. So then you can just doa naked return, return without
any arguments, and it just fillsin those existing values and
returns those. You need

Shay Nehmad (12:46):
That's very smart.

Jonathan Hall (12:47):
Yeah. Except that it makes code almost unreadable
or less readable, I should say,because you don't know. Like, if
you're looking at a return, youdon't know what the values are,
then you have to go back andread the function to see what
those values have been set to.If they're being set to, know,
maybe the error has been set toa non null value and you're
returning an error and you don'tknow it. So it just makes code

(13:07):
really unreadable.
And maybe what's even worse, ifyou have closures within your
function like that and maybe aclosure just has an early return
because it's a closure thatreturns nothing. Or maybe it's a
closure that returns somethingdifferent than what your outer
function returns. It's reallyhard to compare those returns
with the returns of the largerscope. You don't know what's

(13:28):
what. Is it a naked returnbecause this this closure has no
return values?
Is it an accurate return becauseit's part of this other thing?
Naked returns just make codeunreadable. I don't can't think
of any reason they actuallyshould ever exist to be clever.
They're sightless typing. Buteven that problem is now solved.

Shay Nehmad (13:44):
Yes. If you use the new release of GoFumpt, which is
they actually released a minorbug fix since then, but the the
minor version is 0.9. SoGoFumpt, g o f u m p t, is like
a slightly stricter version ofGo format, GoFMT. I like it. I I

(14:06):
I now bring it on by default toany project because Me too.
Just the less I can I the less Ican, care about style, but the
more consistent my code is, thebetter? And I've found that this
is extra true for, now that I'musing, like, you know, agents to
work on my code a lot. So CloudCode and and Cursor Background
Agents and all that funkynonsense. They like it when all

(14:28):
the code looks very much thesame and is very readable. So a
tool like GoFund really helps inthat regard.
And their new release, 0.9, isvery conservative, values. It's,
it will it's all about clothingall the naked returns, which I
think is a is a crazy good,like, branding for this PR. Have

(14:50):
you turned it on? Does it work?

Jonathan Hall (14:53):
Well, I know it works because I wrote it and I
tested it. I'm actually So Iusually use GoFund as part of
Golang CI Lint. So I'm lookingforward to this version being
included in the next version,hopefully, of Golang CI Lint,
which will make it automaticallyincluded in all my workflows.

Shay Nehmad (15:08):
Cool, cool. Anyway, proposals from John all the way
from like proposing toimplementation. I like it. Do
you think I'll ever make it to,like, Go FMT or is that not I

Jonathan Hall (15:22):
a would love that, but I doubt it.

Shay Nehmad (15:25):
Why not? Like, what what's stopping you from opening
that issue on the Go or is itjust, like, not good enough in
your Maybe

Jonathan Hall (15:31):
I could. I mean, in my opinion, the negative
returns are just a misfeature ofthe language in the first place.
So at least automating them awayin this sense is a step in the
right direction. My feeling isthat GoFund, when it was
originally created, was sort ofintended as a test bed for new
features to potentially go intoGo FMT. I'm not aware of any of
those features that have everbeen back ported to the

(15:52):
original.

Shay Nehmad (15:53):
It feels kind of weird to have a feature in a
language and then have Go FMT,which literally automatically
runs on every save on every IDEthat has, like, the Go tooling
enabled to disable that feature.It it feels like a really
roundabout like, just patch themout of the language or
something. But it's not thatimportant. Like, it it reduces
code readability a little bit. Alittle bit.

(16:17):
But very, very cool.

Jonathan Hall (16:18):
Happy to have you there. We've been chatting for a
little bit. Let's go ahead andtake a quick break. We'll come
back with a few more storiesbefore we end of the program.

Shay Nehmad (16:31):
Like mentioned on the top of the show, this show
is supported by you. We have aPatreon and you can contribute a
few bucks a month to help us runthis fun but rather expensive
hobby. We pay for editing,hosting fees, our time. Well, we
don't pay for our time. We sortof donate our time.
This is a hobby. We do it forfun and to learn, but it's still
like your direct support is verymuch appreciated. If you wanna

(16:53):
find that link or reach us inany other in any of our other
links, which include our Slackchannel and our email and our
swag store and whatever, allpast episodes with transcripts,
which I've been recently usingto like try and find people I I
remember we interviewed, but Idon't exactly remember what they
said. Use kapago.dev. You canfind all the links there or

(17:17):
email us at newskapago.
Dev, that is newskapago.dev.Other than giving us money by
joining our Patreon, you cansupport the show by sharing
about it. A lot of people havebeen joining the Slack recently.
I've been I've noticed thatevery time I open the Slack
channel, like I see, oh, X hasjoined, Y has joined. I've been

(17:38):
trying to like react with a waveemoji, which is not like the
most in-depth, like gratitude Icould give, just because we're,
like, hundreds of people at thispoint.
But we really, really appreciateanyone who joins the channel
and, like, even just lurksaround. I'll just shout out Adam
Urie, who just joined, like,this Tuesday. Hey, Adam. Thank

(17:58):
you for joining the Cup of Gochannel and all the rest of,
like, the 608 of you. Yeah.
I can't mention all of you byname. But, Adam, you you won.
You're you're mentioned on thisweek's episode. So, we really
like it when people join, theshow and join the community. So
please leave a review onSpotify, Apple Podcasts, or just
wherever you listen to yourpodcast.

(18:19):
Share the show with a friend ora colleague or a co student. If
and if you learn somethinginteresting, like mention us. We
we have a few people thatmention us regularly, the
weekly, Go newsletter, ApplyGoMhmm. Always, mentions us, which
is very nice. But, yeah, there'sthere's a lot of, cool
discussions on the Slackchannel, and we're very happy to

(18:40):
see, like, the show doingnumbers.
It doesn't mean anything becausewe do it for learning, but I
don't know. It really makes mefeel good just going into
Transistor, which is thesoftware we use to manage the
show and seeing, how many peoplelisten and seeing, like, the
discussions on on Slack. Eventhough theoretically it
shouldn't matter, to me itmatters. I don't know how you

(19:01):
feel about it, Jonathan.

Jonathan Hall (19:02):
It's it's fun. I mean, yeah, this this show has
done has had a much biggerimpact than I ever would have
imagined when we started.

Shay Nehmad (19:09):
We just passed a 150,000 all time downloads. Wow.
Yeah. Which is pretty crazy. Imean, we have a 125 episodes, so
it it works out like it makessense.

Jonathan Hall (19:21):
Mhmm.

Shay Nehmad (19:21):
But it's just a really big number.

Jonathan Hall (19:23):
Yes.

Shay Nehmad (19:25):
Cool. Cool. Cool. Other than that, this show is,
this week, sponsored byboldlygo. Tech.

Jonathan Hall (19:32):
Woo hoo. That sounds familiar.

Shay Nehmad (19:33):
Are you looking for a fractional gophering? Is that
a good way to to put it? Sure.

Jonathan Hall (19:38):
That's a great way to put it.

Shay Nehmad (19:40):
Why don't you tell us what BoldlyGo. Tech is?

Jonathan Hall (19:43):
I would love to. I have some availability coming
up. We're going go next month tohelp you and your team improve
your Go projects, especiallywhen it comes to architecture or
how to structure your projects,how to get a project off the
ground. I've helped severalclients rescue a project from an
agency that maybe didn't know goall that well, or maybe an LLM

(20:04):
that didn't know go that well.So if that's kind of thing you
could use some expert help withand you don't necessarily need a
full time person on board, lookme up.
Prices are probably morereasonable than you would expect
to hire somebody with the sortof experience I have making
fools of myself on podcasts.

Shay Nehmad (20:19):
Yeah. Join brands you know and trust already, like
Canonical, Unity, Deliveroo,Booking, and Teamwork. You're
already running Jonathan's Codein production.

Jonathan Hall (20:29):
Probably are.

Shay Nehmad (20:29):
It's clothing all your returns right now. And, you
know, there are some customertestimonials on the side as
well. But, you know, John,you're listening to the show. He
knows what he's talking about.If you need, you know, help
scaling up a code GoBase orfrustrated with the output of,
like, offshore agency or just apretty bad team on your company,

(20:54):
although that's harder to admit,or you have like a brand new Go
project on the company roadmapand you wanna start it fresh and
you wanna start it right andmake sure that it it grows, you
know, in a sustainable way, youcan get the world class Go
development subscription over atboldlygo.tech.
Thank you for sponsoring theshow.

Jonathan Hall (21:13):
Woo hoo. Thank you for letting me sponsor the
show.

Shay Nehmad (21:17):
Yeah. It's kind of one last thing for this break. I
am planning a San Franciscomeetup, and I'm having woes.
I've already settled on a date.This is just if you're in the
Bay Area, listen.
If not, you can to you can zoneout for the next, like, thirty
seconds. It's supposed to beOctober 23. I am looking for a

(21:38):
place to host it. So there's oneguy, Akshay Shah, I think he's a
listener actually, who's lookingfor a place. And I'm also
looking for a place with, Ithink, another company.
I will not name them in casethey won't actually deliver. But
if you're in the Bay Area,October 23, definitely, like,
clear your calendars. But Iwon't send the Eventbrite thing

(21:59):
until I have a place to actuallyrun it at because I don't want
it to, cancel last minutebecause I don't have a company
who's willing to host it. So ifyou're in the Bay Area, find me
a place to host. I'm just like,you know, doing it on WeWorks
and I really don't want themeetup to happen at a WeWork,
because that's like superexpensive personally for me.
I might be able to get them tosponsor it. I'm trying to talk

(22:21):
to them right now, but if youcan help me, please help me. But
remember, I just moved here. I'mI'm I'm new. But if it will
happen, it's very exciting and,Josh Bleecker Snyder will be
there and it'll be very a lot offun.
It'll also be really close to mybirthday, is October 19. We'll
probably have a party. That's itfor the, break. We took a break
off last week, so we have somemore topics to discuss. So let's

(22:44):
just go to the next part of theshow.
Let's do it.

Jonathan Hall (22:50):
I want to talk about building bulletproof
leader election and Kubernetesoperators, a deep dive.

Shay Nehmad (22:55):
That's a smooth

Jonathan Hall (23:00):
is a blog post.

Shay Nehmad (23:02):
Is a blog

Jonathan Hall (23:02):
Yeah. Would Blog Blog be shy. Sure. So this this
probably is really more aKubernetes related post than a
Go related post, although thecode is written in Go. So if you
sit at that cross sectionbetween Go and Kubernetes, this
post is really probably best foryou.
But do you understand leaderelection, Shai? Do you
understand the problem thisclaims to be trying to solve?

Shay Nehmad (23:24):
Yes. I'll avoid all the political commentary,
especially this week. And if youread books like Designing Data
Intensive Applications or if youlearned like about distributed
computing or if you have everhad to maintain Kubernetes
clusters, I've had to do allthree, you realize the problem
that multiple computers are notnecessarily better than one. And

(23:46):
like you have a few computersand one that needs to delegate
tasks between them. And I'm I'mintentionally using like simple
language because this isactually a simple problem.
When you layer it with all thenonsense Kubernetes words, it
sounds complicated. Yeah. But inreality, it's very simple. You
have like five computers and youwant them all to do tasks, but
somehow they need to choosewho's doing which task and who's

(24:09):
doing what. Right?
Just a general problem indistributed computing. One way
to resolve it is to say, okay,computer number one is the
leader and it will like allocatethe tasks or load the balance or
whatever. However, whole one ofthe problems when you're
distributing computing is thatif one of the nodes goes down,
if one of the, like, workersgoes down, that's not a huge
problem, right? Because, oh,I'll just not the leader can

(24:32):
decide, okay, it went down, it'snot responding to pings anymore,
I won't send it any more tasks.But if the leader goes down,
like, not zero of the tasks aregetting allocated anymore.
So if the leader goes down, oneway to resolve it is leader
election. Like, I'm trying toget to the leaders and all the
workers are trying to get to aleader. And if all the workers

(24:53):
are getting, like, getting to aconsensus that the leader is
down, maybe it has networkissues, maybe it has a power
failure, maybe it has softwarefailure, but it's not working
anymore. We need to elect a newone. Right?
And leader election is theprocess through which it
happens. And it's importantbecause it's distributed. Like,
now you have a bunch ofcomputers that don't have a
leader telling you them what todo, and they need to agree on a

(25:15):
new one in a very consistentway. So you could say, it
doesn't really matter who's theleader, right, because it's just
a bunch of computers, so just dorandom. But then you'll be in a
terrible situation whereeverybody thinks someone else is
the leader and nobody's doingany work.
That's what that's myunderstanding of the problem.

Jonathan Hall (25:30):
I think you summarized it pretty well. Last
bit kind of sounds sounds likeour podcast. Like, we we don't
know who the leader is, so noneof us do anything.

Shay Nehmad (25:37):
Yeah. Other than Filip.

Jonathan Hall (25:40):
Other than Filip. The the blog post goes into some
of the previous examples of howthis is done. I'm not going to
go into the details because thespecifics are boring unless
you're deep into this world, andwhy some of them aren't ideal,
and then offers their ownsolution, which is to use a
ConfigMap based leader election,which claims to be simple and

(26:03):
transparent. Kubernetes native,which explains why that term
doesn't make any sense if youdon't know Kubernetes, reliable
and observable. So and it goesthrough, you know, as the title
claims, a deep dive.
It's not the deepest dive.You're not going to start
hemorrhaging because this is toocomplicated if you want to read

(26:23):
it through it, But it goesthrough some of the code that
does different parts of this,the observability, leader
election, atomic acquisition.Yeah. It's a nice a nice
summary.

Shay Nehmad (26:36):
One thing I like that Dish I shared in the blog
is the test cases. It's, like,such a really good way to
understand what problems youneed to deal with. So he just
shares, like I'm I'm sure it'son all of them, but he shared,
okay. So we need to test theleader election scenario. So
fresh election, you just boot upa cluster and nobody is the

(26:58):
well, like, we need to figure itout.
Take over from a dead pod. Takeover from a stale leader.
Respect the active leader.That's, like, such a good way to
explain what this feature doeswithout actually sharing all the
code, which is really, reallygreat. And, Bishai, just another
banger.
I liked his, talk on the latest,San Francisco meetup, And we

(27:21):
actually play basketballtogether, so I'm I'm like kind
of biased. But another anothershot from three. It's on Medium,
so go give him a clap, which ismy least favorite of the social
media interactions. It's like soperformative and when you click
on it on Medium, you know whatI'm talking about? The clap
button.

Jonathan Hall (27:39):
Oh, yeah. Yeah. Uh-huh. It does

Shay Nehmad (27:41):
a single clap, which is, like, the most cynical
thing you can do after someonegives you something. Exactly.
It's just so awkward. I don'tthe chances that the UX designer
for Medium is listening is,like, zero to this show. But if
someone knows him, tell themthat this, like, gives me,
Schuidenfroid on, like,unimaginable levels.

(28:03):
You're just clicking thatbutton.

Jonathan Hall (28:05):
Alright. A couple quick updates before we move on
to the lightning round, on toproposals. The first one

Shay Nehmad (28:11):
On on past news items.

Jonathan Hall (28:12):
Yes. I

Shay Nehmad (28:13):
I like it when we do that, when we do follow ups.
Makes me feel like a realjournalist.

Jonathan Hall (28:18):
Oh. So back in August on the twenty third at
episode 123, we mentioned theproposal to deprecate the XNet
context package. That proposalhas been accepted, so it
shouldn't really change anythingas we talked about in that
episode. Go listen to it if youwant the full details, but that

(28:39):
will be deprecated. Don't use itanymore.
You shouldn't have been using itfor ages anyway, but definitely
don't use it now.

Shay Nehmad (28:43):
Yeah. I actually wasn't aware it existed. If you
if you lived your life withoutknowing that this package
existed, now you now you'regood. You don't have to

Jonathan Hall (28:53):
catch Vindicated. Yes. And the other one, one I'm
actually a little bit moreexcited about for fairly obvious
reasons, which will becomeapparent is the proposal we also
talked about back in episode oneeighteen from July, a proposal
to add an expression to create apointer to simple types. This
brought some discussion on theSlack channel that you

(29:14):
mentioned. People talking aboutwhen would like, I think your
point, Shai, was when would youever use this?
And my point was I use it allthe freaking time. And we got
some back and forth about thaton the on the Slack channel.
This proposal was proposed byRob Pike. And the last comment
as of this recording is also byRob Pike, which reflects on the
the final or probably finalversion. So this is now likely

(29:36):
accepted.
It hasn't officially beenaccepted. Next week, we'll
likely have an update that saysit's been accepted. The proposal
is to change the way new works.So right now, new takes a type.
Mhmm.
They're proposing to let it alsotake a value. It So could take
either type or an expressionvalue or value expression. And
if it's a value, then it justcreates a pointer to that value

(29:58):
rather than a pointer to anempty value of the type. And
Rob's comment is, as explainedseveral times by various pieces
of this conversation, I wouldprefer the type to be explicit.
That is, that the expression isan optional second argument.
But since this proposal appearsto be reaching closure and the
final version does solve a longstanding problem, I can only
celebrate. Thank you. I really

Shay Nehmad (30:20):
love love that approach of disagreeing Yes.

Jonathan Hall (30:24):
Yes. I completely agree with Rob's sentiment here.

Shay Nehmad (30:28):
When I had like high level engineers, high level
meaning, you know, highlyperforming, like staff level
people, This was one of thething that separated, like,
people on the senior level tothe people on the staff level.
Like, even if you're a 100% surein your conviction, when it's
not critical, disagree andcommit and move on and do it

(30:50):
super respectfully. This is likea masterclass.

Jonathan Hall (30:53):
Yeah. Very, very cool. I I I tend to agree with
Rob. I would prefer an explicitthing rather than this argument
that takes two two magicalmeetings, but I don't really
care. If I have this capabilityin the language, I will use it
no matter what it looks like.
I don't care how you spell it. Iwill use s.

Shay Nehmad (31:06):
I have actually a a like an interesting question to
you here. So if I'm a newcomerto the language, right, do you
think this makes Go morecomplicated to understand?
Because I remember, like,usually people who come into Go,
they come from two directions.Either they come from a low

(31:27):
level language and then all thepointers and new and whatever is
easy because it's easier in Go.Yeah.
Like, you're coming from C plusplus this is not complicated for
you. Right? Right. Right. Thisis super simple.
What I'm talking about arepeople like moving from Kotlin
or Python or JavaScript or Ruby,like, you know what I mean?
Yeah. Yeah. These languageswhere you don't where you aren't
exposed to these, like, lowlevel concepts of pointers and

(31:50):
and memory management and thingslike that. Do you think that
this makes the language moreless approachable for them?

Jonathan Hall (31:58):
I don't

Shay Nehmad (31:59):
In think any significant way or is it
actually making it simplerbecause you don't have that
gotcha of, oh, I need I can't dothis thing, which I think I
should have been able to do.

Jonathan Hall (32:09):
So that's a good question. I hadn't really
thought about it, but what Ithink my answer is, is that
whatever gotchas there werealready exist in that new word.
Calling new on a type is alreadya little bit weird, especially
if you're not familiar withpointers. Like you're not, you
know, you get this thing like, Igot this magical pointer to zero
value. Like first, what's a zerovalue?
That's a new concept to mostpeople coming to Go and what's a

(32:32):
pointer? So that's alreadyconfusing. I think pointing to a
specific value is actually lessconfusing. So I think the new
added behavior probably will bemore intuitive to newcomers than
the

Shay Nehmad (32:42):
existing Yeah, like new three makes sense. Yeah.
It's very explicit, like new andthen pass the word, the number
three into it, meaning, oh,instead of just having it on the
stack, I'll have it on the heapand I'll have a pointer. Yeah.
That to me feels pretty obvious.
But the new, like, just pass anint, I think they'll like I

(33:03):
don't know. I'll never allow itin a code review.

Jonathan Hall (33:05):
That's already weird. And virtually the only
time I ever use that, by way, iswhen I'm using generics. And
that's sometimes the only way toin to instantiate a a generic
value.

Shay Nehmad (33:15):
Sometimes you need a new t.

Jonathan Hall (33:16):
Yeah. Exactly.

Shay Nehmad (33:17):
Yeah. That makes sense, actually. I always forget
about generics and Go because,you know, I'm trying to get

Jonathan Hall (33:21):
You don't need them that often.

Shay Nehmad (33:22):
Yeah. Yeah. Yeah. What you said. Alright.
I can't believe we workedthrough the, our this week
backlog, but we still have thelightning round. Lightning
round.

Jonathan Hall (33:40):
First up in the lightning round, you ever use
Postgres, Shai?

Shay Nehmad (33:43):
All the time. And literally, I was late for this
recording session because I wason a design meeting at our team
talking about let's not addRedis to our stack. Let's just
use Postgres. It has a cache,it's fine. Leave it alone, you
can do everything with Postgres,it's fine.

Jonathan Hall (34:00):
I love that take because I I convinced a client
to do the same thing a fewmonths ago, to get rid of Redis
and just use Postgres. Do youuse PGX for Postgres?

Shay Nehmad (34:08):
As you know, and you're, like, spreading salt on
my wounds right now. Uh-oh. Atwork, I'm doing TypeScript. But
if I were if I were to usePostgres, I would definitely use
PGX.

Jonathan Hall (34:20):
Because I was hoping you would say yes so I
could say you're already runningmy code in production, but I So
can't say PGX, which if you'renot familiar, is a driver for
Postgres that sits pretty lowlevel to the Postgres API
itself. So it's one of the mostperformant Go drivers for
Postgres. It's not standardlibrary compliant, although it

(34:42):
does have a compatibility shimif you need to use that. But
regardless, it's a very popularlibrary and they just released
version five point seven pointsix. We don't usually talk about
point releases of randompackages, but this one is
interesting to me because Icontributed to it.
The PGX pool package, if you'renot familiar, is the part that
manages pools of connections andI contributed a new hook to the

(35:06):
PGX pool. So if you need to dosome validation or or something
on a connection as it's pulledfrom that pool, I added a hook
to make that more robust thanwhat was already there. So I was
excited to see that.

Shay Nehmad (35:19):
Prepare the connection. Yeah. So the Why
goal would I use that for?

Jonathan Hall (35:23):
So the reason I'm using it is I need to set the
role for the connection at thetime the connection is set based
on a value in sort of thecontext. Yes. Which is easy to
do. The problem is what ifsomebody puts a bogus value in
the context to a role thatdoesn't exist in Postgres, then
it generates an error. And therewas no way with the old hook to
say, this is invalid, don't dothis.

(35:44):
And it would result in aninfinite loop.

Shay Nehmad (35:46):
That's actually such a pragmatic use case. You
just wanted to like set the roleof everything to the app, Right?
Mhmm. Or or a specific, userbase. That's awesome.
And, you know, just upgrade ifyou need this feature. It sounds
like the sort of thing thatpeople already implemented
themselves. I know I implementedit myself, like, just a few
months ago for Node Postgresbecause it doesn't have maybe

(36:09):
I'll steal that idea andimplement it in Node Postgres.
On the other end, it's Node, sowhatever. As mentioned, before
in the show, Jonathan, you'renaked.

Jonathan Hall (36:21):
I am.

Shay Nehmad (36:21):
So if you want a cool gopher Hawaiian shirt, oh,
boy, do I have great news foryou.

Jonathan Hall (36:27):
Tell me about it. Help me to clothe my naked
There's

Shay Nehmad (36:30):
a repo from two weeks ago with images that have,
like, Hawaiian print type thingwith, gophers on them. That's
awesome. That's it. I I don'tneed to add anything else. If if
you know you want it, youalready have the link open.
It's in the show notes. And ifyou're like, what are you
talking about? Hawaiian printfor with little cute gophers?

(36:53):
Why why are you talking aboutthis? Then you don't.

Jonathan Hall (36:55):
Yeah. The idea is you could, you know, upload this
to your favorite print on demandservice or whatever and have
some cloth made and then makeyour own t

Shay Nehmad (37:04):
shirt or crease or whatever. This is by Russ, and
he said, if you do makesomething fun and are willing to
share it, please send me apicture. So if you do print it
out on a thing, go send him apicture. I'm sure he would
really appreciate it. I don'tknow.
Maybe I'll maybe we can do acombo. You know what? Maybe next
week I'll have an update aboutthis.

Jonathan Hall (37:23):
Oh. Stay tuned. Can't wait.

Shay Nehmad (37:25):
One last lightning round item, from you, Jonathan,
is about my all time favoriteformat. Woo hoo. YAML.

Jonathan Hall (37:32):
YAML. It won't be in the standard library, sadly,
but, there is a new fork of whatused to be called, I think, go.
Pkg. N. Yaml.
V3 or something to that effectthat has been forked. That
particular that one I justmentioned has been archived
since I think April. I think weeven mentioned that on the show
back back then. So now the YAMLproject is maintaining the, I

(37:56):
guess you could call it theofficial Go YAML package now.
They adopted one that was notofficial but was heavily used.
It is now adopted by the YAMLproject. I think that makes it
official, wouldn't you say?

Shay Nehmad (38:07):
Yeah. They support like various versions, but
they're frozen and, you know,has Yamal has different flavors.
So this might not work for youbecause, I don't know, it uses
YAML bools, which if you'reusing GoYAML to parse GitHub

(38:27):
actions, won't work for youbecause it says, like, on GitHub
action syntax says, like, oncolon to say on push or on pull
request. Mhmm. If you use thislibrary, it's gonna be
translated to the word true.
Alright. So to the value true.You know, it's official in the
sense that, like, it's official,but it might not work for your

(38:50):
specific use case, and it's veryimportant to remember that.
Although, I think there might bea way to configure it. I haven't
tried it yet.
But it just gives me the, like,more confidence to use a library
that I feel won't be, like,super abandoned in in in two
seconds and it's fully coveredwith tests and whatever. All the
problems I have with it areactually problems with YAML.

Jonathan Hall (39:10):
But you love YAML.

Shay Nehmad (39:11):
Yeah. Yeah. For sure. If I had to use it, now I
I I know which library I'm gonnarecommend by default from Yeah.
Now

Jonathan Hall (39:20):
There are, of course, other libraries and even
there, the yaml.org mentions atleast two others for Go. So it's
not like they're trying to,like, rule the world with this
if you if you have a need foranother one. Another popular one
is the one from Kubernetes. It'snot on their list, there are So
you could certainly chooseothers. But I still think it's a
great thing to have a verypopular library no longer in

(39:41):
archive mode getting updates.

Shay Nehmad (39:43):
For for Ishais, like, if he had to pick a a YAML
library to implement hiselection the leader election
thing, I would tell him todepend on the Kubernetes one and
not this one because he'salready depending on the
Kubernetes one because he'sdepending on Kubernetes. Right?
Exactly. Yeah. It's it's it'sdifficult.
If Kubernetes moves to usingthis one, then it's like a

(40:04):
complete takeover. But I I thinkthere's zero chance of this
Alright.

Jonathan Hall (40:08):
Well, I think we'll throw our lightning round.
I think we've talked about asmuch news as we can muster for
the week.

Shay Nehmad (40:13):
Yeah.

Jonathan Hall (40:14):
And I will not be here next week, so I hope you
have a good time.

Shay Nehmad (40:17):
Yeah. We're we're talking with a few potential co
hosts. Worst case, I'll do theshow alone. And, yeah, thank you
all very much for listening andfor for putting up with us
missing last week. Now we'reboth back on our feet.
And we got a lot of love on theSlack channel as well. It's like
it's a tiny little thing, but Ireally appreciated it. It made
me feel nice. That's it.Alright.

(40:38):
Well, until next time. Programexited. Program exited. Goodbye.
Advertise With Us

Popular Podcasts

On Purpose with Jay Shetty

On Purpose with Jay Shetty

I’m Jay Shetty host of On Purpose the worlds #1 Mental Health podcast and I’m so grateful you found us. I started this podcast 5 years ago to invite you into conversations and workshops that are designed to help make you happier, healthier and more healed. I believe that when you (yes you) feel seen, heard and understood you’re able to deal with relationship struggles, work challenges and life’s ups and downs with more ease and grace. I interview experts, celebrities, thought leaders and athletes so that we can grow our mindset, build better habits and uncover a side of them we’ve never seen before. New episodes every Monday and Friday. Your support means the world to me and I don’t take it for granted — click the follow button and leave a review to help us spread the love with On Purpose. I can’t wait for you to listen to your first or 500th episode!

Stuff You Should Know

Stuff You Should Know

If you've ever wanted to know about champagne, satanism, the Stonewall Uprising, chaos theory, LSD, El Nino, true crime and Rosa Parks, then look no further. Josh and Chuck have you covered.

The Joe Rogan Experience

The Joe Rogan Experience

The official podcast of comedian Joe Rogan.

Music, radio and podcasts, all free. Listen online or download the iHeart App.

Connect

© 2025 iHeartMedia, Inc.