/
githubmirror
/
beego
Обзор
Документация
Войти
/
githubmirror
/
beego
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
adapter/context/response.go
26 строк
482 B
Ming Deng
remove pkg directory;
08 окт 2020, 13:29
08 окт 2020, 13:29
14c1b76
Код
Авторство
О чём код?
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)) }