Enhanced user-friendliness by opening link in terminal

This commit is contained in:
Lordfarshad 2023-10-02 15:42:44 +03:30
parent a481ee2897
commit e3609b40a3
1 changed files with 4 additions and 2 deletions

6
gin.go
View File

@ -15,10 +15,11 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/gin-gonic/gin/internal/bytesconv"
"github.com/gin-gonic/gin/render"
"golang.org/x/net/http2" "golang.org/x/net/http2"
"golang.org/x/net/http2/h2c" "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 const defaultMultipartMemory = 32 << 20 // 32 MB
@ -383,6 +384,7 @@ func (engine *Engine) Run(addr ...string) (err error) {
address := resolveAddress(addr) address := resolveAddress(addr)
debugPrint("Listening and serving HTTP on %s\n", address) debugPrint("Listening and serving HTTP on %s\n", address)
fmt.Printf("http://localhost:%s", address)
err = http.ListenAndServe(address, engine.Handler()) err = http.ListenAndServe(address, engine.Handler())
return return
} }