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.
- Host: GitHub
- URL: https://github.com/xjh22222228/mac
- Owner: xjh22222228
- License: mit
- Created: 2021-06-25T02:28:28.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-27T11:32:55.000Z (almost 4 years ago)
- Last Synced: 2025-01-14T14:58:57.859Z (3 months ago)
- Topics: macaddress
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)