Go for Web Developers Workshop Part I

Meetup #54. Please RSVP at Meetup.

We get started at 6:00 pm.

Sponsors

Venue provided by Startup Edmonton.

Workshop

Part I of the Go for Web Developers workshop, led by Nathan Youngman with mentors Chris Olsen and Peter Preeper, built a small Go client for the Dark Sky weather API. The hands-on session moved from constructing the forecast URL and issuing an HTTP GET with net/http to automated testing with httptest.Server, which starts a fake Dark Sky endpoint so tests don't hit the real service. Attendees refactored the client into an object-ish design, parsed the JSON response with json.Unmarshal, and added error handling with errors.New and richer test assertions via t.Errorf. The closing challenge was to write a server that serves Edmonton weather as JSON and HTML using http.ListenAndServe, json.Marshal, and html/template.

Key points:

  • Hands-on workshop building a Dark Sky weather API client in Go.
  • Covered URL building, HTTP GET, and JSON response parsing.
  • Used httptest.Server to test against a fake API endpoint.
  • Introduced object-oriented-style design and a host parameter for testability.
  • Practised error handling and assertion-based tests.
  • Challenge: serve Edmonton weather as JSON and HTML with net/http and html/template.

Instructor: Nathan Youngman

Mentors: Chris Olsen, Peter Preeper

Events