Skip to content

Instantly share code, notes, and snippets.

@saffetblt
Created October 21, 2019 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saffetblt/e6e75532d35fa65d8f0dc49945fae44a to your computer and use it in GitHub Desktop.
Save saffetblt/e6e75532d35fa65d8f0dc49945fae44a to your computer and use it in GitHub Desktop.
package main
import "testing"
func TestPrivateIP(t *testing.T) {
isPrivate, _ := PrivateIP("192.168.1.6")
if !isPrivate {
t.Error(isPrivate)
}
}
func TestValidIP4(t *testing.T) {
isIPv4 := ValidIP4("185.123.045.223")
if !isIPv4 {
t.Error(isIPv4)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment