From 11763f132db6e5b491ac4ad4fa1a8fa6fcd27edc Mon Sep 17 00:00:00 2001 From: mohamadreza Date: Mon, 1 Jan 2024 15:16:06 +0330 Subject: [PATCH] chore: discard unnesary function parseIp --- gin.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/gin.go b/gin.go index 5cf19621..b5e15318 100644 --- a/gin.go +++ b/gin.go @@ -469,20 +469,6 @@ func (engine *Engine) validateHeader(header string) (clientIP string, valid bool return "", false } -// parseIP parse a string representation of an IP and returns a net.IP with the -// minimum byte representation or nil if input is invalid. -func parseIP(ip string) net.IP { - parsedIP := net.ParseIP(ip) - - if ipv4 := parsedIP.To4(); ipv4 != nil { - // return ip in a 4-byte representation - return ipv4 - } - - // return ip in a 16-byte representation or nil - return parsedIP -} - // RunTLS attaches the router to a http.Server and starts listening and serving HTTPS (secure) requests. // It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router) // Note: this method will block the calling goroutine indefinitely unless an error happens.