Add missing comments

This commit is contained in:
pancho horrillo
2019-11-20 07:14:00 +01:00
parent d81ef278da
commit 7ea43048bc
5 changed files with 10 additions and 0 deletions
+3
View File
@@ -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