netprivate

Build Status Go Report Card PkgGoDev

A simple library that helps you check if an IP address is in the private defined range of the network.

The library works with:

  • IPv4
  • IPv6

Example usage

if netprivate.Is(net.ParseIP("127.0.0.1")) {
    fmt.Println("this is a private network IP address")
}

GitHub

View Github