You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
6 months ago | |
---|---|---|
geoip | 6 months ago | |
ip2region | 9 months ago | |
ip2region_v2 | 9 months ago | |
ipv6wry | 9 months ago | |
qqwry | 6 months ago | |
.drone.yml | 1 year ago | |
.gitignore | 9 months ago | |
LICENSE | 11 months ago | |
README.md | 10 months ago | |
analyse.go | 9 months ago | |
client.go | 9 months ago | |
const.go | 6 months ago | |
go.mod | 6 months ago | |
go.sum | 6 months ago | |
ip.go | 9 months ago | |
is.go | 9 months ago | |
query.go | 9 months ago |
README.md
Golang Ip
📦 Golang Ip
安装
go get -v -u go.dtapp.net/goip
使用
package main
import (
"context"
"go.dtapp.net/goip"
"testing"
)
func TestGoIp(t *testing.T) {
// 获取Mac地址
t.Log(goip.GetMacAddr(context.Background()))
// 内网ip
t.Log(goip.GetInsideIp(context.Background()))
// 外网ip
t.Log(goip.GetOutsideIp(context.Background()))
}