Utilities for a JSON-based API.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

18 行
212 B

  1. package impart
  2. import (
  3. "net/http"
  4. )
  5. type HTTPError struct {
  6. Status int
  7. Message string
  8. }
  9. func (h HTTPError) Error() string {
  10. if h.Message == "" {
  11. return http.StatusText(h.Status)
  12. }
  13. return h.Message
  14. }