Handler

Easy round robin with net/http

By Chee Leong

Introduction

Golang came bundled with a pretty comprehensive HTTP Standard Library a.k.a net/http.

I’m going to show you how to do a simple round robin HTTP server with Golang’s Duck Typing a.k.a Handler interface.

And because Golang Playground doesn’t work well with HTTP server, I’m not going to provide the link, so you have to download the script and run it yourself.

Basic

So, let’s start with the boilerplate we’re going to use for the rest of the guide.