Closures in Go

This is a 3 part series composed of the following articles:

1. What is a Closure?

An explanation of what anonymous functions and closures are, along with examples of how to create and use them in Go (aka Golang).

2. 5 Useful Ways to Use Closures in Go

Explore five different real world use cases for closures that will help you understand and utilize closures better in your own code.

3. Gotchas and Common Mistakes with Closures in Go

This article explores a couple easy to make but hard to debug mistakes that can be made when working with closures in Go, and explains how to avoid them.

Learn Web Development with Go!

Sign up for my mailing list and I'll send you a FREE sample from my course - Web Development with Go. The sample includes 19 screencasts and the first few chapters from the book.

You will also receive emails from me about Go coding techniques, upcoming courses (including FREE ones), and course discounts.

Avatar of Jon Calhoun
Written by
Jon Calhoun

Jon Calhoun is a full stack web developer who teaches about Go, web development, algorithms, and anything programming. If you haven't already, you should totally check out his Go courses.

Previously, Jon worked at several statups including co-founding EasyPost, a shipping API used by several fortune 500 companies. Prior to that Jon worked at Google, competed at world finals in programming competitions, and has been programming since he was a child.

Spread the word

Did you find this page helpful? Let others know about it!

Sharing helps me continue to create both free and premium Go resources.

Want to discuss the article?

See something that is wrong, think this article could be improved, or just want to say thanks? I'd love to hear what you have to say!

You can reach me via email or via twitter.

Recent Articles All Articles Mini-Series Progress Updates Tags About Me Go Courses

©2018 Jonathan Calhoun. All rights reserved.