Cancel culture is really getting out of hand in the Go stdlib

Shay Nehmad:

Jonathan, you made a mistake. I'm gonna have to correct you in this episode. This is Cup of Go for 07/30/2026. Summers creep into an end. Keep up to date through the important happenings in the Go community in about twenty minutes per week.

Shay Nehmad:

I'm Shay Nehmad.

Jonathan Hall:

And I'm Jonathan Hall.

Shay Nehmad:

How are you planning to wrap up the summer? Any crazy plans, for example, next week?

Jonathan Hall:

Oh, yeah. Today, my mother gets here and she's staying for two weeks. And part of the reason she's staying for two weeks is to help comfort for me while I'm gone next week to Seattle to go for a call. So I don't know if you wanna do this show without me next week, but I'm gonna be busy partying up with gophers. So, yeah, just count me out.

Shay Nehmad:

I am jealous. But no, we will just delay the recording to Monday. It'll be fine. Filippo, cut here for a second. A few moments later.

Shay Nehmad:

Sorry. My boss walked in. You know how that is.

Jonathan Hall:

I just That should that should be the the

Shay Nehmad:

teaser for You that know what?

Jonathan Hall:

We can do that for sure.

Shay Nehmad:

So, yeah, who are you gonna meet at Gopher Con? You I planning to don't know.

Jonathan Hall:

I know Bill Kennedy is gonna be there because we've chatted about that. I expect I'll meet some other folks, maybe some of our listeners. I hope that some of our listeners will come introduce themselves and I can chat with them.

Shay Nehmad:

And you probably have a bunch of stickers. I remember you had like a I million

Jonathan Hall:

do have some stickers I will be taking and probably a cup of go shirt that I'll be taking.

Shay Nehmad:

Nice. Oh, the new shirt? Did it make did it make it?

Jonathan Hall:

It's here. Bro. I've got it.

Shay Nehmad:

Aspas. It works.

Jonathan Hall:

I'll be wearing it.

Shay Nehmad:

Nice. Nice. I got mine as well. It's a bit too big. I I I'm still not used to American sizes, but it's fine.

Shay Nehmad:

Anyway, today we're gonna talk about release, a proposal, a couple of blog posts, a tool for generating stuff, just a little bit of a hodgepodge. Last week was very proposal heavy. So you wanna kick us off with something by Jamie, friend of the show.

Jonathan Hall:

Yeah. So Jamie's project, OAPI CodeGen has a new release version 2.8, which now supports OpenAPI 3.1, is a big milestone for anybody who cares about OpenAPI. This is a big one. Jamie,

Shay Nehmad:

please re release it and make sure your version is the same as the OpenAPI version. Just make your version 3.1. I don't know if you guys discussed it, but like if your project is following a different project, then the versioning scheme should be the same. It will make my life so much easier if I see that OpenAPI cogen or OAPI cogen, sorry, is version 3.1, because then it's very easy for me to know that it's You know what I mean? Anyway, sorry.

Shay Nehmad:

Yeah, yeah. I'm gonna get off my soapbox here. What is in this new version?

Jonathan Hall:

There are reasons that's not always possible, by the way. The most obvious one would be, what if you support two different schemas, one from OpenAPI and one from GraphQL or whatever. You can't follow both. I don't know if that's relevant to this project, but anyway. Yeah, the big headline feature is OpenAPI 3.1 support.

Jonathan Hall:

A few other things, now it requires Go 1.25. It does include some breaking changes which you'll care about if you're using an older version or upgrading. Trailing slash routes on that HTTP server are no longer act as catchallels, for example.

Shay Nehmad:

Everything changes in code generators are always tough. It's the sort of thing you think about like a compiler that's always going work the same, but it actually doesn't work like that.

Jonathan Hall:

Right, right. I don't know that these will all There's only like two things. The other one being security sculpture no longer committed by default. So hopefully it won't affect too many people in too many ways.

Shay Nehmad:

Yeah, but 3.1 support is huge. It's really important. I've been using 3.1 for all of my API documentation, which at Adoption is like a big thing. A lot of customers actually have been, you know, since day one, I've been like, our API has to be really good because customers will integrate with our product. And, you know, products people are like, no, let's do features.

Shay Nehmad:

And when someone asks to, you know, have an API, then fix it. And I was like, no, you gotta have it day one, otherwise it's not gonna work. And then customers started integrating with our stuff without even without telling us. And I was like, yes, I was correct. And having great tools for generating, you know, SDKs and stuff, agent skills, whatever, from OpenAPI documentation is really important.

