diff --git a/gin/server.go b/gin/server.go index 7c1d9a0f..aea20b8f 100644 --- a/gin/server.go +++ b/gin/server.go @@ -30,15 +30,15 @@ func NewServer(e *gin.Engine, opts ...Option) *Server { addr: ":8080", } + for _, opt := range opts { + opt(srv) + } + srv.server = &http.Server{ Addr: srv.addr, Handler: e, } - for _, opt := range opts { - opt(srv) - } - return srv }