September 2019: Challenge
Meetup #61. Please RSVP at Meetup.
We get started at 6:30 pm.
Sponsors
Venue provided by Startup Edmonton.
Food sponsored by Bellstone Engineering.
Talks
What's New in Go 1.13
Matthias Stone walked through the highlights of Go 1.13. TLS 1.3 is now on by default, cutting connection and reconnection overhead and dropping deprecated protocols. Number literals gained binary (0b) and octal (0o) prefixes, hexadecimal floating-point literals, imaginary suffixes, and underscore digit separators. The headline change for many was error wrapping: fmt.Errorf's new %w verb wraps an error while preserving the chain, which errors.Is, errors.As, and errors.Unwrap can then inspect. The go command now downloads and authenticates modules through the module mirror and checksum database by default, and modules support was improved (active by default in $GOPATH/src, with sum verification).
Key points:
- TLS 1.3 enabled by default, with lower overhead.
- New number literal syntax:
0b/0o, hex floats, imaginary literals,_separators. - Error wrapping via
%winfmt.Errorf. errors.Is,errors.As, anderrors.Unwrapinspect the wrapped chain.- Module mirror and checksum database used by default.
- Improved module support in
$GOPATH/src.
Challengs
The evening's second half was a pizza-themed pair-programming challenge: write a Go program, using only the standard library, that works out how many pizzas to order from the number of people (people/4). Pairs were encouraged to have the less experienced gopher drive with the more experienced one mentoring. The challenge was staged: Phase I added validation and polish (math.Round, numeric-only input, correct pluralisation, and go test tests), Phase II introduced dietary restrictions (gluten-free, vegetarian, vegan) that had to be satisfied with least waste using table-driven tests, and Phase III wrapped the shared business logic in a web frontend built with html/template and http.ListenAndServe, with HTML5 input validation and httptest tests.
Key points:
Build a pizza-count calculator with the Go standard library.
Pairs: less experienced drives, more experienced mentors.
Covered interactive, flag, and environment-variable input.
Phase I: validation, pluralisation, and
testingtests.Phase II: dietary restrictions, best-fit ordering, table-driven tests.
Phase III: HTML frontend with shared business logic and
httptest.Bring a laptop or a friend with a laptop
You should install Go before arriving
We will be pair programming so experience with Go is optional
See the slides
News
- Go 1.13
- Go 1.13.1 - Sep 25
- Module Mirror and Checksum Database Launched
- Unit Testing Code with Hard-to-Mock Dependencies by Adam Wolfe Gordon
- GopherCon 2019 talks
Events
- Monthly Hack Day - Oct 5
- Hacktoberfest Kickoff - Oct 7
- Edmonton Startup Week - Oct 21-25
- Canada Learning Code: YEGTech Open House - Oct 26
- Edmonton Go Meetup - October