@ -2,6 +2,7 @@ package http
import (
"context"
"errors"
"fmt"
"net"
"net/http"
@ -152,7 +153,10 @@ func (s *Server) Start() error {
}
s.lis = lis
s.log.Infof("[HTTP] server listening on: %s", lis.Addr().String())
return s.Serve(lis)
if err := s.Serve(lis); !errors.Is(err, http.ErrServerClosed) {
return err
return nil
// Stop stop the HTTP server.
@ -3,7 +3,6 @@ package http
"encoding/json"
"testing"
@ -38,7 +37,7 @@ func TestServer(t *testing.T) {
testClient(t, srv)
})
if err := srv.Start(); !errors.Is(err, http.ErrServerClosed) {
if err := srv.Start(); err != nil {
t.Fatal(err)
@ -4,7 +4,6 @@ import (
"bytes"
@ -61,7 +60,7 @@ func TestService(t *testing.T) {
testServiceClient(t, srv)