Featured

eris – provides a better way to handle, trace, and log errors in Go 🎄

Package eris provides a better way to handle, trace, and log errors in Go. This package is inspired by a few existing packages: xerrors, pkg/errors, and Go 1.13 errors. go get github.com/rotisserie/eris Check out the package docs for more detailed information or...

What’s Next: GoLand 2020.1 Roadmap

A month ago we released GoLand 2019.3. For this version, we mostly focused on giving you the most enjoyable IDE experience possible. We hope our efforts have paid off! GoLand 2019.3 consumes less CPU and performs faster than any previous versions, has more accurate...

GoLand 2019.3: Faster Than Ever Before with Improved Go Modules Support, New Quick-fixes, and Much More

Today we are happy to announce GoLand 2019.3 is released! This one was slightly different from our regular releases. We aimed to fight bugs, glitches, unexpected behavior, and anything confusing, to provide you with a more pleasant experience as you develop with...

Announcing the 2019 Go Developer Survey

Help shape the future of Go Since 2016, thousands of Gophers around the world have helped the Go project by sharing your thoughts via our annual Go Developer Survey. Your feedback has played an enormous role in driving changes to our language, ecosystem, and...

GoLand 2019.3 Turns Beta!

Our train of Early Access Program builds is quickly approaching its final destination. GoLand 2019.3 has reached the Beta milestone, so starting today we are focusing on polishing things up and getting the IDE ready for the release. Note that while the Beta is quite...

Go.dev: a new hub for Go developers

Over the last two years, as we’ve spoken with users at companies of all sizes, we’ve heard three questions repeatedly: who else is using Go, what do they use it for, and how can I find useful Go packages? Today we are launching go.dev, a new hub for Go developers, to...

Get GoLand, Support Women Who Go and GoBridge, and Celebrate Go’s Birthday!

This weekend, on the 10th of November, the Go language turns 10 years old. Congratulations to all the gophers worldwide! As our gift to the Go community, we have decided to launch a fundraising campaign to support the Women Who Go and GoBridge non-profit...

Shell Scripting with GoLand 2019.2

Go developers may rely at times on shell scripts to perform various tasks. In this post, we’ll have a look at the new builtin support for Shell scripting in GoLand 2019.2. First, we need a new shell script file, let’s call it hello.sh. As you have probably...

Go 2018 Survey Results

Thank you This post summarizes the results of our 2018 user survey and draws comparisons between the results of our prior surveys from 2016 and 2017. This year we had 5,883 survey respondents from 103 different countries. We are grateful to everyone who provided their...

2019.2 Features that Make Debugging Easier

GoLand 2019.2 brings with it a lot of new features and bug-fixes. In addition to making the debugger compatible with the new features in Go 1.13, we’ve added a few more things to help you debug code even more quickly and efficiently. Function call support Better...

What’s next: GoLand 2019.3 roadmap

Three weeks ago we released GoLand 2019.2 with function calls support in the debugger, enhanced color schemes, customizable Postfix Completion templates, smarter Go Modules and dep integration, quick-fixes based on the Change Signature refactoring, and many other new...

GoLand 2019.3 Opens its Early Access Program!

The first Early Access Program (EAP) build for GoLand 2019.3 is ready for you to try. You can get it via the Toolbox App, download from the website, or use a snap package (for Ubuntu). Or, right in GoLand, select Automatically check updates for Early Access Program in...

GoLand 2019.3 EAP 4 is Out with MongoDB Support and Importing & Handling Known Package Aliases

Get this EAP build via the Toolbox App, download from the website, or use a snap package (for Ubuntu). Or, right in GoLand, select Automatically check updates for Early Access Program in Preferences / Settings | Appearance & Behavior | System Settings | Updates....

Graceful shutdown of a TCP server in Go

This post is going to discuss how to gracefully shut down a TCP server in Go. While servers typically never stop running (until the process is killed), in some scenarios - e.g. in tests - it's useful to shut them down in an orderly way. High-level structure of TCP...

How to mock in your Go (Golang) tests.

Go has a built-in testing framework provided by the testing package, that makes writing tests easier, but how do we write a more complicated test that requires mocking? In this post, we will learn how to take advantage of structs and interfaces in Go to mock any...

PubSub using channels in Go

The idiomatic way of writing concurrent code in Go is as a collection of goroutines communicating over channels. In my experience, the Publish-subscibe pattern (PubSub) comes up often as a way to structure code. The pattern presented here has topic-based...

My Reading Habits

January 02, 2020 at 05:30 Tags Reading In 2019 I've finished 63 books, which is a new personal record: I began keeping detailed track of my reading when this blog launched in 2003. In case you're wondering, the total count since 2003 is just a bit over 700, though...

Dynamically scoped variables in Go

This is a thought experiment in API design. It starts with the classic Go unit testing idiom: func TestOpenFile(t *testing.T) { f, err := os.Open("notfound") if err != nil { t.Fatal(err) } // ... } What’s the problem with this code? The assertion. if err != nil...

“Beating” C with 400 lines of unoptimized assembly

Suggested title: "Beating" C with 400 lines of unoptimized assembly Earlier this week I ran into a fun quick blog post named Beating C with 70 lines of Go, which reimplements the basic functionality of wc in Go using various approaches and compares their performance....

How to send good pull requests on GitHub

Over the past few years I authored or reviewed thousands of GitHub pull requests (PRs), both for work and for personal projects. I've come to believe there's a small set of useful rules of thumb for what makes a good PR, what makes a bad PR, and why getting the good...

Diffie-Hellman Key Exchange

This post presents the Diffie-Hellman Key Exchange (DHKE) - an important part of today's practical cryptography. Whenever you're accessing an HTTPS website, it's very likely that your browser and the server negotiated a shared secret key using the DHKE under the hood....

Use internal packages to reduce your public API surface

In the beginning, before the go tool, before Go 1.0, the Go distribution stored the standard library in a subdirectory called pkg/ and the commands which built upon it in cmd/. This wasn’t so much a deliberate taxonomy but a by product of the original make based...

Question about code in Google’s github api client

Hi, I'm currently using Google's Github api client repo as a reference for my own api client that I am writing. I'm learning quite a bit from reading their code, but one thing I do not understand is in their github.go source code. They have a Response struct for http...

Has anyone implemented Authboss?

I’m looking for an authentication/session system and having trouble finding repos that use https://github.com/volatiletech/authboss or https://github.com/qor/auth which seem to be the largest, full-featured auth systems for Go. (There are also OAuth2 specific...