HTTP Servers
You've seen how to build HTTP servers in Chapter 15, HTTP Servers, but you might remember that there was something that's difficult to handle with HTTP servers, and this was the application's state. Essentially, an HTTP server runs as a single program and listens to requests in the main routine. However, when a new HTTP request is made by one of the clients, a new routine is created that handles that specific request. You have not done it manually, nor have you managed the server's channels, but this is how it works internally. You do not actually need to send anything across the different Goroutines because each routine and each request is independent since they have been made by different people.
However, what you must think of is how to not create race conditions when you want to keep a state. Most HTTP servers are stateless, especially if you're building a microservice environment. However, you might want to keep track of things with a...