The workshop is suitable for the participants of the Golang 101: Intro to Golang - Part 1 Workshop or for people with basic some experience in Go.
In order to make the most of our workshop, please, have a look at the things covered in the Golang 101: Intro to Golang - Part 1 here and here.
What is the workshop about?
We’ll dive into some more interesting (and probably a bit harder) topics concerning networking and concurrency in Golang. To make things smoother and ensure we’re on the same page we want to give you a head start on solving the task we’ll be tackling.
We’ll use the code for our command line app from last time to make a simple web app that does a similar task of applying an image kernel to an image file that we upload to it. For that we’ll need several things:
-
a bit of basic understanding of HTTP (we’ll go over this at the start of the workshop to make sure we’re on the same page)
-
getting familiar with the net/http built-in package, especially the server part of it
-
having a grasp on concurrency and parallelism
-
conceptual understanding of goroutines and channels in Go
What we’ll do:
-
Go over the basics of HTTP and set up a simple HTTP server in go
-
Render a simple web form and use it’s input in the backend
-
See how we can upload files to our web server
-
Process these files with our code from last time
Exercise:
Try writing a small program that responds to HTTP requests using the example in the docs for http.Server.ListenAndServe. See what happens when you follow that example and try to open http://localhost:8080 in your browser. Try playing around a bit with the code to see how you can make it give different responses. See how you can pass more arguments to your handler function from your browser (for instance by using a query string) and access them via the Request object in your code.
We will go over these concepts in brief at the start of the workshop as well, but it will help you if you get a bit acquainted with them beforehand, so there’s nothing stressfully new.
Huge thanks to our partner Uber Engineering for hosting and co-organising this workshop. Special thanks to the mentors!
*The event is free of charge. All you need to do is to register for the workshop and get yourself acquainted with the things covered in the Golang 101: Part 1 Workshop. Your motivation is the key to get selected to participate in the workshop.