chore: add some annotations (#1544)
ref: #1075 because I am not a native English, maybe have a bit problem.
This commit is contained in:
@@ -9,12 +9,14 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Redirect contains the http request reference and redirects status code and location.
|
||||
type Redirect struct {
|
||||
Code int
|
||||
Request *http.Request
|
||||
Location string
|
||||
}
|
||||
|
||||
// Render (Redirect) redirects the http request to new location and writes redirect response.
|
||||
func (r Redirect) Render(w http.ResponseWriter) error {
|
||||
// todo(thinkerou): go1.6 not support StatusPermanentRedirect(308)
|
||||
// when we upgrade go version we can use http.StatusPermanentRedirect
|
||||
@@ -25,4 +27,5 @@ func (r Redirect) Render(w http.ResponseWriter) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// WriteContentType (Redirect) don't write any ContentType.
|
||||
func (r Redirect) WriteContentType(http.ResponseWriter) {}
|
||||
|
||||
Reference in New Issue
Block a user