Shay Nehmad:

So great stuff, Jamie. Good work. How many stars does this project have? I'm wondering, like, I know I I because I think of it as like a project of a friend. Yeah.

Shay Nehmad:

This is like a serious, serious project.

Jonathan Hall:

One one k forks. 8.5 k stars.

Shay Nehmad:

Yeah. I never understood the forks as a metric. Like, it doesn't make any sense.

Jonathan Hall:

What do you mean? Like, do you know what it means or or why it

Shay Nehmad:

matters? I know technically it means a thousand people pressed on the fork button, but I know for a fact that there aren't a thousand people maintaining different versions of OAPI cogen. I think people just click it sort of next they think it's like like and subscribe or something. You know what I mean?

Jonathan Hall:

It might be. But look at two ninety three contributors. That suggests that at least two ninety three people had to click the fork to create a pull request.

Shay Nehmad:

Oh, unless you can create a pull request on this repo? But you have

Jonathan Hall:

to have right access to the repo to do that, which

Shay Nehmad:

means you have Oh, yeah, yeah, Got it. Got it. Got it.

Jonathan Hall:

So that just probably means roughly four times as many people that's contributed have forked it to make a hack to either for a probably not like a maintain fork, but just like, is this something I can reproduce? Can I figure out what's going on here? So I think that 3,000 number makes sense.

Shay Nehmad:

Yeah. And it deals I with 10,000

Jonathan Hall:

certainly fork far more projects on an experimental basis than I actually contribute to, you know, just to see, you know, maybe there's a bug here and then I discover there's not or that it's not relevant

Shay Nehmad:

or I'm trying

Jonathan Hall:

to work around or something

Shay Nehmad:

like that. It's totally beside the point, but I wish I could like temporarily fork. And then if I don't push to it in in, a seven day period after that, it, deletes the fork. You know what I mean? You you certainly can't get all these digits on garbage around.

Jonathan Hall:

You have to delete it yourself.

Shay Nehmad:

Anyway, good work, Jamie, this, like, very success clearly very successful open source project in the new version. And I don't know, I use it, so I'm I'm one of the 10,000 for sure. Although, you know, a lot of people have thoughts about cogeneration. Some people don't super love it, but,

Jonathan Hall:

some

Shay Nehmad:

of them might be in this room right now. We were having live commentary from the, like, peanut gallery on the episode. Anyway, I at the request of my boss, I also hate cogeneration now. Official position. Anyway, let's talk about one proposal.

Shay Nehmad:

Last week, we did a ton of proposals, but I was really interested in this one. Just because of the drop support, I was very surprised at drop support. Can you explain what is a drop support for transport. Cancer request?

Jonathan Hall:

Yes, can explain it. So this proposal has been accepted. So I think this will come in 01/20, probably 01/28. I think it's too late for this to land on 01/27. So, one hundred twenty seven will still support transport.

Jonathan Hall:

CancelRequest, but 01/2028 coming next February will not. What is it? It's a way to cancel an HTTP request that is in flight. You may not have heard of it. Have you

Shay Nehmad:

heard of

Jonathan Hall:

this one? Have you used it? You probably use it all the time, right?

Shay Nehmad:

So I'm sure that I've implemented, you know, once the server gets serious enough and does enough things, you want to be able for example, you know, someone sends you a request and then they close the tab or whatever, you wanna cancel the the context. So, you know, if you have DB requests flying or any side effects going on or whatever, for them to get canceled or rolled back as well, right? So let's say someone opens up a billing page and then presses pay and then closes the tab, you wanna cancel that payment. You know what I mean?

Jonathan Hall:

Right.

Shay Nehmad:

So I know that I've used some mechanism to implement something like this in Go once, but I have some questions. I don't know if I use this specific function.

Jonathan Hall:

So you're talking about server side, this is client side. This is for you're making an HTTP request to a client and you want to cancel it before it returns.

Shay Nehmad:

I'm making an HTTP request as a client.

Jonathan Hall:

As a client, Right, to a right. So this would be the HTTP dot client object and you want to cancel that somehow. One way you can do that is with a function called cancel request on the transport. So, have to reach into the transport that's in the client and say cancel this request. I would bet you a lot of money you've never used this feature.

Jonathan Hall:

And if you have, it was a long, long time ago because this actual feature was deprecated in Go 1.6 in 2016.

Shay Nehmad:

Wait, but I know canceled requests also as a client to other microservices.

Jonathan Hall:

Sure. So you probably did that using a different mechanism because there's three of them now.

Shay Nehmad:

Okay. Oh, and this proposal is about like making it two, being it two?

Jonathan Hall:

Right. So this one, this particular one was deprecated in 2016, ten years ago, And it was added in Go and it was deprecated in favor of a new one called request. Cancel. So, you may have used that one, which lets you rather than having to reach into the internals of your client on the transport and canceling a request that way, you can now just on the request object cancel directly. That was added in Go 1.5, this old one was deprecated one version later in 1.6.

Jonathan Hall:

But then in Go 1.13, we implemented a new version which you probably have used, which lets you use a new request with context and you can just cancel that context and that cancels the request. So those are the three mechanisms. The oldest of those three is being finally removed after being deprecated for ten years.

Shay Nehmad:

Okay, I got it. And the reason for deleting it is just to like clean up stuff or is there a specific It's reason why

Jonathan Hall:

it's basically clean up, yeah. Because maintaining this third way to cancel requests requires some maintenance. Now, to be clear, it will still be available behind the Go debug flag for four more versions. So, this will be fully twelve and a half years deprecated before it's finally completely removed from Go. So, it's going to be in Go 127, is coming out next month.

Jonathan Hall:

It will be removed except for GoDebug and Go 1.28 and then 1.29, thirty and thirty one will still have it behind GoDebug flags. It will be Go 1.32 before it's fully actually removed completely and you can't use it anymore.

Shay Nehmad:

I'm specifically excited for Go 32, like a nice round number.

Jonathan Hall:

Yeah, the next time we'll have such an exciting release will be Go 1.64, which will be very long.

Shay Nehmad:

We'll probably be at Go two by then with all its error handling and Whatever. Other break Okay. This sounds very reasonable, but it does lead to, like, a design question I have for you.

Jonathan Hall:

Okay.

Shay Nehmad:

On the server, isn't it, like, super difficult to actually implement handling request cancellation correctly?

Jonathan Hall:

I mean

Shay Nehmad:

I've I've thought about it a few times, you know, someone Yeah. Sends a Someone sends a request from a browser. Let's say it's not like very specific code, then they close the tab or whatever. Theoretically, you should get a signal, right, or they move to a different part of the application. You should get a signal like, oh, I don't want this API request anymore that I sent.

Shay Nehmad:

But like, what do you do on the server level to handle this like gracefully? You gotta cancel DB connections and then close them gracefully, and you gotta any logs, any traces, got to like sort of undo them because this was canceled and whatever. Like it's I've realized that I haven't I've thought about a lot of things when designing server side, but I haven't thought about this case too much.

Jonathan Hall:

Are you asking as the application developer how difficult it is or like from this standpoint of writing the net HTTP library, how difficult it is?

Shay Nehmad:

No, I'm talking generically as like someone who's doing server side and back end, not from like the the low level By I the am asking you generically and not specifically about Go because I know you're going to start doing TypeScript and I'm doing TypeScript. So I'm trying to ask about general design because I think in Go it's way easier because you have the context package and if cancel, it's all like way more built in than in other languages.

Jonathan Hall:

So, I don't know how you do it in TypeScript at all, but the general idea is watch for the cancellation signal, whatever form, whatever form it takes. And if you receive that, then at the point of the work, stop doing the work. And how easy that is to do depends on the work being done. Like if let's say it's something really generic, you're looping over a billion rows or a billion pieces of data to add them together. You could just every thousand rows check, has this been canceled?

Jonathan Hall:

And if it is, stop calculating those billion rows and return early, right?

Shay Nehmad:

Yeah. But let's say you have a serious API surface, like here, you know, at work, I have a ton of APIs. It's not like, oh, just the three functions that I have to think about. It's like 300 of them, you know what I mean? Or a 100 of them.

Shay Nehmad:

So basically, okay, implement the generic mechanism to capture that signal once, but you do actually have to think about every single function.

Jonathan Hall:

Yeah, every place you're

Shay Nehmad:

doing some work,

Jonathan Hall:

you need the ability to do that. But you can decompose it so that you only have to think about it in each case as it's done. So you're looping through your billion things, you do that. Or maybe you're blocking on a network connection. So while you're blocking for the network connection, you also check depending on your language and capabilities, you either check periodically or simultaneously for that signal happening.

Jonathan Hall:

