Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/err.go Secret

Created October 31, 2020 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/e06cce92d962882b79d76644a35748e9 to your computer and use it in GitHub Desktop.
Save parzibyte/e06cce92d962882b79d76644a35748e9 to your computer and use it in GitHub Desktop.
func respondWithError(err error, w http.ResponseWriter) {
w.WriteHeader(http.StatusInternalServerError)
json.NewEncoder(w).Encode(err.Error())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment