A wrapper for http://ipinfo.io in Go
Go
Latest commit 09a7490 Jun 25, 2015 @revh refactoring
Permalink
Failed to load latest commit information.
LICENSE Initial commit Jun 21, 2015
README.md refactoring Jun 25, 2015
ipinfo.go refactoring Jun 25, 2015
ipinfo_test.go refactoring Jun 25, 2015

README.md

ipinfo

A wrapper for http://ipinfo.io written in Go language

package main

import (
    "log"
    "net"

    "github.com/RevH/ipinfo"
)

func main() {
    myIP, err := ipinfo.MyIP()
    if err != nil {
        log.Fatalln(err)
    }
    log.Println(myIP)

    foreignIP, err := ipinfo.ForeignIP("8.8.8.8")
    if err != nil {
        log.Fatalln(err)
    }
    log.Println(foreignIP)
}