From e3609b40a3bb6f03bd5b8872d3f96c94821632e7 Mon Sep 17 00:00:00 2001 From: Lordfarshad Date: Mon, 2 Oct 2023 15:42:44 +0330 Subject: [PATCH] Enhanced user-friendliness by opening link in terminal --- gin.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gin.go b/gin.go index ed8b6dad..28f1e0c5 100644 --- a/gin.go +++ b/gin.go @@ -15,10 +15,11 @@ import ( "strings" "sync" - "github.com/gin-gonic/gin/internal/bytesconv" - "github.com/gin-gonic/gin/render" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" + + "github.com/gin-gonic/gin/internal/bytesconv" + "github.com/gin-gonic/gin/render" ) const defaultMultipartMemory = 32 << 20 // 32 MB @@ -383,6 +384,7 @@ func (engine *Engine) Run(addr ...string) (err error) { address := resolveAddress(addr) debugPrint("Listening and serving HTTP on %s\n", address) + fmt.Printf("http://localhost:%s", address) err = http.ListenAndServe(address, engine.Handler()) return }