多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
~~~ 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) } ~~~