Featured

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...

Go Modules: v2 and Beyond

Introduction This post is part 4 in a series. Part 1 — Using Go Modules Part 2 — Migrating To Go Modules Part 3 — Publishing Go Modules Part 4 — Go Modules: v2 and Beyond (this post) As a successful project matures and new requirements are...

Goland 2019.3 EAP 6 is Out with Highlighting in go.mod Files, and Just a Pinch of Bug-Fixes

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

GoLand 2019.1 EAP 7: Install any Go SDK right from the IDE

GoLand 2019.1 EAP 7 is out! Get this new EAP build via our Toolbox App, from the website, as a snap package (for Linux), or directly from GoLand – just select Automatically check updates for Early Access Program in Preferences / Settings | Appearance &...

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 EAP 3 is Out with New Quick-fixes, Ability to Call Method of an Embedded Field in the Debugger, and More

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....

GoLand 2019.2 EAP #2: Custom Postfix Templates, Better View of Dates in the Debugger, and Updates for Kubernetes

GoLand 2019.2 EAP #2 is available for download! Let’s have a look what we packed in this build for you. Download GoLand 2019.2 EAP 2 As usual, you can get this new EAP build via the Toolbox App, from the website, or as a snap package (for Linux). Or update right...

Goland 2019.3 EAP 6 is Out with Highlighting in go.mod Files, and Just a Pinch of Bug-Fixes

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

Go 2, here we come!

Background At GopherCon 2017, Russ Cox officially started the thought process on the next big version of Go with his talk The Future of Go (blog post). We have called this future language informally Go 2, even though we understand now that it will arrive in...

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...

Simple Go project layout with modules

A very common question Go beginners have is "how do I organize my code?". Some of the things folks are wondering about are: How does my repository structure reflect the way users import my code? How do I distribute commands (command-line programs that users can...

Summary of reading: July – September 2019

"HTTP - The Definitive Guide" by David Gourney and Brian Totty et. el. - very thorough reference for the HTTP protocol, including tons of useful information about tangential topics like proxies, tunnels, cookies etc. A shame that this book is so dated (from 2002) - it...

Be wary of functions which take several parameters of the same type

APIs should be easy to use and hard to misuse.— Josh Bloch A good example of a simple looking, but hard to use correctly, API is one which takes two or more parameters of the same type. Let’s compare two function signatures: func Max(a, b int) int func...

Don’t force allocations on the callers of your API

This is a post about performance. Most of the time when talking about the performance of a piece of code the overwhelming advice should be (with apologies to Brendan Gregg) don’t worry about it, yet. However there is one area where I council developers to think...

RSA – theory and implementation

RSA has been a staple of public key cryptography for over 40 years, and is still being used today for some tasks in the newest TLS 1.3 standard. This post describes the theory behind RSA - the math that makes it work, as well as some practical considerations; it also...

Reading file, each line = new goroutine..

Like the title says, I have a file with 5,000 IPs on each new line. I would like to take each line, and do a regular HTTP get request and print what the response is. I been doing tons of research but need guidance on how I can have it so each line it reads in the file...

How to write a file with sudo?

Imagine that I have a application and I need to write files. Some of the files I want to run on my current user and some on folders like `/etc` so it's protected and I need to execute with sudo. But I can't do that because some files need to be with my current user....

Load Data infile

Hi, ​ Im looking to import the data from a .csv file into my mysql database. I've read that, LOAD DATA INFILE is supposed to be very fast at loading a large data-set into a DB. I've never used LOAD DATA INFILE before, but I am interested in testing it out in my...

Using receivers vs arguments?

When designing a program - what is the best way to pass a variable to the function body? The way I see it is: One way is to use method receiver func (t *T) MyFunc() Another way is to use function arguments func MyFunc(arg0 T1, arg1 T2) Or mix func (t *T) MyFunc(arg0...