module
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Jan 9, 2026
License: MIT
Opens a new window with license information.
README
¶
Some IP & MAC validation utils
go get github.com/rannday/[email protected]
IP Validation
Uses https://pkg.go.dev/net/netip
import "github.com/rannday/netaddr/ip"
v, err := ip.IsValidIPv4("192.168.1.1")
// v == "192.168.1.1"
v, err := ip.IsValidIPv6("2001:db8::1")
// v == "2001:db8::1"
MAC Address Validation
import "github.com/rannday/netaddr/mac"
v, err := mac.IsValidMAC("aa:bb:cc:dd:ee:ff")
// v == "AABBCCDDEEFF"
f, err := mac.FormatMAC("AABB.CCDD.EEFF")
// f == "aa:bb:cc:dd:ee:ff"
Directories
¶
Click to show internal directories.
Click to hide internal directories.