Golang Ip库
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.
Go to file
李光春 dd73986ecc
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
- update
2 years ago
ip2region update ip2region 2 years ago
v4 - update v4 2 years ago
v6 update 2 years ago
.drone.yml - update 2 years ago
.gitignore update 2 years ago
README.md update 2 years ago
analyse.go update 2 years ago
go.mod - update v4 2 years ago
go.sum - update v4 2 years ago
goip.go update 2 years ago
goip_test.go - update 2 years ago
ip.go update 2 years ago
ip_test.go - update 2 years ago
version.go - update 2 years ago
version_test.go - update 2 years ago

README.md

Golang Ip

📦 Golang Ip库组件

godoc goproxy.cn goreportcard.com deps.dev

安装使用

go get -v -u go.dtapp.net/goip

导入

import (
    "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())
}