Where it's most difficult is when you need to propagate that cancellation to another service you don't control. And one example where I know historically it's been a problem, I don't know if it still is, is MySQL. In the past and maybe still today, I don't know, it was impossible to cancel a MySQL operation that was happening at least from the Go library. I don't know if MySQL had that capability at a different level, but in the Go library you couldn't just cancel a running MySQL operation. So you could just stop listening for the response, but it would still, my SQL operation would keep happening in the background and then eventually return a bunch of rows to nowhere.

Jonathan Hall:

Cool.

Shay Nehmad:

Well, I feel like it's difficult and that I haven't thought about it enough, but at least this proposal will make it marginally easier for me to pick which function to do on the client side when I'm implementing this between microservices. Yeah. That was my tie in. It's kind of weak, but I just wanted to get a It design lesson

Jonathan Hall:

was for because if you had if you had somehow found that one and decided you wanted to try it, you would have immediately seen the deprecated don't use this documentation stuff.

Shay Nehmad:

Yeah. I love it in my ID. It's like it has all strike through through it. It's like the teacher giving you with a little red pen. You remember in school?

Jonathan Hall:

Yes. For sure.

Shay Nehmad:

All right. I wanted to talk about a few blog posts, looking at the time of this episode, I think I'm only gonna have time for one. I also wanna clear the record here and like clear my name. I have more than one shirt. It just hand ended up that I'm wearing the same shirt like three times for this episode.

Shay Nehmad:

But don't worry, I have more than a single shirt.

Jonathan Hall:

This is just the one you keep on the shelf behind you.

Shay Nehmad:

It just it just turns out that I'm I'm wearing my dream theater shirt for these episodes. I don't know what happened. But I have multiple shirts, I promise. So I don't know if you remember, but episode one one two, we had a live episode in San Francisco where we introduced the green tea garbage collection garbage collector algorithm. That was really fun.

Shay Nehmad:

Well, one last thing on the backlog that we really wanted to get to is this sort of big and sorta intimidating proposal about green tea garbage collection, which I opened and started reading and got intimidated and closed it and put it like, tagged you on the backlog so you teach me about it. But I have to admit, you know, I sort of vaguely remember how it works from just talking about it in that episode, but I wouldn't be able to, like, give you a lot of details. And then I saw this blog post from Phil Eden on a site called theconsensus.dev, we'll get back to that in a second, called watching Go's new garbage collector move through the heap. I love this blog post. If you're like me and you like digging, you know, opening up the hood and seeing how something works, This is really cool.

Shay Nehmad:

So it takes a go and c sharp, by the way, if any of the Genentech people are listening, and sort of compares how they're how they're allocating objects on the heap, how they, like it walks the address space. And instead of being a blog post that's like, oh, this is how it works with some visualizations, it gives you commands and code that you can run and actually look, and it prints out how the heap looks. So you run the code, it's called heapach. Go, you can copy it, and then you'll see like, literally, you'll see the code print out where objects are on the heap, which I thought was really cool. I never thought about being able to do that, but of course you can do that, right?

Shay Nehmad:

And if compares Go and C, I sort of don't want to ruin it for you, but there is one interesting thing where Go puts all the same objects in the heap, objects of similar size together because of how Green Tea works with it later and C doesn't. And some performance comparisons of like how the mark and sweep works and how fast it works and stuff like that. I really, really like this blog post. I highly recommend just checking it out. There's also some Python in it as well.

Shay Nehmad:

And then it compares how many references, how many misses you have, blah, blah, blah. Real, really good stuff. Have you ever like dove that deep into how the garbage collection works?

Jonathan Hall:

No, never. Have only the biggest sense of how garbage collection works. Happy to

Shay Nehmad:

look I at didn't to. Need to. And I think probably you didn't need either. I think 99.99% of developers don't, but I really think it's worth it to like check out this blog post. It teaches a lot of good tools and very interesting stuff.

Shay Nehmad:

It looks at a worst case, etcetera, etcetera. But I was surprised, it's like, this is a really high quality blog post. So I looked up Phil Eden, because usually when someone writes this well, they like have more blog posts that are really good. And I just wanna shout out this project page, company, I'm not sure exactly what it is, theconsensus.dev. It's Phil Eden's like thing.

Shay Nehmad:

He's just writing really, really good blog posts and you can sponsor him by posting some job openings or sponsor it directly. But yeah, I think it's really good. I looked at a few other blog posts here, just a lot of good stuff going on here. And I think it's relatively new as well. I read the about page and his like personal blog.

Shay Nehmad:

