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.Serverto test against a fake API endpoint. - Introduced object-oriented-style design and a
hostparameter for testability. - Practised error handling and assertion-based tests.
- Challenge: serve Edmonton weather as JSON and HTML with
net/httpandhtml/template.
Instructor: Nathan Youngman
Mentors: Chris Olsen, Peter Preeper
- We'll be working on a client for a JSON API.
- Bring a laptop with Go installed.
- Slides from the workshop
Events
- Edmonton Go: Go for Web Developers Workshop Part II - October 22
- Hacktoberfest - Oct 15, 22, 29
- GoLab in Florence, Italy - Oct 22-23
- Edmonton Go Meetup - November