Improved performance

This commit is contained in:
2024-03-14 19:22:39 +01:00
parent 559f8c8456
commit c179ca6651
3 changed files with 10 additions and 7 deletions

11
common_test.go Normal file
View File

@ -0,0 +1,11 @@
package server_test
import "net/http"
// NullResponse implements the http.ResponseWriter interface with
// empty methods to better understand memory usage in benchmarks.
type NullResponse struct{}
func (r *NullResponse) Header() http.Header { return nil }
func (r *NullResponse) Write([]byte) (int, error) { return 0, nil }
func (r *NullResponse) WriteHeader(int) {}