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.
李光春
e1337b1cd5
|
2 years ago | |
---|---|---|
.. | ||
ip2region | 2 years ago | |
v4 | 2 years ago | |
v6 | 2 years ago | |
.drone.yml | 2 years ago | |
.gitignore | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago | |
analyse.go | 2 years ago | |
const.go | 2 years ago | |
goip.go | 2 years ago | |
ip.go | 2 years ago |
README.md
Golang Ip
📦 Golang Ip库
安装
go get -v -u go.dtapp.net/goip
使用
package main
import (
"go.dtapp.net/goip"
"testing"
)
func TestGoIp(t *testing.T) {
// 获取Mac地址
t.Log(goip.GetMacAddr())
// 内网ip
t.Log(goip.GetInsideIp())
// 外网ip
t.Log(goip.GetOutsideIp())
}