mirror of
https://github.com/openfaas/faas.git
synced 2025-06-22 14:53:25 +00:00
We now have two write interceptors, with one moved into faas-provider. This commit makes the gateway use the new external package and deletes its own. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
13 lines
294 B
Go
13 lines
294 B
Go
package httputil
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
// Errorf sets the response status code and write formats the provided message as the
|
|
// response body
|
|
func Errorf(w http.ResponseWriter, statusCode int, msg string, args ...interface{}) {
|
|
http.Error(w, fmt.Sprintf(msg, args...), statusCode)
|
|
}
|