/
githubmirror
/
beego
Обзор
Документация
Войти
/
githubmirror
/
beego
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
server/web/context/response.go
26 строк
482 B
Ming Deng
format code
14 дек 2020, 07:34
14 дек 2020, 07:34
d4da82e
Код
Авторство
О чём код?
package context import ( "net/http" "strconv" ) const ( // BadRequest indicates HTTP error 400 BadRequest StatusCode = http.StatusBadRequest // NotFound indicates HTTP error 404 NotFound StatusCode = http.StatusNotFound ) // StatusCode sets the HTTP response status code type StatusCode int func (s StatusCode) Error() string { return strconv.Itoa(int(s)) } // Render sets the HTTP status code func (s StatusCode) Render(ctx *Context) { ctx.Output.SetStatus(int(s)) }