An open API service indexing awesome lists of open source software.

https://github.com/xjh22222228/mac

get mac address for go.
https://github.com/xjh22222228/mac

macaddress

Last synced: about 2 months ago
JSON representation

get mac address for go.

Awesome Lists containing this project

README

        

## MAC
Get the local mac address.

## Install
```bash
$ go get -u github.com/xjh22222228/mac
```

## Usage
```go
// Fetch the computer's MAC address
macAddr, err := mac.Default()

// Fetch the computer's MAC address for a specific interface
macAddr, err := mac.AddrWithIface("en0")

// Validate that an address is a MAC address
isMac := mac.IsIsMAC("ac:de:48:00:11:22")
```

## LICENSE
[MIT](./LICENSE)