Skip to content

Commit 08ffcd0

Browse files
committed
Make linter happy
1 parent c1bee0e commit 08ffcd0

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

accesslog/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (l *logger) LogAccess(_ context.Context, det Details, req *http.Request) {
3535
handlerName = "-"
3636
}
3737

38-
l.Logger.Printf("%s: %s %s \"%s %s %s\" %d %db %s\n",
38+
l.Printf("%s: %s %s \"%s %s %s\" %d %db %s\n",
3939
Message,
4040
RemoteAddr(req),
4141
handlerName,

options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func BaseContext(ctx context.Context) func(_ net.Listener) context.Context {
119119
// internal [http.Server.BaseContext].
120120
func WithBaseContext(ctx context.Context) Option {
121121
return optionFunc(func(srv *Server) error {
122-
srv.httpServer.BaseContext = BaseContext(ctx)
122+
srv.BaseContext = BaseContext(ctx)
123123
return nil
124124
})
125125
}
@@ -139,7 +139,7 @@ func WithTLSConfig(conf *tls.Config, opts ...easytls.Option) Option {
139139
return err
140140
}
141141

142-
srv.httpServer.TLSConfig = conf
142+
srv.TLSConfig = conf
143143
return nil
144144
})
145145
}

server.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,18 @@ func (srv *Server) start() error {
117117
State: srv.state,
118118
})
119119
}
120-
121120
if srv.state == StateClosed {
122121
srv.httpServer = http.Server{
123-
DisableGeneralOptionsHandler: srv.httpServer.DisableGeneralOptionsHandler,
124-
TLSConfig: srv.httpServer.TLSConfig,
125-
TLSNextProto: srv.httpServer.TLSNextProto,
126-
ConnState: srv.httpServer.ConnState,
127-
ErrorLog: srv.httpServer.ErrorLog,
128-
BaseContext: srv.httpServer.BaseContext,
129-
ConnContext: srv.httpServer.ConnContext,
122+
DisableGeneralOptionsHandler: srv.DisableGeneralOptionsHandler,
123+
TLSConfig: srv.TLSConfig,
124+
TLSNextProto: srv.TLSNextProto,
125+
ConnState: srv.ConnState,
126+
ErrorLog: srv.ErrorLog,
127+
BaseContext: srv.BaseContext,
128+
ConnContext: srv.ConnContext,
130129
}
131130
}
131+
132132
if srv.log == nil {
133133
srv.log = NopLogger()
134134
}
@@ -232,9 +232,9 @@ func (srv *Server) isClosed(err error) (ok bool) {
232232
// error when the server is closed.
233233
func (srv *Server) Run() error {
234234
srv.mut.RLock()
235-
useTLS := srv.httpServer.TLSConfig != nil &&
236-
(len(srv.httpServer.TLSConfig.Certificates) != 0 ||
237-
srv.httpServer.TLSConfig.GetCertificate != nil)
235+
useTLS := srv.TLSConfig != nil &&
236+
(len(srv.TLSConfig.Certificates) != 0 ||
237+
srv.TLSConfig.GetCertificate != nil)
238238
srv.mut.RUnlock()
239239

240240
var err error
@@ -270,7 +270,7 @@ func (srv *Server) Shutdown(ctx context.Context) error {
270270
srv.mut.Lock()
271271
srv.state = StateClosing
272272
srv.log.LogServerShutdown(srv.name)
273-
srv.httpServer.SetKeepAlivesEnabled(false)
273+
srv.SetKeepAlivesEnabled(false)
274274
shutdownTimeout := srv.Config.ShutdownTimeout
275275
srv.mut.Unlock()
276276

0 commit comments

Comments
 (0)