1 Star 0 Fork 0

simple/simple.io

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
errors.go 417 Bytes
Copy Edit Raw Blame History
kui.xu authored 2024-09-24 18:30 +08:00 . perf(http):
package http
import "net/http"
// http错误
type statusError struct {
code int
text string
}
func (e *statusError) Error() string {
return http.StatusText(e.code) + ": " + e.text
}
// 错误的请求 400
func badRequestError(e string) error {
return &statusError{http.StatusBadRequest, e}
}
// 服务器错误 500
func serverError(e string) error {
return &statusError{http.StatusInternalServerError, e}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/simple-set/simple.io.git
git@gitee.com:simple-set/simple.io.git
simple-set
simple.io
simple.io
v1.6.5

Search