Add missing comments
This commit is contained in:
@@ -5,10 +5,13 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// A ServerErrMessage represents the reason why the error happened
|
||||
type ServerErrMessage struct {
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
// WriteErrorResponse writes the error JSON body to the provided http.ResponseWriter,
|
||||
// after setting the appropiate Content-Type header
|
||||
func WriteErrorResponse(statusCode int, reasonMsg string, res http.ResponseWriter) {
|
||||
respBody := ServerErrMessage{}
|
||||
respBody.Reason = reasonMsg
|
||||
|
||||
Reference in New Issue
Block a user