---
title: "Inlined Defers in Go"
publication: "Go Weekly"
issue: 296
published_at: "2020-01-24"
canonical_url: "https://golangweekly.com/issues/296"
---

And more Go news, links, and tutorials of the week.       

#296 — January 24, 2020 

[Read on the Web](https://golangweekly.com/issues/296)   

Golang Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/g8vqmfzmcr6hox7rh8ap.jpg)](https://github.com/AllenDang/giu)   

[Giu: A Cross Platform Rapid GUI Framework Based on Dear ImGui](https://github.com/AllenDang/giu) — Another way to create simple GUI apps from Go. [Dear ImGui](https://github.com/ocornut/imgui) is an interesting GUI library (for C++) aimed at creating quite idiosyncratic UIs aimed at power users rather than standard end-user UIs. 

Allen Dang   

[Inlined Defers in Go](https://rakyll.org/inlined-defers/) — An optimization in 1.14 and later for simple use cases with `defer` that removes most of the performance hit for deferred functions, complete with the how and the why. 

Jaana B. Dogan   [![\](https://copm.s3.amazonaws.com/b17bc5ae.png)](https://get.mux.com/2NAwocg) 

[Reach Your Go App Users Anywhere with Video That Streams Beautifully, Everywhere](https://get.mux.com/2NAwocg) — Automatically deliver the best user experience for every combination of device, browser, location, and bandwidth with Mux's video API. Get started with a $20 credit. 

Mux sponsor   

[Stats: A Comprehensive Go Statistics Library Package](https://github.com/montanaflynn/stats) — No dependencies, well tested, work with concepts like averages, sums, percentiles, standard deviation, etc. This week’s addition? [Normal distribution functions.](https://github.com/montanaflynn/stats/commit/60d707fd1db41538718d32aa9f0ea667a62716c2) 

Montana Flynn   

[Algorithms with Go](https://algorithmswithgo.com/) — For your benefit, I _very_ rarely link to anything behind an email wall, but Jon has produced _so much_ great content for our community, and this little Go algorithm course will benefit many of you, so… :-) 

Jon Calhoun   

[Go's Tooling Is An Undervalued Technology](https://nullprogram.com/blog/2020/01/21/) — This is focused mostly on the Go compiler but brings in package management as well. And, he’s right: Go’s compiler is so fast and good the average developer doesn’t need to think much about it. 

Chris Wellons  

💻 Jobs  

[Sr. Software Engineer at CrowdStrike (Remote)](https://crowdstrike.wd5.myworkdayjobs.com/crowdstrikecareers/job/USA-Remote/Sr-Software-Engineer_R3806) — CrowdStrike is the leader in cloud-delivered endpoint protection, which helps protect our customers from cybersecurity attacks. 

CrowdStrike   

[Golang Developer at X-Team (Remote)](https://x-team.com/remote-go-developer-jobs/?utm_source=cooperpress&utm_medium=email-ad&utm_campaign=go) — Work with the world's leading brands, from anywhere. Travel the world while being part of the most energizing community of developers. 

X-Team   

[Find a Job Through Vettery](https://www.vettery.com/tech?utm_source=newsletter&utm_medium=cooper-golangweekly&utm_term=tech&utm_content=grouped&utm_campaign=ad-77582) — Vettery is completely free for job seekers. Make a profile, name your salary, and connect with hiring managers from top employers. 

Vettery  

📘 Articles & Tutorials  

[On the Graceful Shutdown of a TCP Server in Go](https://eli.thegreenplace.net/2020/graceful-shutdown-of-a-tcp-server-in-go/) — Shutting down a TCP server can be tricky because it’s not necessarily clear what an existing client is doing. Here are two strategies to consider. Be safe, my friends. 

Eli Bendersky   

[Why `go.mod` Has Its Own Bespoke Syntax](https://github.com/golang/go/issues/23966#issuecomment-377997161) — An interesting bit of history here if you’ve wondered why `go.mod` couldn’t just use JSON or YAML, say. 

Russ Cox   

▶[Dynamically Instrumenting Go Programs](https://www.youtube.com/watch?v=de9cVAx6REA) 

Jason Keene   

[Measure and Improve Go Code Performance with Blackfire.io](https://hello.blackfire.io/go?utm_source=golang_weekly&utm_medium=newsletter&utm_campaign=q1_2020) — Profile in development, test/staging, and production. Visualize bottlenecks in an intuitive UI and find root causes. 

Blackfire.io sponsor   

[Generating a Static Site with Hugo and Netlify](https://blog.risingstack.com/static-site-generator-hugo-netlify/) — Not much Go to see here, but Hugo is a popular Go-based static site generation tool so if you want to get started with it.. 

Máté Boér   

[A Chapter in the Life of Go’s Compiler](https://medium.com/samsara-engineering/a-chapter-in-the-life-of-gos-compiler-c89b9db74617) — A pretty technical post on Go and deterministic compilation, which was working, then not working, then working again…with a flag. 

Jon San Miguel   

[Go + Services = One Goliath Project](https://engineering.khanacademy.org/posts/goliath.htm) — The journey from a monolithic Python 2 to a distributed, service-based Go platform, including the rationale and progress made to date. 

Khan Academy Engineering   

[Why I've Come to Like That Go's Type Inference Is Limited](https://utcc.utoronto.ca/~cks/space/blog/programming/GoLimitedTypeInferenceLike) — Type inference in Go is limited to within a single function, and that’s a good thing that avoids spooky things. 

Chris Siebenmann  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/qtx11jcurnnzcrufi4b4.jpg)](https://github.com/muesli/termenv)   

[termenv: Advanced ANSI Style and Color Support for Terminal Apps](https://github.com/muesli/termenv) — Offers convenient methods to colorize and style output, without needing to deal with weird ANSI escape sequences and color conversions. 

Christian Muehlhaeuser   

[GoMock: A Mocking Framework for Go](https://github.com/golang/mock) — Has two modes of operation: source and reflect. Source mode generates mock interfaces from a source file. Reflect mode generates mock interfaces by building a program that uses reflection to understand interfaces. 

Go Project   

[Faster CI/CD for All Your Software Projects Using Buildkite](https://buildkite.com/?pk_campaign=golangweekly-240120&pk_source=cp-golangweekly&pk_medium=newsletter) 

Buildkite sponsor   

[Eris: A Better Way to Handle, Trace, and Log Errors?](https://github.com/rotisserie/eris) — Designed to give you more control over error handling via error wrapping, stack tracing, and output formatting. 

rotisserie   

[Ink: A Framework for 2D Graphics in Go](https://buchanae.github.io/ink/) — An experimental project focused on creative coding and based on OpenGL. The [examples](https://github.com/buchanae/ink/tree/master/sketches) show off what it can do (in code, at least). 

Alex Buchanan   

[automaxprocs: Automatically Set `GOMAXPROCS` to Match Linux Container CPU Quota](https://github.com/uber-go/automaxprocs) 

Uber Golang   

[uprobe-http-tracer: uprobe-based HTTP Tracer for Go Binaries](https://github.com/sematext/uprobe-http-tracer) — Captures calls to `http.Get` including the URL. More background here. 

Sematext Group, Inc.         

Curated by [Glenn Goodrich](https://twitter.com/ruprict) and [Peter Cooper](https://twitter.com/peterc). 

[Change your email address](https://golangweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://golangweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
