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.
golog/vendor/go.dtapp.net/goip
李光春 b664b74537
- add delete
2 years ago
..
ip2region - add vendor 2 years ago
v4 - add delete 2 years ago
v6 - add vendor 2 years ago
.drone.yml - add vendor 2 years ago
.gitignore - add delete 2 years ago
LICENSE - add vendor 2 years ago
README.md - add vendor 2 years ago
analyse.go - add vendor 2 years ago
const.go - add delete 2 years ago
goip.go - add vendor 2 years ago
ip.go - add vendor 2 years ago

README.md

Golang Ip

📦 Golang Ip

godoc goproxy.cn goreportcard.com deps.dev

安装

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