10 行
206 B
Go
10 行
206 B
Go
package responses
|
|
|
|
import "net/http"
|
|
|
|
// Redirect to a different URL.
|
|
func Redirect(w http.ResponseWriter, r *http.Request, url string) {
|
|
w.Header().Set("Location", url)
|
|
w.WriteHeader(http.StatusFound)
|
|
}
|