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.
|
11 months ago | |
---|---|---|
ip2region | 1 year ago | |
v4 | 11 months ago | |
v6 | 1 year ago | |
.drone.yml | 1 year ago | |
.gitignore | 1 year ago | |
LICENSE | 11 months ago | |
README.md | 11 months ago | |
analyse.go | 1 year ago | |
go.mod | 11 months ago | |
go.sum | 12 months ago | |
goip.go | 11 months ago | |
goip_test.go | 1 year ago | |
ip.go | 1 year ago | |
ip_test.go | 1 year ago | |
version.go | 11 months ago | |
version_test.go | 1 year ago |
README.md
Golang Ip
📦 Golang Ip库
安装
go get -v -u github.com/dtapps/goip
使用
package main
import (
"github.com/dtapps/goip"
"testing"
)
func TestGoIp(t *testing.T) {
// 获取Mac地址
t.Log(goip.GetMacAddr())
// 内网ip
t.Log(goip.GetInsideIp())
// 外网ip
t.Log(goip.GetOutsideIp())
}