netaddr

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2026 License: MIT

README

Go Network Tools

Some IP & MAC validation utils go get github.com/rannday/netaddr@v0.1.0

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

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL