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.
dingtalk/vendor/go.dtapp.net/goip
李光春 2f7385f8f6
- update
2 years ago
..
ip2region - update 2 years ago
.drone.yml - update vendor 2 years ago
.gitignore - update 2 years ago
LICENSE - update vendor 2 years ago
README.md - update vendor 2 years ago
analyse.go - update 2 years ago
const.go - update 2 years ago
ip.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

使用

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