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.
goip/README.md

38 lines
899 B

2 years ago
<h1>
<a href="https://www.dtapp.net/">Golang Ip</a>
</h1>
2 years ago
📦 Golang Ip库
2 years ago
[comment]: <> (go)
2 years ago
[![godoc](https://pkg.go.dev/badge/github.com/dtapps/goip?status.svg)](https://pkg.go.dev/github.com/dtapps/goip)
[![goproxy.cn](https://goproxy.cn/stats/github.com/dtapps/goip/badges/download-count.svg)](https://goproxy.cn/stats/github.com/dtapps/goip)
[![goreportcard.com](https://goreportcard.com/badge/github.com/dtapps/goip )](https://goreportcard.com/report/github.com/dtapps/goip)
[![deps.dev](https://img.shields.io/badge/deps-go-red.svg)](https://deps.dev/go/github.com%2Fdtapps%2Fgoip)
2 years ago
2 years ago
#### 安装
2 years ago
```go
2 years ago
go get -v -u github.com/dtapps/goip
2 years ago
```
2 years ago
#### 使用
2 years ago
```go
package main
import (
2 years ago
"github.com/dtapps/goip"
2 years ago
"testing"
)
func TestGoIp(t *testing.T) {
// 获取Mac地址
t.Log(goip.GetMacAddr())
// 内网ip
t.Log(goip.GetInsideIp())
// 外网ip
t.Log(goip.GetOutsideIp())
}
2 years ago
```