in main.go [223:232]
func healthcheck() error {
resp, err := http.Get(fmt.Sprintf("http://%s/api/orders", *healthcheckAddr))
if err != nil {
return err
}
defer resp.Body.Close()
var orders []Order
return json.NewDecoder(resp.Body).Decode(&orders)
}