Repository: goadesign/goa (go)

Issue:
goa example from README generates file http.go reporting G112 when using golangci-lint
When generating calcsvc from README.md golangci-lint reports:
```
$ goa gen calcsvc/design
$ goa example calcsvc/design

$ golangci-lint run --enable gosec
cmd/calc/http.go:77:10: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
	srv := &http.Server{Addr: u.Host, Handler: handler}
```
goa version: v3.8.2
go version: 1.19
golangci-lint version: 1.48.0

Pull request:
Fix potential Slowloris attack in generated example code
as reported by golangci-lint version 1.48.

Fixes #3121

Patch:
diff --git a/http/codegen/example_server.go b/http/codegen/example_server.go
index fb76f7aa..a8f38b64 100644
--- a/http/codegen/example_server.go
+++ b/http/codegen/example_server.go
@@ -287,7 +287,7 @@ func handleHTTPServer(ctx context.Context, u *url.URL{{ range $.Services }}{{ if
 	httpSvrEndT = `
 	// Start HTTP server using default configuration, change the code to
 	// configure the server as required by your service.
-	srv := &http.Server{Addr: u.Host, Handler: handler}
+	srv := &http.Server{Addr: u.Host, Handler: handler, ReadHeaderTimeout: time.Second * 60}
 
 	{{- range .Services }}
 		for _, m := range {{ .Service.VarName }}Server.Mounts {


Test patch:
diff --git a/http/codegen/testdata/example_code.go b/http/codegen/testdata/example_code.go
index 7106679b..21beaa36 100644
--- a/http/codegen/testdata/example_code.go
+++ b/http/codegen/testdata/example_code.go
@@ -59,7 +59,7 @@ func handleHTTPServer(ctx context.Context, u *url.URL, serviceEndpoints *service
 
 	// Start HTTP server using default configuration, change the code to
 	// configure the server as required by your service.
-	srv := &http.Server{Addr: u.Host, Handler: handler}
+	srv := &http.Server{Addr: u.Host, Handler: handler, ReadHeaderTimeout: time.Second * 60}
 	for _, m := range serviceServer.Mounts {
 		logger.Printf("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern)
 	}
@@ -158,7 +158,7 @@ func handleHTTPServer(ctx context.Context, u *url.URL, wg *sync.WaitGroup, errc
 
 	// Start HTTP server using default configuration, change the code to
 	// configure the server as required by your service.
-	srv := &http.Server{Addr: u.Host, Handler: handler}
+	srv := &http.Server{Addr: u.Host, Handler: handler, ReadHeaderTimeout: time.Second * 60}
 	for _, m := range serviceServer.Mounts {
 		logger.Printf("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern)
 	}
@@ -257,7 +257,7 @@ func handleHTTPServer(ctx context.Context, u *url.URL, serviceEndpoints *service
 
 	// Start HTTP server using default configuration, change the code to
 	// configure the server as required by your service.
-	srv := &http.Server{Addr: u.Host, Handler: handler}
+	srv := &http.Server{Addr: u.Host, Handler: handler, ReadHeaderTimeout: time.Second * 60}
 	for _, m := range serviceServer.Mounts {
 		logger.Printf("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern)
 	}
@@ -360,7 +360,7 @@ func handleHTTPServer(ctx context.Context, u *url.URL, serviceEndpoints *service
 
 	// Start HTTP server using default configuration, change the code to
 	// configure the server as required by your service.
-	srv := &http.Server{Addr: u.Host, Handler: handler}
+	srv := &http.Server{Addr: u.Host, Handler: handler, ReadHeaderTimeout: time.Second * 60}
 	for _, m := range serviceServer.Mounts {
 		logger.Printf("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern)
 	}
@@ -467,7 +467,7 @@ func handleHTTPServer(ctx context.Context, u *url.URL, streamingServiceAEndpoint
 
 	// Start HTTP server using default configuration, change the code to
 	// configure the server as required by your service.
-	srv := &http.Server{Addr: u.Host, Handler: handler}
+	srv := &http.Server{Addr: u.Host, Handler: handler, ReadHeaderTimeout: time.Second * 60}
 	for _, m := range streamingServiceAServer.Mounts {
 		logger.Printf("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern)
 	}