Merge pull request #7349 from thaJeztah/gofmt_119

clean-up "nolint" comments, remove unused ones, update golangci-lint
This commit is contained in:
Mike Brown
2022-10-17 10:50:24 -05:00
committed by GitHub
35 changed files with 74 additions and 72 deletions

View File

@@ -235,7 +235,12 @@ func (c config) newClient() (*containerd.Client, error) {
func serve(c config) error {
go func() {
if err := http.ListenAndServe(c.Metrics, metrics.Handler()); err != nil {
srv := &http.Server{
Addr: c.Metrics,
Handler: metrics.Handler(),
ReadHeaderTimeout: 5 * time.Minute, // "G112: Potential Slowloris Attack (gosec)"; not a real concern for our use, so setting a long timeout.
}
if err := srv.ListenAndServe(); err != nil {
logrus.WithError(err).Error("listen and serve")
}
}()