Redirect
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.GET("/", Redirect)
r.Run(":5000")
}
func Redirect(ctx *gin.Context) {
ctx.Redirect(http.StatusPermanentRedirect, "http://www.google.com/")
}

Last updated