Removed SetStatus
This commit is contained in:
parent
b50b9e1083
commit
dde1b64e32
@ -18,7 +18,6 @@ type Context interface {
|
|||||||
Reader(io.Reader) error
|
Reader(io.Reader) error
|
||||||
Request() Request
|
Request() Request
|
||||||
Response() Response
|
Response() Response
|
||||||
SetStatus(status int)
|
|
||||||
String(string) error
|
String(string) error
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ func (ctx *context) Error(status int, messages ...any) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.SetStatus(status)
|
ctx.response.WriteHeader(status)
|
||||||
return errors.Join(combined...)
|
return errors.Join(combined...)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,11 +89,6 @@ func (ctx *context) Response() Response {
|
|||||||
return &ctx.response
|
return &ctx.response
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetStatus writes the header with the given HTTP status code.
|
|
||||||
func (ctx *context) SetStatus(status int) {
|
|
||||||
ctx.response.WriteHeader(status)
|
|
||||||
}
|
|
||||||
|
|
||||||
// String responds with the given string.
|
// String responds with the given string.
|
||||||
func (ctx *context) String(body string) error {
|
func (ctx *context) String(body string) error {
|
||||||
slice := unsafe.Slice(unsafe.StringData(body), len(body))
|
slice := unsafe.Slice(unsafe.StringData(body), len(body))
|
||||||
|
Loading…
Reference in New Issue
Block a user