And also if someone knows Phil, we would love to have him on the show. So maybe I'll shoot him a message as well. But a really cool website, The Consensus. Seems like high quality human writing, which is very much in need right now. Yeah.

Shay Nehmad:

Alright. We're at the time, so let's move to a quick lightning round. Lightning round.

Jonathan Hall:

All right, lightning round. Yes, we had an interview planned, but last minute rescheduling occurred. So we'll do that at some point in the future. So this is a quick episode, but for the lightning round, I wanted to share a tool called Typist GoWasm. It generates PDFs from Typist templates, and it runs entirely in process using WebAssembly.

Jonathan Hall:

Are you familiar with Typist?

Shay Nehmad:

I think it's PDF for invoices or something like that, like a template language, but I'm still using, like, Lech and and LaTeX and whatever.

Jonathan Hall:

Oh, yeah. Yeah. Laifenfeld. Laifenfeld.

Shay Nehmad:

I feel very smart when I use Laifenfeld, but now that AI can write the Laifenfeld thing for me, it sort of took the sting out of it.

Jonathan Hall:

So, typist is basically my understanding is that it's a templating language kind of like markdown, but with a lot more capabilities in markdown. So you can do graphs and diagrams interesting things that you can't do in markdown alone. But this could I'm merge

Shay Nehmad:

always down for these frameworks, new frameworks. I unfortunately think that because of AI generation, people are just gonna start sharing HTML files. That's actually what's gonna happen if you need like a graph or whatever, because it's so easy to create these like artifacts now. But that's okay. So this is a Go project that lets you generate a PDF from a types template?

Jonathan Hall:

That's right.

Shay Nehmad:

What's the Wasm part then?

Jonathan Hall:

So I guess it's just designed to run-in WASM. I don't know if it runs only in WASM. I would've

Shay Nehmad:

Oh, got it. So you can run it, like, in the browser.

Jonathan Hall:

Yeah. You can run it in the browser. Cool. Cool. Cool.

Jonathan Hall:

Yeah.

Shay Nehmad:

Awesome. Yep.

Jonathan Hall:

Well,

Shay Nehmad:

I have two lightning round items.

Jonathan Hall:

The

Shay Nehmad:

first one is as foreseen in the beginning of the episode, you're wrong.

Jonathan Hall:

What?

Shay Nehmad:

I wanna correct you. Last episode you said that about an example. Anything that starts with example is gonna be an example. But Giuseppe Giuseppe Maxia. Shout out, Giuseppe.

Shay Nehmad:

I hope that's how you pronounce it. The compiler is stricter. The name of the function must be example existing function or example existing type, existing method. Must be. So you misled our audience and we will take you to the town square after this and just rip out your ranks, make you write the JavaScript for for a few months.

Shay Nehmad:

No. Just kidding. My real lightning round thing is the Microsoft came out with a new Go Agent Framework. First of all, it's cool because the Microsoft for Go developers finally has a single blog that isn't Go Build is now available. But, yeah, a Microsoft Agent Framework, it's theoretically open source, but it's very, very clearly if you're building agents on Microsoft, so you have like Foundry provider and stuff like that, Azure provider, Azure credential.

Shay Nehmad:

But it's a good way to, you know, include a lot of tools, MCPs, middlewares, wares, and human in the loop approvals. It looks like a pretty thoughtful project in terms of how it's designed. So if you're building like code based agents, it's a pretty good way to do that. There's also the dot net SDK and the Python SDK. So, you know, it's part of a more overarching framework in general for like building and orchestrating AI agents.

Shay Nehmad:

So if you wanted to do that in Go, now you can do it. I think that wraps it up for us.

Jonathan Hall:

I think it does. We'll see you in a week and a half ish since next week we'll be recording the following beginning of the week, right? Yeah.

Shay Nehmad:

As promised, no ad break, but just a quick mention that this show is supported by you on Patreon. Thanks a lot to our Patreons. And if you want to find all the things, you can find them at peppago.dev and that we're not recording next week because of the GopherCon, so we'll get back to you in like a couple of weeks.

Jonathan Hall:

Awesome. See you then. Program exited.

Shay Nehmad:

Goodbye.

Creators and Guests

Jonathan Hall
Host
Jonathan Hall
Freelance Gopher, Continuous Delivery consultant, and host of the Boldly Go YouTube channel.
Shay Nehmad
Host
Shay Nehmad
Engineering Enablement Architect @ Orca
Cancel culture is really getting out of hand in the Go stdlib
Broadcast by