Downloading dependencies with Go modules can be significantly faster than using GOPATH-based dependency management. A fresh dependency download experiment for this post took 9 minutes and 33.845 seconds in GOPATH mode and 10.185 seconds in module mode. This post explains why. The key difference is that modules avoid deep repository clones and can use a module proxy.

For an introduction to Go modules, see

GOPATH-based dependency management downloads every dependency into GOPATH/src, doing a deep clone of the version control repository in the process.

So, if you’re in GOPATH mode and your project depends on A, which depends on…

Go has several built-in numeric types, “sets of integer or floating-point values.” Some architecture-independent types are uint8 (8-bit, unsigned integer), int16 (16-bit, signed integer), and complex128 (128-bit complex number). Curiously, the Go spec also includes architecture-dependent types:

  • uint
  • int
  • uintptr

How many bits do these types require? Unhelpfully, the spec says int and uint are the same size, “either 32 or 64 bits.” A uintptr is “an unsigned integer large enough to store the uninterpreted bits of a pointer value.”

By far the most common of these three types I’ve seen is int. If you know your program will only…

Tyler Bui-Palsulich

Engineer at Google, working on Go and Google Cloud Platform

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store