mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 04:52:26 +08:00
14 lines
248 B
Go
14 lines
248 B
Go
package fakes
|
|
|
|
import "net/http"
|
|
|
|
func NewFakeHTTPHandler(status int, res []byte) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, req *http.Request) {
|
|
w.WriteHeader(status)
|
|
_, err := w.Write(res)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
}
|