William Cheng c1931c10da
Add tests with optional body for go-server (#22034)
* add tests with optional body for go-server

* update workfllow
2025-09-27 14:28:28 +08:00

34 lines
596 B
Go

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
/*
* optional body
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 1.0.1
*/
package petstoreserver
import (
"net/http"
"log"
"time"
)
func Logger(inner http.Handler, name string) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
start := time.Now()
inner.ServeHTTP(w, r)
log.Printf(
"%s %s %s %s",
r.Method,
r.RequestURI,
name,
time.Since(start),
)
})
}