August 2018: Go 1.11

Meetup #52. Please RSVP at Meetup.

We get started at 6:30 pm.

Sponsors

Venue provided by Startup Edmonton.

Talks

Go modules quick overview

Peter Preeper gave a quick overview of Go modules, introduced in Go 1.11 as the replacement for the GOPATH-based build model. A module is a collection of related Go packages and is the unit of source code interchange and versioning; the go command gained direct support for working with it. He walked through creating a module with go mod init, adding a dependency during go build, inspecting it with go list -m all, and downgrading or upgrading with go get module@version. Getting started means using Go 1.11, working outside GOPATH (or setting GO111MODULE=on inside it), and adopting semantic versioning — remembering the v prefix.

Key points:

  • Go 1.11 introduced modules, replacing GOPATH-based builds.
  • A module is a set of related packages and the unit of versioning.
  • go mod init creates a go.mod; builds add require entries.
  • go list -m all and go list -m -versions inspect dependencies.
  • go get module@version upgrades or downgrades a dependency.
  • Work outside GOPATH, or set GO111MODULE=on inside it.
  • Follow semantic versioning — and don't forget the v prefix.

Peter Preeper (slides)

News & Articles

Events