1 Star 0 Fork 0

szmaozi/go-utils

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
net.go 189 Bytes
Copy Edit Raw Blame History
szmaozi authored 2021-09-02 13:41 . wip: merge biob-v1
package utils
import "github.com/gin-gonic/gin"
//获取ip
func GetRequestIP(c *gin.Context) string {
reqIP := c.ClientIP()
if reqIP == "::1" {
reqIP = "127.0.0.1"
}
return reqIP
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/szmaozi/go-utils.git
git@gitee.com:szmaozi/go-utils.git
szmaozi
go-utils
go-utils
29e02a007caf

Search