Skip to content

dantaya/ipFormat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

Golang ip Formatting functions

All methods are fairly self explanatory, and reading the godoc page should explain everything. If something isn't clear, open an issue or submit a pull request.

Example

First, ensure the library is installed and up to date by running go get -u github.com/buffalo-news/ipFormat.

package main

import (
	"fmt"

	"github.com/buffalo-news/ipFormat"
)

func main() {
	ip1, _ := ipFormat.New("192.168.0.2/24")
	ip2, _ := ipFormat.New("192.168.0.6")

	ip1, _ = ip1.ToV6()
	ip2, _ = ip2.ToV6()

	fmt.Println(ip1.Address)
	fmt.Println(ip1.CIDR)
	fmt.Println(ip2.Address)
}

About

Golang ipFormatting functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%