Micro-service for file storage and processing written in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
233 B

  1. package controllers
  2. import (
  3. "encoding/json"
  4. "net/http"
  5. )
  6. func writeError(w http.ResponseWriter, status int, errStr string) {
  7. w.WriteHeader(status)
  8. json.NewEncoder(w).Encode(struct {
  9. Error string `json:"error"`
  10. }{errStr})
  11. }