Introduction

Go was created to solve the problems that came with the new architecture of multi-core processors, creating high-performance networks that serve millions of requests and compute-intensive jobs. The idea behind Go was to increase productivity by enabling rapid prototyping, decreasing compile and build time, and enabling better dependency management.

Unlike most other programming languages, Go provides the net/http package, which is sufficient when creating HTTP clients and servers. This chapter will cover the creation of HTTP and TCP servers in Go.

We will start with some simple recipes to create an HTTP and TCP server and will gradually move to recipes that are more complex, where we implement basic authentication, optimize server ...

Get Go Web Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.