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
李光春 35356ae48b
- update v4
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
LICENSE - update v4 2 years ago
README.md - update v4 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 v4 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 v4 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 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())
}