When you just want to check if yours is http.Handlerdoing what it should, you don't need to use it httptest.Server. Just call the handler by the instance httptest.ResponseRecorderand check the output, as in example .
The possible uses are httptest.Servernumerous, so here are just a couple that comes to my mind:
If your code depends on some external services and APIs, you can use a test server to simulate. (Although I would personally select all the code associated with external data sources and then use them through interfaces so that I can easily create fake objects for my tests.)
If you are working with a client-server application, you can use a test server to emulate the server part when testing the client side.