Repository: goadesign/goa (go)

Issue:
chi: wildcard '*' must be the last value in a route. trim trailing text or use a '{param}' instead
'panic: chi: wildcard '*' must be the last value in a route. trim trailing text or use a '{param}' instead
 I have a problem with new version in goa.design v3.13.0:

```go
var _ = Service("swagger", func() {
	Meta("swagger:generate", "false")
	Description("The swagger service serves the API swagger definition.")

	Method("jsonSpecification", func() {
		Result(MapOf(String, Any))
		HTTP(func() {
			GET("swagger/swagger.json")
			Response(StatusOK, func() {
				ContentType(jsonContentType)
			})
		})

	})
	Files("/swagger-ui/{*path}", "./swagger-ui", func() {
		Description("This path contains the Swagger UI files")
	})
})
```

It occurs when trying to mount the service.

`swaggersvr.Mount(mux, swaggerServer)`




 

Pull request:
Update wildcard handling for chi router
The upgrade to chi caused a regression for file servers using wildcards.

Fix #3357 

Patch:
diff --git a/http/codegen/server.go b/http/codegen/server.go
index 7cc5a03b..883bd29f 100644
--- a/http/codegen/server.go
+++ b/http/codegen/server.go
@@ -415,7 +415,7 @@ func {{ .MountHandler }}(mux goahttp.Muxer, h http.Handler) {
 	{{- if .IsDir }}
 		{{- range .RequestPaths }}
 	mux.Handle("GET", "{{ . }}{{if ne . "/"}}/{{end}}", h.ServeHTTP)
-	mux.Handle("GET", "{{ . }}{{if ne . "/"}}/{{end}}*{{ $.PathParam }}", h.ServeHTTP)
+	mux.Handle("GET", "{{ . }}{{if ne . "/"}}/{{end}}{*{{ $.PathParam }}}", h.ServeHTTP)
 		{{- end }}
 	{{- else }}
 		{{- range .RequestPaths }}


Test patch:
diff --git a/http/codegen/testdata/server_init_functions.go b/http/codegen/testdata/server_init_functions.go
index c2a66304..ee3a31ee 100644
--- a/http/codegen/testdata/server_init_functions.go
+++ b/http/codegen/testdata/server_init_functions.go
@@ -235,7 +235,7 @@ func (s *Server) Mount(mux goahttp.Muxer) {
 var ServerMultipleFilesMounterCode = `// MountPathToFolder configures the mux to serve GET request made to "/".
 func MountPathToFolder(mux goahttp.Muxer, h http.Handler) {
 	mux.Handle("GET", "/", h.ServeHTTP)
-	mux.Handle("GET", "/*wildcard", h.ServeHTTP)
+	mux.Handle("GET", "/{*wildcard}", h.ServeHTTP)
 }
 `
 
@@ -243,7 +243,7 @@ var ServerMultipleFilesWithPrefixPathMounterCode = `// MountPathToFolder configu
 // "/server_file_server".
 func MountPathToFolder(mux goahttp.Muxer, h http.Handler) {
 	mux.Handle("GET", "/server_file_server/", h.ServeHTTP)
-	mux.Handle("GET", "/server_file_server/*wildcard", h.ServeHTTP)
+	mux.Handle("GET", "/server_file_server/{*wildcard}", h.ServeHTTP)
 }
 `