🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { // 302 Found 重定向到新的URL http.Redirect(w, r, "/destination", http.StatusFound) }) http.HandleFunc("/destination", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "This is the destination page.") }) fmt.Println("Server is running on :8080") http.ListenAndServe(":8080", nil) } ~~~