👕 Clothe your naked gophers and returns, with this one weird episode THEY don't want you to know about!
This show is supported by you. Stick around till the break to hear more about that. Welcome back to Cup o' Go for 09/13/2025. Keep up to date with the important happenings in the Go community in about fifteen minutes per week, almost every week. I'm Shay Nehmad.
Jonathan Hall:Welcome back. How are feeling, man?
Shay Nehmad: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:I had an infected tooth and couldn't do anything either. So, I'm glad we're both back in the saddle again, ready to talk about go news.
Shay Nehmad:Yeah. And since we missed a week, there are a few things we bumped to the backlog that's not gonna make it this show. And I think this show is also probably gonna be a little bit longer. Mhmm. Although people like listening on their podcast things, they they already know what the length of the show is.
Shay Nehmad:I don't know yet. True. But we bumped we we know that the JSON v two blog is out. We'll talk about it some other time. And we know that, Google has announced the Genkit one point zero thing, and we bumped that as well.
Shay Nehmad:I just wanna we just wanna get some hands on time with it before we actually talk about it on the show. So we know we know we missed some we missed some stuff, but we'll try to, get you up to speed. And thank you for your patience letting us take a week off.
Jonathan Hall:Yeah. First up, we have new point releases. This actually happened, what, a week and a half ago, nine days ago. So it's not that new. We would've talked about it last week if we'd been around, but go one point twenty five point one and one point twenty four point seven have both been released.
Shay Nehmad:Yeah. And it's with one of these bugs that's like I literally imagine the Go team going like, you know, the screen going black and white and the audio getting kind of crackly and be like, is this ever happened to you? And you see like a hapless housewife, like trying to do the dishes and they fall out of their hands, you know? Yeah. Yeah.
Shay Nehmad:So has this ever happened to you, Jonathan? You're trying to configure your API endpoints, but you're uncertain whether you should add a leading slash or not.
Jonathan Hall:Yeah. That happens all the time. Or trailing slashes or middle slashes, you know, forward or backslashes. My gosh, slashes are so confusing.
Shay Nehmad:So for just $9.99, so three simple payments, Go's course protection now doesn't exempt things without the missing slashes, which I'm sure is a strict is gonna be an actually strict 5050% split of people who did it one way and people did it another way because it's just random. But, yeah, it's like when you did a pattern and you added the, like an insecure bypass pattern, some extra patterns without the slash were also exempted. And because it's like a security bypass, they were like, hey, if you want the extra slash, you put it there as well. This is one of those things that's mostly useful for development. Like, you shouldn't have insecure bypass patterns on production normally for cross origin.
Shay Nehmad:Yeah. So as a developer, you'll immediately notice that it happened after you upgrade and just add a slash through the pattern. So it's not a it's not a huge downgrade in terms of dev experience, but it's a it it is better in terms of security. So Yeah. And I know we both discussed this in before the show.
Shay Nehmad:It's like we understand what cross origin policy means theoretically. Right?
Jonathan Hall:Right. Yeah.
Shay Nehmad:What what is it then?
Jonathan Hall:Oh, you're putting me on the spot now.
Shay Nehmad:We all know it just for the other people.
Jonathan Hall:Yeah. Right. Right. Right.
Shay Nehmad:Right. The show, we talked about, like, how everybody knows conceptually what cross origin is, but, you know, how it always gets a little fuzzy. You actually
Jonathan Hall:explain Super fuzzy.
Shay Nehmad:Yeah. Yeah. We won't go into the details, right now, but it's just a security feature in, you know, HTTP web servers.
Jonathan Hall:And if you don't know what it is conceptually, don't feel too bad either. It's not really
Shay Nehmad:It's confusing, man.
Jonathan Hall:It's confusing, and it only matters if you're really doing web front end development for the most part.
Shay Nehmad:You should know it if you're doing web
Jonathan Hall:If you're doing web front end, you should know it. If you're not, don't worry about it.
Shay Nehmad:Yes. But now it's slightly, slightly more secure.
Jonathan Hall:So that's our security release out of the way. We have a couple other community releases we'll be talking about. But first, I guess this is also a release. Go for Con Europe has released all of their videos from the conference. So if you didn't make it to Go for Con Europe, or if you wanna relive the experience on their YouTube channel, they have 17 talks up.
Jonathan Hall:There's some good ones on here from Dave Chaney, from the Go team, Brittany Elisch. There's a bunch here, Jonathan Amsterdam. Have you watched any of these, Shy? Anything of them that jumped out at you?
Shay Nehmad: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 talking about topics and then lightning talks.
Shay Nehmad:I wonder who they ate to that format from. There's one thing, speakers versus the audience game show. Oh, man. That I don't know what's going on there, but I I feel bad for missing it. Like, the FOMO is real.
Jonathan Hall:I also really like their, their music. Anyway, one talk that really jumped out at me was one from Damian Neal about testing time.
Shay Nehmad:We mentioned this in the past.
Jonathan Hall:Yes. We have. We have.
Shay Nehmad:And now it's the future even though when you change the past. You remember that scene from, the latest Avengers? Haven't seen any
Jonathan Hall:of the Avengers, but I'm sure that most of our audience have.
Shay Nehmad:So there's the the last one, is like a time travel movie. Like it's basically Back to the Future with superheroes. Okay. And there's one scene where the Hulk explains, like, you can't go back to the future and change your past because if you change the past, you're changing someone else's future. Blah blah blah.
Shay Nehmad:Nice. So that that's what's going on with this, with this topic, right, of testing time, basically.
Jonathan Hall:Yes. So I remember last episode or a couple episodes ago, talked about the blog post. It was also incidentally written by Damian Neal about testing time, similar title to the talk. Interesting. And it's really just about the testing sync test package, which allows you gives you some extra levers to pull when you're testing code that depends on time in asynchronous ways.
Jonathan Hall:I'm sure we've all written tests where 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 thing and you hope that's long enough and that your CI pipeline isn't so slow on running on some some slow server that one second is actually long enough for it to happen. This is a way to not do that. The testing sync test package basically lets you sort of wait until all go routines are blocking and waiting for something to happen and then advance to the next thing.
Jonathan Hall:So if you have something that's waiting, you know, one go routine is waiting on another go routine to complete something, then once all go routines are blocked waiting on each other, that means that that thing is probably completed. Now we can move on to the next bit in your test without sleeping arbitrarily long amounts of time. I've really oversimplified it because I want you to go read the blog post and or watch the video of Damien talking about this rather than listening to me talk about it.
Shay Nehmad:I will say that this is a problem that I've faced. Like, lot of the things we talk about, you know, the the Go announcement, the security release we just mentioned, it's like something global. It's HTTP thing, but it's specific to Go. And the next thing we're gonna talk about, GoFumped and Naked Returns, it's like a super specific Go thing that doesn't exist in any other language. Right?
Shay Nehmad:But this problem of, like, dealing with time in tests is super universal. I just wanna, like, say, if you work, in other languages alongside Go like myself, there's there's equivalent things in other languages as well, but only as third party libraries. For example, 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 a decorator.
Jonathan Hall:Right.
Shay Nehmad:And I think in JavaScript, there's Sinos Sinon, sorry, Sinon, which is way harder to use. And this is just a very universal problem in general. And it kinda sucks that, you know, every single testing course I see is all about, like, writing tests, but not with dealing with these problems that happen on every single software project that I will that of, like, sufficient complexity that I work on. Mhmm. Mhmm.
Shay Nehmad:It's like a so so Go having it as part of the standard library, just again well, you know, standard. It's just part of it goes to show when people say Go is, like, production language or, like, a real business language. It, like, deals with pains that actual software developers have. Yeah. And not, like, fancy nonsense that nobody cares about.
Shay Nehmad:Because I've dealt with this problem maybe five times already in my
Jonathan Hall:software Yeah. It comes up fairly often for me too.
Shay Nehmad: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:I've I've only played with it a little bit. It's it's simpler than I would have invented myself. So, yes, I'm happy for it in that sense.
Shay Nehmad:They did Better than the code I would write is pretty has a pretty low bar. I know for you it's a higher bar, but for me it's like
Jonathan Hall:So just like when I when I think about trying to solve that problem, the the solutions I come up with are much more complicated than what they have, which is great that they've they've taken the time to think it through and come up with a simple approach to a fairly complex problem. What I don't know yet from experience is if it will solve all of my time related testing problems. I'll have to play with it for probably a couple of years before I figure that out. But it's definitely helping, will help me in a number of cases. I have some test cases I could go back and rewrite now.
Jonathan Hall:I have one bug I'm trying to debug on a project that's about timing. I'm actually looking at rewriting those tests with sync test to see if that helps isolate the bug. So, yeah, I think it's a great step in the right direction, a huge step in the right direction for for making these tests easier to deal with.
Shay Nehmad:Yeah. And both the talk and the blog post are are the type of blog posts that I like, which are like a story. It's not like, here's how to use the new sync test. If you need that, just go to the sync test documentation. But if you wanna, like, the story behind it and the experiment and what's going on right now, you should definitely, like, read it at the of the bottom.
Shay Nehmad:It's pretty good. It's pretty good. And I assume, you know, people will start using sync sync test and will just collect feed feedback and issues, and now it's just part of the standard library and we'll improve it.
Jonathan Hall:Yep. Cool. Cool.
Shay Nehmad:Cool. As I've mentioned Mhmm. You this is an audio format. Right? You can't see it, but we're both, naked right now.
Jonathan Hall:We should I don't
Shay Nehmad:know how to segue from that to the fact that the new this release is on naked returns. I'll just say, I said it because it's on naked returns. Looking at the at the relevant issue, I see it's by someone. Oh, who is this handsome fellow? Oh my goodness.
Shay Nehmad:It's like, all you need to do is search for the word naked and go related to the repositories, and you'll find Jonathan there. So you opened this on October 2023, which is forever ago. Yeah. Is it before we started? When did we start it?
Shay Nehmad:Never mind. No. It's not.
Jonathan Hall:No. I think we already started the show.
Shay Nehmad:Yeah. But, yeah. Can you explain what are naked returns and why do you hate them so much?
Jonathan Hall:I have a whole video about this. I know. Put a link to that for anybody who's missed it. But the TLDR, a naked return in Go, you're allowed to name your return variables when you define a function, right? So you might have a function that returns an int and error.
Jonathan Hall:Maybe you call it count and so you name your return values. If you do that
Shay Nehmad:I still have to type them. I do like count int and then error.
Jonathan Hall:Yeah, right. You have to type them in the function definition. But then in the function body, when you return, you're allowed to then just say return without telling the values that you return and returns whatever those values are that may have been set in the function or not. That's called a naked return. And I hate them because
Shay Nehmad:they're So so hard to when I write the names in the function signature, it basically is it's not part of the function signature, like in the in the physical space it is, but it's actually two variable definition lines in the function.
Jonathan Hall:It like automatically declares those functions, those values to their zero value when the function starts. So then you can just do a naked return, return without any arguments, and it just fills in those existing values and returns those. You need
Shay Nehmad:That's very smart.
Jonathan Hall: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, you don't know what the values are, then you have to go back and read the function to see what those values have been set to. If they're being set to, know, maybe the error has been set to a non null value and you're returning an error and you don't know it. So it just makes code really unreadable.
Jonathan Hall:And maybe what's even worse, if you have closures within your function like that and maybe a closure just has an early return because it's a closure that returns nothing. Or maybe it's a closure that returns something different than what your outer function returns. It's really hard to compare those returns with the returns of the larger scope. You don't know what's what. Is it a naked return because this this closure has no return values?
Jonathan Hall:Is it an accurate return because it's part of this other thing? Naked returns just make code unreadable. I don't can't think of any reason they actually should ever exist to be clever. They're sightless typing. But even that problem is now solved.
Shay Nehmad:Yes. If you use the new release of GoFumpt, which is they actually released a minor bug fix since then, but the the minor version is 0.9. So GoFumpt, g o f u m p t, is like a slightly stricter version of Go format, GoFMT. I like it. I I I now bring it on by default to any project because Me too.
Shay Nehmad:Just the less I can I the less I can, care about style, but the more consistent my code is, the better? And I've found that this is extra true for, now that I'm using, like, you know, agents to work on my code a lot. So Cloud Code and and Cursor Background Agents and all that funky nonsense. They like it when all the code looks very much the same and is very readable. So a tool like GoFund really helps in that regard.
Shay Nehmad:And their new release, 0.9, is very conservative, values. It's, it will it's all about clothing all the naked returns, which I think is a is a crazy good, like, branding for this PR. Have you turned it on? Does it work?
Jonathan Hall:Well, I know it works because I wrote it and I tested it. I'm actually So I usually use GoFund as part of Golang CI Lint. So I'm looking forward to this version being included in the next version, hopefully, of Golang CI Lint, which will make it automatically included in all my workflows.
Shay Nehmad:Cool, cool. Anyway, proposals from John all the way from like proposing to implementation. I like it. Do you think I'll ever make it to, like, Go FMT or is that not I
Jonathan Hall:a would love that, but I doubt it.
Shay Nehmad:Why not? Like, what what's stopping you from opening that issue on the Go or is it just, like, not good enough in your Maybe
Jonathan Hall:I could. I mean, in my opinion, the negative returns are just a misfeature of the language in the first place. So at least automating them away in this sense is a step in the right direction. My feeling is that GoFund, when it was originally created, was sort of intended as a test bed for new features to potentially go into Go FMT. I'm not aware of any of those features that have ever been back ported to the original.
Shay Nehmad: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 IDE that has, like, the Go tooling enabled to disable that feature. It it feels like a really roundabout like, just patch them out of the language or something. But it's not that important. Like, it it reduces code readability a little bit. A little bit.
Shay Nehmad:But very, very cool.
Jonathan Hall:Happy to have you there. We've been chatting for a little bit. Let's go ahead and take a quick break. We'll come back with a few more stories before we end of the program.
Shay Nehmad:Like mentioned on the top of the show, this show is supported by you. We have a Patreon and you can contribute a few bucks a month to help us run this fun but rather expensive hobby. We pay for editing, hosting fees, our time. Well, we don't pay for our time. We sort of donate our time.
Shay Nehmad:This is a hobby. We do it for fun and to learn, but it's still like your direct support is very much appreciated. If you wanna find that link or reach us in any other in any of our other links, which include our Slack channel and our email and our swag store and whatever, all past episodes with transcripts, which I've been recently using to like try and find people I I remember we interviewed, but I don't exactly remember what they said. Use kapago.dev. You can find all the links there or email us at newskapago.
Shay Nehmad:Dev, that is newskapago.dev. Other than giving us money by joining our Patreon, you can support the show by sharing about it. A lot of people have been joining the Slack recently. I've been I've noticed that every time I open the Slack channel, like I see, oh, X has joined, Y has joined. I've been trying to like react with a wave emoji, which is not like the most in-depth, like gratitude I could give, just because we're, like, hundreds of people at this point.
Shay Nehmad:But we really, really appreciate anyone who joins the channel and, like, even just lurks around. I'll just shout out Adam Urie, who just joined, like, this Tuesday. Hey, Adam. Thank you for joining the Cup of Go channel and all the rest of, like, the 608 of you. Yeah.
Shay Nehmad:I can't mention all of you by name. But, Adam, you you won. You're you're mentioned on this week's episode. So, we really like it when people join, the show and join the community. So please leave a review on Spotify, Apple Podcasts, or just wherever you listen to your podcast.
Shay Nehmad:Share the show with a friend or a colleague or a co student. If and if you learn something interesting, like mention us. We we have a few people that mention us regularly, the weekly, Go newsletter, ApplyGo Mhmm. Always, mentions us, which is very nice. But, yeah, there's there's a lot of, cool discussions on the Slack channel, and we're very happy to see, like, the show doing numbers.
Shay Nehmad:It doesn't mean anything because we do it for learning, but I don't know. It really makes me feel good just going into Transistor, which is the software we use to manage the show and seeing, how many people listen and seeing, like, the discussions on on Slack. Even though theoretically it shouldn't matter, to me it matters. I don't know how you feel about it, Jonathan.
Jonathan Hall:It's it's fun. I mean, yeah, this this show has done has had a much bigger impact than I ever would have imagined when we started.
Shay Nehmad:We just passed a 150,000 all time downloads. Wow. Yeah. Which is pretty crazy. I mean, we have a 125 episodes, so it it works out like it makes sense.
Jonathan Hall:Mhmm.
Shay Nehmad:But it's just a really big number.
Jonathan Hall:Yes.
Shay Nehmad:Cool. Cool. Cool. Other than that, this show is, this week, sponsored by boldlygo. Tech.
Jonathan Hall:Woo hoo. That sounds familiar.
Shay Nehmad:Are you looking for a fractional gophering? Is that a good way to to put it? Sure.
Jonathan Hall:That's a great way to put it.
Shay Nehmad:Why don't you tell us what BoldlyGo. Tech is?
Jonathan Hall:I would love to. I have some availability coming up. We're going go next month to help you and your team improve your Go projects, especially when it comes to architecture or how to structure your projects, how to get a project off the ground. I've helped several clients rescue a project from an agency that maybe didn't know go all that well, or maybe an LLM that didn't know go that well. So if that's kind of thing you could use some expert help with and you don't necessarily need a full time person on board, look me up.
Jonathan Hall:Prices are probably more reasonable than you would expect to hire somebody with the sort of experience I have making fools of myself on podcasts.
Shay Nehmad:Yeah. Join brands you know and trust already, like Canonical, Unity, Deliveroo, Booking, and Teamwork. You're already running Jonathan's Code in production.
Jonathan Hall:Probably are.
Shay Nehmad:It's clothing all your returns right now. And, you know, there are some customer testimonials 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 or frustrated with the output of, like, offshore agency or just a pretty bad team on your company, although that's harder to admit, or you have like a brand new Go project on the company roadmap and you wanna start it fresh and you wanna start it right and make sure that it it grows, you know, in a sustainable way, you can get the world class Go development subscription over at boldlygo.tech.
Shay Nehmad:Thank you for sponsoring the show.
Jonathan Hall:Woo hoo. Thank you for letting me sponsor the show.
Shay Nehmad:Yeah. It's kind of one last thing for this break. I am planning a San Francisco meetup, and I'm having woes. I've already settled on a date. This is just if you're in the Bay Area, listen.
Shay Nehmad:If not, you can to you can zone out for the next, like, thirty seconds. It's supposed to be October 23. I am looking for a place to host it. So there's one guy, Akshay Shah, I think he's a listener actually, who's looking for a place. And I'm also looking for a place with, I think, another company.
Shay Nehmad:I will not name them in case they won't actually deliver. But if you're in the Bay Area, October 23, definitely, like, clear your calendars. But I won't send the Eventbrite thing until I have a place to actually run it at because I don't want it to, cancel last minute because I don't have a company who's willing to host it. So if you'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 the meetup to happen at a WeWork, because that's like super expensive personally for me.
Shay Nehmad:I might be able to get them to sponsor it. I'm trying to talk to them right now, but if you can help me, please help me. But remember, I just moved here. I'm I'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 of fun.
Shay Nehmad:It'll also be really close to my birthday, is October 19. We'll probably have a party. That's it for the, break. We took a break off last week, so we have some more topics to discuss. So let's just go to the next part of the show.
Shay Nehmad:Let's do it.
Jonathan Hall:I want to talk about building bulletproof leader election and Kubernetes operators, a deep dive.
Shay Nehmad:That's a smooth
Jonathan Hall:is a blog post.
Shay Nehmad:Is a blog
Jonathan Hall:Yeah. Would Blog Blog be shy. Sure. So this this probably is really more a Kubernetes related post than a Go related post, although the code is written in Go. So if you sit at that cross section between Go and Kubernetes, this post is really probably best for you.
Jonathan Hall:But do you understand leader election, Shai? Do you understand the problem this claims to be trying to solve?
Shay Nehmad:Yes. I'll avoid all the political commentary, especially this week. And if you read books like Designing Data Intensive Applications or if you learned like about distributed computing or if you have ever had to maintain Kubernetes clusters, I've had to do all three, you realize the problem that multiple computers are not necessarily better than one. And like you have a few computers and one that needs to delegate tasks between them. And I'm I'm intentionally using like simple language because this is actually a simple problem.
Shay Nehmad:When you layer it with all the nonsense Kubernetes words, it sounds complicated. Yeah. But in reality, it's very simple. You have like five computers and you want them all to do tasks, but somehow they need to choose who's doing which task and who's doing what. Right?
Shay Nehmad:Just a general problem in distributed computing. One way to resolve it is to say, okay, computer number one is the leader and it will like allocate the tasks or load the balance or whatever. However, whole one of the problems when you're distributing computing is that if one of the nodes goes down, if one of the, like, workers goes down, that's not a huge problem, right? Because, oh, I'll just not the leader can decide, okay, it went down, it's not responding to pings anymore, I won't send it any more tasks. But if the leader goes down, like, not zero of the tasks are getting allocated anymore.
Shay Nehmad:So if the leader goes down, one way to resolve it is leader election. Like, I'm trying to get to the leaders and all the workers are trying to get to a leader. And if all the workers are getting, like, getting to a consensus that the leader is down, maybe it has network issues, maybe it has a power failure, maybe it has software failure, but it's not working anymore. We need to elect a new one. Right?
Shay Nehmad:And leader election is the process through which it happens. And it's important because it's distributed. Like, now you have a bunch of computers that don't have a leader telling you them what to do, and they need to agree on a new one in a very consistent way. So you could say, it doesn't really matter who's the leader, right, because it's just a bunch of computers, so just do random. But then you'll be in a terrible situation where everybody thinks someone else is the leader and nobody's doing any work.
Shay Nehmad:That's what that's my understanding of the problem.
Jonathan Hall:I think you summarized it pretty well. Last bit kind of sounds sounds like our podcast. Like, we we don't know who the leader is, so none of us do anything.
Shay Nehmad:Yeah. Other than Filip.
Jonathan Hall:Other than Filip. The the blog post goes into some of the previous examples of how this is done. I'm not going to go into the details because the specifics are boring unless you're deep into this world, and why some of them aren't ideal, and then offers their own solution, which is to use a ConfigMap based leader election, which claims to be simple and transparent. Kubernetes native, which explains why that term doesn't make any sense if you don't know Kubernetes, reliable and observable. So and it goes through, you know, as the title claims, a deep dive.
Jonathan Hall:It's not the deepest dive. You're not going to start hemorrhaging because this is too complicated if you want to read it through it, But it goes through 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: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 you need to deal with. So he just shares, like I'm I'm sure it's on all of them, but he shared, okay. So we need to test the leader election scenario. So fresh election, you just boot up a cluster and nobody is the well, like, we need to figure it out.
Shay Nehmad:Take over from a dead pod. Take over from a stale leader. Respect the active leader. That's, like, such a good way to explain what this feature does without actually sharing all the code, which is really, really great. And, Bishai, just another banger.
Shay Nehmad:I liked his, talk on the latest, San Francisco meetup, And we actually play basketball together, so I'm I'm like kind of biased. But another another shot from three. It's on Medium, so go give him a clap, which is my least favorite of the social media interactions. It's like so performative and when you click on it on Medium, you know what I'm talking about? The clap button.
Jonathan Hall:Oh, yeah. Yeah. Uh-huh. It does
Shay Nehmad:a single clap, which is, like, the most cynical thing you can do after someone gives you something. Exactly. It's just so awkward. I don't the chances that the UX designer for Medium is listening is, like, zero to this show. But if someone knows him, tell them that this, like, gives me, Schuidenfroid on, like, unimaginable levels.
Shay Nehmad:You're just clicking that button.
Jonathan Hall:Alright. A couple quick updates before we move on to the lightning round, on to proposals. The first one
Shay Nehmad:On on past news items.
Jonathan Hall:Yes. I
Shay Nehmad:I like it when we do that, when we do follow ups. Makes me feel like a real journalist.
Jonathan Hall:Oh. So back in August on the twenty third at episode 123, we mentioned the proposal to deprecate the XNet context package. That proposal has been accepted, so it shouldn't really change anything as we talked about in that episode. Go listen to it if you want the full details, but that will be deprecated. Don't use it anymore.
Jonathan Hall:You shouldn't have been using it for ages anyway, but definitely don't use it now.
Shay Nehmad:Yeah. I actually wasn't aware it existed. If you if you lived your life without knowing that this package existed, now you now you're good. You don't have to
Jonathan Hall:catch Vindicated. Yes. And the other one, one I'm actually a little bit more excited about for fairly obvious reasons, which will become apparent is the proposal we also talked about back in episode one eighteen from July, a proposal to add an expression to create a pointer to simple types. This brought some discussion on the Slack channel that you mentioned. People talking about when would like, I think your point, Shai, was when would you ever use this?
Jonathan Hall:And my point was I use it all the freaking time. And we got some back and forth about that on the on the Slack channel. This proposal was proposed by Rob Pike. And the last comment as of this recording is also by Rob Pike, which reflects on the the final or probably final version. So this is now likely accepted.
Jonathan Hall:It hasn't officially been accepted. Next week, we'll likely have an update that says it's been accepted. The proposal is to change the way new works. So right now, new takes a type. Mhmm.
Jonathan Hall:They're proposing to let it also take a value. It So could take either type or an expression value or value expression. And if it's a value, then it just creates a pointer to that value rather than a pointer to an empty value of the type. And Rob's comment is, as explained several times by various pieces of this conversation, I would prefer the type to be explicit. That is, that the expression is an optional second argument.
Jonathan Hall:But since this proposal appears to be reaching closure and the final version does solve a long standing problem, I can only celebrate. Thank you. I really
Shay Nehmad:love love that approach of disagreeing Yes.
Jonathan Hall:Yes. I completely agree with Rob's sentiment here.
Shay Nehmad:When I had like high level engineers, high level meaning, you know, highly performing, like staff level people, This was one of the thing that separated, like, people on the senior level to the people on the staff level. Like, even if you're a 100% sure in your conviction, when it's not critical, disagree and commit and move on and do it super respectfully. This is like a masterclass.
Jonathan Hall:Yeah. Very, very cool. I I I tend to agree with Rob. I would prefer an explicit thing rather than this argument that takes two two magical meetings, but I don't really care. If I have this capability in the language, I will use it no matter what it looks like.
Jonathan Hall:I don't care how you spell it. I will use s.
Shay Nehmad:I have actually a a like an interesting question to you here. So if I'm a newcomer to the language, right, do you think this makes Go more complicated to understand? Because I remember, like, usually people who come into Go, they come from two directions. Either they come from a low level language and then all the pointers and new and whatever is easy because it's easier in Go. Yeah.
Shay Nehmad:Like, you're coming from C plus plus this is not complicated for you. Right? Right. Right. This is super simple.
Shay Nehmad:What I'm talking about are people like moving from Kotlin or Python or JavaScript or Ruby, like, you know what I mean? Yeah. Yeah. These languages where you don't where you aren't exposed to these, like, low level concepts of pointers and and memory management and things like that. Do you think that this makes the language more less approachable for them?
Jonathan Hall:I don't
Shay Nehmad:In think any significant way or is it actually making it simpler because you don't have that gotcha of, oh, I need I can't do this thing, which I think I should have been able to do.
Jonathan Hall:So that's a good question. I hadn't really thought about it, but what I think my answer is, is that whatever gotchas there were already exist in that new word. Calling new on a type is already a little bit weird, especially if you're not familiar with pointers. Like you're not, you know, you get this thing like, I got this magical pointer to zero value. Like first, what's a zero value?
Jonathan Hall:That's a new concept to most people coming to Go and what's a pointer? So that's already confusing. I think pointing to a specific value is actually less confusing. So I think the new added behavior probably will be more intuitive to newcomers than the
Shay Nehmad:existing Yeah, like new three makes sense. Yeah. It's very explicit, like new and then pass the word, the number three into it, meaning, oh, instead of just having it on the stack, I'll have it on the heap and I'll have a pointer. Yeah. That to me feels pretty obvious.
Shay Nehmad:But the new, like, just pass an int, I think they'll like I don't know. I'll never allow it in a code review.
Jonathan Hall:That's already weird. And virtually the only time I ever use that, by way, is when I'm using generics. And that's sometimes the only way to in to instantiate a a generic value.
Shay Nehmad:Sometimes you need a new t.
Jonathan Hall:Yeah. Exactly.
Shay Nehmad:Yeah. That makes sense, actually. I always forget about generics and Go because, you know, I'm trying to get
Jonathan Hall:You don't need them that often.
Shay Nehmad:Yeah. Yeah. Yeah. What you said. Alright.
Shay Nehmad:I can't believe we worked through the, our this week backlog, but we still have the lightning round. Lightning round.
Jonathan Hall:First up in the lightning round, you ever use Postgres, Shai?
Shay Nehmad:All the time. And literally, I was late for this recording session because I was on a design meeting at our team talking about let's not add Redis 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:I love that take because I I convinced a client to do the same thing a few months ago, to get rid of Redis and just use Postgres. Do you use PGX for Postgres?
Shay Nehmad:As you know, and you're, like, spreading salt on my wounds right now. Uh-oh. At work, I'm doing TypeScript. But if I were if I were to use Postgres, I would definitely use PGX.
Jonathan Hall:Because I was hoping you would say yes so I could say you're already running my code in production, but I So can't say PGX, which if you're not familiar, is a driver for Postgres that sits pretty low level to the Postgres API itself. So it's one of the most performant Go drivers for Postgres. It's not standard library compliant, although it does have a compatibility shim if you need to use that. But regardless, it's a very popular library and they just released version five point seven point six. We don't usually talk about point releases of random packages, but this one is interesting to me because I contributed to it.
Jonathan Hall:The PGX pool package, if you're not familiar, is the part that manages pools of connections and I contributed a new hook to the PGX pool. So if you need to do some validation or or something on a connection as it's pulled from that pool, I added a hook to make that more robust than what was already there. So I was excited to see that.
Shay Nehmad:Prepare the connection. Yeah. So the Why goal would I use that for?
Jonathan Hall:So the reason I'm using it is I need to set the role for the connection at the time the connection is set based on a value in sort of the context. Yes. Which is easy to do. The problem is what if somebody puts a bogus value in the context to a role that doesn't exist in Postgres, then it generates an error. And there was no way with the old hook to say, this is invalid, don't do this.
Jonathan Hall:And it would result in an infinite loop.
Shay Nehmad:That's actually such a pragmatic use case. You just wanted to like set the role of everything to the app, Right? Mhmm. Or or a specific, user base. That's awesome.
Shay Nehmad:And, you know, just upgrade if you need this feature. It sounds like the sort of thing that people already implemented themselves. I know I implemented it myself, like, just a few months ago for Node Postgres because it doesn't have maybe I'll steal that idea and implement it in Node Postgres. On the other end, it's Node, so whatever. As mentioned, before in the show, Jonathan, you're naked.
Jonathan Hall:I am.
Shay Nehmad:So if you want a cool gopher Hawaiian shirt, oh, boy, do I have great news for you.
Jonathan Hall:Tell me about it. Help me to clothe my naked There's
Shay Nehmad:a repo from two weeks ago with images that have, like, Hawaiian print type thing with, gophers on them. That's awesome. That's it. I I don't need to add anything else. If if you know you want it, you already have the link open.
Shay Nehmad:It's in the show notes. And if you're like, what are you talking about? Hawaiian print for with little cute gophers? Why why are you talking about this? Then you don't.
Jonathan Hall:Yeah. The idea is you could, you know, upload this to your favorite print on demand service or whatever and have some cloth made and then make your own t
Shay Nehmad:shirt or crease or whatever. This is by Russ, and he said, if you do make something fun and are willing to share it, please send me a picture. So if you do print it out on a thing, go send him a picture. I'm sure he would really appreciate it. I don't know.
Shay Nehmad:Maybe I'll maybe we can do a combo. You know what? Maybe next week I'll have an update about this.
Jonathan Hall:Oh. Stay tuned. Can't wait.
Shay Nehmad:One last lightning round item, from you, Jonathan, is about my all time favorite format. Woo hoo. YAML.
Jonathan Hall:YAML. It won't be in the standard library, sadly, but, there is a new fork of what used to be called, I think, go. Pkg. N. Yaml.
Jonathan Hall:V3 or something to that effect that has been forked. That particular that one I just mentioned has been archived since I think April. I think we even mentioned that on the show back back then. So now the YAML project is maintaining the, I guess you could call it the official Go YAML package now. They adopted one that was not official but was heavily used.
Jonathan Hall:It is now adopted by the YAML project. I think that makes it official, wouldn't you say?
Shay Nehmad:Yeah. They support like various versions, but they're frozen and, you know, has Yamal has different flavors. So this might not work for you because, I don't know, it uses YAML bools, which if you're using GoYAML to parse GitHub actions, won't work for you because it says, like, on GitHub action syntax says, like, on colon to say on push or on pull request. Mhmm. If you use this library, it's gonna be translated to the word true.
Shay Nehmad: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 specific use case, and it's very important to remember that. Although, I think there might be a way to configure it. I haven't tried it yet.
Shay Nehmad: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 covered with tests and whatever. All the problems I have with it are actually problems with YAML.
Jonathan Hall:But you love YAML.
Shay Nehmad:Yeah. Yeah. For sure. If I had to use it, now I I I know which library I'm gonna recommend by default from Yeah. Now
Jonathan Hall:There are, of course, other libraries and even there, the yaml.org mentions at least 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 for another one. Another popular one is the one from Kubernetes. It's not on their list, there are So you could certainly choose others. But I still think it's a great thing to have a very popular library no longer in archive mode getting updates.
Shay Nehmad:For for Ishais, like, if he had to pick a a YAML library to implement his election the leader election thing, I would tell him to depend on the Kubernetes one and not this one because he's already depending on the Kubernetes one because he's depending on Kubernetes. Right? Exactly. Yeah. It's it's it's difficult.
Shay Nehmad:If Kubernetes moves to using this one, then it's like a complete takeover. But I I think there's zero chance of this Alright.
Jonathan Hall:Well, I think we'll throw our lightning round. I think we've talked about as much news as we can muster for the week.
Shay Nehmad:Yeah.
Jonathan Hall:And I will not be here next week, so I hope you have a good time.
Shay Nehmad:Yeah. We're we're talking with a few potential co hosts. Worst case, I'll do the show alone. And, yeah, thank you all very much for listening and for for putting up with us missing last week. Now we're both back on our feet.
Shay Nehmad:And we got a lot of love on the Slack channel as well. It's like it's a tiny little thing, but I really appreciated it. It made me feel nice. That's it. Alright.
Shay Nehmad:Well, until next time. Program exited. Program exited. Goodbye.
Creators and Guests

